For more up-to-date information, please refer to the TAC SDK GitHub repository.

Constructor

constructor(params: TacSDKTonClientParams)

Parameters:

  • params: Configuration object of type TacSDKTonClientParams
    • network: Network enum (Network.Testnet or Network.Mainnet)
    • tonClientParameters?: Optional TON client parameters
    • delay?: Optional delay in seconds (default: 3)
    • settingsAddress?: Optional TAC protocol contract address

Constructor include the following methods:

init()

async init(): Promise<void>

Initializes the SDK instance.

sendCrossChainTransaction()

async sendCrossChainTransaction(
  evmProxyMsg: EvmProxyMsg,
  sender: SenderAbstraction,
  assets?: AssetBridgingData[]
): Promise<TransactionLinker>

Sends a cross-chain transaction.

Parameters:

  • evmProxyMsg: EVM proxy message configuration
  • sender: Transaction sender (TonConnectSender or RawSender)
  • assets: Optional array of assets to bridge

Returns: TransactionLinker object for tracking the transaction

getEVMTokenAddress()

async getEVMTokenAddress(tvmTokenAddress: string): Promise<string>

Gets the corresponding EVM address for a TVM token.

Parameters:

  • tvmTokenAddress: TVM token address

Returns: Promise resolving to EVM token address

TransactionStatus

Class for tracking cross-chain transaction statuses.

getOperationId()

async getOperationId(transactionLinker: TransactionLinker): Promise<string>

Gets the operation ID for a transaction.

Parameters:

  • transactionLinker: TransactionLinker object

Returns: Operation ID string

getStatusTransaction()

async getStatusTransaction(operationId: string): Promise<string>

Gets the current status of a transaction.

Parameters:

  • operationId: Operation ID string

Returns: Transaction status string

getSimplifiedTransactionStatus()

async getSimplifiedTransactionStatus(
  transactionLinker: TransactionLinker,
  isBridgeOperation?: boolean
): Promise<SimplifiedStatuses>

Gets a simplified transaction status.

Parameters:

  • transactionLinker: TransactionLinker object
  • isBridgeOperation: Optional boolean for bridge-only operations

Returns: SimplifiedStatuses enum value

startTracking()

async startTracking(
  transactionLinker: TransactionLinker,
  isBridgeOperation?: boolean
): Promise<void>

Starts tracking a transaction until completion.

Parameters:

  • transactionLinker: TransactionLinker object
  • isBridgeOperation: Optional boolean for bridge-only operations

Example Usage

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

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

// Create EVM payload
const abi = new ethers.AbiCoder();
const encodedParameters = abi.encode(
  ["uint256", "address"],
  [amount, tokenAddress]
);

const evmProxyMsg: EvmProxyMsg = {
  evmTargetAddress: proxyAddress,
  methodName: "swap",
  encodedParameters,
};

// Define assets to bridge
const assets: AssetBridgingData[] = [
  {
    address: tvmTokenAddress,
    amount: tokenAmount,
  },
];

// Initialize sender with TonConnect
const tonConnectUI = new TonConnectUI({
  manifestUrl: manifestUrl,
});
const sender = await SenderFactory.getSender({
  tonConnect: tonConnectUI,
});

// Send transaction
const transactionLinker = await tacSdk.sendCrossChainTransaction(
  evmProxyMsg,
  sender,
  assets
);

// Track transaction status
const tracker = new TransactionStatus();
const status = await tracker.getSimplifiedTransactionStatus(transactionLinker);