npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tonappchain/sdk

v0.7.2

Published

[![Version npm](https://img.shields.io/npm/v/@tonappchain/sdk.svg?logo=npm)](https://www.npmjs.com/package/@tonappchain/sdk) [![Downloads](https://img.shields.io/npm/dm/@tonappchain/sdk.svg)](https://www.npmjs.com/package/@tonappchain/sdk) [![Try on Run

Downloads

8,397

Readme

TacSdk

Version npm Downloads Try on RunKit

The TAC SDK makes it possible to create hybrid dApps that let TON users interact directly with EVM smart contracts without needing to manage multiple wallets or understand the complexities of cross-chain messaging.

Documentation

For full documentation and examples, please visit TAC SDK Documentation.

For practical examples and usage patterns, see Examples Documentation.

Installation

npm install @tonappchain/sdk

or

yarn add @tonappchain/sdk

Features

The TAC SDK enables you to create frontends that:

  • Connect to TON wallets like Tonkeeper or Tonhub
  • Send transactions from TON to your EVM contracts
  • Track cross-chain transaction status in real-time
  • Handle tokens across both chains
  • Create a seamless user experience for TON users

Available Resources

SDK Components

Data Models

  • Enums: Key enumerations used by the SDK.

    • Network: TESTNET or MAINNET.
    • SimplifiedStatuses: PENDING, FAILED, SUCCESSFUL, OPERATION_ID_NOT_FOUND.
    • OperationType: Detailed operation types (PENDING, TON_TAC_TON, ROLLBACK, etc.).
    • StageName: Identifiers for tracking stages (COLLECTED_IN_TAC, EXECUTED_IN_TAC, etc.).
  • Structs: Core data structures.

    • AssetLike: Flexible asset specification for cross-chain operations.
    • EvmProxyMsg: Defines the target EVM call details.
    • TransactionLinker: Identifies a cross-chain operation.
    • (See file for more...)

Navigate through the linked files for full details on parameters, return types, examples, and more.

TACHeader

Note: The TAC protocol only knows how to send data to contracts that inherit from a TacProxy (TacProxyV1) contract. Such a contract must have a strictly defined signature of its methods. It is specified below:

function myProxyFunction(bytes calldata tacHeader, bytes calldata arguments) external onlyTacCCL {
  // Function implementation 
}

Note: methodName in evmProxyMsg must be either a simple method name or a signature of the form MethodName(bytes,bytes)

The first argument of methods must always be TACHeader. It is sent by protocol, augmented with data from executor.

  • bytes tacHeader: Encoded structure TacHeaderV1, containing:
    • uint64 shardsKey: ID you can specify for yourself an inside message to the TVM contract on the TON network.
    • uint256 timestamp: The block timestamp on TON where the user's message was created.
    • bytes32 operationId: Unique identifier for the message created by the TAC infrastructure.
    • string tvmCaller: The TON user's wallet address that sent the message.
    • bytes extraData: Untrusted extra data, provided by executor with the current message if needed. Otherwise, it's an empty bytes array.

You need to specify all the remaining data you need in tuple (bytes) in arguments. For example this is how arguments for addLiquidity method in UniswapV2 (a special proxy contract for it) will look like:

    const abi = new ethers.AbiCoder();
    const encodedParameters = abi.encode(
        ['tuple(address,address,uint256,uint256,uint256,uint256,address,uint256)'],
        [
            [
                EVM_TOKEN_A_ADDRESS,
                EVM_TOKEN_B_ADDRESS,
                amountA,
                amountB,
                amountAMin, 
                amountBMin,  
                UNISWAPV2_PROXY_ADDRESS, 
                deadline 
            ]
        ]
    );

More details in sendAddLiquidity.ts and in other tests.


Usage

import { TacSdk, AssetLike, EvmProxyMsg, SDKParams, Network, SenderFactory } from '@tonappchain/sdk';
import { TonConnectUI } from '@tonconnect/ui';
import { ethers } from 'ethers';

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

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

const sdkParams: SDKParams = {
    network: Network.TESTNET
};
const tacSdk = await TacSdk.create(sdkParams);

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

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

tacSdk.closeConnections();

For a detailed example, see tests/uniswap_v2/sendSwap.ts or tests/uniswap_v2/sendRemoveLiquidity.ts, which demonstrates swapping tokens and removing liquidity on Uniswap and tracking the transaction status.


License

MIT