WalletAccountTon
Defined in: wallet-ton/src/account.ts:34
Signing TON account on Wallet V5R1. It never holds a key: the V5R1 body is
signed by signer.sign(signingCell.hash(), {scheme: 'ed25519', context: 'ton-external'}) — a LocalSigner for seed wallets, anything else
(hardware, MPC, backend) through externalSigner().
Every send runs: hard checks → fresh seqno → preflight on the zero-signed body (estimateFee, emulation when configured, fee cap) → sign → broadcast. The preflight body carries a zero signature, so the signer is only asked once the transaction has passed.
Extends
Section titled “Extends”Implements
Section titled “Implements”IWalletAccount
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountTon(
signer,publicKey,path,config?):WalletAccountTon
Defined in: wallet-ton/src/account.ts:50
publicKey is the signer’s 32-byte ed25519 key; the V5R1 address derives from it synchronously.
Parameters
Section titled “Parameters”signer
Section titled “signer”Signer
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”TonConfig = {}
Returns
Section titled “Returns”WalletAccountTon
Overrides
Section titled “Overrides”WalletAccountReadOnlyTon.constructor
Properties
Section titled “Properties”_address
Section titled “_address”
protectedreadonly_address:Address
Defined in: wallet-ton/src/read-only-account.ts:42
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon._address
_config
Section titled “_config”
protectedreadonly_config:TonConfig
Defined in: wallet-ton/src/read-only-account.ts:39
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon._config
protectedreadonly_init:StateInit
Defined in: wallet-ton/src/read-only-account.ts:41
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon._init
protectedreadonly_rpc:TonCenter|undefined
Defined in: wallet-ton/src/read-only-account.ts:43
Inherited from
Section titled “Inherited from”_walletId
Section titled “_walletId”
protectedreadonly_walletId:bigint
Defined in: wallet-ton/src/read-only-account.ts:40
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon._walletId
address
Section titled “address”
readonlyaddress:string
Defined in: wallet-ton/src/read-only-account.ts:38
User-friendly address.
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.address
readonlychain:string
Defined in: wallet-ton/src/read-only-account.ts:34
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
Implementation of
Section titled “Implementation of”IWalletAccount.chain
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.chain
needsNetwork
Section titled “needsNetwork”
readonlyneedsNetwork:true=true
Defined in: wallet-ton/src/account.ts:36
seqno and fees come from the network before signing.
Implementation of
Section titled “Implementation of”IWalletAccount.needsNetwork
readonlypath:string
Defined in: wallet-ton/src/account.ts:38
Derivation path, ton-mnemonic, or external.
publicKey
Section titled “publicKey”
readonlypublicKey:Uint8Array
Defined in: wallet-ton/src/read-only-account.ts:36
Ed25519 public key the wallet is derived from.
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.publicKey
signerKind
Section titled “signerKind”
readonlysignerKind:"external"|"seed"|"key"
Defined in: wallet-ton/src/account.ts:46
What holds the key: seed, key (one imported key) or external.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get index():
number|undefined
Defined in: wallet-ton/src/account.ts:63
Account index for the standard m/44’/607’/i’ path.
Returns
Section titled “Returns”number | undefined
Methods
Section titled “Methods”checkedAddress()
Section titled “checkedAddress()”
protectedcheckedAddress(to):object
Defined in: wallet-ton/src/read-only-account.ts:135
A destination address with the checks every payment gets: workchain 0 or -1, and a friendly
address’s test-only flag matching the wallet’s network. Used for a native message’s to and a
jetton transfer’s recipient and response destination (round 3, L8).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”object
address
Section titled “address”address:
Address
bounceable
Section titled “bounceable”bounceable:
boolean
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.checkedAddress
describe()
Section titled “describe()”describe(
tx):TonDescription
Defined in: wallet-ton/src/read-only-account.ts:281
Offline description of what tx does — see describeTransaction.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.describe
dispose()
Section titled “dispose()”dispose():
void
Defined in: wallet-ton/src/account.ts:222
Disposes the signer: a local key is zeroized, an external one is released.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IWalletAccount.dispose
estimateFees()
Section titled “estimateFees()”estimateFees(
body):Promise<TonFees>
Defined in: wallet-ton/src/read-only-account.ts:234
in_fwd + storage + gas + fwd from toncenter’s estimateFee (signature ignored).
Parameters
Section titled “Parameters”Cell
Returns
Section titled “Returns”Promise<TonFees>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.estimateFees
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: wallet-ton/src/read-only-account.ts:70
The user-friendly address.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.getAddress
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.getAddress
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: wallet-ton/src/read-only-account.ts:73
Native balance in nanotons.
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.getBalance
getJettonWalletAddress()
Section titled “getJettonWalletAddress()”getJettonWalletAddress(
token):Promise<Address>
Defined in: wallet-ton/src/read-only-account.ts:86
Resolve this wallet’s jetton wallet for a jetton master.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Address>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.getJettonWalletAddress
getSeqno()
Section titled “getSeqno()”getSeqno():
Promise<number>
Defined in: wallet-ton/src/read-only-account.ts:78
Current seqno — 0 until the wallet contract is deployed. Always fetched fresh.
Returns
Section titled “Returns”Promise<number>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.getSeqno
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
token):Promise<bigint>
Defined in: wallet-ton/src/read-only-account.ts:114
Jetton balance in base units, read from this wallet’s jetton wallet; 0 when it does not exist.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getTokenBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.getTokenBalance
getTransactionReceipt()
Section titled “getTransactionReceipt()”getTransactionReceipt(
hash):Promise<TonReceipt|undefined>
Defined in: wallet-ton/src/read-only-account.ts:289
Receipt for a body hash returned by sendTransaction: toncenter v3 maps the message body hash to the account transaction, which is then fetched.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<TonReceipt | undefined>
Implementation of
Section titled “Implementation of”IWalletAccount.getTransactionReceipt
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.getTransactionReceipt
initIfNeeded()
Section titled “initIfNeeded()”
protectedinitIfNeeded():Promise<StateInit|undefined>
Defined in: wallet-ton/src/read-only-account.ts:228
StateInit to attach to an external when the wallet is not deployed yet.
Returns
Section titled “Returns”Promise<StateInit | undefined>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.initIfNeeded
jettonTransferMessage()
Section titled “jettonTransferMessage()”
protectedjettonTransferMessage(o):Promise<V5R1Message>
Defined in: wallet-ton/src/read-only-account.ts:166
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<V5R1Message>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.jettonTransferMessage
jettonWalletData()
Section titled “jettonWalletData()”
protectedjettonWalletData(token,jw):Promise<bigint>
Defined in: wallet-ton/src/read-only-account.ts:100
Read a jetton wallet and prove it is ours for token: get_wallet_data
must name this wallet as owner and token as master. The master’s own
get_wallet_address answer is not trusted on its own — a fake master could
point at our real wallet of another jetton (e.g. USDT).
Parameters
Section titled “Parameters”string
Address
Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.jettonWalletData
quoteSendTransaction()
Section titled “quoteSendTransaction()”quoteSendTransaction(
tx):Promise<{fee:bigint; }>
Defined in: wallet-ton/src/read-only-account.ts:268
Estimated fee of a transaction, in nanotons.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteSendTransaction
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.quoteSendTransaction
quoteTransfer()
Section titled “quoteTransfer()”quoteTransfer(
o):Promise<{fee:bigint; }>
Defined in: wallet-ton/src/read-only-account.ts:274
Estimated fee of a transfer, in nanotons.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteTransfer
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.quoteTransfer
requireRpc()
Section titled “requireRpc()”
protectedrequireRpc(what):TonCenter
Defined in: wallet-ton/src/read-only-account.ts:64
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.requireRpc
sendTransaction()
Section titled “sendTransaction()”sendTransaction(
tx,options?):Promise<TransferResult>
Defined in: wallet-ton/src/account.ts:198
Sign and broadcast; hash is the body hash (hex) — resolve it with getTransactionReceipt.
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.sendTransaction
sign()
Section titled “sign()”sign(
message):Promise<string>
Defined in: wallet-ton/src/account.ts:76
Hex ed25519 signature over the raw message bytes. A 32-byte message — string or bytes — is refused with MessageIsTransactionError: the wallet contract checks a transfer’s signature over the 32-byte hash of its signing cell, so those bytes could be one. Bytes that carry this account’s public key are refused as well: one ed25519 key (an external signer) may also be a Solana wallet, and a Solana transaction names its signer’s key. TON Connect goes through signTonProof and signTonConnectData.
Parameters
Section titled “Parameters”message
Section titled “message”string | Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.sign
signingCell()
Section titled “signingCell()”
protectedsigningCell(messages):Promise<{seqno:number;signing:Cell;validUntil:number; }>
Defined in: wallet-ton/src/read-only-account.ts:219
The cell to sign for messages at the CURRENT seqno (fetched fresh every time).
Parameters
Section titled “Parameters”messages
Section titled “messages”Returns
Section titled “Returns”Promise<{ seqno: number; signing: Cell; validUntil: number; }>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.signingCell
signTonConnectData()
Section titled “signTonConnectData()”signTonConnectData(
request):Promise<TonSignedData>
Defined in: wallet-ton/src/account.ts:99
TON Connect signData (text / binary) for this wallet’s address: the reply the dApp gets.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<TonSignedData>
signTonProof()
Section titled “signTonProof()”signTonProof(
request):Promise<TonProof>
Defined in: wallet-ton/src/account.ts:87
TON Connect ton_proof for this wallet’s address: the proof object of the connect reply. The
digest is built here (0xffff ‖ “ton-connect” ‖ …), so no request can turn it into a transfer.
domain is the host the wallet saw the request come from.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Promise<TonProof>
signTransaction()
Section titled “signTransaction()”signTransaction(
tx,options?):Promise<string>
Defined in: wallet-ton/src/account.ts:173
Sign without broadcasting. Returns the external-message BODY as base64 BoC (pass it back to sendTransaction as a Cell).
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.signTransaction
simulateBody()
Section titled “simulateBody()”simulateBody(
body):Promise<TonSimulation>
Defined in: wallet-ton/src/read-only-account.ts:247
Preflight an external body: fees via estimateFee and, unless
config.emulate === false, a trace emulation (tonapi by default, see
TonConfig.emulate) whose compute/action phases — and the first-hop
internal messages — decide ok. Never throws for a failing emulation,
only for transport problems or a malformed emulator response.
Parameters
Section titled “Parameters”Cell
Returns
Section titled “Returns”Promise<TonSimulation>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.simulateBody
simulateTransaction()
Section titled “simulateTransaction()”simulateTransaction(
tx):Promise<TonSimulation>
Defined in: wallet-ton/src/read-only-account.ts:262
Preflight a TonSendable (unsigned body, current seqno).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TonSimulation>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.simulateTransaction
stateInitOf()
Section titled “stateInitOf()”
protectedstateInitOf(src):StateInit|undefined
Defined in: wallet-ton/src/read-only-account.ts:123
Parameters
Section titled “Parameters”string | Cell | StateInit | undefined
Returns
Section titled “Returns”StateInit | undefined
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.stateInitOf
toMessages()
Section titled “toMessages()”
protectedtoMessages(tx):V5R1Message[]
Defined in: wallet-ton/src/read-only-account.ts:204
Parameters
Section titled “Parameters”TonTransaction | TonTransaction[]
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.toMessages
toReadOnlyAccount()
Section titled “toReadOnlyAccount()”toReadOnlyAccount():
IWalletAccountReadOnly
Defined in: wallet-ton/src/account.ts:216
The same wallet as a WalletAccountReadOnlyTon.
Returns
Section titled “Returns”IWalletAccountReadOnly
Implementation of
Section titled “Implementation of”IWalletAccount.toReadOnlyAccount
transactionMessage()
Section titled “transactionMessage()”
protectedtransactionMessage(tx):V5R1Message
Defined in: wallet-ton/src/read-only-account.ts:156
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.transactionMessage
transfer()
Section titled “transfer()”transfer(
o,writeOptions?):Promise<TransferResult>
Defined in: wallet-ton/src/account.ts:208
TON (no token) or jetton transfer.
Parameters
Section titled “Parameters”writeOptions?
Section titled “writeOptions?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.transfer
validUntil()
Section titled “validUntil()”
protectedvalidUntil():number
Defined in: wallet-ton/src/read-only-account.ts:210
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.validUntil
verify()
Section titled “verify()”verify(
message,signature):Promise<boolean>
Defined in: wallet-ton/src/read-only-account.ts:308
ed25519 over the raw message bytes; signature hex.
Parameters
Section titled “Parameters”message
Section titled “message”string | Uint8Array<ArrayBufferLike>
signature
Section titled “signature”string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IWalletAccount.verify
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTon.verify
fromPrivateKey()
Section titled “fromPrivateKey()”
staticfromPrivateKey(privateKey,publicKey,path,config?):WalletAccountTon
Defined in: wallet-ton/src/account.ts:58
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
Parameters
Section titled “Parameters”privateKey
Section titled “privateKey”Uint8Array
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”TonConfig = {}
Returns
Section titled “Returns”WalletAccountTon