WalletAccountReadOnlyTon
Defined in: wallet-ton/src/read-only-account.ts:33
A TON V5R1 wallet without a key: balance, jetton balances, seqno, fee estimates, emulation, receipts and signature checks.
Extended by
Section titled “Extended by”Implements
Section titled “Implements”IWalletAccountReadOnly
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountReadOnlyTon(
publicKey,config?):WalletAccountReadOnlyTon
Defined in: wallet-ton/src/read-only-account.ts:45
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”string | Uint8Array<ArrayBufferLike>
config?
Section titled “config?”TonConfig = {}
Returns
Section titled “Returns”WalletAccountReadOnlyTon
Properties
Section titled “Properties”_address
Section titled “_address”
protectedreadonly_address:Address
Defined in: wallet-ton/src/read-only-account.ts:42
_config
Section titled “_config”
protectedreadonly_config:TonConfig
Defined in: wallet-ton/src/read-only-account.ts:39
protectedreadonly_init:StateInit
Defined in: wallet-ton/src/read-only-account.ts:41
protectedreadonly_rpc:TonCenter|undefined
Defined in: wallet-ton/src/read-only-account.ts:43
_walletId
Section titled “_walletId”
protectedreadonly_walletId:bigint
Defined in: wallet-ton/src/read-only-account.ts:40
address
Section titled “address”
readonlyaddress:string
Defined in: wallet-ton/src/read-only-account.ts:38
User-friendly 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”IWalletAccountReadOnly.chain
publicKey
Section titled “publicKey”
readonlypublicKey:Uint8Array
Defined in: wallet-ton/src/read-only-account.ts:36
Ed25519 public key the wallet is derived from.
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
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”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>
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”IWalletAccountReadOnly.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”IWalletAccountReadOnly.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>
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>
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”IWalletAccountReadOnly.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”IWalletAccountReadOnly.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>
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>
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>
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”IWalletAccountReadOnly.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”IWalletAccountReadOnly.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”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; }>
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>
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>
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
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”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”validUntil()
Section titled “validUntil()”
protectedvalidUntil():number
Defined in: wallet-ton/src/read-only-account.ts:210
Returns
Section titled “Returns”number
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”IWalletAccountReadOnly.verify