To begin using the TAC-SDK, you need to create an instance of the TacSdk class. This class is the main entry point for all cross-chain operations.

Basic Setup

import { TacSdk } from "tac-sdk";
import { Network } from "tac-sdk";

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

Configuration Options

The TacSdk constructor accepts a TacSDKTonClientParams object with the following options:

type TacSDKTonClientParams = {
  tonClientParameters?: TonClientParameters;
  network?: Network;
  delay?: number;
};

Parameters Explained

  • network: Choose between Network.Testnet or Network.Mainnet
    • Default: Network.Testnet
  • delay: Time delay (in seconds) for requests to the TON client
    • Default: 0
    • Recommended: 5 when using default tonClientParameters
  • tonClientParameters: Optional custom parameters for the TON client configuration

HTTP API Endpoints

The SDK uses these default public endpoints:

Network Selection

// For testing
const testSdk = new TacSdk({ network: Network.Testnet });

// For production
const prodSdk = new TacSdk({ network: Network.Mainnet });

Setting Appropriate Delays

// With default parameters
const sdk = new TacSdk({ delay: 5 });

// With custom parameters
const customSdk = new TacSdk({
  delay: 3,
  tonClientParameters: {
    /* custom parameters */
  },
});

Usage Example

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

// Now you can use the instance for transactions
// For example:
await tacSdk.sendCrossChainJettonTransaction(/* parameters */);