Skip to content
docs

TonConfig

Defined in: wallet-ton/src/types.ts:18

Options for a TON wallet manager or account: toncenter endpoints, network, fee caps and emulation before signing.

optional allowDrainingTransactions?: boolean

Defined in: wallet-ton/src/types.ts:55

Allow a body whose emulated risk.transfer_all_remaining_balance is true (send mode 128 / CARRY_ALL_BALANCE). Refused by default — nothing this wallet builds does that, so it only ever comes from a foreign bodyBoc.


optional emulate?: TonEmulateConfig

Defined in: wallet-ton/src/types.ts:47

Preflight emulation of every send (zero-signed external). Default {kind: 'tonapi'}: POST {tonApiUrl}/wallet/emulate (verdict + risk), falling back to /traces/emulate. {kind: 'toncenter-v3', url} posts to a toncenter emulateTrace endpoint instead. false = estimateFee only. A non-zero compute exit, an aborted transaction, a failed action phase or a failed FIRST-HOP internal message throws SimulationError before signing.


optional emulateUrl?: string

Defined in: wallet-ton/src/types.ts:49


optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: wallet-ton/src/types.ts:28

Injectable fetch (tests, custom agents). Defaults to globalThis.fetch.

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional indexerUrl?: string

Defined in: wallet-ton/src/types.ts:34

toncenter v3 base used for receipts (default https://toncenter.com/api/v3).


optional jettonAttachedValue?: string | number | bigint

Defined in: wallet-ton/src/types.ts:61

Nanotons attached to a jetton transfer on top of forwardTonAmount (default 0.05 TON).


optional maxJettonAttachedValue?: string | number | bigint

Defined in: wallet-ton/src/types.ts:67

Most nanotons a jetton transfer() may attach to the jetton-wallet call, forwardTonAmount included (default 1 TON). The contract that receives them is the one the jetton master names, so a fake master gets all of it: the cap bounds what such a call can cost.


optional network?: "mainnet" | "testnet"

Defined in: wallet-ton/src/types.ts:73

‘mainnet’ (ton:-239, default) or ‘testnet’ (ton:-3). Sets the CAIP-2 id, the address flags and the wallet_id network (-239 / -3), so a testnet wallet has its own address and its signed messages are not valid on mainnet (as in Tonkeeper and @ton/ton).


optional provider?: TonProvider | TonProvider[]

Defined in: wallet-ton/src/types.ts:22

Alias of tonClient.


optional retries?: number

Defined in: wallet-ton/src/types.ts:24

Extra rounds across the endpoint list after the first full pass (default 3).


optional simulate?: boolean

Defined in: wallet-ton/src/types.ts:57

Run the preflight (estimateFee + emulation when configured) before signing. Default true.


optional timeoutMs?: number

Defined in: wallet-ton/src/types.ts:26

Per-request timeout in ms (default 15 000).


optional tonApiKey?: string

Defined in: wallet-ton/src/types.ts:38

tonapi bearer key (sent as Authorization: Bearer …); also sent as X-API-Key to a toncenter-v3 emulator.


optional tonApiUrl?: string

Defined in: wallet-ton/src/types.ts:36

tonapi base used for fee rates and (by default) emulation (default https://tonapi.io/v2).


optional tonClient?: TonProvider | TonProvider[]

Defined in: wallet-ton/src/types.ts:20

toncenter endpoint(s) or TonRpc(s). A list fails over in order. Omit for an offline (sign-only) wallet.


optional transactionMaxFee?: number | bigint

Defined in: wallet-ton/src/types.ts:32

Max fee (nanotons) for sendTransaction / signTransaction.


optional transferMaxFee?: number | bigint

Defined in: wallet-ton/src/types.ts:30

Max fee (nanotons) for transfer.


optional validUntilSeconds?: number

Defined in: wallet-ton/src/types.ts:59

Seconds a signed external stays valid (default 60, max 600).


optional walletId?: object

Defined in: wallet-ton/src/types.ts:80

V5R1 wallet_id parts. Defaults (network id from network, subwallet 0) give the addresses Tonkeeper and Tonhub derive for a key; change the subwallet only to reach a wallet that was created with a different one. A networkGlobalId that contradicts network is refused.

optional networkGlobalId?: number

optional subwalletNumber?: number