Skip to content
docs

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.

  • IWalletAccountReadOnly

new WalletAccountReadOnlyTon(publicKey, config?): WalletAccountReadOnlyTon

Defined in: wallet-ton/src/read-only-account.ts:45

string | Uint8Array<ArrayBufferLike>

TonConfig = {}

WalletAccountReadOnlyTon

protected readonly _address: Address

Defined in: wallet-ton/src/read-only-account.ts:42


protected readonly _config: TonConfig

Defined in: wallet-ton/src/read-only-account.ts:39


protected readonly _init: StateInit

Defined in: wallet-ton/src/read-only-account.ts:41


protected readonly _rpc: TonCenter | undefined

Defined in: wallet-ton/src/read-only-account.ts:43


protected readonly _walletId: bigint

Defined in: wallet-ton/src/read-only-account.ts:40


readonly address: string

Defined in: wallet-ton/src/read-only-account.ts:38

User-friendly address.


readonly chain: 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”.

IWalletAccountReadOnly.chain


readonly publicKey: Uint8Array

Defined in: wallet-ton/src/read-only-account.ts:36

Ed25519 public key the wallet is derived from.

protected checkedAddress(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).

string

object

address: Address

bounceable: boolean


describe(tx): TonDescription

Defined in: wallet-ton/src/read-only-account.ts:281

Offline description of what tx does — see describeTransaction.

TonSendable

TonDescription


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).

Cell

Promise<TonFees>


getAddress(): Promise<string>

Defined in: wallet-ton/src/read-only-account.ts:70

The user-friendly address.

Promise<string>

IWalletAccountReadOnly.getAddress


getBalance(): Promise<bigint>

Defined in: wallet-ton/src/read-only-account.ts:73

Native balance in nanotons.

Promise<bigint>

IWalletAccountReadOnly.getBalance


getJettonWalletAddress(token): Promise<Address>

Defined in: wallet-ton/src/read-only-account.ts:86

Resolve this wallet’s jetton wallet for a jetton master.

string

Promise<Address>


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.

Promise<number>


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.

string

Promise<bigint>

IWalletAccountReadOnly.getTokenBalance


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.

string

Promise<TonReceipt | undefined>

IWalletAccountReadOnly.getTransactionReceipt


protected initIfNeeded(): 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.

Promise<StateInit | undefined>


protected jettonTransferMessage(o): Promise<V5R1Message>

Defined in: wallet-ton/src/read-only-account.ts:166

TonTransferOptions

Promise<V5R1Message>


protected jettonWalletData(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).

string

Address

Promise<bigint>


quoteSendTransaction(tx): Promise<{ fee: bigint; }>

Defined in: wallet-ton/src/read-only-account.ts:268

Estimated fee of a transaction, in nanotons.

TonSendable

Promise<{ fee: bigint; }>

IWalletAccountReadOnly.quoteSendTransaction


quoteTransfer(o): Promise<{ fee: bigint; }>

Defined in: wallet-ton/src/read-only-account.ts:274

Estimated fee of a transfer, in nanotons.

TonTransferOptions

Promise<{ fee: bigint; }>

IWalletAccountReadOnly.quoteTransfer


protected requireRpc(what): TonCenter

Defined in: wallet-ton/src/read-only-account.ts:64

string

TonCenter


protected signingCell(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).

V5R1Message[]

Promise<{ seqno: number; signing: Cell; validUntil: number; }>


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.

Cell

Promise<TonSimulation>


simulateTransaction(tx): Promise<TonSimulation>

Defined in: wallet-ton/src/read-only-account.ts:262

Preflight a TonSendable (unsigned body, current seqno).

TonSendable

Promise<TonSimulation>


protected stateInitOf(src): StateInit | undefined

Defined in: wallet-ton/src/read-only-account.ts:123

string | Cell | StateInit | undefined

StateInit | undefined


protected toMessages(tx): V5R1Message[]

Defined in: wallet-ton/src/read-only-account.ts:204

TonTransaction | TonTransaction[]

V5R1Message[]


protected transactionMessage(tx): V5R1Message

Defined in: wallet-ton/src/read-only-account.ts:156

TonTransaction

V5R1Message


protected validUntil(): number

Defined in: wallet-ton/src/read-only-account.ts:210

number


verify(message, signature): Promise<boolean>

Defined in: wallet-ton/src/read-only-account.ts:308

ed25519 over the raw message bytes; signature hex.

string | Uint8Array<ArrayBufferLike>

string

Promise<boolean>

IWalletAccountReadOnly.verify