Skip to main content

Documentation Index

Fetch the complete documentation index at: https://companyname-a7d5b98e-feature-fumodocs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Hook

Balances

useBalance

React hook reading the Toncoin balance of the currently selected wallet through TanStack Query — auto-resolves the wallet address (use useBalanceByAddress for an arbitrary address).
ParameterTypeDescription
parametersUseBalanceParametersTanStack Query overrides (select, enabled, staleTime, …) and an optional network override.
parameters.addressUserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseBalanceReturnType<selectData = GetBalanceByAddressData> — TanStack Query result for the balance read. Example
const { data: balance, isLoading, error } = useBalance();

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return <div>Balance: {balance}</div>;

useBalanceByAddress

React hook reading the Toncoin balance of an arbitrary address through TanStack Query — useful for addresses that aren’t tied to the selected wallet (use useBalance for the selected wallet).
ParameterTypeDescription
parametersUseBalanceByAddressParametersTarget address, optional network override, and TanStack Query overrides.
parameters.addressUserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseBalanceByAddressReturnType<selectData = GetBalanceByAddressData> — TanStack Query result for the balance read. Example
const {
    data: balance,
    isLoading,
    error,
} = useBalanceByAddress({
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return <div>Balance: {balance}</div>;

useWatchBalance

Subscribe to Toncoin balance updates for the currently selected wallet. Updates flow into the TanStack Query cache so useBalance picks up the new data automatically (use useWatchBalanceByAddress for a fixed address). Requires a streaming provider registered for the network — the hook exits silently with a console warning when none is configured.
ParameterTypeDescription
parametersUseWatchBalanceParametersUpdate callback and optional network override.
parameters.onChange(update: BalanceUpdate) => voidCallback fired on every balance update from the streaming provider.
parameters.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: void. Example
const { data: balance } = useBalance();

useWatchBalance();

return <div>Current balance: {balance}</div>;

useWatchBalanceByAddress

Subscribe to Toncoin balance updates for an arbitrary address — updates flow into the TanStack Query cache so useBalanceByAddress picks up the new data automatically. Requires a streaming provider registered for the network — the hook exits silently with a console warning when none is configured.
ParameterTypeDescription
parameters*UseWatchBalanceByAddressParametersAddress, update callback and optional network override.
parameters.addressUserFriendlyAddress | AddressWallet address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.onChange(update: BalanceUpdate) => voidCallback fired on every balance update from the streaming provider.
Returns: void. Example
const address = 'UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ';
const network = Network.mainnet();
const { data: balance } = useBalanceByAddress({ address, network });

useWatchBalanceByAddress({ address, network });

return <div>Current balance: {balance}</div>;

Connectors

useConnectorById

Look up a connector by its id and stay subscribed to its registration lifecycle — updates when a connector with that id is registered (via AppKit’s constructor or addConnector) or unregistered. Returns the matching Connector, or undefined when none with that id is currently registered. Use useConnectedWallets if you want to react to wallet connect/disconnect events instead.
ParameterTypeDescription
id*stringID of the connector to look up.
Returns: Connector | undefined — The matching Connector, or undefined if none with that id is registered.

useConnectors

Read the list of connectors registered on this AppKit instance. Updates when a connector is registered or unregistered (use useConnectedWallets to react to wallet connect/disconnect events). Returns: UseConnectorsReturnType — Read-only array of registered Connectors.

Crypto Onramp

useCreateCryptoOnrampDeposit

Create a crypto-onramp deposit from a quote previously obtained via useCryptoOnrampQuote. Call mutate(options) where options matches CreateCryptoOnrampDepositOptions (quote, refund address, optional provider override). On success, data is the CryptoOnrampDeposit carrying the address and amount the user must send on the source chain to complete the onramp. Pair with useCryptoOnrampStatus to poll the deposit until it settles.
ParameterTypeDescription
parametersUseCreateCryptoOnrampDepositParametersTanStack Query mutation overrides (parameters.mutation).
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseCreateCryptoOnrampDepositReturnType<context = unknown> — Mutation result for the deposit call.

useCryptoOnrampContext

Reads the CryptoOnrampContext populated by CryptoOnrampWidgetProvider — returns the widget’s selection state, quote/deposit data and actions (CryptoOnrampContextType). Returns: CryptoOnrampContextType.

useCryptoOnrampProvider

Read a registered crypto-onramp provider by id, or the default provider when no id is given — subscribes to watchCryptoOnrampProviders and re-reads via getCryptoOnrampProvider so the result stays in sync. The read swallows the throw from getCryptoOnrampProvider (which throws when no provider matches — or when no id is passed and no default has been registered) and yields undefined instead.
ParameterTypeDescription
parametersUseCryptoOnrampProviderParametersOptional provider id.
parameters.idstringProvider ID to look up. When omitted, returns the registered default provider.
Returns: UseCryptoOnrampProviderReturnType — The matching provider, or undefined when none is registered.

useCryptoOnrampProviders

List every crypto-onramp provider registered on the AppKit instance (both those passed via AppKitConfig’s providers and those added later through registerProvider). Subscribes to watchCryptoOnrampProviders and re-reads via getCryptoOnrampProviders so the array stays in sync. Returns: UseCryptoOnrampProvidersReturnType — Array of registered crypto-onramp providers.

useCryptoOnrampQuote

Quote a crypto-to-TON onramp — given a source asset/chain and the target TON asset, returns the rate, expected amount and the provider-specific metadata required to feed useCreateCryptoOnrampDeposit. data is the CryptoOnrampQuote payload.
ParameterTypeDescription
parametersUseCryptoOnrampQuoteParametersQuote inputs and TanStack Query overrides.
parameters.amountstringAmount to onramp (either source or target crypto, depending on isSourceAmount)
parameters.sourceCurrencyAddressstringSource crypto currency address (contract address or 0x0… for native)
parameters.sourceChainstringSource 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.
parameters.targetCurrencyAddressstringTarget crypto currency address on TON (contract address or 0x0… for native)
parameters.recipientAddressstringTON address that will receive the target crypto.
parameters.refundAddressstringRefund address for the source crypto.
parameters.isSourceAmountbooleanIf true, amount is the source amount to spend. If false, amount is the target amount to receive. Defaults to true when omitted.
parameters.providerOptionsTProviderOptions = unknownProvider-specific options.
parameters.providerIdstringProvider to quote against. Defaults to the registered default provider.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseCryptoOnrampQuoteReturnType<selectData = GetCryptoOnrampQuoteData> — TanStack Query result for the quote read.

useCryptoOnrampStatus

Read the current status of a crypto-onramp deposit previously created via useCreateCryptoOnrampDeposit. Typically polled via refetchInterval until data reaches a terminal state — 'success' (delivered to the recipient) or 'failed' (provider could not complete the deposit).
ParameterTypeDescription
parametersUseCryptoOnrampStatusParametersDeposit id, originating provider id and TanStack Query overrides.
parameters.depositIdstringDeposit id.
parameters.providerIdstringIdentifier of the provider that issued this deposit.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseCryptoOnrampStatusReturnType<selectData = GetCryptoOnrampStatusData> — TanStack Query result for the status read.

Jettons

useJettonBalanceByAddress

React hook reading a jetton balance for a given owner through TanStack Query — derives the owner’s jetton-wallet address from the master and formats the balance using the supplied decimals.
ParameterTypeDescription
parametersUseJettonBalanceByAddressParametersJetton master, owner address, decimals, optional network override and TanStack Query overrides.
parameters.jettonAddressUserFriendlyAddressJetton master contract address (the token, not the user’s wallet for it).
parameters.ownerAddressUserFriendlyAddressOwner of the jetton wallet — typically the connected user’s address.
parameters.jettonDecimalsnumberDecimals declared by the jetton master. Used to format the raw balance into a human-readable string.
parameters.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.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseJettonBalanceByAddressReturnType<selectData = GetJettonBalanceByAddressData> — TanStack Query result for the jetton balance read. Example
const {
    data: balance,
    isLoading,
    error,
} = useJettonBalanceByAddress({
    ownerAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    jettonAddress: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiXme1Xc56Iwobkzgnjj',
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return <div>Jetton Balance: {balance}</div>;

useJettonInfo

React hook reading jetton-master metadata (name, symbol, decimals, image, description) through TanStack Query.
ParameterTypeDescription
parametersUseJettonInfoParametersJetton master address, optional network override and TanStack Query overrides.
parameters.addressUserFriendlyAddressJetton master contract address whose metadata is being fetched.
parameters.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.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseJettonInfoReturnType<selectData = GetJettonInfoData> — TanStack Query result for the jetton info read. Example
const {
    data: info,
    isLoading,
    error,
} = useJettonInfo({
    address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiXme1Xc56Iwobkzgnjj',
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return (
    <div>
        <h3>Jetton Info</h3>
        <p>Name: {info?.name}</p>
        <p>Symbol: {info?.symbol}</p>
        <p>Decimals: {info?.decimals}</p>
    </div>
);

useJettonWalletAddress

React hook deriving the owner’s jetton-wallet address — the per-owner contract that actually holds the jetton balance for a given master — through TanStack Query.
ParameterTypeDescription
parametersUseJettonWalletAddressParametersJetton master, owner address, optional network override and TanStack Query overrides.
parameters.jettonAddressUserFriendlyAddressJetton master contract address.
parameters.ownerAddressUserFriendlyAddressOwner whose jetton wallet should be derived.
parameters.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.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseQueryReturnType<selectData, Error> — TanStack Query result for the jetton-wallet address read. Example
const {
    data: walletAddress,
    isLoading,
    error,
} = useJettonWalletAddress({
    ownerAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    jettonAddress: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiXme1Xc56Iwobkzgnjj',
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return <div>Jetton Wallet Address: {walletAddress}</div>;

useJettons

React hook listing jettons held by the currently selected wallet through TanStack Query — auto-resolves the wallet address (use useJettonsByAddress for an arbitrary address).
ParameterTypeDescription
parametersUseJettonsParametersTanStack Query overrides (select, enabled, staleTime, …), pagination and an optional network override.
parameters.addressUserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.limitnumberMaximum number of jettons to return.
parameters.offsetnumberNumber of jettons to skip before returning results — used for pagination.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseJettonsReturnType<selectData = GetJettonsByAddressData> — TanStack Query result for the jettons list. Example
const { data: jettons, isLoading, error } = useJettons();

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return (
    <div>
        <h3>Jettons</h3>
        <ul>
            {jettons?.jettons.map((jetton) => (
                <li key={jetton.walletAddress}>
                    {jetton.info.name}: {jetton.balance}
                </li>
            ))}
        </ul>
    </div>
);

useJettonsByAddress

React hook listing jettons held by an arbitrary address through TanStack Query — useful for wallets that aren’t selected in AppKit (use useJettons for the selected wallet).
ParameterTypeDescription
parametersUseJettonsByAddressParametersOwner address, optional network override, pagination and TanStack Query overrides.
parameters.addressUserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.limitnumberMaximum number of jettons to return.
parameters.offsetnumberNumber of jettons to skip before returning results — used for pagination.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseJettonsByAddressReturnType<selectData = GetJettonsByAddressData> — TanStack Query result for the jettons list. Example
const {
    data: jettons,
    isLoading,
    error,
} = useJettonsByAddress({
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return (
    <div>
        <h3>Jettons</h3>
        <ul>
            {jettons?.jettons.map((jetton) => (
                <li key={jetton.walletAddress}>
                    {jetton.info.name}: {jetton.balance}
                </li>
            ))}
        </ul>
    </div>
);

useTransferJetton

Transfer a jetton from the selected wallet in one step — derives the owner’s jetton-wallet from the master address, builds the transfer message, signs it through the wallet and broadcasts it. Call mutate with the jettonAddress (master), the recipientAddress, an amount (in jetton units as a human-readable decimal — converted into raw smallest units using jettonDecimals), the jettonDecimals itself and an optional comment. On success, data carries the BoC and normalized hash of the broadcast transaction. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseTransferJettonParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseTransferJettonReturnType<context = unknown> — Mutation result for the jetton transfer call. Example
const { mutate: transfer, isPending, error } = useTransferJetton();

const handleTransfer = () => {
    transfer({
        recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
        amount: '100', // 100 USDT
        jettonAddress: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
        jettonDecimals: 6,
    });
};

return (
    <div>
        <button onClick={handleTransfer} disabled={isPending}>
            {isPending ? 'Transferring...' : 'Transfer Jetton'}
        </button>
        {error && <div>Error: {error.message}</div>}
    </div>
);

useWatchJettons

Subscribe to jetton-balance updates for the currently selected wallet. Updates flow into the TanStack Query cache so useJettons picks up the new data automatically (use useWatchJettonsByAddress for a fixed address). Requires a streaming provider registered for the network — the hook exits silently with a console warning when none is configured.
ParameterTypeDescription
parametersUseWatchJettonsParametersUpdate callback and optional network override.
parameters.onChange(update: JettonUpdate) => voidCallback fired on every jetton-balance update from the streaming provider.
parameters.networkNetworkNetwork to watch on. Defaults to the selected wallet’s network.
Returns: void. Example
const { data: jettons } = useJettons();

useWatchJettons();

return (
    <div>
        <h3>Your Jettons:</h3>
        <ul>
            {jettons?.jettons.map((j) => (
                <li key={j.walletAddress}>
                    {j.info.name}: {j.balance}
                </li>
            ))}
        </ul>
    </div>
);

useWatchJettonsByAddress

Subscribe to jetton-balance updates for an arbitrary owner address. Updates flow into the TanStack Query cache so useJettonsByAddress and useJettonBalanceByAddress pick up the new data automatically. Requires a streaming provider registered for the network — the hook exits silently with a console warning when none is configured.
ParameterTypeDescription
parameters*UseWatchJettonsByAddressParametersOwner address, update callback and optional network override.
parameters.addressUserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.onChange(update: JettonUpdate) => voidCallback fired on every jetton-balance update from the streaming provider.
parameters.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: void. Example
const address = 'UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ';
const { data: jettons } = useJettonsByAddress({ address });

useWatchJettonsByAddress({ address });

return (
    <div>
        <h3>Jettons for {address}:</h3>
        <ul>
            {jettons?.jettons.map((j) => (
                <li key={j.walletAddress}>
                    {j.info.name}: {j.balance}
                </li>
            ))}
        </ul>
    </div>
);

NFTs

useNft

React hook reading metadata and ownership for a single NFT through TanStack Query, keyed by its contract address. data is null when the indexer has no record.
ParameterTypeDescription
parametersUseNftParametersNFT address, optional network override, and TanStack Query overrides.
parameters.addressUserFriendlyAddress | AddressNFT contract address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseNftReturnType<selectData = GetNftData> — TanStack Query result for the NFT read. Example
const {
    data: nft,
    isLoading,
    error,
} = useNft({
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return (
    <div>
        <h3>NFT Details</h3>
        <p>Name: {nft?.info?.name}</p>
        <p>Collection: {nft?.collection?.name}</p>
        <p>Owner: {nft?.ownerAddress}</p>
    </div>
);

useNfts

React hook that reads NFTs held by the currently selected wallet through TanStack Query — auto-resolves the wallet address (use useNftsByAddress for an arbitrary address).
ParameterTypeDescription
parametersUseNFTsParametersOptional pagination, network override, and TanStack Query overrides.
parameters.addressUserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.limitnumberMaximum number of NFTs to return.
parameters.offsetnumberNumber of NFTs to skip before returning results — used for pagination.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseNFTsReturnType<selectData = GetNFTsData> — TanStack Query result for the NFTs read. Example
const {
    data: nfts,
    isLoading,
    error,
} = useNfts({
    limit: 10,
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return (
    <div>
        <h3>My NFTs</h3>
        <ul>
            {nfts?.nfts.map((nft) => (
                <li key={nft.address}>
                    {nft.info?.name} ({nft.collection?.name})
                </li>
            ))}
        </ul>
    </div>
);

useNftsByAddress

React hook that reads NFTs held by an arbitrary address through TanStack Query — useful for wallets that aren’t selected in AppKit (use useNfts for the selected wallet).
ParameterTypeDescription
parametersUseNFTsByAddressParametersOwner address, optional pagination and network override, plus TanStack Query overrides.
parameters.addressUserFriendlyAddress | AddressOwner address — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.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.
parameters.limitnumberMaximum number of NFTs to return.
parameters.offsetnumberNumber of NFTs to skip before returning results — used for pagination.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseNFTsByAddressReturnType<selectData = GetNFTsData> — TanStack Query result for the NFTs read. Example
const {
    data: nfts,
    isLoading,
    error,
} = useNftsByAddress({
    address: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
    limit: 10,
});

if (isLoading) {
    return <div>Loading...</div>;
}

if (error) {
    return <div>Error: {error.message}</div>;
}

return (
    <div>
        <h3>NFTs</h3>
        <ul>
            {nfts?.nfts.map((nft) => (
                <li key={nft.address}>
                    {nft.info?.name} ({nft.collection?.name})
                </li>
            ))}
        </ul>
    </div>
);

useTransferNft

Transfer an NFT from the selected wallet in one step — builds the ownership-transfer message and broadcasts it. Call mutate with an nftAddress, the recipientAddress, an optional amount (the TON attached for gas — defaults to AppKit’s NFT gas-fee constant when omitted) and an optional comment. On success, data carries the BoC and normalized hash of the broadcast transaction. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseTransferNftParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseTransferNftReturnType<context = unknown> — Mutation result for the transfer call. Example
const { mutate: transfer, isPending, error } = useTransferNft();

const handleTransfer = () => {
    transfer({
        nftAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
        recipientAddress: 'EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c',
        comment: 'Gift for you',
    });
};

return (
    <div>
        <button onClick={handleTransfer} disabled={isPending}>
            {isPending ? 'Transferring...' : 'Transfer NFT'}
        </button>
        {error && <div>Error: {error.message}</div>}
    </div>
);

Networks

useBlockNumber

React hook reading the latest masterchain seqno through TanStack Query — useful for freshness checks and pagination cursors.
ParameterTypeDescription
parametersUseBlockNumberParametersTanStack Query overrides and optional network.
parameters.networkNetworkNetwork to query. Defaults to mainnet when omitted.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseBlockNumberReturnType<selectData = GetBlockNumberData> — TanStack Query result for the seqno read.

useDefaultNetwork

Read and write AppKit’s default network — the network connectors use for new wallet connections. Returns a useState-style tuple. The read side updates when the default changes through any source (this hook, setDefaultNetwork, manager events). Returns: UseDefaultNetworkReturnType — Tuple [network, setNetwork].

useNetwork

Read the Network the selected wallet is connected to. Updates when the wallet’s network changes (e.g. user switches mainnet/testnet inside the wallet). Returns: UseNetworkReturnType — Selected wallet’s network, or undefined when no wallet is selected.

useNetworks

Read the list of networks configured on AppKit. Updates when AppKitNetworkManager adds, replaces or drops a network. Returns: UseNetworksReturnType — Array of configured Networks.

Settings

useAppKit

Read the AppKit instance hosted by AppKitProvider. Throws when the hook is rendered outside the provider tree. Returns: AppKit — The AppKit instance shared with descendant hooks/components.

useAppKitTheme

State hook that mirrors the active appkit-react theme to document.body[data-ta-theme] — returns a [theme, setTheme] tuple just like useState. Returns: readonly [string, Dispatch<SetStateAction<string>>] — Tuple [theme, setTheme] for reading and switching the active theme.

useI18n

Read the i18n context published by I18nProvider (or the wrapping AppKitProvider). Returns the active locale, translation function and helpers to switch locales or merge dictionaries. Throws when rendered outside the provider tree. Returns: I18nContextType — The i18n context (I18nContextType) with activeLocale, t, locale and addDict.

Signing

useSignBinary

Ask the selected wallet to sign an opaque binary blob (Base64-encoded), without on-chain structure. Call mutate from an event handler with the bytes to sign and an optional network override. On success, data carries the signature plus the signer address, timestamp and dApp domain the wallet bound to the signature. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseSignBinaryParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseSignBinaryReturnType<context = unknown> — Mutation result for the signing call.

useSignCell

Ask the selected wallet to sign a TON cell — typically so the signature can later be verified on-chain by a contract. Call mutate from an event handler with the cell content, a TL-B-style schema (used by the wallet to render the payload to the user before signing) and an optional network override. On success, data carries the signature plus the signer address, timestamp and dApp domain. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseSignCellParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseSignCellReturnType<context = unknown> — Mutation result for the signing call.

useSignText

Ask the selected wallet to sign a plain-text message — useful for off-chain login proofs and signed challenges. Call mutate from an event handler with the text to sign and an optional network override. On success, data carries the signature plus the canonicalized signer address, timestamp and dApp domain the wallet bound to the signature. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseSignTextParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseSignTextReturnType<context = unknown> — Mutation result for the signing call.

Staking

useBuildStakeTransaction

Build a stake/unstake TransactionRequest from a StakingQuote (obtained via useStakingQuote) without sending it — lets the UI inspect, batch, or pass the request to useSendTransaction separately. Call mutate(params) where params matches BuildStakeTransactionOptions (quote + user address, optional provider override). The resulting TransactionRequest is in data once the mutation resolves. Returns: UseBuildStakeTransactionReturnType<context = unknown> — Mutation result for the build call.

useStakedBalance

React hook reading a user’s staked balance from a staking provider through TanStack Query — total staked plus, depending on the provider, any instant-unstake balance available right now. 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.
ParameterTypeDescription
parametersUseStakedBalanceParametersOwner address, optional providerId, optional network override, and TanStack Query overrides.
parameters.userAddressUserFriendlyAddressOwner whose staked balance should be read.
parameters.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.
parameters.providerIdstringProvider to query. Defaults to the registered default staking provider.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseStakedBalanceReturnType<selectData = GetStakedBalanceData> — TanStack Query result for the staked-balance read.

useStakingContext

Reads the StakingContextType from the nearest StakingWidgetProvider (or StakingWidget). Outside a provider, returns the default context (empty inputs, no-op actions) so a custom UI can still mount without crashing. Returns: StakingContextType.

useStakingProvider

React hook returning a registered staking provider. Subscribes to provider-registry changes via watchStakingProviders and looks up by id, or returns the registered default when no id is given. Returns undefined when no provider matches and no default has been registered (where the underlying getStakingProvider action would throw).
ParameterTypeDescription
parametersUseStakingProviderParametersOptional provider id.
parameters.idstringProvider ID to look up. When omitted, returns the registered default staking provider.
Returns: UseStakingProviderReturnType — Matching staking provider instance, or undefined when none resolves.

useStakingProviderInfo

React hook reading live staking-pool info for a provider through TanStack Query — APY, instant-unstake liquidity and (for liquid staking) the current exchange rate. Use useStakingProviderMetadata for static metadata (name, stake/receive tokens, supported unstake modes). 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.
ParameterTypeDescription
parametersUseStakingProviderInfoParametersOptional providerId, network override, and TanStack Query overrides.
parameters.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.
parameters.providerIdstringProvider to query. Defaults to the registered default staking provider.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseStakingProviderInfoReturnType<selectData = GetStakingProviderInfoData> — TanStack Query result for the live provider info.

useStakingProviderMetadata

Read static metadata for a staking provider — display name, stake/receive tokens, supported unstake modes and contract address. Returns undefined when no provider matches and no default is registered. Use useStakingProviderInfo for live values (APY, instant-unstake liquidity, exchange rate). 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.
ParameterTypeDescription
parametersUseStakingProviderMetadataParametersOptional providerId and network override.
parameters.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.
parameters.providerIdstringProvider to query. Defaults to the registered default staking provider.
Returns: StakingProviderMetadata | undefined — Static StakingProviderMetadata, or undefined when the provider can’t be resolved.

useStakingProviders

React hook returning every staking provider registered on the AppKit instance (both those passed via config and those added later). Subscribes to provider-registry changes via watchStakingProviders. Returns: UseStakingProvidersReturnType — Array of registered staking providers.

useStakingQuote

Quote a stake or unstake — given an amount, direction ('stake' / 'unstake') and the target asset, returns the rate, expected output and the provider-specific metadata required to feed useBuildStakeTransaction. data is the StakingQuote payload. 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.
ParameterTypeDescription
parametersUseStakingQuoteParametersQuote parameters, optional providerId, optional network override, and TanStack Query overrides.
parameters.directionStakingQuoteDirectionDirection of the quote (stake or unstake)
parameters.amountstringAmount of tokens to stake or unstake.
parameters.userAddressUserFriendlyAddressAddress of the user.
parameters.networkNetworkNetwork on which the staking will be executed.
parameters.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.
parameters.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).
parameters.providerOptionsTProviderOptions = unknownProvider-specific options.
parameters.providerIdstringProvider to quote against. Defaults to the registered default staking provider.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseStakingQuoteReturnType<selectData = GetStakingQuoteData> — TanStack Query result for the quote read.

Swap

useBuildSwapTransaction

Build a swap TransactionRequest from a SwapQuote (obtained via useSwapQuote) without sending it — lets the UI inspect, batch, or pass the request to useSendTransaction separately. Call mutate(params) where params matches BuildSwapTransactionOptions (quote, user address, optional slippage/deadline overrides). The resulting TransactionRequest is in data once the mutation resolves.
ParameterTypeDescription
parametersUseBuildSwapTransactionParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseBuildSwapTransactionReturnType<context = unknown> — Mutation result for the build call.

useSwapContext

Reads the SwapContextType populated by the nearest SwapWidgetProvider (or the SwapWidget that mounts one). Outside a provider it returns the no-op default value. Returns: SwapContextType.

useSwapProvider

Read and switch the default swap provider — subscribes to watchSwapProviders and re-reads via getSwapProvider. Returns a useState-style tuple. The read swallows the throw from getSwapProvider (which throws when no provider matches — or when no id is passed and no default has been registered) and yields undefined instead. Returns: UseSwapProviderReturnType — Tuple [provider, setProviderId].

useSwapProviders

List every swap provider registered on the AppKit instance (both those passed via AppKitConfig’s providers and those added later through registerProvider). Subscribes to watchSwapProviders and re-reads via getSwapProviders so the array stays in sync. Returns: UseSwapProvidersReturnType — Array of registered swap providers.

useSwapQuote

Quote a swap — given source/target tokens and an amount, returns the rate, expected output and the provider-specific metadata required to feed useBuildSwapTransaction. data is the SwapQuote payload. The network field 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.
ParameterTypeDescription
parametersUseSwapQuoteParametersSource and target tokens, amount, optional network/provider override, and TanStack Query overrides.
parameters.amountstringAmount of tokens to swap (incoming or outgoing depending on isReverseSwap)
parameters.fromSwapTokenToken to swap from.
parameters.toSwapTokenToken to swap to.
parameters.networkNetworkNetwork on which the swap will be executed.
parameters.slippageBpsnumberSlippage tolerance in basis points (1 bp = 0.01%)
parameters.maxOutgoingMessagesnumberMaximum number of outgoing messages
parameters.providerOptionsTProviderOptions = unknownProvider-specific options.
parameters.isReverseSwapbooleanIf true, amount is the amount to receive (buy). If false, amount is the amount to spend (sell).
parameters.providerIdstringProvider to quote against. Defaults to the registered default swap provider.
parameters.queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.
Returns: UseSwapQuoteReturnType<selectData = GetSwapQuoteData> — TanStack Query result for the swap quote.

Transactions

useSendTransaction

Hand a pre-built TransactionRequest to the selected wallet for signing and broadcast — typically the second step after a buildX / createX action (e.g. useBuildSwapTransaction, useBuildStakeTransaction) produces the request. Call mutate(request). On success, data carries the BoC and normalized hash of the broadcast transaction. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseSendTransactionParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseSendTransactionReturnType<context = unknown> — Mutation result for the send call.

useTransactionStatus

Poll the status of a sent transaction by its BoC or normalized hash. In TON a single external message triggers a tree of internal messages, so the transaction is 'completed' only once the entire trace finishes — pair with refetchInterval to keep polling until data.status is 'completed' or 'failed'. Pass either boc or normalizedHash (not both). The underlying action throws Error('Either boc or normalizedHash must be provided') when neither is supplied — TanStack Query surfaces it via the query’s error.
ParameterTypeDescription
parameters*UseTransactionStatusParametersboc xor normalizedHash, optional network and TanStack Query overrides.
Returns: UseTransactionStatusReturnType<selectData = GetTransactionStatusData> — TanStack Query result for the status read.

useTransferTon

Send TON from the selected wallet in one step — builds the transfer message, hands it to the wallet for signing and broadcasts it. Call mutate with a recipientAddress, an amount (in TON as a human-readable decimal, converted to nano-TON internally) and any of the optional comment / payload / stateInit fields. On success, data carries the BoC and normalized hash of the broadcast transaction — pair with useTransactionStatus to poll the trace to completion. Throws Error('Wallet not connected') if no wallet is currently selected — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseTransferTonParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseTransferTonReturnType<context = unknown> — Mutation result for the transfer call.

useWatchTransactions

Subscribe to incoming-transaction events for the currently selected wallet (use useWatchTransactionsByAddress for a fixed address). Auto-rebinds when the user connects, switches or disconnects. Requires a streaming provider registered for the network — the hook exits silently with a console warning when none is configured.
ParameterTypeDescription
parametersUseWatchTransactionsParametersUpdate callback.
parameters.onChange(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.
Returns: void. Example
const [lastUpdate, setLastUpdate] = useState<TransactionsUpdate | null>(null);

useWatchTransactions({
    onChange: (update) => {
        setLastUpdate(update);
    },
});

return (
    <div>
        {lastUpdate ? (
            <div>
                Last update for: {lastUpdate.address}
                <br />
                Transactions count: {lastUpdate.transactions.length}
            </div>
        ) : (
            'Waiting for transactions...'
        )}
    </div>
);

useWatchTransactionsByAddress

Subscribe to incoming-transaction events for an arbitrary address (use useWatchTransactions for the selected wallet). Requires a streaming provider registered for the network — the hook exits silently with a console warning when none is configured.
ParameterTypeDescription
parameters*UseWatchTransactionsByAddressParametersAddress, update callback and optional network override.
parameters.addressUserFriendlyAddress | AddressAddress to watch — pass a UserFriendlyAddress string or an Address instance from @ton/core.
parameters.onChange(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.
parameters.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: void. Example
const address = 'UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ';
const [lastUpdate, setLastUpdate] = useState<TransactionsUpdate | null>(null);

useWatchTransactionsByAddress({
    address,
    onChange: (update) => {
        setLastUpdate(update);
    },
});

return (
    <div>
        {lastUpdate ? (
            <div>
                New transactions for: {lastUpdate.address}
                <br />
                Count: {lastUpdate.transactions.length}
            </div>
        ) : (
            'Waiting for transactions...'
        )}
    </div>
);

Wallets

useAddress

Read the user-friendly address of the currently selected wallet. Updates when the selection changes. Returns: UseAddressReturnType — Selected wallet’s address, or undefined when none is selected.

useConnect

Open a registered connector’s connection flow (e.g., the TonConnect modal) and await its completion. Call mutate from a Connect button with the connectorId of the connector to drive. Once the user finishes the flow the new wallet becomes available via useSelectedWallet / useConnectedWallets. Throws Error('Connector with id "<id>" not found') when no connector with that id is registered — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseConnectParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseConnectReturnType<context = unknown> — Mutation result for the connect call.

useConnectedWallets

Read the list of currently connected wallets across all registered connectors. Updates when a wallet connects or disconnects. Returns: UseConnectedWalletsReturnType — Read-only array of WalletInterfaces.

useDisconnect

Tear down the session on a registered connector, disconnecting whichever wallet it currently holds. Call mutate from a Log out / Disconnect button with the connectorId of the connector to tear down. Once it resolves the wallet drops out of useSelectedWallet / useConnectedWallets. Throws Error('Connector with id "<id>" not found') when no connector with that id is registered — TanStack Query surfaces it via the mutation’s error.
ParameterTypeDescription
parametersUseDisconnectParametersTanStack Query mutation overrides.
parameters.mutationMutationOptionsOverrideTanStack Query mutation options forwarded to useMutation (onSuccess, onError, onMutate, retry, …). mutationFn, mutationKey and throwOnError are managed by the wrapper.
Returns: UseDisconnectReturnType<context = unknown> — Mutation result for the disconnect call.

useSelectedWallet

Read and switch the wallet that AppKit treats as active — most action hooks (useBalance, useSignText, useTransferTon) target this wallet implicitly. Returns a useState-style tuple. Returns: UseSelectedWalletReturnType — Tuple [wallet, setWalletId].

Component

Balances

SendJettonButton

Pre-wired button that builds a jetton transfer with createTransferJettonTransaction and dispatches it through the standard Send flow on click — disabled until recipientAddress, amount, jetton.address and jetton.decimals are all set. Throws inside the click handler when jetton.address or jetton.decimals is missing.
PropTypeDescription
recipientAddress*stringRecipient address.
amount*stringAmount in jetton units as a human-readable decimal string. Converted to raw smallest units via jetton.decimals.
jetton*{ address: string; symbol: string; decimals: number; }Jetton master metadata — address (master contract), symbol (rendered in the button label) and decimals (used to format amount).
commentstringOptional human-readable comment attached to the transfer.
textReactNodeOverride the button label. Defaults to “Send”.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.
children(props: SendRenderProps) => ReactNodeCustom render function — replaces the default button with the caller’s UI. Receives the current send state and click handler via SendRenderProps.
onError(error: Error) => voidCalled when the wallet rejects the request or the send fails. Receives the raised Error.
onSuccess(response: SendTransactionReturnType) => voidCalled once the transaction is broadcast. Receives the wallet’s SendTransactionReturnType (BoC + normalized hash).
Example
return (
    <SendJettonButton
        recipientAddress="EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c"
        amount="5" // 5 USDT (human-readable format)
        comment="Payment for services"
        jetton={{
            address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs', // USDT
            symbol: 'USDT',
            decimals: 6,
        }}
        onSuccess={(result) => console.log('Transaction sent:', result)}
        onError={(error) => console.error('Transaction failed:', error)}
    />
);

SendTonButton

Pre-wired button that builds a TON transfer with createTransferTonTransaction and dispatches it through the standard Send flow on click — disabled until both recipientAddress and amount are set.
PropTypeDescription
recipientAddress*stringRecipient address.
amount*stringAmount in TON as a human-readable decimal string (e.g., "1.5"). Converted to nano-TON internally.
commentstringOptional human-readable comment attached to the transfer.
textReactNodeOverride the button label. Defaults to “Send”.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.
children(props: SendRenderProps) => ReactNodeCustom render function — replaces the default button with the caller’s UI. Receives the current send state and click handler via SendRenderProps.
onError(error: Error) => voidCalled when the wallet rejects the request or the send fails. Receives the raised Error.
onSuccess(response: SendTransactionReturnType) => voidCalled once the transaction is broadcast. Receives the wallet’s SendTransactionReturnType (BoC + normalized hash).
Example
return (
    <SendTonButton
        recipientAddress="EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c"
        amount="1" // 1 TON (human-readable format)
        comment="Hello from AppKit"
        onSuccess={(result) => console.log('Transaction sent:', result)}
        onError={(error) => console.error('Transaction failed:', error)}
    />
);

Crypto Onramp

CryptoOnrampWidget

Drop-in widget for buying TON-side tokens with a crypto payment from another chain — wraps CryptoOnrampWidgetProvider (which drives token/method selection, quote fetching, deposit creation and status polling) around CryptoOnrampWidgetUI. Pass a children render function to swap in a fully custom UI while keeping the same provider state.
PropTypeDescription
children(props: CryptoOnrampWidgetRenderProps) => ReactNodeCustom render function. When provided, replaces the default CryptoOnrampWidgetUI and is called with the full CryptoOnrampWidgetRenderProps (context state, actions and forwarded <div> props), so callers can build a fully custom UI on top of the same provider.
tokensCryptoOnrampToken[]Target tokens (what the user buys on TON). Defaults to a built-in list.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
paymentMethodsCryptoPaymentMethod[]Source crypto payment methods (what the user pays with on another chain). Defaults to a built-in list.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
chainsRecord<string, ChainInfo>Custom CAIP-2 → chain display info overrides. Merged on top of the built-in defaults, so consumers only need to provide what they want to override or add — for example, a single entry keyed by 'eip155:42161' with a name of 'Arbitrum' and a logo URL.
defaultTokenIdstringID of the target token pre-selected on mount.
defaultMethodIdstringID of the source payment method pre-selected on mount.
Example
// Uses built-in defaults for tokens, payment methods and chain display info.
// Make sure a crypto-onramp provider (Layerswap / swaps.xyz) is registered on AppKit.
return <CryptoOnrampWidget defaultTokenId="ton" />;

CryptoOnrampWidgetProvider

Context provider that powers the crypto-to-TON onramp widget — wires together token/method selection state, quote fetching (useCryptoOnrampQuote), deposit creation (useCreateCryptoOnrampDeposit), deposit status polling (useCryptoOnrampStatus), the target-token balance and validation. Consumers read the state via useCryptoOnrampContext.
PropTypeDescription
tokensCryptoOnrampToken[]Target tokens (what the user buys on TON). Defaults to a built-in list.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
paymentMethodsCryptoPaymentMethod[]Source crypto payment methods (what the user pays with on another chain). Defaults to a built-in list.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
chainsRecord<string, ChainInfo>Custom CAIP-2 → chain display info overrides. Merged on top of the built-in defaults, so consumers only need to provide what they want to override or add — for example, a single entry keyed by 'eip155:42161' with a name of 'Arbitrum' and a logo URL.
defaultTokenIdstringID of the target token pre-selected on mount.
defaultMethodIdstringID of the source payment method pre-selected on mount.

CryptoOnrampWidgetUI

Presentational UI for the crypto-to-TON onramp widget — renders the from/to selectors, amount input with presets, continue button, info block (you-get / balance / provider) and the token-pick / method-pick / refund-address / deposit modals. All state and actions come from props (CryptoOnrampWidgetRenderProps). Typically rendered inside CryptoOnrampWidgetProvider via CryptoOnrampWidget.
PropTypeDescription
tokens*CryptoOnrampToken[]Full list of target tokens the user can buy.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
selectedToken*CryptoOnrampToken | nullCurrently selected target token to buy. null until tokens load.
setSelectedToken*(token: CryptoOnrampToken) => voidUpdates selectedToken.
paymentMethods*CryptoPaymentMethod[]Available source crypto payment methods.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
selectedMethod*CryptoPaymentMethodCurrently selected source payment method.
setSelectedMethod*(method: CryptoPaymentMethod) => voidUpdates selectedMethod.
chains*Record<string, ChainInfo>CAIP-2 → chain display info map (built-in defaults merged with consumer overrides).
amount*stringCurrent amount input value as a decimal string.
setAmount*(value: string) => voidUpdates amount.
amountInputMode*CryptoAmountInputModeWhich side amount is denominated in — see CryptoAmountInputMode.
setAmountInputMode*(mode: CryptoAmountInputMode) => voidUpdates amountInputMode.
convertedAmount*stringOther side of amount after applying the current quote’s rate.
presetAmounts*OnrampAmountPreset[]Quick-pick amount buttons rendered in the widget.
quote*CryptoOnrampQuote | nullCurrent quote, or null if not yet fetched / invalidated.
isLoadingQuote*booleanWhether a quote is in flight (includes the input-debounce window).
quoteError*string | nullQuote-side validation/fetch error as an i18n key, or null.
quoteProviderName*string | nullDisplay name of the provider behind the current quote, when available.
deposit*CryptoOnrampDeposit | nullCurrent deposit returned by the provider once createDeposit succeeded.
isCreatingDeposit*booleanWhether createDeposit is in flight.
depositError*string | nullDeposit-side error as an i18n key, or null.
depositAmount*stringFormatted deposit amount the user must send on the source chain.
createDeposit*() => voidTriggers deposit creation from the current quote.
depositStatus*CryptoOnrampStatus | nullLatest deposit status polled via useCryptoOnrampStatus, or null.
isRefundAddressRequired*booleanWhether the current quote provider requires a refund address before deposit.
isReversedAmountSupported*booleanWhether the current quote provider supports reversed (target-amount) input.
refundAddress*stringRefund address the user typed, if isRefundAddressRequired.
setRefundAddress*(address: string) => voidUpdates refundAddress.
targetBalance*stringConnected wallet’s balance of the selected target token (formatted, token units).
isLoadingTargetBalance*booleanWhether the target token balance is being fetched.
isWalletConnected*booleanWhether a TON wallet is currently connected.
canContinue*booleanWhether the user can proceed — valid amount, quote available, and wallet connected.
onReset*() => voidInvalidates the active quote and clears the deposit, returning the widget to its initial state.

NFTs

NftItem

Card-style button rendering an NFT’s image, name and collection name with an “On Sale” badge when applicable — falls back to a placeholder icon when the image is missing or fails to load.
PropTypeDescription
nft*NFTNFT to render — name, collection name, image and on-sale state are derived via getFormattedNftInfo.
Example
return <NftItem nft={sampleNft} onClick={() => console.log('NFT clicked')} />;

Providers

AppKitProvider

Top-level React provider that wires AppKit, the TonConnect bridge and i18n into the component tree — wrap your app once near the root so descendant hooks (useAppKit, useBalance, …) and components can resolve their context.
PropTypeDescription
appKit*AppKitRuntime instance constructed at app startup. Shared across every appkit-react hook and component.
Example
return (
    <AppKitProvider appKit={appKit}>
        <h1>My App</h1>
        {/* Your App Content */}
    </AppKitProvider>
);

I18nProvider

React provider that mounts the i18n context for useI18n and child components — already wrapped by AppKitProvider, so apps usually only render it directly when they need to override the locale or dictionaries.
PropTypeDescription
localestringInitial locale code. Defaults to the i18n library’s default when omitted.
lngDictsRecord<string, Dict>Translation dictionaries keyed by locale. Loaded into the underlying i18n instance on mount.
Example
// Override the locale. Pass `lngDicts` with your own translations when you need them.
return (
    <I18nProvider locale="en">
        <div>My App</div>
    </I18nProvider>
);

Shared

AmountPresets

Horizontal row of preset amount buttons — typically used next to an amount input to offer quick fills.
PropTypeDescription
presets*AmountPreset[]Preset buttons to render, in order.
currencySymbolstringOptional symbol (e.g., "$") prepended to each preset label.
onPresetSelect*(value: string) => voidCalled with the selected preset’s amount unless the preset defines its own onSelect.
Example
return (
    <div>
        <input value={amount} onChange={(e) => setAmount(e.target.value)} placeholder="Amount" />
        <AmountPresets presets={presets} currencySymbol="$" onPresetSelect={setAmount} />
    </div>
);

CopyButton

Icon-only button that copies value to the clipboard on click and flips its icon to a checkmark for a short confirmation window.
PropTypeDescription
value*stringText written to the clipboard when the button is clicked.
aria-label*stringAccessible label for screen readers.
Example
return <CopyButton value="EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c" aria-label="Copy wallet address" />;

CurrencyItem

Compound row used inside currency/token select lists: shows a token logo, name + ticker, optional verified badge, and an optional balance / under-balance on the right. Pass top-level props for the default layout, or pass children made of the sub-components for full control. Members
MemberDescription
CurrencyItem.ContainerRoot <button> wrapper — receives all native button props.
CurrencyItem.LogoToken logo cell rendered as a 40px Logo.
CurrencyItem.InfoVertical block holding the CurrencyItem.Header and CurrencyItem.Ticker.
CurrencyItem.VerifiedBadgeVerified checkmark badge — rendered next to the name when isVerified is set.
CurrencyItem.HeaderTop line of Info (name + verified badge).
CurrencyItem.NamePrimary text line — defaults to the token name, falling back to the ticker when no name is provided.
CurrencyItem.TickerSecondary text line — renders the ticker, and when both ticker and name are present appends followed by the name.
CurrencyItem.RightSideRight-aligned column for balance values.
CurrencyItem.MainBalancePrimary balance number (top of RightSide).
CurrencyItem.UnderBalanceSecondary balance value (e.g., fiat) shown under MainBalance.
Example
// Top-level props give you the default layout in one line.
return (
    <CurrencyItem
        ticker="USDT"
        name="Tether USD"
        icon="https://cdn.example.com/usdt.png"
        balance="1,234.56"
        underBalance="≈ $1,234.56"
        isVerified
        onClick={() => console.log('Picked USDT')}
    />
);

CurrencySelect

Compound currency-select primitives — compose CurrencySelect.Modal with a CurrencySelect.Search and CurrencySelect.ListContainer of CurrencySelect.Section rows to build a custom token picker. For a ready-made implementation see TokenSelectModal. Members
MemberDescription
CurrencySelect.ModalModal wrapper.
CurrencySelect.SearchAuto-focused search input row.
CurrencySelect.ListContainerScrollable list area with built-in empty state.
CurrencySelect.SectionHeaderHeader label rendered above a section.
CurrencySelect.SectionContainer for a group of currency rows.

LowBalanceModal

Modal shown when a transaction would leave insufficient TON to cover fees — adapts its body and buttons to the LowBalanceMode.
PropTypeDescription
open*booleanControls visibility of the modal.
mode*LowBalanceModereduce — user can fix it by reducing the amount (shows Change/Cancel). topup — reducing doesn’t help, user must top up TON (shows Close only).
requiredTon*stringRequired amount in TON, formatted as a decimal string (e.g. "0.423").
onChange*() => voidCalled when the user clicks the primary “Change” action (only in reduce mode).
onCancel*() => voidCalled when the user dismisses the modal (Cancel, Close, or backdrop click).
Example
return (
    <LowBalanceModal
        open={open}
        mode="reduce"
        requiredTon="0.423"
        onChange={() => {
            console.log('Reduce amount to fit balance');
            setOpen(false);
        }}
        onCancel={() => setOpen(false)}
    />
);

OptionSwitcher

Compact dropdown selector — renders the current option’s label and a chevron, opening a Select popover with the remaining choices. Falls back to the raw value or "—" when no option matches.
PropTypeDescription
value*string | undefinedCurrently selected option value.
options*OptionSwitcherOption[]Available options.
onChange*(value: string) => voidCalled when the user picks an option.
disabledbooleanWhen true, the trigger is non-interactive and dimmed.
classNamestringExtra class applied to the trigger button.
Example
return <OptionSwitcher value={value} options={options} onChange={setValue} />;

SettingsButton

Icon-only secondary button with a sliders icon — drop-in trigger for opening settings panels.
PropTypeDescription
onClick() => voidClick handler — typically used to open a settings modal.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.
Example
return <SettingsButton onClick={() => console.log('Open settings')} />;

TokenSelectModal

Ready-made token picker modal — renders a search field and a sectioned list of CurrencyItem rows backed by CurrencySelect. Search matches by symbol, name, or exact address. Selecting a row fires onSelect, closes the modal, and resets the search.
PropTypeDescription
open*booleanControls modal visibility.
onClose*() => voidCalled when the modal is dismissed (selection, backdrop click, or escape).
tokens*T = AppkitUIToken[]Full set of tokens available for selection and search.
tokenSectionsTokenSectionConfig[]Optional sectioning rules. When omitted, all tokens render as a single untitled section.
onSelect*(token: T = AppkitUIToken) => voidCalled with the picked token. The modal closes and resets its search on selection.
title*stringModal header title.
searchPlaceholderstringPlaceholder shown inside the search input.
Example
return (
    <TokenSelectModal
        open={open}
        onClose={() => setOpen(false)}
        tokens={tokens}
        title="Select a token"
        searchPlaceholder="Search by name or address"
        onSelect={(token) => {
            console.log('Picked:', token.symbol);
            setOpen(false);
        }}
    />
);

TokenSelector

Compact pill button used as the trigger for a token picker — shows the token icon (optionally with a network badge), its symbol, and a chevron unless readOnly is set.
PropTypeDescription
title*stringLabel shown next to the icon — typically the token symbol.
iconstringToken logo URL.
iconFallbackstringSingle-character fallback used when icon fails to load. Defaults to the first character of title.
networkIconstringWhen provided, renders a network badge overlay on the icon.
readOnlybooleanHide chevron and suppress click handling — use when there’s nothing to pick.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
Example
return (
    <TokenSelector
        title="TON"
        icon="https://ton.org/download/ton_symbol.png"
        iconFallback="T"
        onClick={() => console.log('Open token picker')}
    />
);

Staking

SelectUnstakeMode

Collapsible selector for the unstake mode (instant / round-end / when-available). Filters options by providerMetadata.supportedUnstakeModes and renders nothing when only one mode is supported. Annotates the instant option with the provider’s current instant-unstake limit.
PropTypeDescription
value*UnstakeModesCurrently selected unstake mode (see UnstakeMode).
onValueChange*(mode: UnstakeModes) => voidCalled when the user picks a different mode.
providerInfo*StakingProviderInfo | undefinedDynamic provider info — used to show the instant-unstake limit when available.
providerMetadata*StakingProviderMetadata | undefinedStatic provider metadata — supplies supportedUnstakeModes and stake-token formatting.
Example
return (
    <SelectUnstakeMode
        value={mode}
        onValueChange={setMode}
        providerMetadata={tonstakersMetadata}
        providerInfo={undefined}
    />
);

StakingBalanceBlock

Row showing the user’s relevant balance for the current direction: wallet balance of the stake token when staking, staked balance when unstaking. Renders a token icon (native TON when the token address is 'ton', otherwise a jetton icon resolved via useJettonInfo), a label, the formatted amount with ticker, and an optional MAX button.
PropTypeDescription
providerMetadata*StakingProviderMetadata | undefinedProvider metadata — supplies the stake/receive tokens (address, ticker, decimals).
direction*StakingQuoteDirectionOperation direction. Selects which token and balance to render.
stakedBalancestringUser’s currently staked amount, used when direction === 'unstake'.
isStakedBalanceLoadingbooleanTrue while the staked balance is being fetched.
balancestringUser’s wallet balance of the stake token, used when direction === 'stake'.
isBalanceLoadingbooleanTrue while the wallet balance is being fetched.
onMaxClick() => voidWhen provided, renders a MAX button that invokes this callback.
Example
return (
    <StakingBalanceBlock
        providerMetadata={tonstakersMetadata}
        direction="stake"
        balance="12.5"
        onMaxClick={() => console.log('Use max balance')}
    />
);

StakingInfo

Summary block rendered below the staking input. Shows the amount the user will receive, the provider’s current APY, the stake-token to receive-token exchange rate (only when the provider has a receive token), and the provider name. The exchange-rate row always reads as 1 stakeToken = X receiveToken, regardless of direction.
PropTypeDescription
quote*StakingQuote | undefinedCurrent staking quote — its amountOut is rendered in the “You get” row.
isQuoteLoading*booleanTrue while the quote is being fetched. Swaps the “You get” value for a skeleton.
providerInfo*StakingProviderInfo | undefinedDynamic provider info — supplies APY and exchange rate.
providerMetadata*StakingProviderMetadata | undefinedStatic provider metadata — supplies token tickers/decimals and the provider name.
isProviderInfoLoading*booleanTrue while provider info is being fetched.
directionStakingQuoteDirectionOperation direction — controls which token’s decimals/ticker label the “You get” amount. Defaults to 'stake'.

StakingSettingsModal

Modal that lets the user pick the active staking provider. The selection is staged locally and only committed via onProviderChange when the user presses Save. Closing the modal otherwise discards the change. Each option is labeled with the provider’s metadata name, falling back to its providerId if metadata is unavailable on the given network.
PropTypeDescription
open*booleanControls modal visibility.
onClose*() => voidCalled when the user dismisses the modal or after a successful save.
provider*StakingProvider | undefinedCurrently active staking provider — used to preselect the option when the modal opens.
providers*StakingProvider[]All registered staking providers to choose from.
onProviderChange*(providerId: string) => voidInvoked with the chosen providerId when the user saves a different selection.
networkNetworkNetwork used to resolve each provider’s display name via its metadata.
Example
// Source `provider` and `providers` from `useStakingProvider` and
// `useStakingProviders` in real usage — they refresh as providers register
// through AppKit.
const provider: StakingProvider | undefined = undefined;
const providers: StakingProvider[] = [];
return (
    <StakingSettingsModal
        open={open}
        onClose={() => setOpen(false)}
        provider={provider}
        providers={providers}
        onProviderChange={(id) => console.log('Switch to', id)}
        network={Network.mainnet()}
    />
);

StakingWidget

High-level staking widget that wires the full stake/unstake flow: pick a provider, enter an amount (with optional reverse input on supported providers), review the quote (APY, exchange rate, “you get”), then submit the transaction. Internally wraps StakingWidgetProvider around StakingWidgetUI. Consumers can replace the UI by passing a render-prop children while keeping the widget’s state, quoting, balance checks, and submission logic.
PropTypeDescription
children(props: StakingWidgetRenderProps) => ReactNodeOptional render-prop. When provided, the default StakingWidgetUI is bypassed and this function is called with the full StakingWidgetRenderProps (context state + forwarded <div> props), letting consumers build a custom UI on top of the widget’s internal logic.
networkNetworkNetwork used for quote fetching, balance reads, and transactions. Falls back to the connected wallet’s network when omitted.
Example
// Falls back to the connected wallet's network when `network` is omitted.
// Make sure a staking provider (e.g. Tonstakers) is registered on AppKit.
return <StakingWidget />;

StakingWidgetProvider

Headless provider that drives the staking-widget flow — owns the input state (amount, direction, unstake mode, reverse-input toggle), fetches quotes and balances, validates the input, and builds + submits the transaction with a low-balance guard. Children read everything through useStakingContext; pair with StakingWidgetUI (or pass a custom UI to StakingWidget’s children).
PropTypeDescription
networkNetworkNetwork used for quote fetching, balance reads, and transactions. Falls back to the connected wallet’s network when omitted.

StakingWidgetUI

Default staking-widget UI. Renders a stake/unstake tabbed layout: a centered amount input with optional reversed input, a StakingBalanceBlock for the relevant balance, the submit button (wired through ButtonWithConnect so a disconnected user is prompted to connect first), a settings button that opens StakingSettingsModal, the unstake-mode picker (SelectUnstakeMode, unstake tab only), and a StakingInfo summary. A LowBalanceModal surfaces when the built transaction would exceed the user’s TON balance. All state is consumed from props — typically supplied by StakingWidgetProvider.
PropTypeDescription
amount*stringAmount the user wants to stake (string to preserve input UX)
canSubmit*booleanWhether the user can proceed with staking (checks balance, amount validity, etc.)
quote*StakingQuote | undefinedRaw staking quote from the provider
isQuoteLoading*booleanTrue while the stake quote is being fetched
error*string | nullCurrent validation/fetch error for staking, null when everything is ok
providerInfo*StakingProviderInfo | undefinedStaking provider dynamic info (APY, instant unstake availability, etc.)
providerMetadata*StakingProviderMetadata | undefinedStaking provider static metadata
stakingProvider*StakingProvider | undefinedCurrently selected staking provider (defaults to the first registered one)
stakingProviders*StakingProvider[]All registered staking providers
setStakingProviderId*(providerId: string) => voidUpdates the selected staking provider
network*Network | undefinedNetwork the widget is operating on (resolved from prop or wallet)
direction*StakingQuoteDirectionCurrent operation direction: ‘stake’ or ‘unstake’
isProviderInfoLoading*booleanTrue while provider info is being fetched
balance*string | undefinedBase balance (native or jetton) available for staking
isBalanceLoading*booleanTrue while base balance is being fetched
stakedBalance*StakingBalance | undefinedUser’s currently staked balance
isStakedBalanceLoading*booleanTrue while staked balance is being fetched
unstakeMode*UnstakeModesSelected unstake-timing mode — 'INSTANT', 'WHEN_AVAILABLE', or 'ROUND_END'. See UnstakeMode.
setAmount*(amount: string) => voidSets the input amount
setUnstakeMode*(mode: UnstakeModes) => voidSets the unstake mode
sendTransaction*() => Promise<void>Triggers the staking/unstaking transaction
onChangeDirection*(direction: StakingQuoteDirection) => voidChanges the direction (stake/unstake)
isSendingTransaction*booleanTrue while a transaction is being processed
isReversed*booleanTrue if the user is inputting the output amount (“I want to get X”)
toggleReversed*() => voidToggles between inputting from amount and output amount
reversedAmount*stringAmount displayed in the reversed (bottom) input
onMaxClick*() => voidSets the input amount to the maximum available balance (leaves room for TON gas on native stake)
isLowBalanceWarningOpen*booleanTrue when the built transaction outflow exceeds the user’s TON balance
lowBalanceMode*'reduce' | 'topup'reduce when the outgoing token is TON (user can fix by changing amount), topup otherwise.
lowBalanceRequiredTon*stringRequired TON amount for the pending operation, formatted as a decimal string. Empty when no pending op.
onLowBalanceChange*() => voidReplace the input with a value that fits within the current TON balance and close the warning.
onLowBalanceCancel*() => voidDismiss the low-balance warning without changing the input.

Swap

SwapField

One row of the swap form. Renders the amount input, fiat conversion, balance line, and a token-selector chip. The pay variant is editable and exposes a “max” shortcut. The receive variant is read-only and shows the quote result.
PropTypeDescription
type*'pay' | 'receive'pay renders the editable source row with a “max” shortcut. receive renders the read-only target row.
amount*stringCurrent amount shown in the input as a human-readable decimal string.
fiatSymbolstringFiat currency symbol displayed in front of the converted value. Defaults to "$".
tokenAppkitUITokenCurrently selected token. Controls the token selector label, balance formatting and fiat conversion.
onAmountChange(value: string) => voidCalled with the raw input value when the user edits the amount. Only fired for type: "pay".
balancestringFormatted balance of token for the active wallet, as a human-readable decimal string. Rendered in the balance line beneath the input.
isBalanceLoadingbooleanWhen true, the balance area renders a skeleton placeholder instead of the value.
loadingbooleanWhen true, the underlying input renders its loading state — used while a fresh quote is in flight.
onMaxClick() => voidCalled when the user clicks the “max” shortcut to fill the maximum spendable amount.
onTokenSelectorClick() => voidCalled when the user clicks the token selector chip — typically opens a SwapTokenSelectModal.
sizeInputSizeSize token applied to the input control(s) inside: `‘s''m''l’. Defaults to ’m’`.
variantInputVariantVisual variant: 'default' paints a filled field. 'unstyled' drops the chrome.
disabledbooleanWhen true, descendant input controls are disabled.
errorbooleanWhen true, the field renders in error styling and Input.Caption switches to error text.
resizablebooleanWhen true, Input.Input scales its font down to fit the available width as the user types.
Example
return (
    <SwapField
        type="pay"
        amount={amount}
        onAmountChange={setAmount}
        token={ton}
        balance="12.5"
        onMaxClick={() => setAmount('12.5')}
        onTokenSelectorClick={() => console.log('Open token picker')}
    />
);

SwapFlipButton

Round button rendered between the source and target SwapField rows. Clicking it flips the selected tokens. Visual rotation is driven by rotated.
PropTypeDescription
onClick() => voidCalled when the user clicks the button. Wire this to a handler that swaps the source/target tokens (e.g. onFlip from the swap context).
rotatedbooleanWhen true, the icon is drawn in its rotated state — used to animate between flips.
Example
// Drop it between the source and target `SwapField` rows. Wire `onClick` to your token-flip handler.
return <SwapFlipButton rotated={rotated} onClick={() => setRotated((prev) => !prev)} />;

SwapInfo

Summary block rendered under the swap form. Shows the minimum amount the user is guaranteed to receive after slippage, the configured slippage tolerance, and the active SwapProvider.
PropTypeDescription
toToken*AppkitUIToken | nullTarget token the user is receiving. Used to format minReceived with the right decimals and symbol.
slippage*numberSlippage tolerance in basis points (100 = 1%). Rendered as a percentage.
providerSwapProviderCurrent SwapProvider. Its display name is shown in the provider row.
quoteSwapQuoteQuote whose minReceived value is displayed. When undefined the value falls back to 0 (still suffixed with the token symbol).
isQuoteLoadingbooleanWhen true, the minimum-received value renders a skeleton placeholder instead of the formatted number.
Example
// In the swap widget `quote` and `provider` come from `useSwapContext`; until
// those resolve the min-received row shows `0 USDT` and the provider row a
// skeleton placeholder.
return <SwapInfo toToken={toToken} slippage={100} />;

SwapWidget

Drop-in swap UI that walks the user through picking the source/target tokens, entering an amount, reviewing the quote (rate, min-received, slippage, provider), and confirming the swap — which builds the transaction via useBuildSwapTransaction and dispatches it through the standard send flow. Internally mounts a SwapWidgetProvider so the rendered UI (default SwapWidgetUI or a custom children render-prop) can read state through useSwapContext.
PropTypeDescription
children(props: SwapWidgetRenderProps) => ReactNodeOptional render-prop receiving the full swap context plus the forwarded <div> props. When supplied it replaces the default SwapWidgetUI.
networkNetworkNetwork used for quote fetching and balance reads. When omitted, falls back to the selected wallet’s network via useNetwork.
tokens*AppkitUIToken[]Full list of tokens available for swapping in the UI. Filtered to the active network internally.
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens inside the SwapTokenSelectModal.
defaultFromSymbolstringSymbol of the token pre-selected as the source on first mount (e.g. "TON").
defaultToSymbolstringSymbol of the token pre-selected as the target on first mount.
fiatSymbolstringFiat currency symbol displayed next to converted amounts. Defaults to "$".
defaultSlippagenumberInitial slippage tolerance in basis points (100 = 1%). Defaults to 100.
Example
// Make sure a swap provider (e.g. DeDust / Omniston) is registered on AppKit.
return <SwapWidget tokens={tokens} defaultFromSymbol="TON" defaultToSymbol="USDT" defaultSlippage={100} />;

SwapWidgetProvider

Provider that wires up the full swap state machine — debounces the entered amount, fetches the quote via useSwapQuote, reads source/target balances, validates the input, exposes the active SwapProvider, and offers sendSwapTransaction which builds the transaction with useBuildSwapTransaction and sends it (raising the low-balance warning when the outflow exceeds the user’s TON balance). Children read everything through useSwapContext.
PropTypeDescription
tokens*AppkitUIToken[]Full list of tokens available for swapping in the UI. Filtered to the active network internally.
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens inside the SwapTokenSelectModal.
defaultFromSymbolstringSymbol of the token pre-selected as the source on first mount (e.g. "TON").
defaultToSymbolstringSymbol of the token pre-selected as the target on first mount.
networkNetworkNetwork used for quote fetching and balance reads. When omitted, falls back to the selected wallet’s network via useNetwork.
fiatSymbolstringFiat currency symbol displayed next to converted amounts. Defaults to "$".
defaultSlippagenumberInitial slippage tolerance in basis points (100 = 1%). Defaults to 100.

SwapWidgetUI

Default visual implementation of the swap widget — composes SwapField (source, then target), a SwapFlipButton between them, the submit button (auto-prompts wallet connect when no wallet is selected), the settings trigger that opens SwapSettingsModal, a SwapTokenSelectModal for picking source/target tokens, the SwapInfo summary, and a low-balance warning. Drives all state from the swap context props it receives — pair with SwapWidgetProvider, or use SwapWidget which mounts both.
PropTypeDescription
tokens*AppkitUIToken[]Full list of available tokens for swapping
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens in the selector
fromToken*AppkitUIToken | nullCurrently selected source token
toToken*AppkitUIToken | nullCurrently selected target token
fromAmount*stringAmount the user wants to swap (string to preserve input UX)
toAmount*stringCalculated receive amount from the current quote
fiatSymbol*stringFiat currency symbol for price display, e.g. ”$“
fromBalance*string | undefinedUser’s balance of the “from” token
toBalance*string | undefinedUser’s balance of the “to” token
isFromBalanceLoading*booleanTrue while the “from” balance is being fetched
isToBalanceLoading*booleanTrue while the “to” balance is being fetched
canSubmit*booleanWhether the user can proceed with the swap (checks balance, amount, quote)
quote*GetSwapQuoteData | undefinedRaw swap quote from the provider
isQuoteLoading*booleanTrue while the quote is being fetched from the API
error*string | nullCurrent validation or fetch error, null when everything is ok
slippage*numberSlippage tolerance in basis points (100 = 1%)
swapProvider*SwapProvider | undefinedCurrently selected swap provider (defaults to the first registered one)
swapProviders*SwapProvider[]All registered swap providers
setSwapProviderId*(providerId: string) => voidUpdates the selected swap provider
setFromToken*(token: AppkitUIToken) => voidUpdates the source token
setToToken*(token: AppkitUIToken) => voidUpdates the target token
setFromAmount*(amount: string) => voidUpdates the swap amount
setSlippage*(slippage: number) => voidUpdates the slippage tolerance
onFlip*() => voidSwaps source and target tokens
onMaxClick*() => voidSets the “from” amount to the maximum available balance
sendSwapTransaction*() => Promise<void>Executes the swap transaction
isSendingTransaction*booleanTrue while a transaction is being built or sent
isLowBalanceWarningOpen*booleanTrue when the built transaction outflow exceeds the user’s TON balance
lowBalanceMode*'reduce' | 'topup'reduce when the outgoing token is TON (user can fix by changing amount), topup otherwise.
lowBalanceRequiredTon*stringRequired TON amount for the pending operation, formatted as a decimal string. Empty when no pending op.
onLowBalanceChange*() => voidReplace the input with a value that fits within the current TON balance and close the warning.
onLowBalanceCancel*() => voidDismiss the low-balance warning without changing the input.

UI

Block

Flex container primitive — renders a <div> that lays its children out vertically ('column') or horizontally ('row').
PropTypeDescription
direction'row' | 'column'Flex direction of the block. Defaults to 'column'.
Example
return (
    <Block direction="row">
        <span>Left</span>
        <span>Right</span>
    </Block>
);

Button

Themed <button> with size, border-radius, and variant tokens. Renders an optional leading icon, swaps content for a spinner while loading, and is disabled whenever disabled or loading is true.
PropTypeDescription
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.
Example
return (
    <Button size="m" variant="fill" onClick={() => console.log('Clicked')}>
        Send transaction
    </Button>
);

CenteredAmountInput

Center-aligned, auto-resizing amount input with optional leading symbol and trailing ticker. Scales the font down to fit the container when the rendered text overflows, and clicking the wrapper focuses the input.
PropTypeDescription
value*stringControlled input value (decimal string).
onValueChange*(value: string) => voidCalled with the new string whenever the user edits the input.
tickerstringOptional trailing ticker label (e.g., 'TON').
symbolstringOptional leading currency symbol (e.g., '$').
placeholderstringPlaceholder shown when value is empty. Defaults to '0'.
disabledbooleanWhen true, the underlying <input> is disabled.
Example
return <CenteredAmountInput value={amount} onValueChange={setAmount} ticker="TON" placeholder="0" />;

Collapsible

Animated collapsible container — transitions its height between 0 and the content’s natural height when open toggles. Sets aria-hidden to mirror the open state.
PropTypeDescription
open*booleanWhen true, the content is expanded. When false, it is collapsed to zero height.
Example
return (
    <div>
        <button onClick={() => setOpen((prev) => !prev)}>{open ? 'Hide details' : 'Show details'}</button>
        <Collapsible open={open}>
            <p>Hidden details about the transaction.</p>
        </Collapsible>
    </div>
);

InfoBlock

Compound component for rendering a stacked list of label/value rows (e.g., transaction details, settings summaries). Sub-components forward extra props to the underlying DOM element so callers can layer custom classes and handlers. Members
MemberDescription
InfoBlock.ContainerOuter wrapper — vertical container that hosts the rows.
InfoBlock.RowHorizontal row that pairs a label with a value.
InfoBlock.LabelLabel cell — typically the muted descriptor on the left.
InfoBlock.ValueValue cell — typically the emphasized content on the right.
InfoBlock.LabelSkeletonSkeleton placeholder for a InfoBlock.Label while data is loading. Defaults to width=64, height='1lh'.
InfoBlock.ValueSkeletonSkeleton placeholder for a InfoBlock.Value while data is loading. Defaults to width=80, height='1lh'.
Example
return (
    <InfoBlock.Container>
        <InfoBlock.Row>
            <InfoBlock.Label>Rate</InfoBlock.Label>
            <InfoBlock.Value>1 TON$5.43</InfoBlock.Value>
        </InfoBlock.Row>
        <InfoBlock.Row>
            <InfoBlock.Label>Network fee</InfoBlock.Label>
            <InfoBlock.Value>0.01 TON</InfoBlock.Value>
        </InfoBlock.Row>
    </InfoBlock.Container>
);

Input

Compound text-input component. Use the default export as the outer wrapper (it is the Input.Container) and compose sub-components for the header, field, slots, control, and caption. State flags (disabled, error, loading, resizable, size) live on the container and are read by the inner control via context. Members
MemberDescription
Input.ContainerOuter wrapper that provides input context (size, variant, disabled, error, loading, resizable).
Input.HeaderHeader row above the field — holds the title and optional trailing controls.
Input.TitleTitle text shown inside Input.Header.
Input.FieldHorizontal row that holds slots and the input control.
Input.SlotSide-anchored slot used for adornments such as icons or buttons.
Input.InputThe actual <input> control. Respects context flags and reads its size/variant from Input.Container.
Input.CaptionCaption / helper text below the field. Switches to error styling when the container has error set.
Example
return (
    <Input size="m">
        <Input.Header>
            <Input.Title>Recipient</Input.Title>
        </Input.Header>
        <Input.Field>
            <Input.Input value={value} onChange={(event) => setValue(event.target.value)} placeholder="EQ..." />
        </Input.Field>
        <Input.Caption>Paste a TON wallet address.</Input.Caption>
    </Input>
);
Square logo / avatar primitive — renders an <img> when src loads successfully, otherwise shows a text fallback (after a brief delay to avoid flicker). Useful for token icons, wallet avatars, and project logos.
PropTypeDescription
sizenumberSquare size in pixels for the rendered logo. Defaults to 30.
srcstringImage URL to render. While loading or on failure, the fallback is shown.
altstringAlt text passed to the underlying <img>. When fallback is not provided, its first character is shown as the fallback. If both are missing, no fallback is rendered.
fallbackstringText shown in place of the image when src fails or is missing (defaults to the first character of alt).
Example
return <Logo size={48} src="https://ton.org/download/ton_symbol.png" alt="TON" fallback="T" />;

LogoWithNetwork

Token logo with an overlaid network badge — wraps Logo and renders a smaller secondary logo as a corner badge to indicate which network the asset belongs to.
PropTypeDescription
sizenumberSize of the main logo in pixels. Defaults to 30. The network badge is sized to size * 0.4.
srcstringImage source for the main logo.
altstringAlt text for the main logo.
fallbackstringFallback text shown when the main logo image fails or is missing.
networkSrcstringImage source for the network badge overlay. When omitted, the badge is not rendered.
networkAltstringAlt text for the network badge.
Example
return (
    <LogoWithNetwork
        size={48}
        src="https://cdn.example.com/usdt.png"
        alt="USDT"
        fallback="U"
        networkSrc="https://ton.org/download/ton_symbol.png"
        networkAlt="TON"
    />
);
Centered modal dialog with a header (optional title + close button) and a scrollable body. Clicking the overlay closes the modal. Clicks on the content do not bubble through.
PropTypeDescription
openbooleanControlled open state.
onOpenChange(open: boolean) => voidCalled whenever the open state changes (e.g., via the close button, overlay click, or Escape).
titlestringOptional title rendered in the modal header.
childrenReactNodeModal body content.
classNamestringAdditional class name applied to the content container.
bodyClassNamestringAdditional class name applied to the body container.
Example
return (
    <div>
        <button onClick={() => setOpen(true)}>Open modal</button>
        <Modal open={open} onOpenChange={setOpen} title="Confirm action">
            <p>Are you sure you want to proceed?</p>
        </Modal>
    </div>
);

Select

Compound select / dropdown component with controlled or uncontrolled state. The content is portaled to document.body and positioned relative to the trigger. Closes on outside click, Escape, or item selection. Members
MemberDescription
Select.RootProvider that owns the selected value and open state, controlled or uncontrolled.
Select.TriggerButton-based trigger that toggles the popover and exposes aria-expanded.
Select.ContentPortaled popover that renders the list of items. Positioned under the trigger with optional sideOffset.
Select.ItemSelectable option row. Commits its value to the root on click.
Example
return (
    <Select.Root value={value} onValueChange={setValue}>
        <Select.Trigger>{value === 'mainnet' ? 'Mainnet' : 'Testnet'}</Select.Trigger>
        <Select.Content>
            <Select.Item value="mainnet">Mainnet</Select.Item>
            <Select.Item value="testnet">Testnet</Select.Item>
        </Select.Content>
    </Select.Root>
);

Skeleton

Animated placeholder block used while data is loading. Supply width / height to match the dimensions of the eventual content.
PropTypeDescription
widthstring | numberWidth of the placeholder. Accepts any valid CSS length or a number (interpreted as pixels).
heightstring | numberHeight of the placeholder. Accepts any valid CSS length or a number (interpreted as pixels).
Example
return <Skeleton width={120} height="1.2em" />;

Tabs

Root tabs container — owns the active value (controlled or uncontrolled) and shares it with descendant TabsList, TabsTrigger, and TabsContent via context.
PropTypeDescription
valuestringControlled active tab value.
defaultValuestringInitial active tab when uncontrolled. Defaults to ''.
onValueChange(value: string) => voidCalled whenever the active tab changes.
children*ReactNodeCompound sub-components — typically TabsList (with TabsTriggers) followed by TabsContents.
Example
return (
    <Tabs value={tab} onValueChange={setTab}>
        <TabsList>
            <TabsTrigger value="stake">Stake</TabsTrigger>
            <TabsTrigger value="unstake">Unstake</TabsTrigger>
        </TabsList>
        <TabsContent value="stake">
            <p>Stake your TON to earn rewards.</p>
        </TabsContent>
        <TabsContent value="unstake">
            <p>Withdraw your staked TON.</p>
        </TabsContent>
    </Tabs>
);

TabsContent

Tab panel rendered with role="tabpanel". Returns null unless its value matches the active Tabs value.
PropTypeDescription
value*stringValue this panel is associated with — rendered only when the parent Tabs is on this value.
children*ReactNodePanel content.

TabsList

Horizontal list of tab triggers with role="tablist".
PropTypeDescription
children*ReactNodeTab triggers — typically one or more TabsTriggers.

TabsTrigger

Tab trigger button with role="tab". Activates its value on click and reflects active state via aria-selected and data-state.
PropTypeDescription
value*stringValue committed to the parent Tabs when this trigger is activated.
children*ReactNodeTrigger label / content.

TonIcon

TON brand diamond glyph — solid, inherits color from currentColor.
PropTypeDescription
sizenumberSquare size of the icon in pixels. Defaults to DEFAULT_ICON_SIZE.

TonIconCircle

TON brand glyph rendered inside a filled circle, using the TON brand color token.
PropTypeDescription
sizenumberSquare size of the icon in pixels. Defaults to DEFAULT_ICON_SIZE.

Type

Balances

SendJettonButtonProps

Props accepted by SendJettonButton — extends the base Send button props (button text, sizing, callbacks) with the jetton-transfer details.
FieldTypeDescription
recipientAddress*stringRecipient address.
amount*stringAmount in jetton units as a human-readable decimal string. Converted to raw smallest units via jetton.decimals.
jetton*{ address: string; symbol: string; decimals: number; }Jetton master metadata — address (master contract), symbol (rendered in the button label) and decimals (used to format amount).
commentstringOptional human-readable comment attached to the transfer.
textReactNodeOverride the button label. Defaults to “Send”.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.
children(props: SendRenderProps) => ReactNodeCustom render function — replaces the default button with the caller’s UI. Receives the current send state and click handler via SendRenderProps.
onError(error: Error) => voidCalled when the wallet rejects the request or the send fails. Receives the raised Error.
onSuccess(response: SendTransactionReturnType) => voidCalled once the transaction is broadcast. Receives the wallet’s SendTransactionReturnType (BoC + normalized hash).

SendTonButtonProps

Props accepted by SendTonButton — extends the base Send button props (button text, sizing, callbacks) with the TON-transfer details.
FieldTypeDescription
recipientAddress*stringRecipient address.
amount*stringAmount in TON as a human-readable decimal string (e.g., "1.5"). Converted to nano-TON internally.
commentstringOptional human-readable comment attached to the transfer.
textReactNodeOverride the button label. Defaults to “Send”.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.
children(props: SendRenderProps) => ReactNodeCustom render function — replaces the default button with the caller’s UI. Receives the current send state and click handler via SendRenderProps.
onError(error: Error) => voidCalled when the wallet rejects the request or the send fails. Receives the raised Error.
onSuccess(response: SendTransactionReturnType) => voidCalled once the transaction is broadcast. Receives the wallet’s SendTransactionReturnType (BoC + normalized hash).

UseBalanceByAddressParameters

Parameters accepted by useBalanceByAddress — TanStack Query options (select, enabled, staleTime, …) plus the target address and optional network override.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseBalanceByAddressReturnType

Return type of useBalanceByAddress — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseBalanceByAddressReturnType = UseQueryReturnType<
    selectData,
    GetBalanceErrorType
>;

UseBalanceParameters

Parameters accepted by useBalance — same shape as UseBalanceByAddressParameters. The hook resolves address from the selected wallet and overrides any value supplied here.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseBalanceReturnType

Return type of useBalance — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseBalanceReturnType = UseBalanceByAddressReturnType<selectData>;

UseWatchBalanceByAddressParameters

Parameters accepted by useWatchBalanceByAddress — same fields as WatchBalanceByAddressOptions, all optional so callers can render the hook before the address is known.
type UseWatchBalanceByAddressParameters = Partial<WatchBalanceByAddressOptions>;

UseWatchBalanceParameters

Parameters accepted by useWatchBalance — same fields as UseWatchBalanceByAddressParameters minus address, which the hook resolves from the selected wallet.
type UseWatchBalanceParameters = Omit<UseWatchBalanceByAddressParameters, 'address'>;

Connectors

UseConnectorsReturnType

Return type of useConnectors — same shape as GetConnectorsReturnType.
type UseConnectorsReturnType = GetConnectorsReturnType;

Crypto Onramp

ChainInfo

Display info for a CAIP-2 chain — used by the crypto onramp widget to render chain names and logos.
FieldTypeDescription
name*stringHuman-readable chain name (e.g. "Ethereum", "Arbitrum One").
logostringOptional logo URL for the chain.

CryptoAmountInputMode

Which side the amount input is currently denominated in — token means the user is entering the target-token amount, method means they are entering the source payment-method amount.
type CryptoAmountInputMode = 'token' | 'method';

CryptoOnrampContextType

Shape of the CryptoOnrampContext value — selection state, quote/deposit data and actions exposed by CryptoOnrampWidgetProvider to the widget UI (and to custom render callbacks passed to CryptoOnrampWidget).
FieldTypeDescription
tokens*CryptoOnrampToken[]Full list of target tokens the user can buy.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
selectedToken*CryptoOnrampToken | nullCurrently selected target token to buy. null until tokens load.
setSelectedToken*(token: CryptoOnrampToken) => voidUpdates selectedToken.
paymentMethods*CryptoPaymentMethod[]Available source crypto payment methods.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
selectedMethod*CryptoPaymentMethodCurrently selected source payment method.
setSelectedMethod*(method: CryptoPaymentMethod) => voidUpdates selectedMethod.
chains*Record<string, ChainInfo>CAIP-2 → chain display info map (built-in defaults merged with consumer overrides).
amount*stringCurrent amount input value as a decimal string.
setAmount*(value: string) => voidUpdates amount.
amountInputMode*CryptoAmountInputModeWhich side amount is denominated in — see CryptoAmountInputMode.
setAmountInputMode*(mode: CryptoAmountInputMode) => voidUpdates amountInputMode.
convertedAmount*stringOther side of amount after applying the current quote’s rate.
presetAmounts*OnrampAmountPreset[]Quick-pick amount buttons rendered in the widget.
quote*CryptoOnrampQuote | nullCurrent quote, or null if not yet fetched / invalidated.
isLoadingQuote*booleanWhether a quote is in flight (includes the input-debounce window).
quoteError*string | nullQuote-side validation/fetch error as an i18n key, or null.
quoteProviderName*string | nullDisplay name of the provider behind the current quote, when available.
deposit*CryptoOnrampDeposit | nullCurrent deposit returned by the provider once createDeposit succeeded.
isCreatingDeposit*booleanWhether createDeposit is in flight.
depositError*string | nullDeposit-side error as an i18n key, or null.
depositAmount*stringFormatted deposit amount the user must send on the source chain.
createDeposit*() => voidTriggers deposit creation from the current quote.
depositStatus*CryptoOnrampStatus | nullLatest deposit status polled via useCryptoOnrampStatus, or null.
isRefundAddressRequired*booleanWhether the current quote provider requires a refund address before deposit.
isReversedAmountSupported*booleanWhether the current quote provider supports reversed (target-amount) input.
refundAddress*stringRefund address the user typed, if isRefundAddressRequired.
setRefundAddress*(address: string) => voidUpdates refundAddress.
targetBalance*stringConnected wallet’s balance of the selected target token (formatted, token units).
isLoadingTargetBalance*booleanWhether the target token balance is being fetched.
isWalletConnected*booleanWhether a TON wallet is currently connected.
canContinue*booleanWhether the user can proceed — valid amount, quote available, and wallet connected.
onReset*() => voidInvalidates the active quote and clears the deposit, returning the widget to its initial state.

CryptoOnrampProviderProps

Props for CryptoOnrampWidgetProvider — configures the target tokens and payment methods exposed to the widget, plus optional chain display overrides.
FieldTypeDescription
tokensCryptoOnrampToken[]Target tokens (what the user buys on TON). Defaults to a built-in list.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
paymentMethodsCryptoPaymentMethod[]Source crypto payment methods (what the user pays with on another chain). Defaults to a built-in list.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
chainsRecord<string, ChainInfo>Custom CAIP-2 → chain display info overrides. Merged on top of the built-in defaults, so consumers only need to provide what they want to override or add — for example, a single entry keyed by 'eip155:42161' with a name of 'Arbitrum' and a logo URL.
defaultTokenIdstringID of the target token pre-selected on mount.
defaultMethodIdstringID of the source payment method pre-selected on mount.

CryptoOnrampToken

Target token (what the user is buying on TON) in the crypto onramp widget. Kept separate from AppkitUIToken because address is the raw form expected by the onramp provider (e.g. "0x0000000000000000000000000000000000000000" for native TON, "EQCx..." for USDT jetton master).
FieldTypeDescription
id*stringStable identifier used by section configs and pre-selection props.
symbol*stringToken symbol, e.g. "TON", "USDT".
name*stringFull token name, e.g. "Toncoin", "Tether".
decimals*numberNumber of decimals for the token.
address*stringAddress as the onramp provider expects it.
logostringOptional logo URL.

CryptoOnrampTokenSectionConfig

Section configuration grouping CryptoOnrampToken entries by id in a picker.
FieldTypeDescription
title*stringSection header (typically already localized by the caller).
ids*string[]Ids of CryptoOnrampToken entries to include in this section, in order.

CryptoOnrampWidgetProps

Props for CryptoOnrampWidget — extends CryptoOnrampProviderProps (tokens, payment methods, defaults, chain overrides) plus the native <div> props the widget root forwards.
FieldTypeDescription
children(props: CryptoOnrampWidgetRenderProps) => ReactNodeCustom render function. When provided, replaces the default CryptoOnrampWidgetUI and is called with the full CryptoOnrampWidgetRenderProps (context state, actions and forwarded <div> props), so callers can build a fully custom UI on top of the same provider.
tokensCryptoOnrampToken[]Target tokens (what the user buys on TON). Defaults to a built-in list.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
paymentMethodsCryptoPaymentMethod[]Source crypto payment methods (what the user pays with on another chain). Defaults to a built-in list.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
chainsRecord<string, ChainInfo>Custom CAIP-2 → chain display info overrides. Merged on top of the built-in defaults, so consumers only need to provide what they want to override or add — for example, a single entry keyed by 'eip155:42161' with a name of 'Arbitrum' and a logo URL.
defaultTokenIdstringID of the target token pre-selected on mount.
defaultMethodIdstringID of the source payment method pre-selected on mount.

CryptoOnrampWidgetRenderProps

Props for CryptoOnrampWidgetUI (and for the custom render callback on CryptoOnrampWidget) — the full CryptoOnrampContextType state and actions, plus the native <div> props the widget root forwards (className, style, etc.).
FieldTypeDescription
tokens*CryptoOnrampToken[]Full list of target tokens the user can buy.
tokenSectionsCryptoOnrampTokenSectionConfig[]Optional section configs grouping tokens in the picker.
selectedToken*CryptoOnrampToken | nullCurrently selected target token to buy. null until tokens load.
setSelectedToken*(token: CryptoOnrampToken) => voidUpdates selectedToken.
paymentMethods*CryptoPaymentMethod[]Available source crypto payment methods.
methodSectionsPaymentMethodSectionConfig[]Optional section configs grouping paymentMethods in the picker.
selectedMethod*CryptoPaymentMethodCurrently selected source payment method.
setSelectedMethod*(method: CryptoPaymentMethod) => voidUpdates selectedMethod.
chains*Record<string, ChainInfo>CAIP-2 → chain display info map (built-in defaults merged with consumer overrides).
amount*stringCurrent amount input value as a decimal string.
setAmount*(value: string) => voidUpdates amount.
amountInputMode*CryptoAmountInputModeWhich side amount is denominated in — see CryptoAmountInputMode.
setAmountInputMode*(mode: CryptoAmountInputMode) => voidUpdates amountInputMode.
convertedAmount*stringOther side of amount after applying the current quote’s rate.
presetAmounts*OnrampAmountPreset[]Quick-pick amount buttons rendered in the widget.
quote*CryptoOnrampQuote | nullCurrent quote, or null if not yet fetched / invalidated.
isLoadingQuote*booleanWhether a quote is in flight (includes the input-debounce window).
quoteError*string | nullQuote-side validation/fetch error as an i18n key, or null.
quoteProviderName*string | nullDisplay name of the provider behind the current quote, when available.
deposit*CryptoOnrampDeposit | nullCurrent deposit returned by the provider once createDeposit succeeded.
isCreatingDeposit*booleanWhether createDeposit is in flight.
depositError*string | nullDeposit-side error as an i18n key, or null.
depositAmount*stringFormatted deposit amount the user must send on the source chain.
createDeposit*() => voidTriggers deposit creation from the current quote.
depositStatus*CryptoOnrampStatus | nullLatest deposit status polled via useCryptoOnrampStatus, or null.
isRefundAddressRequired*booleanWhether the current quote provider requires a refund address before deposit.
isReversedAmountSupported*booleanWhether the current quote provider supports reversed (target-amount) input.
refundAddress*stringRefund address the user typed, if isRefundAddressRequired.
setRefundAddress*(address: string) => voidUpdates refundAddress.
targetBalance*stringConnected wallet’s balance of the selected target token (formatted, token units).
isLoadingTargetBalance*booleanWhether the target token balance is being fetched.
isWalletConnected*booleanWhether a TON wallet is currently connected.
canContinue*booleanWhether the user can proceed — valid amount, quote available, and wallet connected.
onReset*() => voidInvalidates the active quote and clears the deposit, returning the widget to its initial state.

CryptoPaymentMethod

Source crypto payment method (what the user pays with on another chain) in the crypto onramp widget.
FieldTypeDescription
id*stringStable identifier for the method — used for selection state and methodSections.ids
symbol*stringToken symbol, e.g. “USDC”, “USDT”.
name*stringFull token name shown in the picker, e.g. “USD Coin”, “Tether”.
chain*stringSource chain in CAIP-2 format, e.g. “eip155:8453”, “eip155:56” — passed as sourceChain to the onramp provider. The widget resolves a display name and logo for it via the chains map (see CryptoOnrampWidgetProvider).
decimals*numberNumber of decimals for the token (used to convert between display and base units)
address*stringToken contract address on the source network (empty string / zero address for native)
logostringToken logo URL shown in the picker and selectors.

OnrampAmountPreset

Quick-pick amount button shown above the crypto-onramp input (carried on CryptoOnrampContextType’s presetAmounts).
FieldTypeDescription
amount*stringAmount value the preset sets on click (decimal string).
label*stringButton label shown to the user.

PaymentMethodSectionConfig

Section configuration grouping CryptoPaymentMethod entries by id in a picker.
FieldTypeDescription
title*stringSection header (typically already localized by the caller).
ids*string[]Ids of CryptoPaymentMethod entries to include in this section, in order.

UseCreateCryptoOnrampDepositParameters

Parameters accepted by useCreateCryptoOnrampDeposit — TanStack Query mutation options forwarded via parameters.mutation.
type UseCreateCryptoOnrampDepositParameters = CreateCryptoOnrampDepositMutationOptions<context>;

UseCreateCryptoOnrampDepositReturnType

Return type of useCreateCryptoOnrampDeposit — TanStack Query mutation result.
type UseCreateCryptoOnrampDepositReturnType = UseMutationResult<
    CreateCryptoOnrampDepositData,
    CreateCryptoOnrampDepositErrorType,
    CreateCryptoOnrampDepositVariables,
    context
>;

UseCryptoOnrampProviderParameters

Parameters accepted by useCryptoOnrampProvider — optional provider id forwarded to getCryptoOnrampProvider.
type UseCryptoOnrampProviderParameters = GetCryptoOnrampProviderOptions;

UseCryptoOnrampProviderReturnType

Return type of useCryptoOnrampProvider — the matching CryptoOnrampProviderInterface, or undefined when none is registered (the hook swallows the throw from getCryptoOnrampProvider).
type UseCryptoOnrampProviderReturnType = GetCryptoOnrampProviderReturnType | undefined;

UseCryptoOnrampProvidersReturnType

Return type of useCryptoOnrampProviders — array of every CryptoOnrampProviderInterface currently registered on the AppKit instance.
type UseCryptoOnrampProvidersReturnType = GetCryptoOnrampProvidersReturnType;

UseCryptoOnrampQuoteParameters

Parameters accepted by useCryptoOnrampQuote — TanStack Query options (select, enabled, staleTime, …) plus the source/target assets, amount and optional provider override forwarded to getCryptoOnrampQuote.
FieldTypeDescription
amountstringAmount to onramp (either source or target crypto, depending on isSourceAmount)
sourceCurrencyAddressstringSource crypto currency address (contract address or 0x0… for native)
sourceChainstringSource 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.
targetCurrencyAddressstringTarget crypto currency address on TON (contract address or 0x0… for native)
recipientAddressstringTON 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseCryptoOnrampQuoteReturnType

Return type of useCryptoOnrampQuote — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseCryptoOnrampQuoteReturnType = UseQueryReturnType<
    selectData,
    GetCryptoOnrampQuoteErrorType
>;

UseCryptoOnrampStatusParameters

Parameters accepted by useCryptoOnrampStatus — TanStack Query options (select, enabled, refetchInterval, …) plus the deposit id, originating provider id and optional provider override forwarded to getCryptoOnrampStatus.
FieldTypeDescription
depositIdstringDeposit id.
providerIdstringIdentifier of the provider that issued this deposit.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseCryptoOnrampStatusReturnType

Return type of useCryptoOnrampStatus — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseCryptoOnrampStatusReturnType = UseQueryReturnType<
    selectData,
    GetCryptoOnrampStatusErrorType
>;

Jettons

UseJettonBalanceByAddressParameters

Parameters accepted by useJettonBalanceByAddress — TanStack Query options (select, enabled, staleTime, …) plus the jetton master, owner address, decimals and optional network override.
FieldTypeDescription
jettonAddressUserFriendlyAddressJetton master contract address (the token, not the user’s wallet for it).
ownerAddressUserFriendlyAddressOwner of the jetton wallet — typically the connected user’s address.
jettonDecimalsnumberDecimals 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseJettonBalanceByAddressReturnType

Return type of useJettonBalanceByAddress — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseJettonBalanceByAddressReturnType = UseQueryReturnType<
    selectData,
    GetJettonBalanceErrorType
>;

UseJettonInfoParameters

Parameters accepted by useJettonInfo — TanStack Query options (select, enabled, staleTime, …) plus the jetton master address and optional network override.
FieldTypeDescription
addressUserFriendlyAddressJetton 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseJettonInfoReturnType

Return type of useJettonInfo — TanStack Query result carrying data, isLoading, error and the standard companions. data is null when the indexer has no record for that master address.
type UseJettonInfoReturnType = UseQueryReturnType<
    selectData,
    GetJettonInfoErrorType
>;

UseJettonWalletAddressParameters

Parameters accepted by useJettonWalletAddress — TanStack Query options (select, enabled, staleTime, …) plus the jetton master, owner address and optional network override.
FieldTypeDescription
jettonAddressUserFriendlyAddressJetton master contract address.
ownerAddressUserFriendlyAddressOwner 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseJettonWalletAddressReturnType

Return type of useJettonWalletAddress — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseJettonWalletAddressReturnType = UseQueryReturnType<
    selectData,
    GetJettonWalletAddressErrorType
>;

UseJettonsByAddressParameters

Parameters accepted by useJettonsByAddress — TanStack Query options (select, enabled, staleTime, …) plus the owner address, optional network override and pagination.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseJettonsByAddressReturnType

Return type of useJettonsByAddress — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseJettonsByAddressReturnType = UseQueryReturnType<
    selectData,
    GetJettonsErrorType
>;

UseJettonsParameters

Parameters accepted by useJettons — same shape as UseJettonsByAddressParameters. The hook resolves address from the selected wallet and overrides any value supplied here.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseJettonsReturnType

Return type of useJettons — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseJettonsReturnType = UseJettonsByAddressReturnType<selectData>;

UseTransferJettonParameters

Parameters accepted by useTransferJetton — TanStack Query mutation options.
type UseTransferJettonParameters = TransferJettonOptions<context>;

UseTransferJettonReturnType

Return type of useTransferJetton — TanStack Query mutation result.
type UseTransferJettonReturnType = UseMutationReturnType<
    TransferJettonData,
    TransferJettonErrorType,
    TransferJettonVariables,
    context,
    (
        variables: TransferJettonVariables,
        options?: MutateOptions<TransferJettonData, TransferJettonErrorType, TransferJettonVariables, context>,
    ) => void,
    MutateFunction<TransferJettonData, TransferJettonErrorType, TransferJettonVariables, context>
>;

UseWatchJettonsByAddressParameters

Parameters accepted by useWatchJettonsByAddress — same fields as WatchJettonsByAddressOptions, all optional so callers can render the hook before the address is known.
type UseWatchJettonsByAddressParameters = Partial<WatchJettonsByAddressOptions>;

UseWatchJettonsParameters

Parameters accepted by useWatchJettons — update callback and optional network override. The hook resolves the address from the selected wallet.
type UseWatchJettonsParameters = Partial<WatchJettonsOptions>;

NFTs

NftItemProps

Props accepted by NftItem — extends the native <button> props (onClick, disabled, className, …) with the NFT to render.
FieldTypeDescription
nft*NFTNFT to render — name, collection name, image and on-sale state are derived via getFormattedNftInfo.

UseNFTsByAddressParameters

Parameters accepted by useNftsByAddress — TanStack Query options (select, enabled, staleTime, …) plus the owner address, optional pagination (limit, offset) and network override. The network field 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.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseNFTsByAddressReturnType

Return type of useNftsByAddress — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseNFTsByAddressReturnType = UseQueryReturnType<selectData, GetNFTsErrorType>;

UseNFTsParameters

Parameters accepted by useNfts — same shape as UseNFTsByAddressParameters. The hook resolves address from the selected wallet and overrides any value supplied here.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseNFTsReturnType

Return type of useNfts — TanStack Query result carrying data, isLoading, error and the standard companions.
type UseNFTsReturnType = UseNFTsByAddressReturnType<selectData>;

UseNftParameters

Parameters accepted by useNft — TanStack Query options (select, enabled, staleTime, …) plus the NFT contract address and optional network override. The network field 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.
FieldTypeDescription
addressUserFriendlyAddress | 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseNftReturnType

Return type of useNft — TanStack Query result carrying data (the NFT or null when the indexer has no record), isLoading, error and the standard companions.
type UseNftReturnType = UseQueryReturnType<selectData, GetNftErrorType>;

UseTransferNftParameters

Parameters accepted by useTransferNft — TanStack Query mutation options.
type UseTransferNftParameters = TransferNftOptions<context>;

UseTransferNftReturnType

Return type of useTransferNft — TanStack Query mutation result.
type UseTransferNftReturnType = UseMutationReturnType<
    TransferNftData,
    TransferNftErrorType,
    TransferNftVariables,
    context,
    (
        variables: TransferNftVariables,
        options?: MutateOptions<TransferNftData, TransferNftErrorType, TransferNftVariables, context>,
    ) => void,
    MutateFunction<TransferNftData, TransferNftErrorType, TransferNftVariables, context>
>;

Networks

UseBlockNumberParameters

Parameters accepted by useBlockNumber — TanStack Query options plus an optional network override. Defaults to the selected wallet’s network. If no wallet is selected, falls back to mainnet.
FieldTypeDescription
networkNetworkNetwork to query. Defaults to mainnet when omitted.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseBlockNumberReturnType

Return type of useBlockNumber — TanStack Query result.
type UseBlockNumberReturnType = UseQueryReturnType<
    selectData,
    GetBlockNumberErrorType
>;

UseDefaultNetworkReturnType

Return type of useDefaultNetwork[network, setNetwork] tuple. network is the current default (or undefined). setNetwork calls setDefaultNetwork and emits networks:default-changed.
type UseDefaultNetworkReturnType = [
    network: GetDefaultNetworkReturnType,
    setNetwork: (network: Network | undefined) => void,
];

UseNetworkReturnType

Return type of useNetworkundefined when no wallet is currently selected.
type UseNetworkReturnType = Network | undefined;

UseNetworksReturnType

Return type of useNetworks — same shape as GetNetworksReturnType.
type UseNetworksReturnType = GetNetworksReturnType;

Providers

I18nContextType

Shape returned by useI18n — current locale, translation function and helpers to switch locales or merge new dictionaries at runtime.
FieldTypeDescription
activeLocale*stringCurrently active locale code (e.g., "en", "ru").
t*I18n['t']Translation function — accepts a key plus interpolation values and returns the localized string.
locale*(lang: string, dict?: Dict) => voidSwitch to a new locale. Pass an optional dict to install translations alongside the switch.
addDict*(lang: string, dict: Dict) => voidMerge a translation dictionary for lang without changing the active locale.

I18nProviderProps

Props accepted by I18nProvider.
FieldTypeDescription
localestringInitial locale code. Defaults to the i18n library’s default when omitted.
lngDictsRecord<string, Dict>Translation dictionaries keyed by locale. Loaded into the underlying i18n instance on mount.

Settings

AppKitTheme

Theme value accepted by useAppKitTheme'light', 'dark', or any custom string mapped to a data-ta-theme token in the host’s CSS.
type AppKitTheme = 'light' | 'dark' | string;

Shared

AmountPreset

Single preset entry rendered as a button in AmountPresets.
FieldTypeDescription
label*stringText shown inside the button (e.g., "25%", "Max", "100").
amount*stringValue passed to AmountPresetsProps.onPresetSelect when the button is clicked.
onSelect() => voidOptional custom click handler — when set, it runs instead of onPresetSelect.

AmountPresetsProps

Props accepted by AmountPresets.
FieldTypeDescription
presets*AmountPreset[]Preset buttons to render, in order.
currencySymbolstringOptional symbol (e.g., "$") prepended to each preset label.
onPresetSelect*(value: string) => voidCalled with the selected preset’s amount unless the preset defines its own onSelect.

AppkitUIToken

UI-side token descriptor consumed by appkit-react widgets (SwapWidget, SwapField, currency selectors, etc.) — identifies the token in the picker UI and carries display + on-chain fields the widget needs to render and quote.
FieldTypeDescription
id*stringStable id used for picker selection state and section grouping.
symbol*stringTicker symbol shown in the picker and selector chip (e.g., "TON", "USDT").
name*stringFull token name shown in the picker (e.g., "Toncoin").
decimals*numberNumber of decimal places used to format raw amounts.
address*stringToken contract address. Pass 'ton' for native TON; otherwise the jetton master’s user-friendly address.
logostringOptional URL of the token logo shown in the picker and selector chip.
ratestringOptional fiat exchange rate (1 token = rate fiat units). Used by widgets to render fiat conversions next to amounts.
network*NetworkNetwork the token lives on. Widgets filter their token universe by the active network.

CopyButtonProps

Props accepted by CopyButton.
FieldTypeDescription
value*stringText written to the clipboard when the button is clicked.
aria-label*stringAccessible label for screen readers.

CurrencyItemProps

Props accepted by CurrencyItem when used as a single-shot button. Passing children switches it into compound mode and bypasses these fields.
FieldTypeDescription
tickerstringToken symbol (e.g., "TON") — also used as the icon fallback and rendered in the secondary line.
namestringHuman-readable token name shown as the primary line. Falls back to ticker when absent.
balancestringMain balance value shown on the right side (already-formatted string).
underBalancestringOptional secondary value (e.g., fiat equivalent) shown beneath the main balance.
iconstringURL of the token logo.
isVerifiedbooleanWhen true, renders a verified checkmark badge next to the name.

CurrencySelectListContainerProps

Props accepted by CurrencySelect.ListContainer.
FieldTypeDescription
isEmpty*booleanWhen true, renders the built-in empty state instead of children.

CurrencySelectSearchProps

Props accepted by CurrencySelect.Search.
FieldTypeDescription
searchValue*stringCurrent search query.
onSearchChange*(value: string) => voidCalled whenever the user types in the search input.
placeholderstringPlaceholder text shown when the input is empty.
sizeInputSizeSize token applied to the input control(s) inside: `‘s''m''l’. Defaults to ’m’`.
variantInputVariantVisual variant: 'default' paints a filled field. 'unstyled' drops the chrome.
loadingbooleanWhen true, Input.Input renders a skeleton placeholder instead of an <input>.
disabledbooleanWhen true, descendant input controls are disabled.
errorbooleanWhen true, the field renders in error styling and Input.Caption switches to error text.
resizablebooleanWhen true, Input.Input scales its font down to fit the available width as the user types.

LowBalanceModalProps

Props accepted by LowBalanceModal.
FieldTypeDescription
open*booleanControls visibility of the modal.
mode*LowBalanceModereduce — user can fix it by reducing the amount (shows Change/Cancel). topup — reducing doesn’t help, user must top up TON (shows Close only).
requiredTon*stringRequired amount in TON, formatted as a decimal string (e.g. "0.423").
onChange*() => voidCalled when the user clicks the primary “Change” action (only in reduce mode).
onCancel*() => voidCalled when the user dismisses the modal (Cancel, Close, or backdrop click).

LowBalanceMode

Behavior mode for LowBalanceModal — see LowBalanceModalProps.mode.
type LowBalanceMode = 'reduce' | 'topup';

OptionSwitcherOption

Single entry rendered as an item inside OptionSwitcher.
FieldTypeDescription
value*stringStable value passed back to OptionSwitcherProps.onChange when selected.
label*stringHuman-readable label shown in the trigger and dropdown item.

OptionSwitcherProps

Props accepted by OptionSwitcher.
FieldTypeDescription
value*string | undefinedCurrently selected option value.
options*OptionSwitcherOption[]Available options.
onChange*(value: string) => voidCalled when the user picks an option.
disabledbooleanWhen true, the trigger is non-interactive and dimmed.
classNamestringExtra class applied to the trigger button.

SettingsButtonProps

Props accepted by SettingsButton — extends the base Button props.
FieldTypeDescription
onClick() => voidClick handler — typically used to open a settings modal.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.

TokenBase

Minimal shape every token in TokenSelectModal must satisfy. Callers may use richer types (e.g., AppkitUIToken) — TokenBase only fixes the fields the modal reads.
FieldTypeDescription
id*stringStable identifier used to match tokens against TokenSectionConfig.ids.
symbol*stringTicker (e.g., "TON") — used for display and search matching.
name*stringHuman-readable name — used for display and search matching.
address*stringToken contract address — used for exact-address search matching and as the React key.
logostringOptional logo URL.

TokenSectionConfig

Configuration that maps token ids to a named section in TokenSelectModal. Tokens not covered are placed in an “Other tokens” trailing section.
FieldTypeDescription
title*stringSection header label.
ids*string[]TokenBase.id values to include in this section, in render order.

TokenSelectModalProps

Props accepted by TokenSelectModal.
FieldTypeDescription
open*booleanControls modal visibility.
onClose*() => voidCalled when the modal is dismissed (selection, backdrop click, or escape).
tokens*T = AppkitUIToken[]Full set of tokens available for selection and search.
tokenSectionsTokenSectionConfig[]Optional sectioning rules. When omitted, all tokens render as a single untitled section.
onSelect*(token: T = AppkitUIToken) => voidCalled with the picked token. The modal closes and resets its search on selection.
title*stringModal header title.
searchPlaceholderstringPlaceholder shown inside the search input.

TokenSelectorProps

Props accepted by TokenSelector — extends the base Button props.
FieldTypeDescription
title*stringLabel shown next to the icon — typically the token symbol.
iconstringToken logo URL.
iconFallbackstringSingle-character fallback used when icon fails to load. Defaults to the first character of title.
networkIconstringWhen provided, renders a network badge overlay on the icon.
readOnlybooleanHide chevron and suppress click handling — use when there’s nothing to pick.
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.

Signing

UseSignBinaryParameters

Parameters accepted by useSignBinary — TanStack Query mutation options.
type UseSignBinaryParameters = SignBinaryOptions<context>;

UseSignBinaryReturnType

Return type of useSignBinary — TanStack Query mutation result.
type UseSignBinaryReturnType = UseMutationResult<
    SignBinaryData,
    SignBinaryErrorType,
    SignBinaryVariables,
    context
>;

UseSignCellParameters

Parameters accepted by useSignCell — TanStack Query mutation options.
type UseSignCellParameters = SignCellOptions<context>;

UseSignCellReturnType

Return type of useSignCell — TanStack Query mutation result.
type UseSignCellReturnType = UseMutationResult<
    SignCellData,
    SignCellErrorType,
    SignCellVariables,
    context
>;

UseSignTextParameters

Parameters accepted by useSignText — TanStack Query mutation options.
type UseSignTextParameters = SignTextOptions<context>;

UseSignTextReturnType

Return type of useSignText — TanStack Query mutation result.
type UseSignTextReturnType = UseMutationResult<
    SignTextData,
    SignTextErrorType,
    SignTextVariables,
    context
>;

Staking

SelectUnstakeModeProps

Props accepted by SelectUnstakeMode.
FieldTypeDescription
value*UnstakeModesCurrently selected unstake mode (see UnstakeMode).
onValueChange*(mode: UnstakeModes) => voidCalled when the user picks a different mode.
providerInfo*StakingProviderInfo | undefinedDynamic provider info — used to show the instant-unstake limit when available.
providerMetadata*StakingProviderMetadata | undefinedStatic provider metadata — supplies supportedUnstakeModes and stake-token formatting.

StakingBalanceBlockProps

Props accepted by StakingBalanceBlock.
FieldTypeDescription
providerMetadata*StakingProviderMetadata | undefinedProvider metadata — supplies the stake/receive tokens (address, ticker, decimals).
direction*StakingQuoteDirectionOperation direction. Selects which token and balance to render.
stakedBalancestringUser’s currently staked amount, used when direction === 'unstake'.
isStakedBalanceLoadingbooleanTrue while the staked balance is being fetched.
balancestringUser’s wallet balance of the stake token, used when direction === 'stake'.
isBalanceLoadingbooleanTrue while the wallet balance is being fetched.
onMaxClick() => voidWhen provided, renders a MAX button that invokes this callback.

StakingContextType

Shape of the staking context exposed by StakingWidgetProvider and read via useStakingContext. Aggregates inputs (amount, direction, unstake mode), fetched data (balances, quote, provider info/metadata), derived flags (canSubmit, error, loading states), and the actions used by StakingWidgetUI (send transaction, switch provider, max, low-balance handling).
FieldTypeDescription
amount*stringAmount the user wants to stake (string to preserve input UX)
canSubmit*booleanWhether the user can proceed with staking (checks balance, amount validity, etc.)
quote*StakingQuote | undefinedRaw staking quote from the provider
isQuoteLoading*booleanTrue while the stake quote is being fetched
error*string | nullCurrent validation/fetch error for staking, null when everything is ok
providerInfo*StakingProviderInfo | undefinedStaking provider dynamic info (APY, instant unstake availability, etc.)
providerMetadata*StakingProviderMetadata | undefinedStaking provider static metadata
stakingProvider*StakingProvider | undefinedCurrently selected staking provider (defaults to the first registered one)
stakingProviders*StakingProvider[]All registered staking providers
setStakingProviderId*(providerId: string) => voidUpdates the selected staking provider
network*Network | undefinedNetwork the widget is operating on (resolved from prop or wallet)
direction*StakingQuoteDirectionCurrent operation direction: ‘stake’ or ‘unstake’
isProviderInfoLoading*booleanTrue while provider info is being fetched
balance*string | undefinedBase balance (native or jetton) available for staking
isBalanceLoading*booleanTrue while base balance is being fetched
stakedBalance*StakingBalance | undefinedUser’s currently staked balance
isStakedBalanceLoading*booleanTrue while staked balance is being fetched
unstakeMode*UnstakeModesSelected unstake-timing mode — 'INSTANT', 'WHEN_AVAILABLE', or 'ROUND_END'. See UnstakeMode.
setAmount*(amount: string) => voidSets the input amount
setUnstakeMode*(mode: UnstakeModes) => voidSets the unstake mode
sendTransaction*() => Promise<void>Triggers the staking/unstaking transaction
onChangeDirection*(direction: StakingQuoteDirection) => voidChanges the direction (stake/unstake)
isSendingTransaction*booleanTrue while a transaction is being processed
isReversed*booleanTrue if the user is inputting the output amount (“I want to get X”)
toggleReversed*() => voidToggles between inputting from amount and output amount
reversedAmount*stringAmount displayed in the reversed (bottom) input
onMaxClick*() => voidSets the input amount to the maximum available balance (leaves room for TON gas on native stake)
isLowBalanceWarningOpen*booleanTrue when the built transaction outflow exceeds the user’s TON balance
lowBalanceMode*'reduce' | 'topup'reduce when the outgoing token is TON (user can fix by changing amount), topup otherwise.
lowBalanceRequiredTon*stringRequired TON amount for the pending operation, formatted as a decimal string. Empty when no pending op.
onLowBalanceChange*() => voidReplace the input with a value that fits within the current TON balance and close the warning.
onLowBalanceCancel*() => voidDismiss the low-balance warning without changing the input.

StakingInfoProps

Props accepted by StakingInfo.
FieldTypeDescription
quote*StakingQuote | undefinedCurrent staking quote — its amountOut is rendered in the “You get” row.
isQuoteLoading*booleanTrue while the quote is being fetched. Swaps the “You get” value for a skeleton.
providerInfo*StakingProviderInfo | undefinedDynamic provider info — supplies APY and exchange rate.
providerMetadata*StakingProviderMetadata | undefinedStatic provider metadata — supplies token tickers/decimals and the provider name.
isProviderInfoLoading*booleanTrue while provider info is being fetched.
directionStakingQuoteDirectionOperation direction — controls which token’s decimals/ticker label the “You get” amount. Defaults to 'stake'.

StakingProviderProps

Props accepted by StakingWidgetProvider.
FieldTypeDescription
networkNetworkNetwork used for quote fetching, balance reads, and transactions. Falls back to the connected wallet’s network when omitted.

StakingSettingsModalProps

Props accepted by StakingSettingsModal.
FieldTypeDescription
open*booleanControls modal visibility.
onClose*() => voidCalled when the user dismisses the modal or after a successful save.
provider*StakingProvider | undefinedCurrently active staking provider — used to preselect the option when the modal opens.
providers*StakingProvider[]All registered staking providers to choose from.
onProviderChange*(providerId: string) => voidInvoked with the chosen providerId when the user saves a different selection.
networkNetworkNetwork used to resolve each provider’s display name via its metadata.

StakingWidgetProps

Props accepted by StakingWidget. Extends StakingProviderProps (e.g. network) and standard <div> props forwarded to the default UI.
FieldTypeDescription
children(props: StakingWidgetRenderProps) => ReactNodeOptional render-prop. When provided, the default StakingWidgetUI is bypassed and this function is called with the full StakingWidgetRenderProps (context state + forwarded <div> props), letting consumers build a custom UI on top of the widget’s internal logic.
networkNetworkNetwork used for quote fetching, balance reads, and transactions. Falls back to the connected wallet’s network when omitted.

StakingWidgetRenderProps

Props accepted by StakingWidgetUI (also the argument type for the StakingWidget render-prop). Combines the full StakingContextType with standard <div> props forwarded to the outer wrapper.
FieldTypeDescription
amount*stringAmount the user wants to stake (string to preserve input UX)
canSubmit*booleanWhether the user can proceed with staking (checks balance, amount validity, etc.)
quote*StakingQuote | undefinedRaw staking quote from the provider
isQuoteLoading*booleanTrue while the stake quote is being fetched
error*string | nullCurrent validation/fetch error for staking, null when everything is ok
providerInfo*StakingProviderInfo | undefinedStaking provider dynamic info (APY, instant unstake availability, etc.)
providerMetadata*StakingProviderMetadata | undefinedStaking provider static metadata
stakingProvider*StakingProvider | undefinedCurrently selected staking provider (defaults to the first registered one)
stakingProviders*StakingProvider[]All registered staking providers
setStakingProviderId*(providerId: string) => voidUpdates the selected staking provider
network*Network | undefinedNetwork the widget is operating on (resolved from prop or wallet)
direction*StakingQuoteDirectionCurrent operation direction: ‘stake’ or ‘unstake’
isProviderInfoLoading*booleanTrue while provider info is being fetched
balance*string | undefinedBase balance (native or jetton) available for staking
isBalanceLoading*booleanTrue while base balance is being fetched
stakedBalance*StakingBalance | undefinedUser’s currently staked balance
isStakedBalanceLoading*booleanTrue while staked balance is being fetched
unstakeMode*UnstakeModesSelected unstake-timing mode — 'INSTANT', 'WHEN_AVAILABLE', or 'ROUND_END'. See UnstakeMode.
setAmount*(amount: string) => voidSets the input amount
setUnstakeMode*(mode: UnstakeModes) => voidSets the unstake mode
sendTransaction*() => Promise<void>Triggers the staking/unstaking transaction
onChangeDirection*(direction: StakingQuoteDirection) => voidChanges the direction (stake/unstake)
isSendingTransaction*booleanTrue while a transaction is being processed
isReversed*booleanTrue if the user is inputting the output amount (“I want to get X”)
toggleReversed*() => voidToggles between inputting from amount and output amount
reversedAmount*stringAmount displayed in the reversed (bottom) input
onMaxClick*() => voidSets the input amount to the maximum available balance (leaves room for TON gas on native stake)
isLowBalanceWarningOpen*booleanTrue when the built transaction outflow exceeds the user’s TON balance
lowBalanceMode*'reduce' | 'topup'reduce when the outgoing token is TON (user can fix by changing amount), topup otherwise.
lowBalanceRequiredTon*stringRequired TON amount for the pending operation, formatted as a decimal string. Empty when no pending op.
onLowBalanceChange*() => voidReplace the input with a value that fits within the current TON balance and close the warning.
onLowBalanceCancel*() => voidDismiss the low-balance warning without changing the input.

UseBuildStakeTransactionReturnType

Return type of useBuildStakeTransaction — TanStack Query mutation result that resolves to a TransactionRequest.
type UseBuildStakeTransactionReturnType = UseMutationResult<
    BuildStakeTransactionData,
    BuildStakeTransactionErrorType,
    BuildStakeTransactionVariables,
    context
>;

UseStakedBalanceParameters

Parameters accepted by useStakedBalance — TanStack Query options (select, enabled, staleTime, …) plus the owner address, optional network override and optional providerId.
FieldTypeDescription
userAddressUserFriendlyAddressOwner 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseStakedBalanceReturnType

Return type of useStakedBalance — TanStack Query result carrying the user’s staked balance.
type UseStakedBalanceReturnType = UseQueryReturnType<
    selectData,
    GetStakedBalanceErrorType
>;

UseStakingProviderInfoParameters

Parameters accepted by useStakingProviderInfo — TanStack Query options (select, enabled, staleTime, …) plus an optional providerId and network override.
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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseStakingProviderInfoReturnType

Return type of useStakingProviderInfo — TanStack Query result carrying live StakingProviderInfo.
type UseStakingProviderInfoReturnType = UseQueryReturnType<
    selectData,
    GetStakingProviderInfoErrorType
>;

UseStakingProviderMetadataParameters

Parameters accepted by useStakingProviderMetadata — optional providerId and network override.
type UseStakingProviderMetadataParameters = GetStakingProviderMetadataOptions;

UseStakingProviderMetadataReturnType

Return type of useStakingProviderMetadata — static StakingProviderMetadata for the resolved provider, or undefined when no provider matches and no default is registered (the hook swallows the throw from getStakingProviderMetadata).
type UseStakingProviderMetadataReturnType = GetStakingProviderMetadataReturnType | undefined;

UseStakingProviderParameters

Parameters accepted by useStakingProvider — optional provider id forwarded to getStakingProvider.
type UseStakingProviderParameters = GetStakingProviderOptions;

UseStakingProviderReturnType

Return type of useStakingProvider — the matching staking provider, or undefined when none resolves (the hook swallows the throw from getStakingProvider).
type UseStakingProviderReturnType = GetStakingProviderReturnType | undefined;

UseStakingProvidersReturnType

Return type of useStakingProviders — array of registered staking providers.
type UseStakingProvidersReturnType = GetStakingProvidersReturnType;

UseStakingQuoteParameters

Parameters accepted by useStakingQuote — TanStack Query options (select, enabled, staleTime, …) plus stake/unstake amount, direction, target asset and optional providerId/network override.
FieldTypeDescription
directionStakingQuoteDirectionDirection of the quote (stake or unstake)
amountstringAmount 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseStakingQuoteReturnType

Return type of useStakingQuote — TanStack Query result carrying a StakingQuote.
type UseStakingQuoteReturnType = UseQueryReturnType<
    selectData,
    GetStakingQuoteErrorType
>;

Swap

SwapContextType

Shape of the value exposed by useSwapContext. Holds the selected source/target tokens, the entered amount and the latest quote, balance readouts, validation state, slippage / provider settings, and the callbacks needed to mutate them or to submit the swap transaction.
FieldTypeDescription
tokens*AppkitUIToken[]Full list of available tokens for swapping
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens in the selector
fromToken*AppkitUIToken | nullCurrently selected source token
toToken*AppkitUIToken | nullCurrently selected target token
fromAmount*stringAmount the user wants to swap (string to preserve input UX)
toAmount*stringCalculated receive amount from the current quote
fiatSymbol*stringFiat currency symbol for price display, e.g. ”$“
fromBalance*string | undefinedUser’s balance of the “from” token
toBalance*string | undefinedUser’s balance of the “to” token
isFromBalanceLoading*booleanTrue while the “from” balance is being fetched
isToBalanceLoading*booleanTrue while the “to” balance is being fetched
canSubmit*booleanWhether the user can proceed with the swap (checks balance, amount, quote)
quote*GetSwapQuoteData | undefinedRaw swap quote from the provider
isQuoteLoading*booleanTrue while the quote is being fetched from the API
error*string | nullCurrent validation or fetch error, null when everything is ok
slippage*numberSlippage tolerance in basis points (100 = 1%)
swapProvider*SwapProvider | undefinedCurrently selected swap provider (defaults to the first registered one)
swapProviders*SwapProvider[]All registered swap providers
setSwapProviderId*(providerId: string) => voidUpdates the selected swap provider
setFromToken*(token: AppkitUIToken) => voidUpdates the source token
setToToken*(token: AppkitUIToken) => voidUpdates the target token
setFromAmount*(amount: string) => voidUpdates the swap amount
setSlippage*(slippage: number) => voidUpdates the slippage tolerance
onFlip*() => voidSwaps source and target tokens
onMaxClick*() => voidSets the “from” amount to the maximum available balance
sendSwapTransaction*() => Promise<void>Executes the swap transaction
isSendingTransaction*booleanTrue while a transaction is being built or sent
isLowBalanceWarningOpen*booleanTrue when the built transaction outflow exceeds the user’s TON balance
lowBalanceMode*'reduce' | 'topup'reduce when the outgoing token is TON (user can fix by changing amount), topup otherwise.
lowBalanceRequiredTon*stringRequired TON amount for the pending operation, formatted as a decimal string. Empty when no pending op.
onLowBalanceChange*() => voidReplace the input with a value that fits within the current TON balance and close the warning.
onLowBalanceCancel*() => voidDismiss the low-balance warning without changing the input.

SwapFieldProps

Props accepted by SwapField — a single source/target row inside the swap widget that hosts the amount input, token picker trigger, fiat conversion and balance line.
FieldTypeDescription
type*'pay' | 'receive'pay renders the editable source row with a “max” shortcut. receive renders the read-only target row.
amount*stringCurrent amount shown in the input as a human-readable decimal string.
fiatSymbolstringFiat currency symbol displayed in front of the converted value. Defaults to "$".
tokenAppkitUITokenCurrently selected token. Controls the token selector label, balance formatting and fiat conversion.
onAmountChange(value: string) => voidCalled with the raw input value when the user edits the amount. Only fired for type: "pay".
balancestringFormatted balance of token for the active wallet, as a human-readable decimal string. Rendered in the balance line beneath the input.
isBalanceLoadingbooleanWhen true, the balance area renders a skeleton placeholder instead of the value.
loadingbooleanWhen true, the underlying input renders its loading state — used while a fresh quote is in flight.
onMaxClick() => voidCalled when the user clicks the “max” shortcut to fill the maximum spendable amount.
onTokenSelectorClick() => voidCalled when the user clicks the token selector chip — typically opens a SwapTokenSelectModal.
sizeInputSizeSize token applied to the input control(s) inside: `‘s''m''l’. Defaults to ’m’`.
variantInputVariantVisual variant: 'default' paints a filled field. 'unstyled' drops the chrome.
disabledbooleanWhen true, descendant input controls are disabled.
errorbooleanWhen true, the field renders in error styling and Input.Caption switches to error text.
resizablebooleanWhen true, Input.Input scales its font down to fit the available width as the user types.

SwapFlipButtonProps

Props accepted by SwapFlipButton — the round button placed between the two SwapField rows that swaps the source and target tokens.
FieldTypeDescription
onClick() => voidCalled when the user clicks the button. Wire this to a handler that swaps the source/target tokens (e.g. onFlip from the swap context).
rotatedbooleanWhen true, the icon is drawn in its rotated state — used to animate between flips.

SwapInfoProps

Props accepted by SwapInfo — the summary block under the swap form that surfaces minimum received, slippage and the chosen provider.
FieldTypeDescription
toToken*AppkitUIToken | nullTarget token the user is receiving. Used to format minReceived with the right decimals and symbol.
slippage*numberSlippage tolerance in basis points (100 = 1%). Rendered as a percentage.
providerSwapProviderCurrent SwapProvider. Its display name is shown in the provider row.
quoteSwapQuoteQuote whose minReceived value is displayed. When undefined the value falls back to 0 (still suffixed with the token symbol).
isQuoteLoadingbooleanWhen true, the minimum-received value renders a skeleton placeholder instead of the formatted number.

SwapProviderProps

Props accepted by SwapWidgetProvider — the inputs that configure the swap flow (token universe, network override, defaults).
FieldTypeDescription
tokens*AppkitUIToken[]Full list of tokens available for swapping in the UI. Filtered to the active network internally.
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens inside the SwapTokenSelectModal.
defaultFromSymbolstringSymbol of the token pre-selected as the source on first mount (e.g. "TON").
defaultToSymbolstringSymbol of the token pre-selected as the target on first mount.
networkNetworkNetwork used for quote fetching and balance reads. When omitted, falls back to the selected wallet’s network via useNetwork.
fiatSymbolstringFiat currency symbol displayed next to converted amounts. Defaults to "$".
defaultSlippagenumberInitial slippage tolerance in basis points (100 = 1%). Defaults to 100.

SwapWidgetProps

Props accepted by SwapWidget — extend SwapProviderProps (swap configuration: tokens, network, defaults) with the standard <div> attributes and an optional render-prop override.
FieldTypeDescription
children(props: SwapWidgetRenderProps) => ReactNodeOptional render-prop receiving the full swap context plus the forwarded <div> props. When supplied it replaces the default SwapWidgetUI.
networkNetworkNetwork used for quote fetching and balance reads. When omitted, falls back to the selected wallet’s network via useNetwork.
tokens*AppkitUIToken[]Full list of tokens available for swapping in the UI. Filtered to the active network internally.
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens inside the SwapTokenSelectModal.
defaultFromSymbolstringSymbol of the token pre-selected as the source on first mount (e.g. "TON").
defaultToSymbolstringSymbol of the token pre-selected as the target on first mount.
fiatSymbolstringFiat currency symbol displayed next to converted amounts. Defaults to "$".
defaultSlippagenumberInitial slippage tolerance in basis points (100 = 1%). Defaults to 100.

SwapWidgetRenderProps

Props accepted by SwapWidgetUI (and the children render-prop on SwapWidget). Combines the full SwapContextType with the standard <div> attributes forwarded to the wrapper element.
FieldTypeDescription
tokens*AppkitUIToken[]Full list of available tokens for swapping
tokenSectionsTokenSectionConfig[]Optional section configs for grouping tokens in the selector
fromToken*AppkitUIToken | nullCurrently selected source token
toToken*AppkitUIToken | nullCurrently selected target token
fromAmount*stringAmount the user wants to swap (string to preserve input UX)
toAmount*stringCalculated receive amount from the current quote
fiatSymbol*stringFiat currency symbol for price display, e.g. ”$“
fromBalance*string | undefinedUser’s balance of the “from” token
toBalance*string | undefinedUser’s balance of the “to” token
isFromBalanceLoading*booleanTrue while the “from” balance is being fetched
isToBalanceLoading*booleanTrue while the “to” balance is being fetched
canSubmit*booleanWhether the user can proceed with the swap (checks balance, amount, quote)
quote*GetSwapQuoteData | undefinedRaw swap quote from the provider
isQuoteLoading*booleanTrue while the quote is being fetched from the API
error*string | nullCurrent validation or fetch error, null when everything is ok
slippage*numberSlippage tolerance in basis points (100 = 1%)
swapProvider*SwapProvider | undefinedCurrently selected swap provider (defaults to the first registered one)
swapProviders*SwapProvider[]All registered swap providers
setSwapProviderId*(providerId: string) => voidUpdates the selected swap provider
setFromToken*(token: AppkitUIToken) => voidUpdates the source token
setToToken*(token: AppkitUIToken) => voidUpdates the target token
setFromAmount*(amount: string) => voidUpdates the swap amount
setSlippage*(slippage: number) => voidUpdates the slippage tolerance
onFlip*() => voidSwaps source and target tokens
onMaxClick*() => voidSets the “from” amount to the maximum available balance
sendSwapTransaction*() => Promise<void>Executes the swap transaction
isSendingTransaction*booleanTrue while a transaction is being built or sent
isLowBalanceWarningOpen*booleanTrue when the built transaction outflow exceeds the user’s TON balance
lowBalanceMode*'reduce' | 'topup'reduce when the outgoing token is TON (user can fix by changing amount), topup otherwise.
lowBalanceRequiredTon*stringRequired TON amount for the pending operation, formatted as a decimal string. Empty when no pending op.
onLowBalanceChange*() => voidReplace the input with a value that fits within the current TON balance and close the warning.
onLowBalanceCancel*() => voidDismiss the low-balance warning without changing the input.

UseBuildSwapTransactionParameters

Parameters accepted by useBuildSwapTransaction — TanStack Query mutation options.
type UseBuildSwapTransactionParameters = BuildSwapTransactionMutationOptions<context>;

UseBuildSwapTransactionReturnType

Return type of useBuildSwapTransaction — TanStack Query mutation result.
type UseBuildSwapTransactionReturnType = UseMutationResult<
    BuildSwapTransactionData,
    BuildSwapTransactionErrorType,
    BuildSwapTransactionVariables,
    context
>;

UseSwapProviderReturnType

Return type of useSwapProvider[provider, setProviderId] tuple. provider is the default SwapProviderInterface (or undefined when none is registered). setProviderId calls setDefaultSwapProvider and emits provider:default-changed, which watchSwapProviders picks up.
type UseSwapProviderReturnType = readonly [GetSwapProviderReturnType | undefined, (providerId: string) => void];

UseSwapProvidersReturnType

Return type of useSwapProviders — array of every SwapProviderInterface currently registered on the AppKit instance.
type UseSwapProvidersReturnType = GetSwapProvidersReturnType;

UseSwapQuoteParameters

Parameters accepted by useSwapQuote — TanStack Query options (select, enabled, staleTime, …) plus the SwapQuoteParams fields (source/target tokens, amount, isReverseSwap flag) and an optional providerId / network override.
FieldTypeDescription
amountstringAmount of tokens to swap (incoming or outgoing depending on isReverseSwap)
fromSwapTokenToken to swap from.
toSwapTokenToken to swap to.
networkNetworkNetwork 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.
queryQueryOptionsOverrideTanStack Query options forwarded to useQuery (enabled, staleTime, refetchInterval, select, …). queryKey and queryFn are managed by the wrapper.

UseSwapQuoteReturnType

Return type of useSwapQuote — TanStack Query result carrying data (SwapQuote), isLoading, error and the standard companions.
type UseSwapQuoteReturnType = UseQueryReturnType<
    selectData,
    GetSwapQuoteErrorType
>;

Transactions

UseSendTransactionParameters

Parameters accepted by useSendTransaction — TanStack Query mutation options.
type UseSendTransactionParameters = SendTransactionOptions<context>;

UseSendTransactionReturnType

Return type of useSendTransaction — TanStack Query mutation result.
type UseSendTransactionReturnType = UseMutationReturnType<
    SendTransactionData,
    SendTransactionErrorType,
    SendTransactionVariables,
    context,
    (
        variables: SendTransactionVariables,
        options?: MutateOptions<SendTransactionData, SendTransactionErrorType, SendTransactionVariables, context>,
    ) => void,
    MutateFunction<SendTransactionData, SendTransactionErrorType, SendTransactionVariables, context>
>;

UseTransactionStatusParameters

Parameters accepted by useTransactionStatusboc xor normalizedHash plus optional network and TanStack Query overrides. Pair with query.refetchInterval to poll until the transaction completes.
type UseTransactionStatusParameters = GetTransactionStatusParameters &
    GetTransactionStatusQueryConfig<selectData>;

UseTransactionStatusReturnType

Return type of useTransactionStatus — TanStack Query result for the status read.
type UseTransactionStatusReturnType = UseQueryReturnType<
    selectData,
    GetTransactionStatusErrorType
>;

UseTransferTonParameters

Parameters accepted by useTransferTon — TanStack Query mutation options.
type UseTransferTonParameters = TransferTonOptions<context>;

UseTransferTonReturnType

Return type of useTransferTon — TanStack Query mutation result.
type UseTransferTonReturnType = UseMutationReturnType<
    TransferTonData,
    TransferTonErrorType,
    TransferTonVariables,
    context,
    (
        variables: TransferTonVariables,
        options?: MutateOptions<TransferTonData, TransferTonErrorType, TransferTonVariables, context>,
    ) => void,
    MutateFunction<TransferTonData, TransferTonErrorType, TransferTonVariables, context>
>;

UseWatchTransactionsByAddressParameters

Parameters accepted by useWatchTransactionsByAddress — same fields as WatchTransactionsByAddressOptions, all optional so callers can render the hook before the address is known.
type UseWatchTransactionsByAddressParameters = Partial<WatchTransactionsByAddressOptions>;

UseWatchTransactionsParameters

Parameters accepted by useWatchTransactions.
FieldTypeDescription
onChange(update: TransactionsUpdate) => voidCallback fired on every transactions update from the streaming provider.

UI

BlockProps

Props accepted by Block.
FieldTypeDescription
direction'row' | 'column'Flex direction of the block. Defaults to 'column'.

ButtonProps

Props accepted by Button.
FieldTypeDescription
sizeButtonSizeSize class applied to the button. Pass 'unset' to skip the size class entirely (no padding, no typography) — useful with variant="unstyled".
borderRadiusButtonBorderRadiusBorder radius token. Defaults to a size-dependent value (s2xl, ml, lxl).
variantButtonVariantVisual variant. Use 'unstyled' to opt out of all built-in styling — the consumer is fully responsible for visuals via className. The Button still provides ref forwarding, disabled/loading plumbing, and icon/children rendering.
loadingbooleanWhen true, renders a spinner instead of icon/children and disables the button.
fullWidthbooleanWhen true, the button stretches to fill its container width.
iconReactNodeOptional leading icon rendered before children when not loading.

CenteredAmountInputProps

Props accepted by CenteredAmountInput.
FieldTypeDescription
value*stringControlled input value (decimal string).
onValueChange*(value: string) => voidCalled with the new string whenever the user edits the input.
tickerstringOptional trailing ticker label (e.g., 'TON').
symbolstringOptional leading currency symbol (e.g., '$').
placeholderstringPlaceholder shown when value is empty. Defaults to '0'.
disabledbooleanWhen true, the underlying <input> is disabled.

CollapsibleProps

Props accepted by Collapsible.
FieldTypeDescription
open*booleanWhen true, the content is expanded. When false, it is collapsed to zero height.

IconProps

Standard props for all icon components. Icons render an <svg> whose dimensions are controlled by size. Color is inherited from currentColor, so style icons by setting color on a parent.
FieldTypeDescription
sizenumberSquare size of the icon in pixels. Defaults to DEFAULT_ICON_SIZE.

InputContainerProps

Props accepted by Input.Container (also used by Input itself).
FieldTypeDescription
sizeInputSizeSize token applied to the input control(s) inside: `‘s''m''l’. Defaults to ’m’`.
variantInputVariantVisual variant: 'default' paints a filled field. 'unstyled' drops the chrome.
disabledbooleanWhen true, descendant input controls are disabled.
errorbooleanWhen true, the field renders in error styling and Input.Caption switches to error text.
loadingbooleanWhen true, Input.Input renders a skeleton placeholder instead of an <input>.
resizablebooleanWhen true, Input.Input scales its font down to fit the available width as the user types.
children*ReactNodeCompound sub-components (header, field, control, caption).

InputControlProps

Props accepted by Input.Input — standard <input> props. Size, disabled, loading, and resizable behavior are inherited from the surrounding Input.Container.
type InputControlProps = ComponentProps<'input'>;

InputFieldProps

Props accepted by Input.Field.
FieldTypeDescription
children*ReactNodeField content — typically slots and the input control laid out horizontally.

InputHeaderProps

Props accepted by Input.Header.
FieldTypeDescription
children*ReactNodeHeader content — typically a Input.Title and optional trailing controls.

InputSlotProps

Props accepted by Input.Slot.
FieldTypeDescription
side'left' | 'right'Which edge of the field the slot adheres to.

LogoProps

Props accepted by Logo.
FieldTypeDescription
sizenumberSquare size in pixels for the rendered logo. Defaults to 30.
srcstringImage URL to render. While loading or on failure, the fallback is shown.
altstringAlt text passed to the underlying <img>. When fallback is not provided, its first character is shown as the fallback. If both are missing, no fallback is rendered.
fallbackstringText shown in place of the image when src fails or is missing (defaults to the first character of alt).

LogoWithNetworkProps

Props accepted by LogoWithNetwork.
FieldTypeDescription
sizenumberSize of the main logo in pixels. Defaults to 30. The network badge is sized to size * 0.4.
srcstringImage source for the main logo.
altstringAlt text for the main logo.
fallbackstringFallback text shown when the main logo image fails or is missing.
networkSrcstringImage source for the network badge overlay. When omitted, the badge is not rendered.
networkAltstringAlt text for the network badge.

ModalProps

Props accepted by Modal.
FieldTypeDescription
openbooleanControlled open state.
onOpenChange(open: boolean) => voidCalled whenever the open state changes (e.g., via the close button, overlay click, or Escape).
titlestringOptional title rendered in the modal header.
childrenReactNodeModal body content.
classNamestringAdditional class name applied to the content container.
bodyClassNamestringAdditional class name applied to the body container.

SelectContentProps

Props accepted by Select.Content.
FieldTypeDescription
align'start' | 'end'Horizontal alignment relative to the trigger.
sideOffsetnumberGap between trigger and content in pixels.

SelectItemProps

Props accepted by Select.Item.
FieldTypeDescription
value*stringValue committed to Select.Root when this item is chosen.
disabledbooleanWhen true, the item is not selectable and is excluded from keyboard navigation.

SelectRootProps

Props accepted by Select.Root.
FieldTypeDescription
valuestringControlled selected value.
defaultValuestringInitial value when uncontrolled.
onValueChange(value: string) => voidCalled whenever the selected value changes.
openbooleanControlled open state.
defaultOpenbooleanInitial open state when uncontrolled.
onOpenChange(open: boolean) => voidCalled whenever the open state changes.
disabledbooleanWhen true, the trigger is non-interactive.
children*ReactNodeCompound sub-components — Select.Trigger, Select.Content, Select.Item.

SelectTriggerProps

Props accepted by Select.Trigger — same as ButtonProps. The trigger inherits disabled from the surrounding root if set.
type SelectTriggerProps = ButtonProps;

SkeletonProps

Props accepted by Skeleton.
FieldTypeDescription
widthstring | numberWidth of the placeholder. Accepts any valid CSS length or a number (interpreted as pixels).
heightstring | numberHeight of the placeholder. Accepts any valid CSS length or a number (interpreted as pixels).

TabsContentProps

Props accepted by TabsContent.
FieldTypeDescription
value*stringValue this panel is associated with — rendered only when the parent Tabs is on this value.
children*ReactNodePanel content.

TabsListProps

Props accepted by TabsList.
FieldTypeDescription
children*ReactNodeTab triggers — typically one or more TabsTriggers.

TabsProps

Props accepted by Tabs.
FieldTypeDescription
valuestringControlled active tab value.
defaultValuestringInitial active tab when uncontrolled. Defaults to ''.
onValueChange(value: string) => voidCalled whenever the active tab changes.
children*ReactNodeCompound sub-components — typically TabsList (with TabsTriggers) followed by TabsContents.

TabsTriggerProps

Props accepted by TabsTrigger.
FieldTypeDescription
value*stringValue committed to the parent Tabs when this trigger is activated.
children*ReactNodeTrigger label / content.

Wallets

UseAddressReturnType

Return type of useAddressundefined when no wallet is selected.
type UseAddressReturnType = string | undefined;

UseConnectParameters

Parameters accepted by useConnect — TanStack Query mutation options (onSuccess, onError, onMutate, retry, …).
type UseConnectParameters = ConnectOptions<context>;

UseConnectReturnType

Return type of useConnect — TanStack Query mutation result with mutate/mutateAsync and the standard companions.
type UseConnectReturnType = UseMutationReturnType<
    ConnectData,
    ConnectErrorType,
    ConnectVariables,
    context,
    (
        variables: ConnectVariables,
        options?: MutateOptions<ConnectData, ConnectErrorType, ConnectVariables, context>,
    ) => void,
    MutateFunction<ConnectData, ConnectErrorType, ConnectVariables, context>
>;

UseConnectedWalletsReturnType

Return type of useConnectedWallets — same shape as GetConnectedWalletsReturnType.
type UseConnectedWalletsReturnType = GetConnectedWalletsReturnType;

UseDisconnectParameters

Parameters accepted by useDisconnect — TanStack Query mutation options.
type UseDisconnectParameters = DisconnectOptions<context>;

UseDisconnectReturnType

Return type of useDisconnect — TanStack Query mutation result.
type UseDisconnectReturnType = UseMutationReturnType<
    DisconnectData,
    DisconnectErrorType,
    DisconnectVariables,
    context,
    (
        variables: DisconnectVariables,
        options?: MutateOptions<DisconnectData, DisconnectErrorType, DisconnectVariables, context>,
    ) => void,
    MutateFunction<DisconnectData, DisconnectErrorType, DisconnectVariables, context>
>;

UseSelectedWalletReturnType

Return type of useSelectedWallet[wallet, setWalletId] tuple. wallet is the active WalletInterface (or null). setWalletId calls setSelectedWalletId and emits wallets:selection-changed.
type UseSelectedWalletReturnType = readonly [GetSelectedWalletReturnType, (walletId: string | null) => void];

Constants

Crypto Onramp

DEFAULT_CHAINS

Default mapping of CAIP-2 chain identifiers to ChainInfo used by the crypto onramp widget. Consumers can override or extend this map via the chains prop on CryptoOnrampWidgetProvider.
const DEFAULT_CHAINS = {
    'eip155:1': { name: 'Ethereum' },
    'eip155:10': { name: 'Optimism' },
    'eip155:56': { name: 'BSC' },
    'eip155:137': { name: 'Polygon' },
    'eip155:8453': { name: 'Base' },
    'eip155:42161': {
        name: 'Arbitrum One',
        logo: 'https://cdn.layerswap.io/layerswap/networks/arbitrum_mainnet.png',
    },
    'eip155:43114': { name: 'Avalanche' },
    'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': { name: 'Solana' },
    'bip122:000000000019d6689c085ae165831e93': { name: 'Bitcoin' },
};

UI

DEFAULT_ICON_SIZE

Default size in pixels (24) applied to icons when size is not provided.
const DEFAULT_ICON_SIZE = 24;