TONTONDocs
Reference

AppKit

Action

Balances

getBalance

Read the Toncoin balance of the currently selected wallet, returning null when no wallet is selected (use getBalanceByAddress for an arbitrary address).

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetBalanceOptionsOptional network override.
options.networkNetworkNetwork to read the balance from. Defaults to the selected wallet's network.

Returns: Promise<GetBalanceReturnType> — Balance in TON as a human-readable decimal string, or null when no wallet is selected.

Example

const balance = await getBalance(appKit);
if (balance) {
    console.log('Balance:', balance);
}

getBalanceByAddress

Read the Toncoin balance of an arbitrary address — useful for wallets that aren't selected in AppKit (use getBalance for the selected wallet).

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetBalanceByAddressOptionsTarget address and optional network.
options.address*UserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.networkNetworkNetwork to read the balance from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: Promise<GetBalanceByAddressReturnType> — Balance in TON as a human-readable decimal string.

Example

const balanceByAddress = await getBalanceByAddress(appKit, {
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});
console.log('Balance by address:', balanceByAddress);

watchBalance

Subscribe to Toncoin balance updates for the currently selected wallet, automatically rebinding whenever the selected wallet changes or the connected-wallets list updates (use watchBalanceByAddress for a fixed address). Requires a streaming provider registered for the network — call throws when none is configured. Use hasStreamingProvider to check first.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*WatchBalanceOptionsUpdate callback and optional network override.
options.networkNetworkNetwork to watch on. Defaults to the selected wallet's network.
options.onChange*(update: BalanceUpdate) => voidCallback fired on every balance update from the streaming provider.

Returns: WatchBalanceReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchBalance(appKit, {
    onChange: (update) => {
        console.log('Balance updated:', update.balance);
    },
});

// Later: unsubscribe();

watchBalanceByAddress

Subscribe to Toncoin balance updates for an arbitrary address — useful for monitoring wallets that aren't selected in AppKit (use watchBalance for the selected wallet). Requires a streaming provider registered for the network — call throws when none is configured. Use hasStreamingProvider to check first.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*WatchBalanceByAddressOptionsTarget address, update callback and optional network override.
options.address*UserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.networkNetworkNetwork to watch on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
options.onChange*(update: BalanceUpdate) => voidCallback fired on every balance update from the streaming provider.

Returns: WatchBalanceByAddressReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchBalanceByAddress(appKit, {
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    onChange: (update) => {
        console.log('Balance by address updated:', update.balance);
    },
});

// Later: unsubscribe();

Client

getApiClient

Read the ApiClient configured for a specific Network — throws when the network has no client registered.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetApiClientOptionsNetwork to look up.
options.network*NetworkNetwork whose configured ApiClient should be returned.

Returns: GetApiClientReturnType — The configured ApiClient for the requested network.

Example

const apiClient = getApiClient(appKit, {
    network: Network.mainnet(),
});

console.log('API Client:', apiClient);

Connectors

addConnector

Register a wallet connector at runtime — equivalent to passing it via AppKitConfig's connectors at construction, but available after AppKit is up.

ParameterTypeDescription
appKit*AppKitRuntime instance.
connector*AddConnectorParametersConnector instance or factory to register.

Returns: AddConnectorReturnType — Function that unregisters the connector when called.

Example

const unregister = addConnector(
    appKit,
    createTonConnectConnector({
        tonConnectOptions: {
            manifestUrl: 'https://tonconnect-sdk-demo-dapp.vercel.app/tonconnect-manifest.json',
        },
    }),
);

// Later: unregister();

connect

Trigger the connection flow on a registered connector by id — drives it against AppKit's default network (set via setDefaultNetwork). Throws when no connector with that id exists.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*ConnectParametersConnector to connect through.
parameters.connectorId*stringID of the registered connector to drive the connection through (e.g., 'tonconnect').

Returns: Promise<ConnectReturnType> — Resolves once the connector's connect flow completes. If a wallet was successfully connected, it becomes available via getSelectedWallet.

Example

await connect(appKit, {
    connectorId: 'tonconnect',
});

createConnector

Identity helper for typing a ConnectorFactory inline — returns the factory unchanged so authors get parameter inference without spelling the type out.

ParameterTypeDescription
factory*ConnectorFactoryFactory to wrap.

Returns: ConnectorFactory — The same factory, typed as ConnectorFactory.

createTonConnectConnector

Build a TonConnect-backed Connector for AppKit. Pass the result to AppKitConfig's connectors or addConnector.

ParameterTypeDescription
config*TonConnectConnectorConfigConnector ID, metadata override and TonConnect options or pre-built UI instance.
config.idstringConnector ID. Defaults to TONCONNECT_DEFAULT_CONNECTOR_ID ('tonconnect'). Set this when you need to register multiple TonConnect-flavoured connectors side by side.
config.metadataConnectorMetadataDisplay metadata override. Merged on top of TonConnect's default name and icon.
config.tonConnectOptionsTonConnectUiCreateOptionsOptions forwarded to the underlying TonConnectUI constructor (manifest URL, etc.). Ignored when tonConnectUI is supplied.
config.tonConnectUITonConnectUIPre-built TonConnectUI instance to reuse. When set, the connector skips its own instantiation and tonConnectOptions is ignored.

Returns: ConnectorFactory — Factory function consumed by AppKit at registration time.

Example

// 1. Create TonConnectUI instance
const tonConnectUI = new TonConnectUI({
    manifestUrl: 'https://my-app.com/tonconnect-manifest.json',
});

// 2. Initialize AppKit
const appKit = new AppKit({
    networks: {
        [Network.mainnet().chainId]: {
            apiClient: {
                url: 'https://toncenter.com',
                key: 'your-key',
            },
        },
    },
    connectors: [createTonConnectConnector({ tonConnectUI })],
});

disconnect

Tear down the session on a registered connector — disconnects the wallet currently connected through it, if any. Throws when no connector with that id exists.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*DisconnectParametersConnector to disconnect.
parameters.connectorId*stringID of the registered connector whose wallet should be disconnected.

Returns: Promise<DisconnectReturnType> — Resolves once the connector tears down its session.

Example

await disconnect(appKit, {
    connectorId: 'tonconnect',
});

getConnectorById

Look up a registered connector by its id.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetConnectorByIdOptionsID of the connector to find.
options.id*stringID of the connector to look up.

Returns: GetConnectorByIdReturnType — The matching Connector, or undefined if none with that id is registered.

Example

const connector = getConnectorById(appKit, {
    id: 'tonconnect',
});

if (connector) {
    console.log('Found connector:', connector.id);
}

getConnectors

List every connector registered on this AppKit instance — both those passed via AppKitConfig's connectors and those added later through addConnector.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetConnectorsReturnType — Read-only array of registered Connectors.

Example

const connectors = getConnectors(appKit);
connectors.forEach((connector) => {
    console.log('Connector:', connector.id);
});

watchConnectorById

Subscribe to register/unregister events for a connector with the given id — the callback fires when the connector is added or removed, so callers can react to its presence. Use watchConnectedWallets if you want to react to wallet connect/disconnect events instead.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchConnectorByIdParametersConnector ID and update callback.
parameters.id*stringID of the connector to watch.
parameters.onChange*(connector: Connector | undefined) => voidCallback invoked when the connector with the watched id is registered or unregistered — receives the connector itself, or undefined when none is registered under that id.

Returns: WatchConnectorByIdReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchConnectorById(appKit, {
    id: 'tonconnect',
    onChange: (connector) => {
        console.log('Connector updated:', connector);
    },
});

// Later: unsubscribe();

watchConnectors

Subscribe to changes in the registered-connectors list — the callback fires when a connector is added (via addConnector or AppKit's constructor) or removed, and receives the current list. Use watchConnectedWallets if you want to react to wallet connect/disconnect events instead.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchConnectorsParametersUpdate callback.
parameters.onChange*(connectors: readonly Connector[]) => voidCallback invoked when the list of registered connectors changes — receives the current list.

Returns: WatchConnectorsReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchConnectors(appKit, {
    onChange: (connectors) => {
        console.log('Connectors updated:', connectors);
    },
});

// Later: unsubscribe();

Crypto Onramp

createCryptoOnrampDeposit

Create a crypto-onramp deposit from a quote previously obtained via getCryptoOnrampQuote — the returned CryptoOnrampDeposit carries the address and amount the user must send on the source chain.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*CreateCryptoOnrampDepositOptionsQuote, refund address, and optional provider override.
options.quote*CryptoOnrampQuote<TQuoteMetadata = unknown>Quote to execute the deposit against (contains recipientAddress and provider metadata)
options.refundAddress*stringAddress to refund the crypto to in case of failure.
options.providerOptionsTProviderOptions = unknownProvider-specific options.
options.providerIdstringProvider to create the deposit through. Defaults to quote.providerId, then to the default provider.

Returns: CreateCryptoOnrampDepositReturnType — Deposit details the UI should show to the user (address, amount, optional memo/expiresAt).

createLayerswapProvider

Build a Layerswap-backed CryptoOnrampProvider for AppKit. Pass the result to AppKitConfig's providers or registerProvider.

ParameterTypeDescription
configLayerswapProviderConfigOptional LayerswapProviderConfig. Defaults are filled in for any field left undefined.

Returns: ProviderFactory<LayerswapCryptoOnrampProvider>.

createSwapsXyzProvider

Build a swaps.xyz-backed CryptoOnrampProvider for AppKit. Pass the result to AppKitConfig's providers or registerProvider.

ParameterTypeDescription
config*SwapsXyzProviderConfigConfiguration carrying the required apiKey plus optional URL/sender overrides.

Returns: ProviderFactory<SwapsXyzCryptoOnrampProvider>.

getCryptoOnrampProvider

Get a registered crypto-onramp provider by id, or the default provider when no id is given. Throws when no provider matches — or when no id is passed and no default has been registered.

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetCryptoOnrampProviderOptionsOptional provider id.
options.idstringProvider ID to look up. When omitted, returns the registered default provider.

Returns: GetCryptoOnrampProviderReturnType — The matching CryptoOnrampProviderInterface.

Example

const provider = getCryptoOnrampProvider(appKit, { id: 'layerswap' });
console.log('Crypto onramp provider:', provider.providerId);

getCryptoOnrampProviders

List every crypto-onramp provider registered on this AppKit instance — both those passed via AppKitConfig's providers and those added later through registerProvider.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetCryptoOnrampProvidersReturnType — Array of registered CryptoOnrampProviderInterfaces.

Example

const providers = getCryptoOnrampProviders(appKit);
console.log(
    'Registered crypto onramp providers:',
    providers.map((p) => p.providerId),
);

getCryptoOnrampQuote

Quote a crypto-to-TON onramp — given a source asset/chain and target TON asset, returns the rate, expected amount, and provider metadata needed to call createCryptoOnrampDeposit.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetCryptoOnrampQuoteOptionsSource asset, target asset, amount and optional provider override.
options.amount*stringAmount to onramp (either source or target crypto, depending on isSourceAmount)
options.sourceCurrencyAddress*stringSource crypto currency address (contract address or 0x0... for native)
options.sourceChain*stringSource chain identifier in CAIP-2 format (e.g. 'eip155:1' for Ethereum mainnet, 'eip155:42161' for Arbitrum One). Providers map this to their own chain identifiers internally.
options.targetCurrencyAddress*stringTarget crypto currency address on TON (contract address or 0x0... for native)
options.recipientAddress*stringTON address that will receive the target crypto.
options.refundAddressstringRefund address for the source crypto.
options.isSourceAmountbooleanIf true, amount is the source amount to spend. If false, amount is the target amount to receive. Defaults to true when omitted.
options.providerOptionsTProviderOptions = unknownProvider-specific options.
options.providerIdstringProvider to quote against. Defaults to the registered default provider.

Returns: GetCryptoOnrampQuoteReturnType — Quote with pricing details and the provider metadata required to create a deposit.

getCryptoOnrampStatus

Read the current status of a crypto-onramp deposit by id — typically polled until the result is 'success' or 'failed'.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetCryptoOnrampStatusOptionsDeposit id, originating provider id and optional provider override.
options.depositId*stringDeposit id.
options.providerId*stringIdentifier of the provider that issued this deposit.

Returns: GetCryptoOnrampStatusReturnType — Current CryptoOnrampStatus of the deposit.

watchCryptoOnrampProviders

Subscribe to crypto-onramp provider lifecycle — fires onChange whenever a new provider is registered or the default crypto-onramp provider switches.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchCryptoOnrampProvidersParametersUpdate callback.
parameters.onChange*() => voidCallback fired whenever a crypto-onramp provider is registered or the default crypto-onramp provider changes.

Returns: WatchCryptoOnrampProvidersReturnType — Unsubscribe function — call it to stop receiving updates.

DeFi

registerProvider

Register a DeFi / onramp provider at runtime — equivalent to passing it via AppKitConfig's providers at construction, but available after AppKit is up. AppKit emits provider:registered, picked up by domain-specific subscribers like watchSwapProviders and watchCryptoOnrampProviders.

ParameterTypeDescription
appKit*AppKitRuntime instance.
provider*RegisterProviderOptionsProvider instance or factory to register.

Returns: void.

Example

registerProvider(
    appKit,
    createOmnistonProvider({
        defaultSlippageBps: 100, // 1%
    }),
);

Jettons

createTransferJettonTransaction

Build a jetton transfer TransactionRequest for the selected wallet without sending it — useful when the UI needs to inspect or batch transactions before signing. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*CreateTransferJettonTransactionParametersJetton, recipient, amount, decimals and optional comment.
parameters.jettonAddress*UserFriendlyAddressJetton master contract address being transferred.
parameters.recipientAddress*UserFriendlyAddressRecipient who should receive the jettons.
parameters.amount*stringAmount in jetton units as a human-readable decimal string (e.g., "1.5").
parameters.jettonDecimals*numberDecimals declared by the jetton master. Used to convert amount into raw smallest units.
parameters.commentstringOptional human-readable comment attached to the transfer.

Returns: Promise<CreateTransferJettonTransactionReturnType> — Transaction request ready to pass to sendTransaction.

Example

const tx = await createTransferJettonTransaction(appKit, {
    jettonAddress: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
    recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    amount: '100', // 100 USDT
    comment: 'Hello Jetton',
    jettonDecimals: 6,
});
console.log('Transfer Transaction:', tx);

getJettonBalance

Read a jetton balance for a given owner — derives the owner's jetton-wallet address from the master, then fetches and formats the balance using the supplied decimals.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetJettonBalanceOptionsJetton master, owner address, decimals and optional network override.
options.jettonAddress*UserFriendlyAddressJetton master contract address (the token, not the user's wallet for it).
options.ownerAddress*UserFriendlyAddressOwner of the jetton wallet — typically the connected user's address.
options.jettonDecimals*numberDecimals declared by the jetton master. Used to format the raw balance into a human-readable string.
options.networkNetworkNetwork to read the balance from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: Promise<GetJettonBalanceReturnType> — Balance as a human-readable decimal string in the jetton's units.

Example

const selectedWallet = getSelectedWallet(appKit);
if (!selectedWallet) {
    console.log('No wallet selected');
    return;
}

const balance = await getJettonBalance(appKit, {
    jettonAddress: 'EQDBE420tTQIkoWcZ9pEOTKY63WVmwyIl3hH6yWl0r_h51Tl',
    ownerAddress: selectedWallet.getAddress(),
    jettonDecimals: 6,
});
console.log('Jetton Balance:', balance);

getJettonInfo

Fetch token metadata for a jetton master — name, symbol, decimals, image and description as reported by the indexer. Returns null when the indexer has no record for that master address.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetJettonInfoOptionsJetton master address and optional network override.
options.address*UserFriendlyAddressJetton master contract address whose metadata is being fetched.
options.networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: Promise<GetJettonInfoReturnType> — Jetton metadata, or null if the indexer has no record.

Example

const info = await getJettonInfo(appKit, {
    address: 'EQDBE420tTQIkoWcZ9pEOTKY63WVmwyIl3hH6yWl0r_h51Tl',
});
console.log('Jetton Info:', info);

getJettonWalletAddress

Derive the jetton-wallet address for a given owner — the per-owner contract that actually holds the jetton balance for jettonAddress.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetJettonWalletAddressOptionsJetton master, owner address and optional network override.
options.jettonAddress*UserFriendlyAddressJetton master contract address.
options.ownerAddress*UserFriendlyAddressOwner whose jetton wallet should be derived.
options.networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: Promise<GetJettonWalletAddressReturnType> — User-friendly address of the owner's jetton wallet.

Example

const selectedWallet = getSelectedWallet(appKit);
if (!selectedWallet) {
    console.log('No wallet selected');
    return;
}

const address = await getJettonWalletAddress(appKit, {
    jettonAddress: 'EQDBE420tTQIkoWcZ9pEOTKY63WVmwyIl3hH6yWl0r_h51Tl',
    ownerAddress: selectedWallet.getAddress(),
});
console.log('Jetton Wallet Address:', address);

getJettons

List jettons held by the currently selected wallet, returning null when no wallet is selected (use getJettonsByAddress for an arbitrary address).

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetJettonsOptionsOptional network override and pagination.
options.networkNetworkNetwork to read jettons from. Defaults to the selected wallet's network.
options.limitnumberMaximum number of jettons to return.
options.offsetnumberNumber of jettons to skip before returning results — used for pagination.

Returns: Promise<GetJettonsReturnType> — Jettons response for the selected wallet, or null when none is selected.

Example

const response = await getJettons(appKit);
if (!response) {
    console.log('No wallet selected or no jettons found');
    return;
}
console.log('Jettons:', response.jettons.length);
response.jettons.forEach((j) => console.log(`- ${j.info.name}: ${j.balance}`));

getJettonsByAddress

List jettons held by an arbitrary address — useful for inspecting wallets that aren't selected in AppKit (use getJettons for the selected wallet). Raw balances are formatted with each jetton's declared decimals, and entries without decimals are dropped.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetJettonsByAddressOptionsOwner address, optional network override and pagination.
options.address*UserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.networkNetworkNetwork to read the jettons from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
options.limitnumberMaximum number of jettons to return.
options.offsetnumberNumber of jettons to skip before returning results — used for pagination.

Returns: Promise<GetJettonsByAddressReturnType> — Jettons response with formatted balances.

Example

const selectedWallet = getSelectedWallet(appKit);
if (!selectedWallet) {
    console.log('No wallet selected');
    return;
}

const response = await getJettonsByAddress(appKit, {
    address: selectedWallet.getAddress(),
});
console.log('Jettons by Address:', response.jettons.length);
response.jettons.forEach((j) => console.log(`- ${j.info.name}: ${j.balance}`));

transferJetton

Build and send a jetton transfer from the selected wallet in one step (use createTransferJettonTransaction + sendTransaction if you need to inspect the transaction first). Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*TransferJettonParametersJetton, recipient, amount, decimals and optional comment.
parameters.jettonAddress*UserFriendlyAddressJetton master contract address being transferred.
parameters.recipientAddress*UserFriendlyAddressRecipient who should receive the jettons.
parameters.amount*stringAmount in jetton units as a human-readable decimal string (e.g., "1.5").
parameters.jettonDecimals*numberDecimals declared by the jetton master. Used to convert amount into raw smallest units.
parameters.commentstringOptional human-readable comment attached to the transfer.

Returns: Promise<TransferJettonReturnType> — Wallet response carrying the BoC of the sent transaction.

Example

const result = await transferJetton(appKit, {
    jettonAddress: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
    recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    amount: '100',
    jettonDecimals: 6,
});
console.log('Transfer Result:', result);

watchJettons

Subscribe to jetton-balance updates for the currently selected wallet, automatically rebinding when the user connects, switches, or disconnects (use watchJettonsByAddress for a fixed address). Requires a streaming provider registered for the network — call throws when none is configured. Use hasStreamingProvider to check first.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*WatchJettonsOptionsUpdate callback and optional network override.
options.onChange*(update: JettonUpdate) => voidCallback fired on every jetton-balance update from the streaming provider.
options.networkNetworkNetwork to watch on. Defaults to the selected wallet's network.

Returns: WatchJettonsReturnType — Unsubscribe function — call it to stop receiving updates.

watchJettonsByAddress

Subscribe to jetton-balance updates for an arbitrary owner address (use watchJettons for the selected wallet). Requires a streaming provider registered for the network — call throws when none is configured. Use hasStreamingProvider to check first.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*WatchJettonsByAddressOptionsOwner address, update callback and optional network override.
options.address*UserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.onChange*(update: JettonUpdate) => voidCallback fired on every jetton-balance update from the streaming provider.
options.networkNetworkNetwork to watch on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: WatchJettonsByAddressReturnType — Unsubscribe function — call it to stop receiving updates.

NFTs

createTransferNftTransaction

Build an NFT transfer TransactionRequest for the selected wallet without sending it — useful when the UI needs to inspect or batch transactions before signing. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*CreateTransferNftTransactionParametersNFT, recipient, optional gas amount and comment.
parameters.nftAddress*UserFriendlyAddressNFT contract address to transfer.
parameters.recipientAddress*UserFriendlyAddressNew owner address.
parameters.amountstringAmount of TON to attach to the transfer for gas. Defaults to AppKit's NFT gas-fee constant when omitted.
parameters.commentstringOptional human-readable comment attached to the transfer.

Returns: Promise<CreateTransferNftTransactionReturnType> — Transaction request ready to pass to sendTransaction.

Example

const tx = await createTransferNftTransaction(appKit, {
    nftAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    comment: 'Gift NFT',
});

console.log('NFT Transfer Transaction:', tx);

getNft

Fetch metadata and ownership for a single NFT by its contract address. Returns null when the indexer has no record.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetNftOptionsNFT address and optional network override.
options.address*UserFriendlyAddress | AddressNFT contract address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: Promise<GetNftReturnType> — NFT data, or null if the indexer has no record.

Example

const nft = await getNft(appKit, {
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});

if (nft) {
    console.log('NFT Name:', nft.info?.name);
    console.log('NFT Collection:', nft.collection?.name);
}

getNfts

List NFTs held by the currently selected wallet, returning null when no wallet is selected (use getNftsByAddress for an arbitrary address).

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetNftsOptionsOptional network override and pagination.
options.networkNetworkNetwork to read NFTs from. Defaults to the selected wallet's network.
options.limitnumberMaximum number of NFTs to return.
options.offsetnumberNumber of NFTs to skip before returning results — used for pagination.

Returns: Promise<GetNftsReturnType> — NFTs response for the selected wallet, or null when none is selected.

Example

const response = await getNfts(appKit);

if (response) {
    console.log('Total NFTs:', response.nfts.length);
    response.nfts.forEach((nft) => console.log(`- ${nft.info?.name}`));
}

getNftsByAddress

List NFTs held by an arbitrary address — useful for inspecting wallets that aren't selected in AppKit (use getNfts for the selected wallet).

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetNftsByAddressOptionsOwner address, optional network override and pagination.
options.address*UserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.networkNetworkNetwork to read NFTs from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
options.limitnumberMaximum number of NFTs to return.
options.offsetnumberNumber of NFTs to skip before returning results — used for pagination.

Returns: Promise<GetNftsByAddressReturnType> — NFTs response with the owner's items.

Example

const response = await getNftsByAddress(appKit, {
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});

console.log('NFTs by address:', response.nfts.length);

transferNft

Build and send an NFT transfer from the selected wallet in one step (use createTransferNftTransaction + sendTransaction if you need to inspect the transaction first). Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*TransferNftParametersNFT, recipient, optional gas amount and comment.
parameters.nftAddress*UserFriendlyAddressNFT contract address to transfer.
parameters.recipientAddress*UserFriendlyAddressNew owner address.
parameters.amountstringAmount of TON to attach to the transfer for gas. Defaults to AppKit's NFT gas-fee constant when omitted.
parameters.commentstringOptional human-readable comment attached to the transfer.

Returns: Promise<TransferNftReturnType> — Wallet response carrying the BoC of the sent transaction.

Example

const result = await transferNft(appKit, {
    nftAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});

console.log('NFT Transfer Result:', result);

Networks

getBlockNumber

Read the latest masterchain seqno (block number) for a network — useful for pagination cursors and freshness checks. Defaults to mainnet when no network is given.

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetBlockNumberOptionsOptional network override.
options.networkNetworkNetwork to query. Defaults to mainnet when omitted.

Returns: Promise<GetBlockNumberReturnType> — Current masterchain seqno as a number.

Example

const blockNumber = await getBlockNumber(appKit);

console.log('Current block number:', blockNumber);

getDefaultNetwork

Read AppKit's currently configured default network — the one connectors enforce on new wallet connections. undefined means any registered network is allowed.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetDefaultNetworkReturnType — The default Network, or undefined if none is set.

Example

const defaultNetwork = getDefaultNetwork(appKit);
console.log('Default network:', defaultNetwork);

getNetwork

Read the Network the selected wallet is connected to, or null when no wallet is selected (use getDefaultNetwork for AppKit's configured default).

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetNetworkReturnType — Network of the selected wallet, or null when none is selected.

Example

const network = getNetwork(appKit);

if (network) {
    console.log('Current network:', network);
}

getNetworks

List every network configured on this AppKit instance via AppKitConfig's networks.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetNetworksReturnType — Array of configured Networks.

Example

const networks = getNetworks(appKit);

console.log('Configured networks:', networks);

hasStreamingProvider

Check whether a streaming provider is registered for a network — required by watchBalance, watchJettons and other live-update actions.

ParameterTypeDescription
appKit*AppKitRuntime instance.
network*NetworkNetwork to check.

Returns: HasStreamingProviderReturnTypetrue when a streaming provider is registered for that network.

Example

const isSupported = hasStreamingProvider(appKit, Network.mainnet());
console.log('Mainnet streaming support:', isSupported);

setDefaultNetwork

Set or clear the default network — connectors enforce it on new wallet connections. Emits NETWORKS_EVENTS.DEFAULT_CHANGED so watchDefaultNetwork subscribers fire. Pass undefined to remove the constraint and allow any registered network.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SetDefaultNetworkParametersNetwork to enforce, or undefined to clear.
parameters.network*Network | undefinedNetwork to enforce on new wallet connections. Pass undefined to allow any registered network.

Returns: SetDefaultNetworkReturnType.

Example

// Enforce testnet for all new wallet connections
setDefaultNetwork(appKit, { network: Network.testnet() });

// Allow any network (clear default)
setDefaultNetwork(appKit, { network: undefined });

watchDefaultNetwork

Subscribe to default-network changes — fires when setDefaultNetwork is called.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchDefaultNetworkParametersUpdate callback.
parameters.onChange*(network: Network | undefined) => voidCallback fired whenever setDefaultNetwork updates the default — receives the new value (or undefined when cleared).

Returns: WatchDefaultNetworkReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchDefaultNetwork(appKit, {
    onChange: (network) => {
        console.log('Default network changed:', network);
    },
});

// Later: unsubscribe();

watchNetworks

Subscribe to changes of the configured-networks list — fires when AppKit's network manager registers or replaces a network's API client.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchNetworksParametersUpdate callback.
parameters.onChange*(networks: Network[]) => voidCallback fired whenever the configured-networks list changes — receives the latest snapshot.

Returns: WatchNetworksReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchNetworks(appKit, {
    onChange: (networks) => {
        console.log('Networks updated:', networks);
    },
});

// Later: unsubscribe();

Signing

signBinary

Ask the selected wallet to sign a binary blob. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SignBinaryParametersBinary content and optional network override.
parameters.bytes*Base64StringBinary blob the user is asked to sign, encoded as Base64.
parameters.networkNetworkNetwork to issue the sign request against. Defaults to AppKit's configured default network. When none is set, the wallet falls back to its current network.

Returns: Promise<SignBinaryReturnType> — Signature and signed payload, as returned by the wallet.

Example

// Example: sign "Hello" in base64
const result = await signBinary(appKit, {
    bytes: 'SGVsbG8=' as Base64String,
});

console.log('Binary Signature:', result.signature);

signCell

Ask the selected wallet to sign a TON cell — typically used so the signature can later be verified on-chain. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SignCellParametersCell content, TL-B schema and optional network override.
parameters.cell*Base64StringTON cell content encoded as Base64 (BoC).
parameters.schema*stringTL-B-style schema describing the cell layout so the wallet can render the payload to the user.
parameters.networkNetworkNetwork to issue the sign request against. Defaults to AppKit's configured default network. When none is set, the wallet falls back to its current network.

Returns: Promise<SignCellReturnType> — Signature and signed payload, as returned by the wallet.

Example

const result = await signCell(appKit, {
    cell: 'te6ccgEBAQEAAgAAGA==' as Base64String, // Example BoC
    schema: 'transfer#abc123 amount:uint64 = Transfer',
});

console.log('Cell Signature:', result.signature);

signText

Ask the selected wallet to sign a plain text message. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SignTextParametersText to sign and optional network override.
parameters.text*stringUTF-8 text the user is asked to sign.
parameters.networkNetworkNetwork to issue the sign request against. Defaults to AppKit's configured default network. When none is set, the wallet falls back to its current network.

Returns: Promise<SignTextReturnType> — Signature and signed payload, as returned by the wallet.

Example

const result = await signText(appKit, {
    text: 'Hello, TON!',
});

console.log('Signature:', result.signature);

Staking

buildStakeTransaction

Build a TransactionRequest that executes a stake or unstake previously quoted by getStakingQuote — returns it without sending so the UI can inspect or batch before signing.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*BuildStakeTransactionOptionsQuote and optional provider override.
options.quote*StakingQuoteThe staking quote based on which the transaction is built.
options.userAddress*UserFriendlyAddressAddress of the user performing the staking.
options.providerOptionsTProviderOptions = unknownProvider-specific options.
options.providerIdstringProvider to stake/unstake through. Defaults to the registered default staking provider.

Returns: BuildStakeTransactionReturnType — Transaction request ready to pass to sendTransaction.

Example

const txRequest = await buildStakeTransaction(appKit, {
    quote,
    userAddress,
});
console.log('Stake Transaction:', txRequest);

createTonstakersProvider

Build a Tonstakers-backed StakingProvider for AppKit. Pass the result to AppKitConfig's providers or registerProvider.

ParameterTypeDescription
configTonStakersProviderConfigOptional TonStakersProviderConfig. Defaults are filled in for any field left undefined.

Returns: (ctx: ProviderFactoryContext) => TonStakersStakingProvider.

getStakedBalance

Read a user's staked balance from a staking provider — total staked plus, depending on the provider, any instant-unstake balance available right now.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetStakedBalanceOptionsOwner address and optional network/provider override.
options.userAddress*UserFriendlyAddressOwner whose staked balance should be read.
options.networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
options.providerIdstringProvider to query. Defaults to the registered default staking provider.

Returns: GetStakedBalanceReturnType — Staked-balance breakdown (StakingBalance) for the user on the resolved network/provider.

Example

const balance = await getStakedBalance(appKit, {
    userAddress,
});
console.log('Staked Balance:', balance);

getStakingManager

Read AppKit's StakingManager — the runtime that owns registered staking providers and dispatches quote/stake/balance calls. Apps usually use the higher-level actions (getStakingQuote, buildStakeTransaction, getStakedBalance) instead of touching the manager directly.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetStakingManagerReturnType — The StakingManager bound to this AppKit instance.

getStakingProvider

Get a registered staking provider by id, or the default staking provider when no id is given. Throws when no provider matches — or when no id is passed and no default has been registered.

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetStakingProviderOptionsOptional provider id.
options.idstringProvider ID to look up. When omitted, returns the registered default staking provider.

Returns: GetStakingProviderReturnType — The matching staking provider instance.

getStakingProviderInfo

Read live staking-pool info for a provider — APY, instant-unstake liquidity and (for liquid staking) the current exchange rate between stake and receive tokens. Use getStakingProviderMetadata for static metadata (display name, stake/receive tokens, supported unstake modes).

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetStakingProviderInfoOptionsOptional network and provider override.
options.networkNetworkNetwork whose staking pool should be inspected. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
options.providerIdstringProvider to query. Defaults to the registered default staking provider.

Returns: GetStakingProviderInfoReturnType — Live staking-provider info for the resolved network.

Example

const providerInfo = await getStakingProviderInfo(appKit, {
    providerId: 'tonstakers',
});
console.log('Provider Info:', providerInfo);

getStakingProviderMetadata

Read static metadata for a staking provider — display name, stake/receive tokens, supported unstake modes, contract address. Use getStakingProviderInfo for live values (APY, instant-unstake liquidity, exchange rate).

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetStakingProviderMetadataOptionsOptional network and provider override.
options.networkNetworkNetwork whose provider metadata should be read. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
options.providerIdstringProvider to query. Defaults to the registered default staking provider.

Returns: GetStakingProviderMetadataReturnType — Static StakingProviderMetadata for the resolved provider.

Example

const providerMetadata = getStakingProviderMetadata(appKit, {
    providerId: 'tonstakers',
});
console.log('Provider Metadata:', providerMetadata);

getStakingProviders

List every staking provider registered on this AppKit instance — both those passed via AppKitConfig's providers and those added later through registerProvider.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetStakingProvidersReturnType — Array of registered staking providers.

Example

const providers = getStakingProviders(appKit);
console.log('Available Staking Providers:', providers);

getStakingQuote

Quote a stake or unstake — given the amount, direction and target asset, returns the rate, expected output and provider metadata needed to call buildStakeTransaction.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetStakingQuoteOptionsQuote parameters and optional provider override.
options.direction*StakingQuoteDirectionDirection of the quote (stake or unstake)
options.amount*stringAmount of tokens to stake or unstake.
options.userAddressUserFriendlyAddressAddress of the user.
options.networkNetworkNetwork on which the staking will be executed.
options.unstakeModeUnstakeModesUnstake-timing mode the quote should target — see UnstakeMode for the supported flavours ('INSTANT', 'WHEN_AVAILABLE', 'ROUND_END'). Only meaningful when direction === 'unstake' and the provider lists the mode in supportedUnstakeModes.
options.isReversedbooleanIf true, for unstake requests the amount is specified in the staking coin (e.g. TON) instead of the Liquid Staking Token (e.g. tsTON).
options.providerOptionsTProviderOptions = unknownProvider-specific options.
options.providerIdstringProvider to quote against. Defaults to the registered default staking provider.

Returns: GetStakingQuoteReturnType — Quote with pricing details and provider metadata.

Example

const quote = await getStakingQuote(appKit, {
    amount: '1000000000',
    direction: 'stake',
});
console.log('Staking Quote:', quote);

setDefaultStakingProvider

Set the default staking provider — subsequent getStakingQuote and buildStakeTransaction calls without an explicit providerId route through it. Emits provider:default-changed, picked up by watchStakingProviders.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SetDefaultStakingProviderParametersID of the provider to make default.
parameters.providerId*stringID of the provider to make default — must already be registered.

Returns: SetDefaultStakingProviderReturnType.

watchStakingProviders

Subscribe to staking provider lifecycle — fires onChange whenever a new provider is registered or the default staking provider switches.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchStakingProvidersParametersUpdate callback.
parameters.onChange*() => voidCallback fired whenever a staking provider is registered or the default staking provider changes.

Returns: WatchStakingProvidersReturnType — Unsubscribe function — call it to stop receiving updates.

Swap

buildSwapTransaction

Build a TransactionRequest that executes a swap previously quoted by getSwapQuote — returns it without sending so the UI can inspect or batch before signing.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*BuildSwapTransactionOptionsQuote and provider-specific options.
options.quote*SwapQuoteThe swap quote based on which the transaction is built.
options.userAddress*UserFriendlyAddressAddress of the user performing the swap.
options.destinationAddressUserFriendlyAddressAddress to receive the swapped tokens (defaults to userAddress)
options.slippageBpsnumberSlippage tolerance in basis points (1 bp = 0.01%)
options.deadlinenumberUnix timestamp (in seconds) after which the swap transaction must not be executed.
options.providerOptionsTProviderOptions = unknownProvider-specific options.

Returns: BuildSwapTransactionReturnType — Transaction request ready to pass to sendTransaction.

Example

const transactionRequest = await buildSwapTransaction(appKit, {
    quote,
    userAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    slippageBps: 100, // 1%
});
const transactionResponse = await sendTransaction(appKit, transactionRequest);
console.log('Swap Transaction:', transactionResponse);

createDeDustProvider

Build a DeDust-backed SwapProvider for AppKit. Pass the result to AppKitConfig's providers or registerProvider.

ParameterTypeDescription
configDeDustSwapProviderConfigOptional DeDustSwapProviderConfig. Defaults are filled in for any field left undefined.

Returns: (ctx: ProviderFactoryContext) => DeDustSwapProvider.

createOmnistonProvider

Build an Omniston-backed SwapProvider for AppKit. Pass the result to AppKitConfig's providers or registerProvider.

ParameterTypeDescription
configOmnistonSwapProviderConfigOptional OmnistonSwapProviderConfig. Defaults are filled in for any field left undefined.

Returns: (ctx: ProviderFactoryContext) => OmnistonSwapProvider.

getSwapManager

Read AppKit's SwapManager — the runtime that owns registered swap providers and dispatches quote/build calls. Apps usually use the higher-level actions (getSwapQuote, buildSwapTransaction) instead of touching the manager directly.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetSwapManagerReturnType — The SwapManager bound to this AppKit instance.

Example

const swapManager = getSwapManager(appKit);

getSwapProvider

Get a registered swap provider by id, or the default swap provider when no id is given. Throws when no provider matches — or when no id is passed and no default has been registered.

ParameterTypeDescription
appKit*AppKitRuntime instance.
optionsGetSwapProviderOptionsOptional provider id.
options.idstringProvider ID to look up. When omitted, returns the registered default swap provider.

Returns: GetSwapProviderReturnType — The matching swap provider instance.

Example

const swapProvider = getSwapProvider(appKit, { id: 'stonfi' });

getSwapProviders

List every swap provider registered on this AppKit instance — both those passed via AppKitConfig's providers and those added later through registerProvider.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetSwapProvidersReturnType — Array of registered swap providers.

Example

const swapProviders = getSwapProviders(appKit);
console.log(
    'Registered providers:',
    swapProviders.map((p) => p.providerId),
);

getSwapQuote

Quote a swap — given source/target tokens and an amount, returns the rate, expected output and provider metadata needed to call buildSwapTransaction.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*GetSwapQuoteOptionsSource and target tokens, amount, optional network and provider override.
options.amount*stringAmount of tokens to swap (incoming or outgoing depending on isReverseSwap)
options.from*SwapTokenToken to swap from.
options.to*SwapTokenToken to swap to.
options.network*NetworkNetwork on which the swap will be executed.
options.slippageBpsnumberSlippage tolerance in basis points (1 bp = 0.01%)
options.maxOutgoingMessagesnumberMaximum number of outgoing messages
options.providerOptionsTProviderOptions = unknownProvider-specific options.
options.isReverseSwapbooleanIf true, amount is the amount to receive (buy). If false, amount is the amount to spend (sell).
options.providerIdstringProvider to quote against. Defaults to the registered default swap provider.

Returns: GetSwapQuoteReturnType — Quote with pricing details and the provider metadata required to build a transaction.

Example

const quote = await getSwapQuote(appKit, {
    from: {
        address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
        decimals: 6,
    },
    to: { address: 'ton', decimals: 9 },
    amount: '1000000000', // nanotons as string
    network: Network.mainnet(),
});
console.log('Swap Quote:', quote);

setDefaultSwapProvider

Set the default swap provider — subsequent getSwapQuote and buildSwapTransaction calls without an explicit providerId route through it. Emits provider:default-changed, picked up by watchSwapProviders.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SetDefaultSwapProviderParametersID of the provider to make default.
parameters.providerId*stringID of the provider to make default — must already be registered.

Returns: SetDefaultSwapProviderReturnType.

Example

setDefaultSwapProvider(appKit, { providerId: 'stonfi' });

watchSwapProviders

Subscribe to swap provider lifecycle — fires onChange whenever a new provider is registered or the default swap provider switches.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchSwapProvidersParametersUpdate callback.
parameters.onChange*() => voidCallback fired whenever a swap provider is registered or the default swap provider changes.

Returns: WatchSwapProvidersReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchSwapProviders(appKit, {
    onChange: () => console.log('Swap providers updated'),
});
unsubscribe();

Transactions

createTransferTonTransaction

Build a TON transfer TransactionRequest for the selected wallet without sending it — useful when the UI needs to inspect or batch transactions before signing. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*CreateTransferTonTransactionParametersRecipient, amount and optional payload/comment/stateInit.
parameters.recipientAddress*UserFriendlyAddressRecipient address.
parameters.amount*stringAmount in TON as a human-readable decimal string (e.g., "1.5"). Converted to nano-TON internally.
parameters.commentstringHuman-readable text comment. Converted to a Base64 payload when no payload is supplied.
parameters.payloadBase64StringRaw Base64 message payload — wins over comment when both are set.
parameters.stateInitBase64StringInitial state for deploying a new contract, encoded as Base64.

Returns: CreateTransferTonTransactionReturnType — Transaction request ready to pass to sendTransaction.

Example

const tx = createTransferTonTransaction(appKit, {
    recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    amount: '0.1', // 0.1 TON (human-readable format)
    comment: 'Draft transaction',
});

console.log('Transaction Request:', tx);

getTransactionStatus

Read the status of a sent transaction by its BoC or normalized hash. In TON a single external message triggers a tree of internal messages — the transaction is 'completed' only when the entire trace finishes. Until then it stays 'pending'. Throws when neither boc nor normalizedHash is provided.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*GetTransactionStatusParametersExactly one of boc or normalizedHash, plus an optional network override.

Returns: Promise<GetTransactionStatusReturnType> — Status response with current state, completed/total message counts and trace details.

sendTransaction

Hand a pre-built TransactionRequest to the selected wallet for signing and broadcast — usually the second step after createTransferTonTransaction, buildSwapTransaction or buildStakeTransaction. Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SendTransactionParametersTransaction request to broadcast.

Returns: Promise<SendTransactionReturnType> — Wallet response carrying the BoC of the sent transaction.

Example

const result = await sendTransaction(appKit, {
    messages: [
        {
            address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
            amount: '100000000', // 0.1 TON in nanotons (raw format)
        },
    ],
});

console.log('Transaction Result:', result);

transferTon

Build and send a TON transfer from the selected wallet in one step (use createTransferTonTransaction + sendTransaction if you need to inspect the transaction first). Throws Error('Wallet not connected') if no wallet is currently selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*TransferTonParametersRecipient, amount and optional payload/comment/stateInit.
parameters.recipientAddress*UserFriendlyAddressRecipient address.
parameters.amount*stringAmount in TON as a human-readable decimal string (e.g., "1.5"). Converted to nano-TON internally.
parameters.commentstringHuman-readable text comment. Converted to a Base64 payload when no payload is supplied.
parameters.payloadBase64StringRaw Base64 message payload — wins over comment when both are set.
parameters.stateInitBase64StringInitial state for deploying a new contract, encoded as Base64.

Returns: Promise<TransferTonReturnType> — Wallet response carrying the BoC of the sent transaction.

Example

const result = await transferTon(appKit, {
    recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    amount: '0.1', // 0.1 TON (human-readable format)
    comment: 'Hello from AppKit!',
});

console.log('Transfer Result:', result);

watchTransactions

Subscribe to incoming-transaction events for the currently selected wallet, automatically rebinding when the user connects, switches, or disconnects (use watchTransactionsByAddress for a fixed address). Requires a streaming provider registered for the network — call throws when none is configured. Use hasStreamingProvider to check first.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*WatchTransactionsOptionsUpdate callback and optional network override.
options.onChange*(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.
options.networkNetworkNetwork to watch on. Defaults to the selected wallet's network.

Returns: WatchTransactionsReturnType — Unsubscribe function — call it to stop receiving updates.

watchTransactionsByAddress

Subscribe to incoming-transaction events for an arbitrary address (use watchTransactions for the selected wallet). Requires a streaming provider registered for the network — call throws when none is configured. Use hasStreamingProvider to check first.

ParameterTypeDescription
appKit*AppKitRuntime instance.
options*WatchTransactionsByAddressOptionsAddress, update callback and optional network override.
options.address*UserFriendlyAddress | AddressAddress to watch — pass a UserFriendlyAddress string or an Address instance from @ton/core.
options.onChange*(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.
options.networkNetworkNetwork to watch on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

Returns: WatchTransactionsByAddressReturnType — Unsubscribe function — call it to stop receiving updates.

Wallets

getConnectedWallets

List every wallet currently connected through any registered Connector.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetConnectedWalletsReturnType — Read-only array of WalletInterfaces.

Example

const wallets = getConnectedWallets(appKit);

console.log('Connected wallets:', wallets);

getSelectedWallet

Read the wallet AppKit treats as "active" — most actions (getBalance, signText, transferTon) target this wallet implicitly. Returns null when no wallet is connected or selected.

ParameterTypeDescription
appKit*AppKitRuntime instance.

Returns: GetSelectedWalletReturnType — Selected WalletInterface, or null when none is selected.

Example

const wallet = getSelectedWallet(appKit);

if (wallet) {
    console.log('Selected wallet:', wallet.getWalletId());
    console.log('Address:', wallet.getAddress());
}

setSelectedWalletId

Switch which connected wallet AppKit treats as selected — emits WALLETS_EVENTS.SELECTION_CHANGED so watchSelectedWallet subscribers fire. Pass null to clear the selection.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*SetSelectedWalletIdParametersWallet ID to select, or null to clear.
parameters.walletId*string | nullWallet ID (as returned by WalletInterface's getWalletId()) to select. Pass null to clear the selection.

Returns: SetSelectedWalletIdReturnType.

Example

setSelectedWalletId(appKit, {
    walletId: 'my-wallet-id',
});

watchConnectedWallets

Subscribe to the list of connected wallets — fires whenever a wallet connects or disconnects through any registered Connector.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchConnectedWalletsParametersUpdate callback.
parameters.onChange*(wallets: WalletInterface[]) => voidCallback fired whenever the list of connected wallets changes — receives the latest snapshot.

Returns: WatchConnectedWalletsReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchConnectedWallets(appKit, {
    onChange: (wallets) => {
        console.log('Connected wallets updated:', wallets.length);
    },
});

// Later: unsubscribe();

watchSelectedWallet

Subscribe to selected-wallet changes — fires when setSelectedWalletId runs, when the wallet manager auto-selects the first wallet because no prior selection survived a connector update, or when it clears the selection because no connected wallets remain.

ParameterTypeDescription
appKit*AppKitRuntime instance.
parameters*WatchSelectedWalletParametersUpdate callback.
parameters.onChange*(wallet: WalletInterface | null) => voidCallback fired whenever the selected wallet changes — receives the new wallet, or null when the selection was cleared.

Returns: WatchSelectedWalletReturnType — Unsubscribe function — call it to stop receiving updates.

Example

const unsubscribe = watchSelectedWallet(appKit, {
    onChange: (wallet) => {
        if (wallet) {
            console.log('Selected wallet changed:', wallet.getWalletId());
        } else {
            console.log('Wallet deselected');
        }
    },
});

// Later: unsubscribe();

Class

Client

ApiClientTonApi

ApiClient implementation backed by the TonAPI indexer.

Constructor: new ApiClientTonApi(config)

ParameterTypeDescription
configBaseApiClientConfigTonAPI client config — endpoint URL and API key. Defaults to TonAPI mainnet/testnet URLs based on config.network.
config.endpointstringBase URL of the indexer endpoint. Defaults to the provider's mainnet/testnet URL based on network.
config.apiKeystringAPI key forwarded to the indexer for higher rate limits.
config.timeoutnumberPer-request timeout in milliseconds. Defaults to a provider-specific value.
config.fetchApitypeof fetchCustom fetch implementation. Defaults to the global fetch.
config.networkNetworkNetwork the client should target. Determines the default endpoint when one isn't supplied.
config.disableNetworkSendbooleanWhen true, swallow sendBoc calls instead of broadcasting them — useful for local development and tests.

ApiClientToncenter

ApiClient implementation backed by the Toncenter API.

Constructor: new ApiClientToncenter(config)

ParameterTypeDescription
configApiClientToncenterConfigToncenter client config — endpoint URL, API key and optional DNS resolver override. Defaults to mainnet/testnet Toncenter URLs based on config.network.
config.dnsResolverstringOverride the contract address used to resolve TON DNS records. Defaults to the network's standard root resolver.
config.endpointstringBase URL of the indexer endpoint. Defaults to the provider's mainnet/testnet URL based on network.
config.apiKeystringAPI key forwarded to the indexer for higher rate limits.
config.timeoutnumberPer-request timeout in milliseconds. Defaults to a provider-specific value.
config.fetchApitypeof fetchCustom fetch implementation. Defaults to the global fetch.
config.networkNetworkNetwork the client should target. Determines the default endpoint when one isn't supplied.
config.disableNetworkSendbooleanWhen true, swallow sendBoc calls instead of broadcasting them — useful for local development and tests.

Core

AppKit

Runtime that wires connectors, networks, providers and the event emitter for a TON dApp. Construct once at startup and reuse for the app's lifetime.

Constructor: new AppKit(config)

ParameterTypeDescription
config*AppKitConfigNetworks, connectors, providers and runtime flags.
config.networksNetworkAdaptersMap of chain ID to NetworkConfig (which holds the api-client setup). If omitted, AppKit defaults to mainnet only.
config.connectorsConnectorInput[]Wallet connectors registered at startup.
config.defaultNetworkNetworkDefault network.
config.providersProviderInput[]Providers registered at startup.

Example

// Initialize AppKit
const appKit = new AppKit({
    networks: {
        [Network.mainnet().chainId]: {
            apiClient: {
                url: 'https://toncenter.com',
                key: 'your-key',
            },
        },
        // Optional: add testnet
        // [Network.testnet().chainId]: {
        //     apiClient: {
        //         url: 'https://testnet.toncenter.com',
        //         key: 'your-key',
        //     },
        // },
    },
    connectors: [
        createTonConnectConnector({
            tonConnectOptions: {
                manifestUrl: 'https://tonconnect-sdk-demo-dapp.vercel.app/tonconnect-manifest.json',
            },
        }),
    ],
});

EventEmitter

Strongly-typed event emitter built on a string event name → payload type map. Type of appKit.emitter and the base for any custom emitters apps create. See AppKitEvents for the full list of events AppKit emits. appKit.emitter.on(name, handler) returns an unsubscribe function.

Constructor: new EventEmitter()

Crypto Onramp

CryptoOnrampError

Error thrown by CryptoOnrampManager and crypto-onramp providers — extends DefiError with name: 'CryptoOnrampError' and a typed CryptoOnrampErrorCode on code.

Constructor: new CryptoOnrampError(message, code, details)

ParameterTypeDescription
message*stringHuman-readable description, forwarded to Error.
code*CryptoOnrampErrorCodeStable error code for branching logic.
detailsunknownOptional provider-specific context for diagnostics.

CryptoOnrampManager

Runtime that owns registered CryptoOnrampProviders and dispatches quote/deposit/status calls. Usually accessed through the higher-level actions (getCryptoOnrampQuote, createCryptoOnrampDeposit, getCryptoOnrampStatus).

Constructor: new CryptoOnrampManager()

CryptoOnrampProvider

Abstract base class implemented by crypto-onramp providers (Layerswap, swaps.xyz, custom integrations). Apps don't use it directly — they consume providers through CryptoOnrampManager and the getCryptoOnramp* / createCryptoOnrampDeposit actions.

Constructor: new CryptoOnrampProvider()

LayerswapCryptoOnrampProvider

CryptoOnrampProvider implementation backed by Layerswap. Prefer the createLayerswapProvider factory over instantiating this class directly — the factory returns a ProviderInput ready to pass to AppKitConfig's providers or registerProvider.

Constructor: new LayerswapCryptoOnrampProvider(config)

ParameterTypeDescription
configLayerswapProviderConfigOptional LayerswapProviderConfig. Defaults are filled in for any field left undefined.
config.apiKeystringOptional API key. Forwarded as X-LS-APIKEY when provided.
config.apiUrlstringOverride the base API URL. Defaults to https://api.layerswap.io/api/v2 (see Layerswap API V2).

SwapsXyzCryptoOnrampProvider

CryptoOnrampProvider implementation backed by swaps.xyz. Prefer the createSwapsXyzProvider factory over instantiating this class directly — the factory returns a ProviderInput ready to pass to AppKitConfig's providers or registerProvider.

Constructor: new SwapsXyzCryptoOnrampProvider(config)

ParameterTypeDescription
config*SwapsXyzProviderConfigConfiguration carrying the required apiKey plus optional URL/sender overrides.
config.apiKey*stringAPI key issued by swaps.xyz (passed as x-api-key)
config.apiUrlstringOverride the base API URL. Defaults to https://api-v2.swaps.xyz/api (see Swaps API Documentation.
config.defaultSenderstringEVM address used as sender on getAction requests. Required by the API even for deposit flows where the actual payer is unknown. Defaults to a null address when omitted.

DeFi

DefiError

Base error thrown across all DeFi domains (swap, staking, onramp, crypto-onramp). Subclassed by SwapError, StakingError, CryptoOnrampError and the internal onramp error — catch the base when you don't care which domain produced the failure.

Constructor: new DefiError(message, code, details)

ParameterTypeDescription
message*stringHuman-readable description, forwarded to Error.
code*DefiErrorCodeStable error code for branching logic.
detailsunknownOptional provider-specific context for diagnostics.

Networks

AppKitNetworkManager

Network manager that extends walletkit's KitNetworkManager with a default-network setter and AppKit event emission. Usually accessed through the higher-level actions (getDefaultNetwork, setDefaultNetwork, watchDefaultNetwork, getNetworks, watchNetworks).

Constructor: new AppKitNetworkManager(options, emitter)

ParameterTypeDescription
options*TonWalletKitOptionsForwarded to the KitNetworkManager base — chiefly the networks map keyed by chain ID.
emitter*AppKitEmitterEmitter the manager publishes networks:default-changed / networks:updated events through.

KitNetworkManager

Walletkit-side network manager that AppKitNetworkManager extends, adding default-network state and AppKit event emission. Apps usually interact with the AppKitNetworkManager subclass.

Constructor: new KitNetworkManager(options)

ParameterTypeDescription
options*TonWalletKitOptionsConfiguration carrying the networks map keyed by chain ID. At least one network must be configured.

Staking

StakingError

Error thrown by StakingManager and staking providers — extends DefiError with name: 'StakingError' and a typed StakingErrorCode on code.

Constructor: new StakingError(message, code, details)

ParameterTypeDescription
message*stringHuman-readable description, forwarded to Error.
code*StakingErrorCodeStable error code for branching logic.
detailsunknownOptional provider-specific context for diagnostics.

StakingManager

Runtime that owns registered StakingProviders and dispatches quote/stake/balance calls. Usually accessed through the higher-level actions (getStakingQuote, buildStakeTransaction, getStakedBalance).

Constructor: new StakingManager(createFactoryContext)

ParameterTypeDescription
createFactoryContext*() => ProviderFactoryContextLazy provider of the ProviderFactoryContext the manager passes into provider factories at registration time.

StakingProvider

Abstract base class implemented by staking providers (Tonstakers, custom integrations, …). Apps don't use it directly — they consume providers through StakingManager and the getStaking* / buildStakeTransaction actions.

Constructor: new StakingProvider(providerId)

ParameterTypeDescription
providerId*stringStable id the provider registers with — must be unique within StakingManager.

TonStakersStakingProvider

StakingProvider implementation backed by Tonstakers. The constructor is private — always go through the createTonstakersProvider factory and pass the result to AppKitConfig's providers or registerProvider.

Constructor: new TonStakersStakingProvider()

Swap

DeDustSwapProvider

SwapProvider implementation backed by DeDust. Prefer the createDeDustProvider factory over instantiating this class directly — the factory returns a ProviderInput ready to pass to AppKitConfig's providers or registerProvider.

Constructor: new DeDustSwapProvider(config)

ParameterTypeDescription
configDeDustSwapProviderConfigOptional DeDustSwapProviderConfig. Defaults are filled in for any field left undefined.
config.providerIdstringCustom provider ID (defaults to 'dedust')
config.defaultSlippageBpsnumberDefault slippage tolerance in basis points (1 bp = 0.01%)
config.apiUrlstringAPI base URL
config.onlyVerifiedPoolsbooleanOnly use verified pools
config.maxSplitsnumberMaximum number of route splits
config.maxLengthnumberMaximum route length (hops)
config.minPoolUsdTvlstringMinimum pool TVL in USD
config.metadataSwapProviderMetadataOverrideCustom metadata for the provider.
config.referralAddressstringThe address of the referrer.
config.referralFeeBpsnumberReferral fee in basis points (max 100 = 1%)

Example

kit.registerProvider(
    createDeDustProvider({
        defaultSlippageBps: 100, // 1%
        referralAddress: 'EQ...',
        referralFeeBps: 50, // 0.5%
    }),
);

OmnistonSwapProvider

SwapProvider implementation backed by Omniston. Prefer the createOmnistonProvider factory over instantiating this class directly — the factory returns a ProviderInput ready to pass to AppKitConfig's providers or registerProvider.

Constructor: new OmnistonSwapProvider(config)

ParameterTypeDescription
configOmnistonSwapProviderConfigOptional OmnistonSwapProviderConfig. Defaults are filled in for any field left undefined.
config.apiUrlstringOptional URL for the Omniston API
config.defaultSlippageBpsnumberDefault slippage tolerance in basis points (1 bp = 0.01%)
config.quoteTimeoutMsnumberTimeout for quote requests in milliseconds
config.providerIdstringIdentifier for the provider.
config.metadataSwapProviderMetadataOverrideCustom metadata for the provider.
config.referrerAddressstringThe address of the referrer.
config.referrerFeeBpsnumberReferrer fee in basis points (1 bp = 0.01%)
config.flexibleReferrerFeebooleanWhether a flexible referrer fee is allowed.

Example

kit.registerProvider(
    createOmnistonProvider({
        defaultSlippageBps: 100, // 1%
        quoteTimeoutMs: 10000,
    }),
);

SwapError

Error thrown by SwapManager and swap providers — extends DefiError with name: 'SwapError' and a typed SwapErrorCode on code.

Constructor: new SwapError(message, code, details)

ParameterTypeDescription
message*stringHuman-readable description, forwarded to Error.
code*SwapErrorCodeStable error code for branching logic.
detailsunknownOptional provider-specific context for diagnostics.

SwapManager

Runtime that owns registered SwapProviders and dispatches quote/swap calls. Usually accessed through the higher-level actions (getSwapQuote, buildSwapTransaction).

Constructor: new SwapManager(createFactoryContext)

ParameterTypeDescription
createFactoryContext*() => ProviderFactoryContextLazy provider of the ProviderFactoryContext the manager passes into provider factories at registration time.

SwapProvider

Abstract base class implemented by swap providers (DeDust, Omniston, custom integrations). Apps don't use it directly — they consume providers through SwapManager and the getSwap* / buildSwapTransaction actions.

Constructor: new SwapProvider()

Wallets

TonConnectWalletAdapter

WalletInterface implementation backed by a TonConnect wallet. Prefer the createTonConnectConnector factory over instantiating this class directly — the connector builds the adapter for every wallet it tracks and apps interact with it through standard AppKit actions (sendTransaction, signText/signBinary/signCell). On-chain reads (balance, jettons, NFTs) live on separate actions (getBalance, getJettons, getNfts) and don't go through this adapter.

Constructor: new TonConnectWalletAdapter(config)

ParameterTypeDescription
config*TonConnectWalletAdapterConfigTonConnect wallet + UI instance and the id of the connector that produced them.
config.connectorId*stringID of the connector that produced this wallet — surfaced as WalletInterface.connectorId.
config.tonConnectWallet*TonConnectWalletUnderlying TonConnect wallet object.
config.tonConnectUI*TonConnectUITonConnect UI instance used to drive sendTransaction and signData calls.

Type

Balances

BalanceUpdate

Update payload delivered to watchBalance / watchBalanceByAddress subscribers when the watched address's TON balance changes.

FieldTypeDescription
type*'balance'The update type field.
address*UserFriendlyAddressThe account address.
rawBalance*TokenAmountThe account balance in nano units.
balance*stringThe formatted balance.
status*StreamingUpdateStatusFinality stage of the update — see StreamingUpdateStatus.

GetBalanceByAddressOptions

Options for getBalanceByAddress.

FieldTypeDescription
address*UserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
networkNetworkNetwork to read the balance from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

GetBalanceByAddressReturnType

Return type of getBalanceByAddress.

type GetBalanceByAddressReturnType = TokenAmount;

GetBalanceOptions

Options for getBalance.

FieldTypeDescription
networkNetworkNetwork to read the balance from. Defaults to the selected wallet's network.

GetBalanceReturnType

Return type of getBalance.

type GetBalanceReturnType = TokenAmount | null;

StreamingUpdateStatus

Finality stage carried by every streaming update — 'pending' (in mempool), 'confirmed' (included in a block), 'finalized' (irreversible), or 'invalidated' (rolled back).

type StreamingUpdateStatus = 'pending' | 'confirmed' | 'finalized' | 'invalidated';

WatchBalanceByAddressOptions

Options for watchBalanceByAddress.

FieldTypeDescription
address*UserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
networkNetworkNetwork to watch on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
onChange*(update: BalanceUpdate) => voidCallback fired on every balance update from the streaming provider.

WatchBalanceByAddressReturnType

Return type of watchBalanceByAddress — call to stop receiving updates.

type WatchBalanceByAddressReturnType = () => void;

WatchBalanceOptions

Options for watchBalance.

FieldTypeDescription
networkNetworkNetwork to watch on. Defaults to the selected wallet's network.
onChange*(update: BalanceUpdate) => voidCallback fired on every balance update from the streaming provider.

WatchBalanceReturnType

Return type of watchBalance — call to stop receiving updates.

type WatchBalanceReturnType = () => void;

Client

AddressBook

Map of raw addresses to their resolved metadata, returned alongside indexed lists (e.g. JettonsResponse, NFTsResponse) so consumers can render labels without extra lookups.

type AddressBook = {
    [key: UserFriendlyAddress]: AddressBookEntry;
};

AddressBookEntry

Single entry inside an AddressBook — pairs the user-friendly address with optional domain name and the list of contract interfaces it implements.

FieldTypeDescription
addressUserFriendlyAddressThe human-readable representation of the blockchain address.
domainstringThe domain name associated with the address if available.
interfaces*string[]List of supported interfaces by the address.

ApiClient

Indexer/RPC client interface used by AppKit to read on-chain state — balance, jettons, NFTs, etc. Each Network resolves to its own ApiClient via AppKitNetworkManager. Apps usually pull one through getApiClient rather than constructing it directly.

FieldTypeDescription
nftItemsByAddress*(request: NFTsRequest) => Promise<NFTsResponse>Look up specific NFT items by address.
nftItemsByOwner*(request: UserNFTsRequest) => Promise<NFTsResponse>List NFT items held by an owner. Supports pagination.
fetchEmulation*(messageBoc: Base64String, ignoreSignature?: boolean) => Promise<ToncenterEmulationResult>Run an emulation pass on a Base64-encoded BoC. Returns the predicted account-state changes and emitted events without sending the message.
sendBoc*(boc: Base64String) => Promise<string>Broadcast a signed BoC to the network and return the message hash.
runGetMethod*(address: UserFriendlyAddress, method: string, stack?: RawStackItem[], seqno?: number) => Promise<GetMethodResult>Run an on-chain get method against a contract and read its TVM stack output.
getAccountState*(address: UserFriendlyAddress, seqno?: number) => Promise<FullAccountState>Read the full on-chain account state (code, data, status, balance) for an address.
getBalance*(address: UserFriendlyAddress, seqno?: number) => Promise<TokenAmount>Read the TON balance of an address in raw nanotons.
getAccountTransactions*(request: TransactionsByAddressRequest) => Promise<TransactionsResponse>List transactions for an address. Ordered newest-first, paginated via LimitRequest.
getTransactionsByHash*(request: GetTransactionByHashRequest) => Promise<TransactionsResponse>Fetch a transaction by its message or body hash.
getPendingTransactions*(request: GetPendingTransactionsRequest) => Promise<TransactionsResponse>List pending (unconfirmed) transactions by accounts or trace ids. Useful for "in-flight" UIs.
getTrace*(request: GetTraceRequest) => Promise<ToncenterTracesResponse>Fetch a confirmed trace (the tree of internal messages spawned by an external one).
getPendingTrace*(request: GetPendingTraceRequest) => Promise<ToncenterTracesResponse>Fetch a pending trace by external-message hash, while it's still in flight.
resolveDnsWallet*(domain: string) => Promise<string | null>Resolve a TON DNS domain to the wallet address it points at. null when unset.
backResolveDnsWallet*(address: UserFriendlyAddress) => Promise<string | null>Reverse-resolve a wallet address to a TON DNS domain that points at it. null when none.
jettonsByAddress*(request: GetJettonsByAddressRequest) => Promise<ToncenterResponseJettonMasters>Look up jetton masters by address — returns indexer metadata for the requested jettons.
jettonsByOwnerAddress*(request: GetJettonsByOwnerRequest) => Promise<JettonsResponse>List jetton holdings owned by an address — returns balances + jetton-master metadata.
getEvents*(request: GetEventsRequest) => Promise<GetEventsResponse>List parsed account events (jetton transfers, NFT moves, swaps, …) for an address.
getMasterchainInfo*() => Promise<MasterchainInfo>Read the latest masterchain info — last seqno, shards, time.

ApiClientConfig

Configuration accepted by NetworkConfig's apiClient — picks an ApiClient implementation (Toncenter / TonAPI) and supplies its endpoint URL plus optional API key.

FieldTypeDescription
urlstringBase URL of the indexer endpoint. Defaults to 'https://toncenter.com' for mainnet, 'https://testnet.toncenter.com' for testnet.
keystringAPI key forwarded to the indexer for higher rate limits.

ApiClientToncenterConfig

Configuration accepted by ApiClientToncenter — endpoint, API key, request timeout, custom fetch, target network, and optional DNS-resolver override.

FieldTypeDescription
dnsResolverstringOverride the contract address used to resolve TON DNS records. Defaults to the network's standard root resolver.
endpointstringBase URL of the indexer endpoint. Defaults to the provider's mainnet/testnet URL based on network.
apiKeystringAPI key forwarded to the indexer for higher rate limits.
timeoutnumberPer-request timeout in milliseconds. Defaults to a provider-specific value.
fetchApitypeof fetchCustom fetch implementation. Defaults to the global fetch.
networkNetworkNetwork the client should target. Determines the default endpoint when one isn't supplied.
disableNetworkSendbooleanWhen true, swallow sendBoc calls instead of broadcasting them — useful for local development and tests.

BaseApiClientConfig

Configuration shared by every ApiClient subclass — endpoint, API key, request timeout, custom fetch, target network and a disableNetworkSend dev toggle. Accepted directly by ApiClientTonApi; extended by ApiClientToncenterConfig.

FieldTypeDescription
endpointstringBase URL of the indexer endpoint. Defaults to the provider's mainnet/testnet URL based on network.
apiKeystringAPI key forwarded to the indexer for higher rate limits.
timeoutnumberPer-request timeout in milliseconds. Defaults to a provider-specific value.
fetchApitypeof fetchCustom fetch implementation. Defaults to the global fetch.
networkNetworkNetwork the client should target. Determines the default endpoint when one isn't supplied.
disableNetworkSendbooleanWhen true, swallow sendBoc calls instead of broadcasting them — useful for local development and tests.

GetApiClientOptions

Options for getApiClient.

FieldTypeDescription
network*NetworkNetwork whose configured ApiClient should be returned.

GetApiClientReturnType

Return type of getApiClient.

type GetApiClientReturnType = ApiClient;

TokenInfo

Display metadata for a token (TON, jetton, or NFT) — name, symbol, image and animation as reported by the indexer. Surfaced as Jetton's info and NFT's info.

FieldTypeDescription
namestringDisplay name of the token.
descriptionstringHuman-readable description of the token.
imageTokenImageToken image in various sizes.
animationTokenAnimationAnimated media associated with the token.
symbolstringTicker symbol of the token (e.g., "TON", "USDT")

Connectors

AddConnectorParameters

Connector instance or factory accepted by addConnector — same shape used in AppKitConfig's connectors.

type AddConnectorParameters = ConnectorInput;

AddConnectorReturnType

Return type of addConnector — call to remove the connector from AppKit.

type AddConnectorReturnType = () => void;

ConnectParameters

Parameters accepted by connect.

FieldTypeDescription
connectorId*stringID of the registered connector to drive the connection through (e.g., 'tonconnect').

ConnectReturnType

Return type of connect.

type ConnectReturnType = void;

Connector

Wallet connector contract — the protocol-specific bridge (TonConnect, embedded wallet, …) AppKit drives once you register it via AppKitConfig's connectors.

FieldTypeDescription
id*stringStable connector identifier, unique within an AppKit instance.
type*stringProtocol type (e.g. 'tonconnect'). Multiple connectors can share the same type.
metadata*ConnectorMetadataDisplay metadata (name, icon) shown in connect UIs.
destroy*() => voidRelease any resources held by the connector. Call on app teardown.
connectWallet*(network?: Network) => Promise<void>Initiate a wallet connection flow on the given network.
disconnectWallet*() => Promise<void>Disconnect the currently connected wallet, if any.
getConnectedWallets*() => WalletInterface[]Wallets currently connected through this connector.

ConnectorFactory

Factory that builds a Connector from ConnectorFactoryContext. AppKit calls it at registration time.

type ConnectorFactory = (ctx: ConnectorFactoryContext) => Connector;

ConnectorFactoryContext

Context that AppKit injects into a ConnectorFactory when building the connector at registration time.

FieldTypeDescription
networkManager*AppKitNetworkManagerNetwork manager the connector should use for client lookups and default-network reads.
eventEmitter*AppKitEmitterEvent emitter the connector should publish wallet/connection events to.

ConnectorInput

Either a ready-made Connector or a ConnectorFactory that produces one — the value accepted by addConnector and AppKitConfig's connectors.

type ConnectorInput = Connector | ConnectorFactory;

ConnectorMetadata

Display metadata for a Connector, surfaced in connect UIs to help users pick the right wallet.

FieldTypeDescription
name*stringHuman-readable connector name (e.g., 'TonConnect').
iconUrlstringOptional URL of an icon shown next to the name.

DisconnectParameters

Parameters accepted by disconnect.

FieldTypeDescription
connectorId*stringID of the registered connector whose wallet should be disconnected.

DisconnectReturnType

Return type of disconnect.

type DisconnectReturnType = void;

GetConnectorByIdOptions

Options for getConnectorById.

FieldTypeDescription
id*stringID of the connector to look up.

GetConnectorByIdReturnType

Return type of getConnectorByIdundefined when no connector with that id is registered.

type GetConnectorByIdReturnType = Connector | undefined;

GetConnectorsReturnType

Return type of getConnectors — read-only view of the registered-connectors array.

type GetConnectorsReturnType = readonly Connector[];

TonConnectConnector

Connector produced by createTonConnectConnector — extends the base interface with the underlying TonConnectUI instance for advanced flows that need direct access (e.g., custom modals).

FieldTypeDescription
id*stringStable connector identifier, unique within an AppKit instance.
type*stringProtocol type (e.g. 'tonconnect'). Multiple connectors can share the same type.
metadata*ConnectorMetadataDisplay metadata (name, icon) shown in connect UIs.
destroy*() => voidRelease any resources held by the connector. Call on app teardown.
connectWallet*(network?: Network) => Promise<void>Initiate a wallet connection flow on the given network.
disconnectWallet*() => Promise<void>Disconnect the currently connected wallet, if any.
getConnectedWallets*() => WalletInterface[]Wallets currently connected through this connector.
tonConnectUI*TonConnectUI | nullUnderlying TonConnectUI instance — null during SSR or before the connector has been initialized. Apps that need to drive the modal directly (e.g. custom UI flows) can read this and call its methods.

TonConnectConnectorConfig

Configuration accepted by createTonConnectConnector.

FieldTypeDescription
idstringConnector ID. Defaults to TONCONNECT_DEFAULT_CONNECTOR_ID ('tonconnect'). Set this when you need to register multiple TonConnect-flavoured connectors side by side.
metadataConnectorMetadataDisplay metadata override. Merged on top of TonConnect's default name and icon.
tonConnectOptionsTonConnectUiCreateOptionsOptions forwarded to the underlying TonConnectUI constructor (manifest URL, etc.). Ignored when tonConnectUI is supplied.
tonConnectUITonConnectUIPre-built TonConnectUI instance to reuse. When set, the connector skips its own instantiation and tonConnectOptions is ignored.

WatchConnectorByIdParameters

Parameters accepted by watchConnectorById.

FieldTypeDescription
id*stringID of the connector to watch.
onChange*(connector: Connector | undefined) => voidCallback invoked when the connector with the watched id is registered or unregistered — receives the connector itself, or undefined when none is registered under that id.

WatchConnectorByIdReturnType

Return type of watchConnectorById — call to stop receiving updates.

type WatchConnectorByIdReturnType = () => void;

WatchConnectorsParameters

Parameters accepted by watchConnectors.

FieldTypeDescription
onChange*(connectors: readonly Connector[]) => voidCallback invoked when the list of registered connectors changes — receives the current list.

WatchConnectorsReturnType

Return type of watchConnectors — call to stop receiving updates.

type WatchConnectorsReturnType = () => void;

Core

AppKitConfig

Constructor options for AppKit — networks, connectors, providers and runtime flags.

FieldTypeDescription
networksNetworkAdaptersMap of chain ID to NetworkConfig (which holds the api-client setup). If omitted, AppKit defaults to mainnet only.
connectorsConnectorInput[]Wallet connectors registered at startup.
defaultNetworkNetworkDefault network.
providersProviderInput[]Providers registered at startup.

AppKitEmitter

Strongly-typed event emitter accessed through appKit.emitter. appKit.emitter.on(name, handler) returns an unsubscribe function.

type AppKitEmitter = EventEmitter<AppKitEvents>;

AppKitEvents

Map of every event name AppKit can emit to its payload type, used to type listeners on AppKitEmitter.

FieldTypeDescription
connector:added*ConnectorAddedPayloadFired by addConnector when a connector is registered with AppKit.
connector:removed*ConnectorRemovedPayloadFired when a connector is unregistered from AppKit — typically by calling the unregister function returned from addConnector.
connector:wallets-updated*ConnectorWalletsUpdatedPayloadFired by a connector whenever its connected-wallets list changes (connect, disconnect, or account switch inside the wallet).
wallets:updated*{ wallets: WalletInterface[] }Fired by AppKit's wallet manager after re-aggregating connectors — wallets is the full current set.
wallets:selection-changed*{ walletId: string | null }Fired when the selected wallet changes — walletId is the new selection, or null when cleared.
networks:updated*Record<string, never>Fired by the network manager when a network's API client is registered or replaced via setClient.
networks:default-changed*DefaultNetworkChangedPayloadFired by setDefaultNetwork — carries the new default network, or undefined when the constraint was cleared.
streaming:balance-update*BalanceUpdateFired by a streaming provider when a watched address's TON balance changes.
streaming:transactions*TransactionsUpdateFired by a streaming provider when new transactions land for a watched address.
streaming:jettons-update*JettonUpdateFired by a streaming provider when a watched address's jetton holdings change.
provider:registered*BaseProviderUpdateFired by a DeFi manager when a provider is registered through it (carries the provider's id and kind).
provider:default-changed*BaseProviderUpdateFired by a DeFi manager when its default provider is set or cleared (carries the new default's id and kind).

BaseProviderUpdate

Payload of provider:registered and provider:default-changed events — carries the affected provider's id and kind.

FieldTypeDescription
providerId*stringStable id of the affected provider — same as the providerId it was registered with.
type*stringProvider-kind discriminator (e.g., 'swap', 'staking', 'onramp', 'crypto-onramp') — same as the provider's type.

ConnectorAddedPayload

Payload of connector:added events — the connector that was just registered.

FieldTypeDescription
connector*ConnectorThe Connector that was just registered with AppKit.

ConnectorRemovedPayload

Payload of connector:removed events — the connector that was just unregistered.

FieldTypeDescription
connector*ConnectorThe Connector that was just unregistered from AppKit (already torn down via destroy()).

ConnectorWalletsUpdatedPayload

Payload of connector:wallets-updated events — fired by a connector when its connected-wallets list changes (connect, disconnect, or account switch inside the wallet).

FieldTypeDescription
connectorId*stringID of the Connector whose wallets just changed.
wallets*WalletInterface[]Wallets currently exposed by the connector — empty when the wallet was just disconnected.

DefaultNetworkChangedPayload

Payload of networks:default-changed events — the new default network, or undefined when cleared.

FieldTypeDescription
network*Network | undefinedNew default network, or undefined when the constraint is cleared.

EventListener

Listener callback signature accepted by EventEmitter's on — receives a KitEvent for the given event type and may return a Promise the emitter awaits.

type EventListener = (event: KitEvent<T>) => void | Promise<void>;

EventPayload

Generic event-payload constraint — an object that the typed event-name → payload map maps to.

type EventPayload = object;

KitEvent

Envelope every EventEmitter listener receives — type is the event name, payload is the event-specific data, source identifies who emitted it, and timestamp is the wall-clock millisecond mark.

FieldTypeDescription
type*stringEvent name (e.g., 'connector:wallets-updated').
payload*T = anyEvent-specific payload — typed via the emitter's event-name → payload map.
sourcestringIdentifier of the component that emitted the event (connector id, manager name, etc.). Useful for filtering listeners.
timestamp*numberWall-clock timestamp in milliseconds when the event was emitted.

SharedKitEvents

Event-name → payload map shared between AppKit and walletkit. AppKit extends it with its own connector, wallet and network events to type AppKitEmitter.

FieldTypeDescription
streaming:balance-update*BalanceUpdateFired by a streaming provider when a watched address's TON balance changes.
streaming:transactions*TransactionsUpdateFired by a streaming provider when new transactions land for a watched address.
streaming:jettons-update*JettonUpdateFired by a streaming provider when a watched address's jetton holdings change.
provider:registered*BaseProviderUpdateFired by a DeFi manager when a provider is registered through it (carries the provider's id and kind).
provider:default-changed*BaseProviderUpdateFired by a DeFi manager when its default provider is set or cleared (carries the new default's id and kind).

Crypto Onramp

CreateCryptoOnrampDepositOptions

Options for createCryptoOnrampDeposit — extends CryptoOnrampDepositParams with an optional provider override.

FieldTypeDescription
quote*CryptoOnrampQuote<TQuoteMetadata = unknown>Quote to execute the deposit against (contains recipientAddress and provider metadata)
refundAddress*stringAddress to refund the crypto to in case of failure.
providerOptionsTProviderOptions = unknownProvider-specific options.
providerIdstringProvider to create the deposit through. Defaults to quote.providerId, then to the default provider.

CreateCryptoOnrampDepositReturnType

Return type of createCryptoOnrampDeposit.

type CreateCryptoOnrampDepositReturnType = Promise<CryptoOnrampDeposit>;

CryptoOnrampDeposit

Deposit details returned by a crypto onramp provider.

The user must send amount of sourceCurrencyAddress to address on sourceChain to complete the onramp. The provider then delivers the target crypto to the user's TON address.

FieldTypeDescription
depositId*stringDeposit id.
address*stringDeposit address on the source chain.
amount*stringExact amount of source crypto the user must send.
sourceCurrencyAddress*stringSource crypto currency address (contract address or 0x0... for native)
sourceChain*stringSource chain identifier in CAIP-2 format (e.g. 'eip155:42161').
memostringOptional memo / tag required by some chains (e.g. XRP, TON comment)
expiresAtnumberUnix timestamp (ms) after which the deposit offer is no longer valid.
chainWarningstringChain-specific warning to show the user (e.g. "send only on Solana")
providerId*stringIdentifier of the provider that issued this deposit.

CryptoOnrampDepositParams

Parameters for creating a crypto onramp deposit.

The recipient is taken from quote.recipientAddress set at quote time.

FieldTypeDescription
quote*CryptoOnrampQuote<TQuoteMetadata = unknown>Quote to execute the deposit against (contains recipientAddress and provider metadata)
refundAddress*stringAddress to refund the crypto to in case of failure.
providerOptionsTProviderOptions = unknownProvider-specific options.

CryptoOnrampProviderInterface

Interface that all crypto onramp providers must implement

FieldTypeDescription
type*'crypto-onramp'Provider kind discriminator pinned to 'crypto-onramp' so registerProvider routes it to the crypto-onramp manager.
providerId*stringUnique identifier for the provider
getMetadata*() => CryptoOnrampProviderMetadataGet static metadata for the provider (display name, logo, url).
getQuote*(params: CryptoOnrampQuoteParams<TQuoteOptions>) => Promise<CryptoOnrampQuote>Get a quote for onramping from another crypto asset into a TON asset
createDeposit*(params: CryptoOnrampDepositParams<TDepositOptions>) => Promise<CryptoOnrampDeposit>Create a deposit for a previously obtained quote
getStatus*(params: CryptoOnrampStatusParams) => Promise<CryptoOnrampStatus>Get the status of a deposit
getSupportedNetworks*() => Network[]Networks this provider can operate on. Consumers should check before calling provider methods. Implementations may return a static list or compute it dynamically (e.g. from runtime config).

CryptoOnrampProviderMetadata

Static metadata for a crypto-onramp provider.

FieldTypeDescription
name*stringHuman-readable provider name (e.g. 'Swaps.xyz')
logostringURL to the provider's logo image.
urlstringURL to the provider's website.
isRefundAddressRequiredbooleanWhether this provider requires a refund address on the source chain. When true, the UI must collect a refund address before creating a deposit.
isReversedAmountSupportedbooleanWhether this provider supports reversed (target-amount) quotes. When false, the UI should hide the direction toggle and only allow source-amount input.

CryptoOnrampProviderMetadataOverride

Used in provider configuration to override fields of the provider's metadata.

FieldTypeDescription
namestringOverride the provider's display name.
logostringOverride the provider's logo URL.
urlstringOverride the provider's website URL.

CryptoOnrampQuote

Crypto onramp quote response with pricing information.

FieldTypeDescription
sourceCurrencyAddress*stringSource crypto currency address (contract address or 0x0... for native)
sourceChain*stringSource chain identifier in CAIP-2 format (e.g. 'eip155:42161').
targetCurrencyAddress*stringTarget crypto currency address on TON (contract address or 0x0... for native)
sourceAmount*stringAmount of source crypto to send.
targetAmount*stringAmount of target crypto to receive.
rate*stringExchange rate (amount of target per 1 unit of source)
recipientAddress*stringTON address that will receive the target crypto.
providerId*stringIdentifier of the crypto onramp provider.
metadataTMetadata = unknownProvider-specific metadata for the quote (e.g. raw response needed to execute)

CryptoOnrampQuoteParams

Parameters for requesting a crypto-to-crypto onramp quote.

The target network is always TON, so only the source side is parameterised.

FieldTypeDescription
amount*stringAmount to onramp (either source or target crypto, depending on isSourceAmount)
sourceCurrencyAddress*stringSource crypto currency address (contract address or 0x0... for native)
sourceChain*stringSource chain identifier in CAIP-2 format (e.g. 'eip155:1' for Ethereum mainnet, 'eip155:42161' for Arbitrum One). Providers map this to their own chain identifiers internally.
targetCurrencyAddress*stringTarget crypto currency address on TON (contract address or 0x0... for native)
recipientAddress*stringTON address that will receive the target crypto.
refundAddressstringRefund address for the source crypto.
isSourceAmountbooleanIf true, amount is the source amount to spend. If false, amount is the target amount to receive. Defaults to true when omitted.
providerOptionsTProviderOptions = unknownProvider-specific options.

CryptoOnrampStatus

Final state of a crypto-onramp deposit returned by getCryptoOnrampStatus'success' (delivered to the recipient), 'pending' (still in flight), or 'failed' (provider could not complete the deposit).

type CryptoOnrampStatus = 'success' | 'pending' | 'failed';

CryptoOnrampStatusParams

Parameters accepted by getCryptoOnrampStatus — identifies a previously created deposit and the provider that issued it.

FieldTypeDescription
depositId*stringDeposit id.
providerId*stringIdentifier of the provider that issued this deposit.

GetCryptoOnrampProviderOptions

Options for getCryptoOnrampProvider.

FieldTypeDescription
idstringProvider ID to look up. When omitted, returns the registered default provider.

GetCryptoOnrampProviderReturnType

Return type of getCryptoOnrampProvider.

type GetCryptoOnrampProviderReturnType = CryptoOnrampProviderInterface;

GetCryptoOnrampProvidersReturnType

Return type of getCryptoOnrampProviders.

type GetCryptoOnrampProvidersReturnType = CryptoOnrampProviderInterface[];

GetCryptoOnrampQuoteOptions

Options for getCryptoOnrampQuote — extends CryptoOnrampQuoteParams with an optional provider override.

FieldTypeDescription
amount*stringAmount to onramp (either source or target crypto, depending on isSourceAmount)
sourceCurrencyAddress*stringSource crypto currency address (contract address or 0x0... for native)
sourceChain*stringSource chain identifier in CAIP-2 format (e.g. 'eip155:1' for Ethereum mainnet, 'eip155:42161' for Arbitrum One). Providers map this to their own chain identifiers internally.
targetCurrencyAddress*stringTarget crypto currency address on TON (contract address or 0x0... for native)
recipientAddress*stringTON address that will receive the target crypto.
refundAddressstringRefund address for the source crypto.
isSourceAmountbooleanIf true, amount is the source amount to spend. If false, amount is the target amount to receive. Defaults to true when omitted.
providerOptionsTProviderOptions = unknownProvider-specific options.
providerIdstringProvider to quote against. Defaults to the registered default provider.

GetCryptoOnrampQuoteReturnType

Return type of getCryptoOnrampQuote.

type GetCryptoOnrampQuoteReturnType = Promise<CryptoOnrampQuote>;

GetCryptoOnrampStatusOptions

Options for getCryptoOnrampStatus — extends CryptoOnrampStatusParams with an optional provider override.

FieldTypeDescription
depositId*stringDeposit id.
providerId*stringIdentifier of the provider that issued this deposit.

GetCryptoOnrampStatusReturnType

Return type of getCryptoOnrampStatus.

type GetCryptoOnrampStatusReturnType = Promise<CryptoOnrampStatus>;

LayerswapProviderConfig

Configuration accepted by createLayerswapProvider.

FieldTypeDescription
apiKeystringOptional API key. Forwarded as X-LS-APIKEY when provided.
apiUrlstringOverride the base API URL. Defaults to https://api.layerswap.io/api/v2 (see Layerswap API V2.

LayerswapQuoteMetadata

Provider-specific metadata returned on a CryptoOnrampQuote's metadata from Layerswap — carries the swap id and deposit action that createCryptoOnrampDeposit reads to build the deposit.

FieldTypeDescription
swapId*stringLayerswap swap id created at quote time and reused by createDeposit / getStatus.
depositAddress*stringPre-computed deposit address on the source chain that the user must send funds to.
sourceAmountBaseUnits*stringSource-chain amount the user must send, in raw base units (e.g., wei).
targetAmountBaseUnits*stringTarget-chain amount the user receives, in raw base units (e.g., nanotons).

SwapsXyzProviderConfig

Configuration accepted by createSwapsXyzProvider.

FieldTypeDescription
apiKey*stringAPI key issued by swaps.xyz (passed as x-api-key)
apiUrlstringOverride the base API URL. Defaults to https://api-v2.swaps.xyz/api (see Swaps API Documentation.
defaultSenderstringEVM address used as sender on getAction requests. Required by the API even for deposit flows where the actual payer is unknown. Defaults to a null address when omitted.

SwapsXyzQuoteMetadata

Provider-specific metadata returned on a CryptoOnrampQuote's metadata from swaps.xyz — carries the resolved action and bridge route that createCryptoOnrampDeposit needs.

FieldTypeDescription
sender*stringEVM sender address swaps.xyz was quoted for. Required when later calling createDeposit.
response*SwapsXyzGetActionResponseRaw getAction response cached at quote time so createDeposit doesn't need an extra round-trip.

SwapsXyzQuoteOptions

swaps.xyz-specific options forwarded through providerOptions on CryptoOnrampQuoteParams.

FieldTypeDescription
slippageBpsnumberSlippage tolerance in basis points (0-10000). Defaults to 100 (1%).

WatchCryptoOnrampProvidersParameters

Parameters accepted by watchCryptoOnrampProviders.

FieldTypeDescription
onChange*() => voidCallback fired whenever a crypto-onramp provider is registered or the default crypto-onramp provider changes.

WatchCryptoOnrampProvidersReturnType

Return type of watchCryptoOnrampProviders — call to stop receiving updates.

type WatchCryptoOnrampProvidersReturnType = () => void;

DeFi

DefiManagerAPI

Shape every DeFi domain manager (swap, staking, onramp, crypto-onramp) satisfies — provider registration, default-provider selection and lookups. Mostly relevant when authoring a new domain manager.

FieldTypeDescription
createFactoryContext*() => ProviderFactoryContextBuild a fresh ProviderFactoryContext the manager hands to provider factories at registration time.
registerProvider*(provider: ProviderInput<T>) => voidRegister a new provider. If a provider with the same id is already registered, it is replaced.
removeProvider*(provider: T) => voidRemove a previously registered provider. No-op if the provider was not registered.
setDefaultProvider*(providerId: string) => voidSet the default provider
getProvider*(providerId?: string) => TGet a registered provider
getProviders*() => T[]Get all registered providers. The returned array keeps a stable reference until the provider list changes.
hasProvider*(providerId: string) => booleanCheck if a provider is registered

DefiProvider

Base interface implemented by every DeFi provider (swap, staking, onramp, crypto-onramp) — exposes providerId, type and getSupportedNetworks. Domain-specific provider interfaces extend this with quote/build/status methods.

FieldTypeDescription
type*DefiProviderTypeProvider kind discriminator narrowed to the DeFi-domain literals so the right manager picks it up at registration time.
getSupportedNetworks*() => Network[]Networks this provider can operate on. Consumers should check before calling provider methods. Implementations may return a static list or compute it dynamically (e.g. from runtime config).
providerId*stringStable provider identifier, unique within the manager that registered it.

DefiProviderType

Discriminator that tags every DefiProvider with its kind — 'swap', 'staking', 'onramp', or 'crypto-onramp'. Used by registerProvider to dispatch to the right manager.

type DefiProviderType = 'swap' | 'staking' | 'onramp' | 'crypto-onramp';

ProviderFactoryContext

Context that AppKit's DeFi managers inject into a ProviderInput factory at registration time — gives the provider access to AppKit's network manager and event emitter.

FieldTypeDescription
networkManager*NetworkManagerNetwork manager the provider should use for client lookups and default-network reads.
eventEmitter*EventEmitter<Events = SharedKitEvents>Event emitter the provider should publish its events to.

ProviderInput

Either a ready-made DeFi/onramp provider instance or a factory that produces one — the value accepted by AppKitConfig's providers and registerProvider.

type ProviderInput = T | ProviderFactory<T>;

RegisterProviderOptions

Provider instance or factory accepted by registerProvider — same shape used in AppKitConfig's providers. AppKit dispatches it to the right manager based on provider.type ('swap', 'staking', 'onramp', 'crypto-onramp').

type RegisterProviderOptions = ProviderInput;

Jettons

CreateTransferJettonTransactionParameters

Parameters accepted by createTransferJettonTransaction and transferJetton.

FieldTypeDescription
jettonAddress*UserFriendlyAddressJetton master contract address being transferred.
recipientAddress*UserFriendlyAddressRecipient who should receive the jettons.
amount*stringAmount in jetton units as a human-readable decimal string (e.g., "1.5").
jettonDecimals*numberDecimals declared by the jetton master. Used to convert amount into raw smallest units.
commentstringOptional human-readable comment attached to the transfer.

CreateTransferJettonTransactionReturnType

Return type of createTransferJettonTransaction.

type CreateTransferJettonTransactionReturnType = TransactionRequest;

GetJettonBalanceOptions

Options for getJettonBalance.

FieldTypeDescription
jettonAddress*UserFriendlyAddressJetton master contract address (the token, not the user's wallet for it).
ownerAddress*UserFriendlyAddressOwner of the jetton wallet — typically the connected user's address.
jettonDecimals*numberDecimals declared by the jetton master. Used to format the raw balance into a human-readable string.
networkNetworkNetwork to read the balance from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

GetJettonBalanceReturnType

Return type of getJettonBalance.

type GetJettonBalanceReturnType = TokenAmount;

GetJettonInfoOptions

Options for getJettonInfo.

FieldTypeDescription
address*UserFriendlyAddressJetton master contract address whose metadata is being fetched.
networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

GetJettonInfoReturnType

Return type of getJettonInfonull when the indexer has no record for that master address.

type GetJettonInfoReturnType = JettonInfo | null;

GetJettonWalletAddressOptions

Options for getJettonWalletAddress.

FieldTypeDescription
jettonAddress*UserFriendlyAddressJetton master contract address.
ownerAddress*UserFriendlyAddressOwner whose jetton wallet should be derived.
networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

GetJettonWalletAddressReturnType

Return type of getJettonWalletAddress.

type GetJettonWalletAddressReturnType = UserFriendlyAddress;

GetJettonsByAddressOptions

Options for getJettonsByAddress.

FieldTypeDescription
address*UserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
networkNetworkNetwork to read the jettons from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
limitnumberMaximum number of jettons to return.
offsetnumberNumber of jettons to skip before returning results — used for pagination.

GetJettonsByAddressReturnType

Return type of getJettonsByAddress.

type GetJettonsByAddressReturnType = JettonsResponse;

GetJettonsOptions

Options for getJettons.

FieldTypeDescription
networkNetworkNetwork to read jettons from. Defaults to the selected wallet's network.
limitnumberMaximum number of jettons to return.
offsetnumberNumber of jettons to skip before returning results — used for pagination.

GetJettonsReturnType

Return type of getJettonsnull when no wallet is currently selected.

type GetJettonsReturnType = JettonsResponse | null;

Jetton

Fungible TEP-74 token held in the user's TON wallet — carries the master contract address, the user's jetton-wallet address, current balance, and token metadata.

FieldTypeDescription
address*UserFriendlyAddressThe jetton master contract address (the token itself).
walletAddress*UserFriendlyAddressThe owner's jetton-wallet contract address — the per-owner contract that actually holds this balance.
balance*TokenAmountThe current jetton balance.
info*TokenInfoInformation about the token.
decimalsNumbernumberThe number of decimal places used by the token
isVerified*booleanIndicates if the jetton is verified.
prices*JettonPrice[]Current prices of the jetton in various currencies.
extra{ [key: string]: unknown; }Additional arbitrary data related to the jetton.

JettonInfo

Token metadata for a jetton master — name, symbol, decimals, image, and verification status as reported by the indexer.

FieldTypeDescription
address*stringJetton master contract address.
name*stringDisplay name of the jetton (e.g., "Tether USD").
symbol*stringTicker symbol (e.g., "USDT").
description*stringFree-form description set by the issuer.
decimalsnumberNumber of decimal places used to format raw amounts (e.g., 6 for USDT).
totalSupplystringTotal supply in raw smallest units.
imagestringURL of the jetton's image.
image_datastringInline image data (Base64) when no image URL is published.
uristringOff-chain metadata URI (TEP-64).
verificationJettonVerificationVerification status reported by the indexer.
metadataRecord<string, unknown>Additional indexer-supplied metadata that doesn't fit the canonical fields.

JettonUpdate

Update payload delivered to watchJettons / watchJettonsByAddress subscribers when the watched owner's jetton balance changes.

FieldTypeDescription
type*'jettons'The update type field.
masterAddress*UserFriendlyAddressThe master jetton contract address.
walletAddress*UserFriendlyAddressThe jetton wallet contract address.
ownerAddress*UserFriendlyAddressThe owner of the jetton wallet.
rawBalance*TokenAmountBalance in raw smallest units (e.g. nano)
decimalsnumberDecimals mapped from metadata if available
balancestringHuman readable formatted balance if decimals are known.
status*StreamingUpdateStatusFinality stage of the update — see StreamingUpdateStatus.

JettonVerification

Verification metadata reported by the indexer for a JettonInfoverified flag plus optional verifier source.

FieldTypeDescription
verified*booleantrue when the indexer has verified this jetton against an allow-list.
source'toncenter' | 'community' | 'manual'Origin of the verification claim.
warningsstring[]Free-form warnings the UI should surface (e.g., scam indicators).

JettonsResponse

Response payload of getJettons / getJettonsByAddress — the list of Jettons plus the address book that resolves raw addresses inside it.

FieldTypeDescription
addressBook*AddressBookAddress book mapping.
jettons*Jetton[]List of Jettons.

TransferJettonParameters

Parameters accepted by transferJetton — same shape as CreateTransferJettonTransactionParameters.

type TransferJettonParameters = CreateTransferJettonTransactionParameters;

TransferJettonReturnType

Return type of transferJetton.

type TransferJettonReturnType = SendTransactionResponse;

WatchJettonsByAddressOptions

Options for watchJettonsByAddress.

FieldTypeDescription
address*UserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
onChange*(update: JettonUpdate) => voidCallback fired on every jetton-balance update from the streaming provider.
networkNetworkNetwork to watch on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

WatchJettonsByAddressReturnType

Return type of watchJettonsByAddress — call to stop receiving updates.

type WatchJettonsByAddressReturnType = () => void;

WatchJettonsOptions

Options for watchJettons.

FieldTypeDescription
onChange*(update: JettonUpdate) => voidCallback fired on every jetton-balance update from the streaming provider.
networkNetworkNetwork to watch on. Defaults to the selected wallet's network.

WatchJettonsReturnType

Return type of watchJettons — call to stop receiving updates.

type WatchJettonsReturnType = () => void;

NFTs

CreateTransferNftTransactionParameters

Parameters accepted by createTransferNftTransaction and transferNft.

FieldTypeDescription
nftAddress*UserFriendlyAddressNFT contract address to transfer.
recipientAddress*UserFriendlyAddressNew owner address.
amountstringAmount of TON to attach to the transfer for gas. Defaults to AppKit's NFT gas-fee constant when omitted.
commentstringOptional human-readable comment attached to the transfer.

CreateTransferNftTransactionReturnType

Return type of createTransferNftTransaction.

type CreateTransferNftTransactionReturnType = TransactionRequest;

GetNftOptions

Options for getNft.

FieldTypeDescription
address*UserFriendlyAddress | AddressNFT contract address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

GetNftReturnType

Return type of getNftnull when the indexer has no record for that address.

type GetNftReturnType = NFT | null;

GetNftsByAddressOptions

Options for getNftsByAddress.

FieldTypeDescription
address*UserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
networkNetworkNetwork to read NFTs from. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
limitnumberMaximum number of NFTs to return.
offsetnumberNumber of NFTs to skip before returning results — used for pagination.

GetNftsByAddressReturnType

Return type of getNftsByAddress.

type GetNftsByAddressReturnType = NFTsResponse;

GetNftsOptions

Options for getNfts.

FieldTypeDescription
networkNetworkNetwork to read NFTs from. Defaults to the selected wallet's network.
limitnumberMaximum number of NFTs to return.
offsetnumberNumber of NFTs to skip before returning results — used for pagination.

GetNftsReturnType

Return type of getNftsnull when no wallet is currently selected.

type GetNftsReturnType = NFTsResponse | null;

NFT

Non-fungible TEP-62 token held in the user's TON wallet — carries the contract address, optional collection link, owner, sale state, and on-chain metadata.

FieldTypeDescription
address*UserFriendlyAddressContract address of the NFT item.
indexstringIndex of the item within its collection.
infoTokenInfoDisplay information about the NFT (name, description, images)
attributesNFTAttribute[]Custom attributes/traits of the NFT (e.g., rarity, properties)
collectionNFTCollectionInformation about the collection this item belongs to.
auctionContractAddressUserFriendlyAddressAddress of the auction contract, if the NFT is being auctioned.
codeHashHexHash of the NFT smart contract code.
dataHashHexHash of the NFT's on-chain data.
isInitedbooleanWhether the NFT contract has been initialized.
isSoulboundbooleanWhether the NFT is soulbound (non-transferable)
isOnSalebooleanWhether the NFT is currently listed for sale.
ownerAddressUserFriendlyAddressCurrent owner address of the NFT.
realOwnerAddressUserFriendlyAddressReal owner address when NFT is on sale (sale contract becomes temporary owner)
saleContractAddressUserFriendlyAddressAddress of the sale contract, if the NFT is listed for sale.
extra{ [key: string]: unknown; }Additional arbitrary data related to the NFT.

NFTAttribute

Single trait of an NFTtraitType names the category (e.g., "Background"), value carries the trait's value (e.g., "Blue").

FieldTypeDescription
traitTypestringCategory or type of the trait (e.g., "Background", "Eyes")
displayTypestringIndexer-supplied hint for how the attribute should be rendered. Optional and indexer-specific.
valuestringValue of the attribute (e.g., "Blue", "Rare")

NFTCollection

NFT collection (TEP-62) — surfaced as NFT's collection and carries the collection's name, image, owner and minting cursor.

FieldTypeDescription
address*UserFriendlyAddressThe blockchain address of the NFT collection contract.
namestringThe name of the NFT collection.
imageTokenImageThe image representing the NFT collection.
descriptionstringA brief description of the NFT collection.
nextItemIndexstringThe index value for the next item to be minted in the collection.
codeHashHexThe hash of the collection's smart contract code.
dataHashHexThe hash of the collection's data in the blockchain.
ownerAddressUserFriendlyAddressThe blockchain address of the collection owner.
extra{ [key: string]: unknown; }Additional arbitrary data related to the NFT collection.

NFTsResponse

Response payload of getNfts / getNftsByAddress — the list of NFTs plus an address book that resolves raw addresses inside it.

FieldTypeDescription
addressBookAddressBookAddress book entries related to the NFTs.
nfts*NFT[]List of NFTs.

TransferNftParameters

Parameters accepted by transferNft — same shape as CreateTransferNftTransactionParameters.

type TransferNftParameters = CreateTransferNftTransactionParameters;

TransferNftReturnType

Return type of transferNft.

type TransferNftReturnType = SendTransactionResponse;

Networks

GetBlockNumberOptions

Options for getBlockNumber.

FieldTypeDescription
networkNetworkNetwork to query. Defaults to mainnet when omitted.

GetBlockNumberReturnType

Return type of getBlockNumber.

type GetBlockNumberReturnType = number;

GetDefaultNetworkReturnType

Return type of getDefaultNetworkundefined when no default has been set (apps may operate on any registered network).

type GetDefaultNetworkReturnType = Network | undefined;

GetNetworkReturnType

Return type of getNetworknull when no wallet is currently selected.

type GetNetworkReturnType = Network | null;

GetNetworksReturnType

Return type of getNetworks.

type GetNetworksReturnType = Network[];

HasStreamingProviderReturnType

Return type of hasStreamingProvider.

type HasStreamingProviderReturnType = boolean;

Network

TON blockchain network identifier.

FieldTypeDescription
chainId*stringChain ID of the network (e.g., "-239" for mainnet, "-3" for testnet)

NetworkAdapters

Multi-network configuration keyed by chain ID — each entry maps a chain ID (e.g. Network.mainnet().chainId) to its own NetworkConfig carrying the api-client setup.

type NetworkAdapters = {
    [key: string]: NetworkConfig | undefined;
};

NetworkConfig

Network configuration for a specific chain.

FieldTypeDescription
apiClientApiClientConfig | ApiClientAPI client configuration or instance.

SetDefaultNetworkParameters

Parameters accepted by setDefaultNetwork.

FieldTypeDescription
network*Network | undefinedNetwork to enforce on new wallet connections. Pass undefined to allow any registered network.

SetDefaultNetworkReturnType

Return type of setDefaultNetwork.

type SetDefaultNetworkReturnType = void;

TonWalletKitOptions

Walletkit-side options shape consumed by KitNetworkManager's constructor — chiefly the networks map keyed by chain ID. AppKit constructs the manager for you, so apps rarely instantiate this directly.

FieldTypeDescription
walletManifestWalletInfoTonConnect wallet manifest published by the dApp. Required for the wallet to recognize the integration.
deviceInfoDeviceInfoDevice fingerprint forwarded with TonConnect requests so wallets can recognize the host.
sessionManagerTONConnectSessionManagerCustom session manager implementation. If not provided, TONConnectStoredSessionManager will be used.
networksNetworkAdaptersNetwork configuration.
bridgeBridgeConfigBridge settings.
storageStorageConfig | StorageAdapterStorage settings.
validation{ strictMode?: boolean; allowUnknownWalletVersions?: boolean; }Validation settings.
eventProcessorEventProcessorConfigEvent processor settings.
analyticsAnalyticsManagerOptions & { enabled?: boolean; }Analytics manager options merged with an enabled toggle. Off by default.
dev{ disableNetworkSend?: boolean; disableManifestDomainCheck?: boolean; }Diagnostic toggles useful during local development. Should not be set in production builds.

WatchDefaultNetworkParameters

Parameters accepted by watchDefaultNetwork.

FieldTypeDescription
onChange*(network: Network | undefined) => voidCallback fired whenever setDefaultNetwork updates the default — receives the new value (or undefined when cleared).

WatchDefaultNetworkReturnType

Return type of watchDefaultNetwork — call to stop receiving updates.

type WatchDefaultNetworkReturnType = () => void;

WatchNetworksParameters

Parameters accepted by watchNetworks.

FieldTypeDescription
onChange*(networks: Network[]) => voidCallback fired whenever the configured-networks list changes — receives the latest snapshot.

WatchNetworksReturnType

Return type of watchNetworks — call to stop receiving updates.

type WatchNetworksReturnType = () => void;

Primitives

Base64String

Base64-encoded byte string — used for transaction payloads, BoCs, signatures, and other opaque binary blobs that travel through TonConnect and the indexer APIs.

type Base64String = string & {
    readonly [base64StringBrand]: never;
};

ExtraCurrencies

Map of extra-currency ids to raw amounts attached to a transaction message — TON's mechanism for transferring non-jetton native tokens (e.g., wrapped or testnet currencies). Keys are the extra-currency ids defined by the masterchain configuration.

type ExtraCurrencies = {
    [key: string]: string;
};

Hex

0x-prefixed hexadecimal string used for public keys and other hashes.

type Hex = `0x${string}` & {
    readonly [hashBrand]: never;
};

MutationOptionsOverride

TanStack Query useMutation options forwarded by AppKit's use*Mutation hooks via parameters.mutationmutationFn, mutationKey and throwOnError are managed by the wrapper and stripped from this shape.

type MutationOptionsOverride = LooseOmit<
    Query.MutationOptions<data, error, Compute<variables>, context>,
    'mutationFn' | 'mutationKey' | 'throwOnError'
>;

QueryOptionsOverride

TanStack Query useQuery options forwarded by AppKit's use*Query hooks via parameters.queryqueryKey and queryFn are managed by the wrapper and stripped from this shape.

type QueryOptionsOverride = UnionLooseOmit<QueryOptions<queryFnData, error, data, queryKey>, 'queryKey' | 'queryFn'>;

TokenAmount

Decimal string carrying a token amount. Preserves precision and avoids floating-point rounding (e.g., "1.5" TON, or raw nano units depending on the API).

type TokenAmount = string;

UserFriendlyAddress

User-friendly TON wallet address as a base64url string (e.g., "EQDtFp...4q2").

type UserFriendlyAddress = string;

Signing

SignBinaryParameters

Parameters accepted by signBinary.

FieldTypeDescription
bytes*Base64StringBinary blob the user is asked to sign, encoded as Base64.
networkNetworkNetwork to issue the sign request against. Defaults to AppKit's configured default network. When none is set, the wallet falls back to its current network.

SignBinaryReturnType

Return type of signBinary.

type SignBinaryReturnType = SignDataResponse;

SignCellParameters

Parameters accepted by signCell.

FieldTypeDescription
cell*Base64StringTON cell content encoded as Base64 (BoC).
schema*stringTL-B-style schema describing the cell layout so the wallet can render the payload to the user.
networkNetworkNetwork to issue the sign request against. Defaults to AppKit's configured default network. When none is set, the wallet falls back to its current network.

SignCellReturnType

Return type of signCell.

type SignCellReturnType = SignDataResponse;

SignData

Payload the user is asked to sign — discriminated union over 'text', 'binary', and 'cell'. Nested under SignDataRequest's data.

type SignData = | { type: 'text'; value: SignDataText }
    | { type: 'binary'; value: SignDataBinary }
    | { type: 'cell'; value: SignDataCell };

SignDataBinary

Binary variant of SignData — opaque byte content the user is asked to sign.

FieldTypeDescription
content*Base64StringRaw binary content encoded as Base64.

SignDataCell

TON cell variant of SignData — Base64-encoded cell payload paired with the schema needed to parse it.

FieldTypeDescription
schema*stringTL-B-style schema describing the cell layout so the wallet can render the payload to the user.
content*Base64StringCell content encoded as Base64.

SignDataRequest

Sign-data payload sent to WalletInterface's signData — discriminated by data.type ('text', 'binary', or 'cell').

FieldTypeDescription
networkNetworkNetwork to issue the sign request against. Defaults to the wallet's current network.
fromstringSender address in raw format. Usually omitted, the wallet fills it in.
data*SignDataPayload the user is asked to sign.

SignDataResponse

Wallet response to a SignDataRequest — carries the signature plus the canonicalized address, timestamp, and domain the wallet committed to.

FieldTypeDescription
signature*stringBase64-encoded signature.
address*stringWallet address that signed, in user-friendly format.
timestamp*numberUnix timestamp the wallet stamped onto the signature.
domain*stringdApp domain the wallet bound the signature to.
payload*SignDataRequestOriginal payload that was signed, echoed back for binding.

SignDataText

Plain-text variant of SignData — UTF-8 string the user is asked to sign.

FieldTypeDescription
content*stringUTF-8 text the user signs.

SignTextParameters

Parameters accepted by signText.

FieldTypeDescription
text*stringUTF-8 text the user is asked to sign.
networkNetworkNetwork to issue the sign request against. Defaults to AppKit's configured default network. When none is set, the wallet falls back to its current network.

SignTextReturnType

Return type of signText.

type SignTextReturnType = SignDataResponse;

Staking

BuildStakeTransactionOptions

Options for buildStakeTransaction — extends StakeParams with an optional provider override.

FieldTypeDescription
quote*StakingQuoteThe staking quote based on which the transaction is built.
userAddress*UserFriendlyAddressAddress of the user performing the staking.
providerOptionsTProviderOptions = unknownProvider-specific options.
providerIdstringProvider to stake/unstake through. Defaults to the registered default staking provider.

BuildStakeTransactionReturnType

Return type of buildStakeTransaction.

type BuildStakeTransactionReturnType = Promise<TransactionRequest>;

GetStakedBalanceOptions

Options for getStakedBalance.

FieldTypeDescription
userAddress*UserFriendlyAddressOwner whose staked balance should be read.
networkNetworkNetwork to query. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
providerIdstringProvider to query. Defaults to the registered default staking provider.

GetStakedBalanceReturnType

Return type of getStakedBalance.

type GetStakedBalanceReturnType = Promise<StakingBalance>;

GetStakingManagerReturnType

Return type of getStakingManager.

type GetStakingManagerReturnType = StakingManager;

GetStakingProviderInfoOptions

Options for getStakingProviderInfo.

FieldTypeDescription
networkNetworkNetwork whose staking pool should be inspected. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
providerIdstringProvider to query. Defaults to the registered default staking provider.

GetStakingProviderInfoReturnType

Return type of getStakingProviderInfo.

type GetStakingProviderInfoReturnType = Promise<StakingProviderInfo>;

GetStakingProviderMetadataOptions

Options for getStakingProviderMetadata.

FieldTypeDescription
networkNetworkNetwork whose provider metadata should be read. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.
providerIdstringProvider to query. Defaults to the registered default staking provider.

GetStakingProviderMetadataReturnType

Return type of getStakingProviderMetadata.

type GetStakingProviderMetadataReturnType = StakingProviderMetadata;

GetStakingProviderOptions

Options for getStakingProvider.

FieldTypeDescription
idstringProvider ID to look up. When omitted, returns the registered default staking provider.

GetStakingProviderReturnType

Return type of getStakingProvider.

type GetStakingProviderReturnType = StakingProviderInterface;

GetStakingProvidersReturnType

Return type of getStakingProviders.

type GetStakingProvidersReturnType = StakingProviderInterface[];

GetStakingQuoteOptions

Options for getStakingQuote — extends StakingQuoteParams with an optional provider override.

FieldTypeDescription
direction*StakingQuoteDirectionDirection of the quote (stake or unstake)
amount*stringAmount of tokens to stake or unstake.
userAddressUserFriendlyAddressAddress of the user.
networkNetworkNetwork on which the staking will be executed.
unstakeModeUnstakeModesUnstake-timing mode the quote should target — see UnstakeMode for the supported flavours ('INSTANT', 'WHEN_AVAILABLE', 'ROUND_END'). Only meaningful when direction === 'unstake' and the provider lists the mode in supportedUnstakeModes.
isReversedbooleanIf true, for unstake requests the amount is specified in the staking coin (e.g. TON) instead of the Liquid Staking Token (e.g. tsTON).
providerOptionsTProviderOptions = unknownProvider-specific options.
providerIdstringProvider to quote against. Defaults to the registered default staking provider.

GetStakingQuoteReturnType

Return type of getStakingQuote.

type GetStakingQuoteReturnType = Promise<StakingQuote>;

SetDefaultStakingProviderParameters

Parameters accepted by setDefaultStakingProvider.

FieldTypeDescription
providerId*stringID of the provider to make default — must already be registered.

SetDefaultStakingProviderReturnType

Return type of setDefaultStakingProvider.

type SetDefaultStakingProviderReturnType = void;

StakeParams

Parameters for staking TON.

FieldTypeDescription
quote*StakingQuoteThe staking quote based on which the transaction is built.
userAddress*UserFriendlyAddressAddress of the user performing the staking.
providerOptionsTProviderOptions = unknownProvider-specific options.

StakingAPI

Staking API interface exposed by StakingManager

FieldTypeDescription
getQuote*(params: StakingQuoteParams, providerId?: string) => Promise<StakingQuote>Get a quote for staking or unstaking
buildStakeTransaction*(params: StakeParams, providerId?: string) => Promise<TransactionRequest>Build a transaction for staking
getStakedBalance*(userAddress: UserFriendlyAddress, network?: Network, providerId?: string) => Promise<StakingBalance>Get user's staked balance
getStakingProviderInfo*(network?: Network, providerId?: string) => Promise<StakingProviderInfo>Get staking provider information
getStakingProviderMetadata*(network?: Network, providerId?: string) => StakingProviderMetadataGet static metadata for a staking provider
createFactoryContext*() => ProviderFactoryContextBuild a fresh ProviderFactoryContext the manager hands to provider factories at registration time.
registerProvider*(provider: ProviderInput<StakingProviderInterface>) => voidRegister a new provider. If a provider with the same id is already registered, it is replaced.
removeProvider*(provider: StakingProviderInterface) => voidRemove a previously registered provider. No-op if the provider was not registered.
setDefaultProvider*(providerId: string) => voidSet the default provider
getProvider*(providerId?: string) => StakingProviderInterfaceGet a registered provider
getProviders*() => Array<StakingProviderInterface>Get all registered providers. The returned array keeps a stable reference until the provider list changes.
hasProvider*(providerId: string) => booleanCheck if a provider is registered

StakingBalance

Staking balance information for a user.

FieldTypeDescription
rawStakedBalance*TokenAmountAmount currently staked, in raw smallest units of the stake token (e.g., nano-TON).
stakedBalance*stringAmount currently staked, formatted to the stake token's decimals as a human-readable decimal string (e.g., "12.5").
rawInstantUnstakeAvailable*TokenAmountAmount available for instant unstake, in raw smallest units of the stake token (e.g., nano-TON).
instantUnstakeAvailable*stringAmount available for instant unstake, formatted to the stake token's decimals as a human-readable decimal string (e.g., "12.5").
providerId*stringIdentifier of the staking provider.

StakingProviderInfo

Dynamic staking information for a provider.

FieldTypeDescription
apy*numberAnnual Percentage Yield in basis points (100 = 1%)
rawInstantUnstakeAvailableTokenAmountAmount available for instant unstake right now, in raw smallest units of the stake token (e.g., nano-TON).
instantUnstakeAvailablestringAmount available for instant unstake right now, formatted to the stake token's decimals as a human-readable decimal string (e.g., "12.5").
exchangeRatestringExchange rate between stakeToken and receiveToken (e.g. 1 TON = 0.95 tsTON). Undefined when there is no receiveToken (direct/custodial staking).

StakingProviderMetadata

Static metadata for a staking provider.

FieldTypeDescription
name*stringHuman-readable provider name (e.g. "Tonstakers")
supportedUnstakeModes*UnstakeModes[]Supported unstake modes for this provider.
supportsReversedQuote*booleanWhether provider supports reversed quote format (e.g., passing TON instead of tsTON for unstake)
stakeToken*StakingTokenInfoToken that the user sends when staking (e.g. TON)
receiveTokenStakingTokenInfoToken that the user receives when staking (e.g. tsTON for liquid staking). Absent for direct/custodial staking.
contractAddressUserFriendlyAddressProvider contract address (optional — custodial providers may not have one)

StakingProviderMetadataOverride

Partial overrides applied on top of a provider's built-in StakingProviderMetadata. Used in provider configuration (e.g. TonStakersChainConfig.metadata) when an integrator needs to tweak the display name, token info or supported modes for a specific chain.

FieldTypeDescription
namestringOverride the human-readable provider name surfaced in UIs.
stakeTokenStakingTokenInfoOverride the StakingTokenInfo of the token the user sends when staking.
receiveTokenStakingTokenInfoOverride the StakingTokenInfo of the token the user receives when staking (e.g. liquid-staking receipt).
contractAddressUserFriendlyAddressOverride the provider contract address (user-friendly format).
supportedUnstakeModesUnstakeModes[]Override the list of supported unstake-timing modes. See UnstakeMode.
supportsReversedQuotebooleanOverride whether the provider supports reversed-amount quotes (e.g., specifying TON instead of tsTON on an unstake quote).

StakingQuote

Staking quote response with pricing information.

FieldTypeDescription
direction*StakingQuoteDirectionDirection of the quote (stake or unstake)
rawAmountIn*TokenAmountAmount of tokens being provided.
rawAmountOut*TokenAmountEstimated amount of tokens to be received.
amountIn*stringFormatted amount of tokens being provided.
amountOut*stringFormatted estimated amount of tokens to be received.
network*NetworkNetwork on which the staking will be executed.
providerId*stringIdentifier of the staking provider.
unstakeModeUnstakeModesUnstake-timing mode the quote was produced for. Only meaningful when direction === 'unstake' — for 'stake' it is ignored.
metadataunknownProvider-specific metadata for the quote.

StakingQuoteDirection

Direction of the staking quote.

type StakingQuoteDirection = 'stake' | 'unstake';

StakingQuoteParams

Parameters for getting a staking quote.

FieldTypeDescription
direction*StakingQuoteDirectionDirection of the quote (stake or unstake)
amount*stringAmount of tokens to stake or unstake.
userAddressUserFriendlyAddressAddress of the user.
networkNetworkNetwork on which the staking will be executed.
unstakeModeUnstakeModesUnstake-timing mode the quote should target — see UnstakeMode for the supported flavours ('INSTANT', 'WHEN_AVAILABLE', 'ROUND_END'). Only meaningful when direction === 'unstake' and the provider lists the mode in supportedUnstakeModes.
isReversedbooleanIf true, for unstake requests the amount is specified in the staking coin (e.g. TON) instead of the Liquid Staking Token (e.g. tsTON).
providerOptionsTProviderOptions = unknownProvider-specific options.

StakingTokenInfo

Display metadata for a staking-pool token — ticker, decimals and address (or 'ton' for native TON). Carried on StakingProviderMetadata's stakeToken and receiveToken so the UI can render the pool's input/output assets.

FieldTypeDescription
ticker*stringTicker symbol (e.g., "TON", "tsTON").
decimals*numberNumber of decimal places used to format raw amounts.
address*string'ton' for native TON, otherwise the token contract address in user-friendly format.

TonStakersChainConfig

Per-chain Tonstakers config — optional TonAPI key for APY reads and an optional staking-provider metadata override.

FieldTypeDescription
tonApiTokenstringTonAPI key used for APY reads. Optional — APY still works without it, but providing one is recommended when you already use TonAPI elsewhere.
metadataStakingProviderMetadataOverrideOptional StakingProviderMetadataOverride applied on top of the built-in Tonstakers metadata for this chain.

TonStakersProviderConfig

Configuration accepted by createTonstakersProvider — map of chain ID (e.g. Network.mainnet().chainId) to its per-chain TonStakersChainConfig.

type TonStakersProviderConfig = {
    [chainId: string]: TonStakersChainConfig;
};

UnstakeModes

Union of UnstakeMode values. Carried on StakingQuoteParams's unstakeMode and on StakingProviderMetadata's supportedUnstakeModes to discriminate 'INSTANT' / 'WHEN_AVAILABLE' / 'ROUND_END' flows.

type UnstakeModes = (typeof UnstakeMode)[keyof typeof UnstakeMode];

WatchStakingProvidersParameters

Parameters accepted by watchStakingProviders.

FieldTypeDescription
onChange*() => voidCallback fired whenever a staking provider is registered or the default staking provider changes.

WatchStakingProvidersReturnType

Return type of watchStakingProviders — call to stop receiving updates.

type WatchStakingProvidersReturnType = () => void;

Swap

BuildSwapTransactionOptions

Options for buildSwapTransaction — same shape as SwapParams.

type BuildSwapTransactionOptions = SwapParams<T>;

BuildSwapTransactionReturnType

Return type of buildSwapTransaction.

type BuildSwapTransactionReturnType = Promise<TransactionRequest>;

DeDustProviderOptions

DeDust-specific options forwarded through providerOptions on SwapQuoteParams / SwapParams.

FieldTypeDescription
protocolsstring[]Protocols to use for routing. Available values: 'dedust', 'dedust_v3', 'dedust_v3_memepad', 'stonfi_v1', 'stonfi_v2', 'tonco', 'memeslab', 'tonfun'. Defaults to all protocols when omitted.
excludeProtocolsstring[]Protocols to exclude from routing.
onlyVerifiedPoolsbooleanOnly use verified pools.
maxSplitsnumberMaximum number of route splits
maxLengthnumberMaximum route length (hops)
excludeVolatilePoolsbooleanExclude volatile pools.
referralAddressstringThe address of the referrer.
referralFeeBpsnumberReferral fee in basis points (max 100 = 1%)

DeDustQuoteMetadata

Provider-specific metadata returned on a SwapQuote's metadata from DeDust — carries the resolved route, fees and swapData payload that buildSwapTransaction needs.

FieldTypeDescription
quoteResponse*DeDustQuoteResponseRaw quote response from API
slippageBps*numberSlippage used for the quote in basis points

DeDustReferralOptions

Optional referral metadata attached to DeDust swaps so the provider can attribute them.

FieldTypeDescription
referralAddressstringThe address of the referrer.
referralFeeBpsnumberReferral fee in basis points (max 100 = 1%)

DeDustSwapProviderConfig

Configuration accepted by createDeDustProvider.

FieldTypeDescription
providerIdstringCustom provider ID (defaults to 'dedust')
defaultSlippageBpsnumberDefault slippage tolerance in basis points (1 bp = 0.01%)
apiUrlstringAPI base URL
onlyVerifiedPoolsbooleanOnly use verified pools
maxSplitsnumberMaximum number of route splits
maxLengthnumberMaximum route length (hops)
minPoolUsdTvlstringMinimum pool TVL in USD
metadataSwapProviderMetadataOverrideCustom metadata for the provider.
referralAddressstringThe address of the referrer.
referralFeeBpsnumberReferral fee in basis points (max 100 = 1%)

GetSwapManagerReturnType

Return type of getSwapManager.

type GetSwapManagerReturnType = SwapManager;

GetSwapProviderOptions

Options for getSwapProvider.

FieldTypeDescription
idstringProvider ID to look up. When omitted, returns the registered default swap provider.

GetSwapProviderReturnType

Return type of getSwapProvider.

type GetSwapProviderReturnType = SwapProviderInterface;

GetSwapProvidersReturnType

Return type of getSwapProviders.

type GetSwapProvidersReturnType = SwapProviderInterface[];

GetSwapQuoteOptions

Options for getSwapQuote — extends SwapQuoteParams with an optional provider override.

FieldTypeDescription
amount*stringAmount of tokens to swap (incoming or outgoing depending on isReverseSwap)
from*SwapTokenToken to swap from.
to*SwapTokenToken to swap to.
network*NetworkNetwork on which the swap will be executed.
slippageBpsnumberSlippage tolerance in basis points (1 bp = 0.01%)
maxOutgoingMessagesnumberMaximum number of outgoing messages
providerOptionsTProviderOptions = unknownProvider-specific options.
isReverseSwapbooleanIf true, amount is the amount to receive (buy). If false, amount is the amount to spend (sell).
providerIdstringProvider to quote against. Defaults to the registered default swap provider.

GetSwapQuoteReturnType

Return type of getSwapQuote.

type GetSwapQuoteReturnType = Promise<SwapQuote>;

OmnistonProviderOptions

Omniston-specific options forwarded through providerOptions on SwapQuoteParams / SwapParams.

FieldTypeDescription
settlementMethodsSettlementMethodValue[]Settlement methods to use for the swap.
referrerAddressstringThe address of the referrer.
referrerFeeBpsnumberReferrer fee in basis points (1 bp = 0.01%)
flexibleReferrerFeebooleanWhether a flexible referrer fee is allowed.

OmnistonQuoteMetadata

Provider-specific metadata returned on a SwapQuote's metadata from Omniston — carries the resolved route and signed quote payload that buildSwapTransaction needs.

FieldTypeDescription
omnistonQuote*QuoteThe actual Omniston quote object

OmnistonReferrerOptions

Optional referrer metadata attached to Omniston swaps so the provider can attribute them.

FieldTypeDescription
referrerAddressstringThe address of the referrer.
referrerFeeBpsnumberReferrer fee in basis points (1 bp = 0.01%)
flexibleReferrerFeebooleanWhether a flexible referrer fee is allowed.

OmnistonSwapProviderConfig

Configuration accepted by createOmnistonProvider.

FieldTypeDescription
apiUrlstringOptional URL for the Omniston API
defaultSlippageBpsnumberDefault slippage tolerance in basis points (1 bp = 0.01%)
quoteTimeoutMsnumberTimeout for quote requests in milliseconds
providerIdstringIdentifier for the provider.
metadataSwapProviderMetadataOverrideCustom metadata for the provider.
referrerAddressstringThe address of the referrer.
referrerFeeBpsnumberReferrer fee in basis points (1 bp = 0.01%)
flexibleReferrerFeebooleanWhether a flexible referrer fee is allowed.

SetDefaultSwapProviderParameters

Parameters accepted by setDefaultSwapProvider.

FieldTypeDescription
providerId*stringID of the provider to make default — must already be registered.

SetDefaultSwapProviderReturnType

Return type of setDefaultSwapProvider.

type SetDefaultSwapProviderReturnType = void;

SwapAPI

API surface exposed by SwapManager — quote and build-transaction calls (plus the provider-management methods inherited from DefiManagerAPI). Mostly relevant when authoring a swap manager replacement.

FieldTypeDescription
getQuote*(params: SwapQuoteParams, providerId?: string) => Promise<SwapQuote>Get a quote for swapping tokens
buildSwapTransaction*(params: SwapParams) => Promise<TransactionRequest>Build a transaction for a swap. Provider is taken from params.quote.providerId, or the manager default.
createFactoryContext*() => ProviderFactoryContextBuild a fresh ProviderFactoryContext the manager hands to provider factories at registration time.
registerProvider*(provider: ProviderInput<SwapProviderInterface<unknown, unknown>>) => voidRegister a new provider. If a provider with the same id is already registered, it is replaced.
removeProvider*(provider: SwapProviderInterface<unknown, unknown>) => voidRemove a previously registered provider. No-op if the provider was not registered.
setDefaultProvider*(providerId: string) => voidSet the default provider
getProvider*(providerId?: string) => SwapProviderInterface<unknown, unknown>Get a registered provider
getProviders*() => Array<SwapProviderInterface<unknown, unknown>>Get all registered providers. The returned array keeps a stable reference until the provider list changes.
hasProvider*(providerId: string) => booleanCheck if a provider is registered

SwapParams

Parameters consumed by buildSwapTransaction — the previously obtained SwapQuote plus optional provider-specific options (TProviderOptions).

FieldTypeDescription
quote*SwapQuoteThe swap quote based on which the transaction is built.
userAddress*UserFriendlyAddressAddress of the user performing the swap.
destinationAddressUserFriendlyAddressAddress to receive the swapped tokens (defaults to userAddress)
slippageBpsnumberSlippage tolerance in basis points (1 bp = 0.01%)
deadlinenumberUnix timestamp (in seconds) after which the swap transaction must not be executed.
providerOptionsTProviderOptions = unknownProvider-specific options.

SwapQuote

Quote returned by getSwapQuote — source/target tokens, expected amounts, rate, slippage, fees and the provider-specific metadata that buildSwapTransaction needs to construct the transaction.

FieldTypeDescription
fromToken*SwapTokenToken being sold.
toToken*SwapTokenToken being bought.
rawFromAmount*TokenAmountAmount of fromToken to sell, in raw smallest units (e.g., nano-TON).
rawToAmount*TokenAmountAmount of toToken to buy, in raw smallest units (e.g., nano-TON).
fromAmount*stringAmount of fromToken to sell, formatted to the token's decimals as a human-readable decimal string (e.g., "1.5").
toAmount*stringAmount of toToken to buy, formatted to the token's decimals as a human-readable decimal string (e.g., "1.5").
rawMinReceived*TokenAmountMinimum amount of toToken to receive after slippage, in raw smallest units (e.g., nano-TON).
minReceived*stringMinimum amount of toToken to receive after slippage, formatted to the token's decimals as a human-readable decimal string (e.g., "1.5").
network*NetworkNetwork on which the swap will be executed.
priceImpactnumberPrice impact of the swap in basis points (100 = 1%)
providerId*stringIdentifier of the swap provider.
expiresAtnumberUnix timestamp in seconds when the quote expires
metadataunknownProvider-specific metadata for the quote.

SwapQuoteParams

Parameters consumed by getSwapQuote — source/target tokens and an amount that is interpreted as either the spend side or the receive side (isReverseSwap flag), plus optional slippage and provider-specific options.

FieldTypeDescription
amount*stringAmount of tokens to swap (incoming or outgoing depending on isReverseSwap)
from*SwapTokenToken to swap from.
to*SwapTokenToken to swap to.
network*NetworkNetwork on which the swap will be executed.
slippageBpsnumberSlippage tolerance in basis points (1 bp = 0.01%)
maxOutgoingMessagesnumberMaximum number of outgoing messages
providerOptionsTProviderOptions = unknownProvider-specific options.
isReverseSwapbooleanIf true, amount is the amount to receive (buy). If false, amount is the amount to spend (sell).

SwapToken

Token descriptor passed to getSwapQuote via SwapQuoteParams's from and to fields (and surfaced on the resulting SwapQuote) — address, decimals plus optional symbol/name/image used by swap-input UIs.

FieldTypeDescription
address*stringToken contract address. 'ton' is used for native TON on the TON chain.
decimals*numberNumber of decimal places used to format raw amounts.
namestringDisplay name (e.g., "Tether USD").
symbolstringTicker symbol (e.g., "USDT").
imagestringURL of the token's image.
chainIdstringChain id in CAIP-2 format when the token lives outside TON.

WatchSwapProvidersParameters

Parameters accepted by watchSwapProviders.

FieldTypeDescription
onChange*() => voidCallback fired whenever a swap provider is registered or the default swap provider changes.

WatchSwapProvidersReturnType

Return type of watchSwapProviders — call to stop receiving updates.

type WatchSwapProvidersReturnType = () => void;

Transactions

CreateTransferTonTransactionParameters

Parameters accepted by createTransferTonTransaction and transferTon.

FieldTypeDescription
recipientAddress*UserFriendlyAddressRecipient address.
amount*stringAmount in TON as a human-readable decimal string (e.g., "1.5"). Converted to nano-TON internally.
commentstringHuman-readable text comment. Converted to a Base64 payload when no payload is supplied.
payloadBase64StringRaw Base64 message payload — wins over comment when both are set.
stateInitBase64StringInitial state for deploying a new contract, encoded as Base64.

CreateTransferTonTransactionReturnType

Return type of createTransferTonTransaction.

type CreateTransferTonTransactionReturnType = TransactionRequest;

GetTransactionStatusParameters

Parameters accepted by getTransactionStatus — must carry exactly one of boc or normalizedHash, plus an optional network override.

type GetTransactionStatusParameters = {
    /** Network to check the transaction on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set. */
    network?: Network;
} & (
    | {
          /** Base64-encoded BoC of the sent transaction (returned by {@link sendTransaction}). */
          boc: string;
          normalizedHash?: never;
      }
    | {
          boc?: never;
          /** Hex-encoded normalized hash of the external-in message (returned by {@link sendTransaction} as `normalizedHash`). */
          normalizedHash: string;
      }
);

GetTransactionStatusReturnType

Return type of getTransactionStatus.

type GetTransactionStatusReturnType = TransactionStatusResponse;

SendTransactionParameters

Parameters accepted by sendTransaction — same shape as TransactionRequest.

type SendTransactionParameters = TransactionRequest;

SendTransactionResponse

Wallet response carrying the BoC (bag of cells) of the external message that was signed and broadcast — used to track or hash the resulting transaction.

FieldTypeDescription
boc*Base64StringBoC of the sent transaction.
normalizedBoc*Base64StringNormalized BoC of the external-in message.
normalizedHash*HexHash of the normalized external-in message.

SendTransactionReturnType

Return type of sendTransaction.

type SendTransactionReturnType = SendTransactionResponse;

Transaction

Single transaction record carried inside TransactionsUpdate's transactions — account, lt/hash, in/out messages and emulation result.

FieldTypeDescription
account*UserFriendlyAddressAccount of the transaction.
accountStateBeforeAccountStateThe state of the account before the transaction was executed.
accountStateAfterAccountStateThe state of the account after the transaction has been applied.
descriptionTransactionDescriptionThe detailed breakdown of the transaction execution.
hash*HexHash of the transaction.
logicalTime*LogicalTimeThe logical time of the transaction.
now*numberUnix timestamp of the transaction.
mcBlockSeqno*numberMasterchain block sequence number
traceExternalHash*HexExternal hash of the trace.
traceIdstringID of the trace.
previousTransactionHashstringThe hash of the previous transaction.
previousTransactionLogicalTimeLogicalTimeThe logical time of the previous transaction.
origStatusAccountStatusOriginal status of the transaction.
endStatusAccountStatusEnd status of the transaction.
totalFeesTokenAmountTotal fees of the transaction.
totalFeesExtraCurrenciesExtraCurrenciesExtra currencies in the total fees.
blockRefTransactionBlockRefThe reference to the block in which the transaction was included.
inMessageTransactionMessageThe incoming message associated with the transaction.
outMessages*TransactionMessage[]The list of outgoing messages produced by the transaction.
isEmulated*booleanEmulated state of the transaction.

TransactionRequest

Transaction payload passed to WalletInterface's sendTransaction — one or more messages, optional network override and validUntil deadline.

FieldTypeDescription
messages*TransactionRequestMessage[]Messages to include in the transaction.
networkNetworkNetwork to execute the transaction on.
validUntilnumberUnix timestamp (seconds) after which the transaction becomes invalid.
fromAddressstringSender wallet address — accepts either raw or user-friendly format.

TransactionRequestMessage

Individual message inside a TransactionRequest — recipient, amount, optional payload and contract stateInit.

FieldTypeDescription
address*stringRecipient wallet address — accepts either raw or user-friendly format.
amount*TokenAmountAmount to transfer, in nano-TON (1 TON = 10⁹ nano-TON).
extraCurrencyExtraCurrenciesAdditional currencies to include in the transfer.
stateInitstringInitial state for deploying a new contract, encoded as Base64.
payloadstringMessage payload, encoded as Base64.

TransactionsUpdate

Update payload delivered to watchTransactions / watchTransactionsByAddress subscribers when transactions land for the watched address.

FieldTypeDescription
type*'transactions'Discriminator pinned to 'transactions' — identifies this update as a transactions stream payload.
address*UserFriendlyAddressAccount address the transactions belong to (the watched address).
transactions*Transaction[]Transactions that landed for address in this update.
traceHash*HexHash of the trace that produced these transactions — the root external-message hash that spawned them.
addressBookAddressBookPre-resolved address-book entries for raw addresses referenced inside transactions, so the UI can render labels without extra lookups.
metadataTransactionAddressMetadataPre-fetched address metadata (interfaces, domain) for the watched address.
status*StreamingUpdateStatusFinality stage of the update — see StreamingUpdateStatus.

TransferTonParameters

Parameters accepted by transferTon — same shape as CreateTransferTonTransactionParameters.

type TransferTonParameters = CreateTransferTonTransactionParameters;

TransferTonReturnType

Return type of transferTon.

type TransferTonReturnType = SendTransactionResponse;

WatchTransactionsByAddressOptions

Options for watchTransactionsByAddress.

FieldTypeDescription
address*UserFriendlyAddress | AddressAddress to watch — pass a UserFriendlyAddress string or an Address instance from @ton/core.
onChange*(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.
networkNetworkNetwork to watch on. Defaults to the selected wallet's network. If no wallet is selected, falls back to AppKit's default network, or mainnet when none is set.

WatchTransactionsByAddressReturnType

Return type of watchTransactionsByAddress — call to stop receiving updates.

type WatchTransactionsByAddressReturnType = () => void;

WatchTransactionsOptions

Options for watchTransactions.

FieldTypeDescription
onChange*(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.
networkNetworkNetwork to watch on. Defaults to the selected wallet's network.

WatchTransactionsReturnType

Return type of watchTransactions — call to stop receiving updates.

type WatchTransactionsReturnType = () => void;

Wallets

GetConnectedWalletsReturnType

Return type of getConnectedWallets — read-only view of the connected-wallets array.

type GetConnectedWalletsReturnType = readonly WalletInterface[];

GetSelectedWalletReturnType

Return type of getSelectedWalletnull when no wallet is currently selected.

type GetSelectedWalletReturnType = WalletInterface | null;

SetSelectedWalletIdParameters

Parameters accepted by setSelectedWalletId.

FieldTypeDescription
walletId*string | nullWallet ID (as returned by WalletInterface's getWalletId()) to select. Pass null to clear the selection.

SetSelectedWalletIdReturnType

Return type of setSelectedWalletId.

type SetSelectedWalletIdReturnType = void;

TonConnectWalletAdapterConfig

Configuration accepted by TonConnectWalletAdapter when wrapping a TonConnect wallet for AppKit.

FieldTypeDescription
connectorId*stringID of the connector that produced this wallet — surfaced as WalletInterface.connectorId.
tonConnectWallet*TonConnectWalletUnderlying TonConnect wallet object.
tonConnectUI*TonConnectUITonConnect UI instance used to drive sendTransaction and signData calls.

WalletInterface

Wallet contract surfaced by every Connector — covers identity (address, public key, network) and signing operations. Reads (balance, jettons, NFTs) go through AppKit actions instead.

FieldTypeDescription
connectorId*stringID of the Connector that produced this wallet.
getAddress*() => UserFriendlyAddressWallet address as a user-friendly base64url string.
getPublicKey*() => HexWallet public key as a 0x-prefixed hex string.
getNetwork*() => NetworkNetwork the wallet is currently connected to.
getWalletId*() => stringStable identifier combining address and network — unique across AppKit's connected wallets.
sendTransaction*(request: TransactionRequest) => Promise<SendTransactionResponse>Send a transaction — the wallet signs and broadcasts it.
signData*(payload: SignDataRequest) => Promise<SignDataResponse>Sign arbitrary data — text, binary or TON cell — through the wallet's sign-data flow.

WatchConnectedWalletsParameters

Parameters accepted by watchConnectedWallets.

FieldTypeDescription
onChange*(wallets: WalletInterface[]) => voidCallback fired whenever the list of connected wallets changes — receives the latest snapshot.

WatchConnectedWalletsReturnType

Return type of watchConnectedWallets — call to stop receiving updates.

type WatchConnectedWalletsReturnType = () => void;

WatchSelectedWalletParameters

Parameters accepted by watchSelectedWallet.

FieldTypeDescription
onChange*(wallet: WalletInterface | null) => voidCallback fired whenever the selected wallet changes — receives the new wallet, or null when the selection was cleared.

WatchSelectedWalletReturnType

Return type of watchSelectedWallet — call to stop receiving updates.

type WatchSelectedWalletReturnType = () => void;

Constants

Connectors

CONNECTOR_EVENTS

Event names AppKit emits for connector-list and connector-wallet changes. Payloads are ConnectorAddedPayload, ConnectorRemovedPayload and ConnectorWalletsUpdatedPayload.

const CONNECTOR_EVENTS = {
    /** A connector was registered via {@link addConnector} (or AppKit's constructor). */
    ADDED: 'connector:added',
    /** A connector was unregistered — typically by calling the unregister function returned from {@link addConnector}, or as part of the connector's own teardown. */
    REMOVED: 'connector:removed',
    /** A connector's connected-wallets list changed (connect, disconnect, or account switch inside the wallet). */
    WALLETS_UPDATED: 'connector:wallets-updated',
} as const;

TONCONNECT_DEFAULT_CONNECTOR_ID

Default id assigned to the TonConnect connector when none is supplied to createTonConnectConnector. Pass this to connect / disconnect to drive the TonConnect flow without hard-coding the literal.

const TONCONNECT_DEFAULT_CONNECTOR_ID = 'tonconnect';

Crypto Onramp

CryptoOnrampErrorCode

Discriminator carried on every CryptoOnrampError's code — covers provider/quote/deposit failures and refund-address validation.

FieldTypeDescription
ProviderError*"PROVIDER_ERROR"Provider's upstream API rejected the call (unexpected response, auth failure, internal error).
QuoteFailed*"QUOTE_FAILED"Provider could not produce a quote for the supplied parameters.
DepositFailed*"DEPOSIT_FAILED"Provider could not create a deposit for the previously obtained quote.
RefundAddressRequired*"REFUND_ADDRESS_REQUIRED"Provider requires a refund address that the caller did not supply.
InvalidRefundAddress*"INVALID_REFUND_ADDRESS"Supplied refund address is not valid for the source chain.
ReversedAmountNotSupported*"REVERSED_AMOUNT_NOT_SUPPORTED"Provider does not support specifying the amount on the target side of the swap.
InvalidParams*"INVALID_PARAMS"Caller passed parameters that fail provider-level validation.

DeFi

DefiErrorCode

Discriminator carried on DefiError's code for codes shared by every DeFi domain — provider lookup, default-provider state, and shared transport/validation failures. Subclass codes (SwapErrorCode, StakingErrorCode, CryptoOnrampErrorCode) cover domain-specific failures.

FieldTypeDescription
ProviderNotFound*"PROVIDER_NOT_FOUND"Provider with the requested id is not registered with the manager.
NoDefaultProvider*"NO_DEFAULT_PROVIDER"No default provider is configured and the caller did not specify one.
NetworkError*"NETWORK_ERROR"Provider rejected the request because of an upstream/network failure.
UnsupportedNetwork*"UNSUPPORTED_NETWORK"Provider does not support the network selected for the operation.
InvalidParams*"INVALID_PARAMS"Caller passed parameters that fail provider-level validation.
InvalidProvider*"INVALID_PROVIDER"Provider failed its own internal validation and cannot be used.

Networks

NETWORKS_EVENTS

Event names AppKit emits on network changes. DEFAULT_CHANGED carries a DefaultNetworkChangedPayload.

const NETWORKS_EVENTS = {
    UPDATED: 'networks:updated',
    DEFAULT_CHANGED: 'networks:default-changed',
} as const;

Staking

StakingErrorCode

Discriminator carried on every StakingError's code'INVALID_PARAMS' (the request was malformed) or 'UNSUPPORTED_OPERATION' (the provider doesn't support this call).

FieldTypeDescription
InvalidParams*"INVALID_PARAMS"Caller passed parameters that fail provider-level validation.
UnsupportedOperation*"UNSUPPORTED_OPERATION"Provider doesn't support the requested operation (e.g., reversed quote on a unidirectional pool).

UnstakeMode

Allowed unstake-timing flavours referenced by UnstakeModes and StakingProviderMetadata's supportedUnstakeModes'INSTANT' (immediate withdrawal when the pool has liquidity, otherwise the funds are returned), 'WHEN_AVAILABLE' (paid out as soon as liquidity is available — instantly or at round end), 'ROUND_END' (paid out at the end of the staking round, typically for the best rate).

const UnstakeMode = { readonly INSTANT: "INSTANT"; readonly WHEN_AVAILABLE: "WHEN_AVAILABLE"; readonly ROUND_END: "ROUND_END"; };

Swap

SwapErrorCode

Discriminator carried on every SwapError's code — covers quote / liquidity / transaction-build failures plus the shared NETWORK_ERROR for upstream-API faults.

FieldTypeDescription
InvalidQuote*"INVALID_QUOTE"Provider returned malformed or missing quote data.
InsufficientLiquidity*"INSUFFICIENT_LIQUIDITY"No route or pool has enough liquidity to satisfy the requested swap.
QuoteExpired*"QUOTE_EXPIRED"Quote payload is too old to use. Fetch a new one before building the transaction.
BuildTxFailed*"BUILD_TX_FAILED"Provider failed to produce a swap transaction from the supplied quote.
NetworkError*"NETWORK_ERROR"Provider rejected the request because of an upstream/network failure.

Wallets

WALLETS_EVENTS

Event names AppKit emits when the available wallet list (UPDATED) or the active wallet (SELECTION_CHANGED) changes.

const WALLETS_EVENTS = {
    UPDATED: 'wallets:updated',
    SELECTION_CHANGED: 'wallets:selection-changed',
} as const;

Last updated on

On this page

ActionBalancesgetBalancegetBalanceByAddresswatchBalancewatchBalanceByAddressClientgetApiClientConnectorsaddConnectorconnectcreateConnectorcreateTonConnectConnectordisconnectgetConnectorByIdgetConnectorswatchConnectorByIdwatchConnectorsCrypto OnrampcreateCryptoOnrampDepositcreateLayerswapProvidercreateSwapsXyzProvidergetCryptoOnrampProvidergetCryptoOnrampProvidersgetCryptoOnrampQuotegetCryptoOnrampStatuswatchCryptoOnrampProvidersDeFiregisterProviderJettonscreateTransferJettonTransactiongetJettonBalancegetJettonInfogetJettonWalletAddressgetJettonsgetJettonsByAddresstransferJettonwatchJettonswatchJettonsByAddressNFTscreateTransferNftTransactiongetNftgetNftsgetNftsByAddresstransferNftNetworksgetBlockNumbergetDefaultNetworkgetNetworkgetNetworkshasStreamingProvidersetDefaultNetworkwatchDefaultNetworkwatchNetworksSigningsignBinarysignCellsignTextStakingbuildStakeTransactioncreateTonstakersProvidergetStakedBalancegetStakingManagergetStakingProvidergetStakingProviderInfogetStakingProviderMetadatagetStakingProvidersgetStakingQuotesetDefaultStakingProviderwatchStakingProvidersSwapbuildSwapTransactioncreateDeDustProvidercreateOmnistonProvidergetSwapManagergetSwapProvidergetSwapProvidersgetSwapQuotesetDefaultSwapProviderwatchSwapProvidersTransactionscreateTransferTonTransactiongetTransactionStatussendTransactiontransferTonwatchTransactionswatchTransactionsByAddressWalletsgetConnectedWalletsgetSelectedWalletsetSelectedWalletIdwatchConnectedWalletswatchSelectedWalletClassClientApiClientTonApiApiClientToncenterCoreAppKitEventEmitterCrypto OnrampCryptoOnrampErrorCryptoOnrampManagerCryptoOnrampProviderLayerswapCryptoOnrampProviderSwapsXyzCryptoOnrampProviderDeFiDefiErrorNetworksAppKitNetworkManagerKitNetworkManagerStakingStakingErrorStakingManagerStakingProviderTonStakersStakingProviderSwapDeDustSwapProviderOmnistonSwapProviderSwapErrorSwapManagerSwapProviderWalletsTonConnectWalletAdapterTypeBalancesBalanceUpdateGetBalanceByAddressOptionsGetBalanceByAddressReturnTypeGetBalanceOptionsGetBalanceReturnTypeStreamingUpdateStatusWatchBalanceByAddressOptionsWatchBalanceByAddressReturnTypeWatchBalanceOptionsWatchBalanceReturnTypeClientAddressBookAddressBookEntryApiClientApiClientConfigApiClientToncenterConfigBaseApiClientConfigGetApiClientOptionsGetApiClientReturnTypeTokenInfoConnectorsAddConnectorParametersAddConnectorReturnTypeConnectParametersConnectReturnTypeConnectorConnectorFactoryConnectorFactoryContextConnectorInputConnectorMetadataDisconnectParametersDisconnectReturnTypeGetConnectorByIdOptionsGetConnectorByIdReturnTypeGetConnectorsReturnTypeTonConnectConnectorTonConnectConnectorConfigWatchConnectorByIdParametersWatchConnectorByIdReturnTypeWatchConnectorsParametersWatchConnectorsReturnTypeCoreAppKitConfigAppKitEmitterAppKitEventsBaseProviderUpdateConnectorAddedPayloadConnectorRemovedPayloadConnectorWalletsUpdatedPayloadDefaultNetworkChangedPayloadEventListenerEventPayloadKitEventSharedKitEventsCrypto OnrampCreateCryptoOnrampDepositOptionsCreateCryptoOnrampDepositReturnTypeCryptoOnrampDepositCryptoOnrampDepositParamsCryptoOnrampProviderInterfaceCryptoOnrampProviderMetadataCryptoOnrampProviderMetadataOverrideCryptoOnrampQuoteCryptoOnrampQuoteParamsCryptoOnrampStatusCryptoOnrampStatusParamsGetCryptoOnrampProviderOptionsGetCryptoOnrampProviderReturnTypeGetCryptoOnrampProvidersReturnTypeGetCryptoOnrampQuoteOptionsGetCryptoOnrampQuoteReturnTypeGetCryptoOnrampStatusOptionsGetCryptoOnrampStatusReturnTypeLayerswapProviderConfigLayerswapQuoteMetadataSwapsXyzProviderConfigSwapsXyzQuoteMetadataSwapsXyzQuoteOptionsWatchCryptoOnrampProvidersParametersWatchCryptoOnrampProvidersReturnTypeDeFiDefiManagerAPIDefiProviderDefiProviderTypeProviderFactoryContextProviderInputRegisterProviderOptionsJettonsCreateTransferJettonTransactionParametersCreateTransferJettonTransactionReturnTypeGetJettonBalanceOptionsGetJettonBalanceReturnTypeGetJettonInfoOptionsGetJettonInfoReturnTypeGetJettonWalletAddressOptionsGetJettonWalletAddressReturnTypeGetJettonsByAddressOptionsGetJettonsByAddressReturnTypeGetJettonsOptionsGetJettonsReturnTypeJettonJettonInfoJettonUpdateJettonVerificationJettonsResponseTransferJettonParametersTransferJettonReturnTypeWatchJettonsByAddressOptionsWatchJettonsByAddressReturnTypeWatchJettonsOptionsWatchJettonsReturnTypeNFTsCreateTransferNftTransactionParametersCreateTransferNftTransactionReturnTypeGetNftOptionsGetNftReturnTypeGetNftsByAddressOptionsGetNftsByAddressReturnTypeGetNftsOptionsGetNftsReturnTypeNFTNFTAttributeNFTCollectionNFTsResponseTransferNftParametersTransferNftReturnTypeNetworksGetBlockNumberOptionsGetBlockNumberReturnTypeGetDefaultNetworkReturnTypeGetNetworkReturnTypeGetNetworksReturnTypeHasStreamingProviderReturnTypeNetworkNetworkAdaptersNetworkConfigSetDefaultNetworkParametersSetDefaultNetworkReturnTypeTonWalletKitOptionsWatchDefaultNetworkParametersWatchDefaultNetworkReturnTypeWatchNetworksParametersWatchNetworksReturnTypePrimitivesBase64StringExtraCurrenciesHexMutationOptionsOverrideQueryOptionsOverrideTokenAmountUserFriendlyAddressSigningSignBinaryParametersSignBinaryReturnTypeSignCellParametersSignCellReturnTypeSignDataSignDataBinarySignDataCellSignDataRequestSignDataResponseSignDataTextSignTextParametersSignTextReturnTypeStakingBuildStakeTransactionOptionsBuildStakeTransactionReturnTypeGetStakedBalanceOptionsGetStakedBalanceReturnTypeGetStakingManagerReturnTypeGetStakingProviderInfoOptionsGetStakingProviderInfoReturnTypeGetStakingProviderMetadataOptionsGetStakingProviderMetadataReturnTypeGetStakingProviderOptionsGetStakingProviderReturnTypeGetStakingProvidersReturnTypeGetStakingQuoteOptionsGetStakingQuoteReturnTypeSetDefaultStakingProviderParametersSetDefaultStakingProviderReturnTypeStakeParamsStakingAPIStakingBalanceStakingProviderInfoStakingProviderMetadataStakingProviderMetadataOverrideStakingQuoteStakingQuoteDirectionStakingQuoteParamsStakingTokenInfoTonStakersChainConfigTonStakersProviderConfigUnstakeModesWatchStakingProvidersParametersWatchStakingProvidersReturnTypeSwapBuildSwapTransactionOptionsBuildSwapTransactionReturnTypeDeDustProviderOptionsDeDustQuoteMetadataDeDustReferralOptionsDeDustSwapProviderConfigGetSwapManagerReturnTypeGetSwapProviderOptionsGetSwapProviderReturnTypeGetSwapProvidersReturnTypeGetSwapQuoteOptionsGetSwapQuoteReturnTypeOmnistonProviderOptionsOmnistonQuoteMetadataOmnistonReferrerOptionsOmnistonSwapProviderConfigSetDefaultSwapProviderParametersSetDefaultSwapProviderReturnTypeSwapAPISwapParamsSwapQuoteSwapQuoteParamsSwapTokenWatchSwapProvidersParametersWatchSwapProvidersReturnTypeTransactionsCreateTransferTonTransactionParametersCreateTransferTonTransactionReturnTypeGetTransactionStatusParametersGetTransactionStatusReturnTypeSendTransactionParametersSendTransactionResponseSendTransactionReturnTypeTransactionTransactionRequestTransactionRequestMessageTransactionsUpdateTransferTonParametersTransferTonReturnTypeWatchTransactionsByAddressOptionsWatchTransactionsByAddressReturnTypeWatchTransactionsOptionsWatchTransactionsReturnTypeWalletsGetConnectedWalletsReturnTypeGetSelectedWalletReturnTypeSetSelectedWalletIdParametersSetSelectedWalletIdReturnTypeTonConnectWalletAdapterConfigWalletInterfaceWatchConnectedWalletsParametersWatchConnectedWalletsReturnTypeWatchSelectedWalletParametersWatchSelectedWalletReturnTypeConstantsConnectorsCONNECTOR_EVENTSTONCONNECT_DEFAULT_CONNECTOR_IDCrypto OnrampCryptoOnrampErrorCodeDeFiDefiErrorCodeNetworksNETWORKS_EVENTSStakingStakingErrorCodeUnstakeModeSwapSwapErrorCodeWalletsWALLETS_EVENTS