This guide will help you start building/modifying your EVM frontend with TAC SDK. You’ll learn how to set up the SDK and make your first cross-chain transaction that will trigger your solidity code deployed on TAC.

Installation

Install the TAC SDK using npm:

npm install tac-sdk

Basic Setup

Once you’ve installed the SDK, you can start building. Here’s a basic setup to get you started:

1

Import dependencies

import { TacSdk } from "tac-sdk";
import { TonConnectUI } from "@tonconnect/ui";
import { ethers } from "ethers";
2

Initialize TON Connect

const tonConnectUI = new TonConnectUI({
  manifestUrl: "YOUR_MANIFEST_URL",
});
3

Create a TAC SDK instance

const tacSdk = new TacSdk({
  network: "TESTNET", // Use "MAINNET" for production
});

Making Your First Cross-Chain Transaction

Here’s a simple example of making a cross-chain transaction:

import { TacSdk } from "tac-sdk";
import { TonConnectUI } from "@tonconnect/ui";
import { ethers } from "ethers";

// Create EVM payload for DappProxy
const abi = new ethers.AbiCoder();
const encodedParameters = abi.encode(
  ["uint256", "uint256", "address[]", "address"],
  [tokenAAmount, tokenBAmount, [EVMtokenAAddress, EVMtokenBAddress], proxyDapp]
);
const evmProxyMsg: EvmProxyMsg = {
  evmTargetAddress: DappProxyAddress,
  methodName: "addLiquidity(uint256,uint256,address[],address)",
  encodedParameters,
};

// Create jetton transfer messages corresponding to EVM tokens, e.g., two tokens for adding liquidity to a pool
const assets: AssetBridgingData[] = [
  {
    address: TVMtokenAAddress,
    amount: tokenAAmount,
  },
  {
    address: TVMtokenBAddress,
    amount: tokenBAmount,
  },
];

const tacSdk = new TacSdk({
  network: Network.Testnet,
  delay: 3,
});
await tacSdk.init();

//Send transaction via tonConnect or mnemonic
const tonConnectUI = new TonConnectUI({
  manifestUrl: config.tonconnectManifestUrl as string,
});
const sender = await SenderFactory.getSender({
  tonConnect: tonConnectUI,
});

return await tacSdk.sendCrossChainTransaction(evmProxyMsg, sender, assets);

API Endpoints

You can use these public endpoints for development:

Next Steps

Now that you’ve made your first cross-chain transaction, you can: