Skip to content
docs

WalletAccountReadOnlyTron

Defined in: wallet-tron/src/read-only-account.ts:101

A Tron address without a key: TRX and TRC-20 balances, allowances, resources, fee estimates, simulation, receipts and signature checks.

  • IWalletAccountReadOnly

new WalletAccountReadOnlyTron(address, config?): WalletAccountReadOnlyTron

Defined in: wallet-tron/src/read-only-account.ts:110

string

TronConfig = {}

WalletAccountReadOnlyTron

protected readonly _client: TronFetch | undefined

Defined in: wallet-tron/src/read-only-account.ts:108


protected readonly _config: TronConfig

Defined in: wallet-tron/src/read-only-account.ts:107


readonly address: string

Defined in: wallet-tron/src/read-only-account.ts:103

base58 T…


readonly addressHex: string

Defined in: wallet-tron/src/read-only-account.ts:105

Hex form (41…).


readonly chain: string

Defined in: wallet-tron/src/read-only-account.ts:106

CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.

IWalletAccountReadOnly.chain

accountExists(address): Promise<boolean>

Defined in: wallet-tron/src/read-only-account.ts:168

Does an account exist on chain (/wallet/getaccount non-empty)?

string

Promise<boolean>


protected asTransaction(o): TronTransaction

Defined in: wallet-tron/src/read-only-account.ts:361

TronTransferOptions

TronTransaction


protected buildTransaction(tx): Promise<TronRawTransaction>

Defined in: wallet-tron/src/read-only-account.ts:214

TronTransaction

Promise<TronRawTransaction>


protected buildWithSimulation(tx, cap?): Promise<{ built: TronRawTransaction; sim?: TronSimulation; }>

Defined in: wallet-tron/src/read-only-account.ts:180

Ask the node for raw_data. Contract calls are simulated first so fee_limit can be derived from the energy they need (×1.2, capped at transactionMaxFee and the call’s cap) when the caller gives none; the simulation rides along so nobody pays for a second one.

TronTransaction

number | bigint

Promise<{ built: TronRawTransaction; sim?: TronSimulation; }>


protected constantCall(contract, functionSelector, parameters, what, extra?): Promise<ConstantCallResponse>

Defined in: wallet-tron/src/read-only-account.ts:140

Read-only contract call. Returns constant_result hex strings.

string

string

object[]

string

Record<string, unknown> = {}

Promise<ConstantCallResponse>


describeTransactionOnline(tx, ctx?): Promise<TronTxDescription>

Defined in: wallet-tron/src/read-only-account.ts:377

describeTransaction plus the unactivated-recipient check against the node.

TronTransaction

DescribeContext = {}

Promise<TronTxDescription>


estimateFee(tx): Promise<TronFeeEstimate>

Defined in: wallet-tron/src/read-only-account.ts:339

Build (if needed) and price a transaction: bandwidth, energy and the sun the sender burns.

TronTransaction

Promise<TronFeeEstimate>


protected estimateRaw(tx, sim?): Promise<TronFeeEstimate>

Defined in: wallet-tron/src/read-only-account.ts:301

Resource-by-resource cost of a node-built transaction. energy comes from a constant call unless the caller already has one (sim).

TronRawTransaction

TronSimulation

Promise<TronFeeEstimate>


getAddress(): Promise<string>

Defined in: wallet-tron/src/read-only-account.ts:131

The base58 address.

Promise<string>

IWalletAccountReadOnly.getAddress


getAllowance(token, spender): Promise<bigint>

Defined in: wallet-tron/src/read-only-account.ts:162

TRC-20 allowance(owner, spender) in base units.

string

string

Promise<bigint>


getBalance(): Promise<bigint>

Defined in: wallet-tron/src/read-only-account.ts:134

TRX balance in sun; 0 for an account that does not exist yet.

Promise<bigint>

IWalletAccountReadOnly.getBalance


protected getChainParameter(key): Promise<bigint>

Defined in: wallet-tron/src/read-only-account.ts:291

string

Promise<bigint>


protected getChainParameters(): Promise<Record<string, bigint>>

Defined in: wallet-tron/src/read-only-account.ts:284

Promise<Record<string, bigint>>


protected getResources(): Promise<Resources>

Defined in: wallet-tron/src/read-only-account.ts:280

Promise<Resources>


getTokenBalance(token): Promise<bigint>

Defined in: wallet-tron/src/read-only-account.ts:149

TRC-20 balanceOf in the token’s base units.

string

Promise<bigint>

IWalletAccountReadOnly.getTokenBalance


getTokenBalances(tokens): Promise<Record<string, bigint>>

Defined in: wallet-tron/src/read-only-account.ts:155

Several TRC-20 balances in parallel, keyed by the tokens as given.

string[]

Promise<Record<string, bigint>>


getTransactionReceipt(hash): Promise<TronReceipt | undefined>

Defined in: wallet-tron/src/read-only-account.ts:384

The receipt, or undefined while the transaction is unconfirmed.

string

Promise<TronReceipt | undefined>

IWalletAccountReadOnly.getTransactionReceipt


protected post<T>(path, body, what): Promise<T>

Defined in: wallet-tron/src/read-only-account.ts:124

T

string

unknown

string

Promise<T>


quoteSendTransaction(tx): Promise<TronQuote>

Defined in: wallet-tron/src/read-only-account.ts:351

fee = the sun the sender burns, after staked / free resources.

TronTransaction

Promise<TronQuote>

IWalletAccountReadOnly.quoteSendTransaction


protected quoteTransaction(tx, sim?): Promise<TronQuote>

Defined in: wallet-tron/src/read-only-account.ts:345

TronRawTransaction

TronSimulation

Promise<TronQuote>


quoteTransfer(o): Promise<TronQuote>

Defined in: wallet-tron/src/read-only-account.ts:369

Fee of a transfer in sun, including account activation when the recipient is new.

TronTransferOptions

Promise<TronQuote>

IWalletAccountReadOnly.quoteTransfer


protected requireClient(what): TronFetch

Defined in: wallet-tron/src/read-only-account.ts:119

string

TronFetch


protected simulateCall(tx): Promise<TronSimulation>

Defined in: wallet-tron/src/read-only-account.ts:221

Constant call by selector + params (unbuilt contract call). Never throws on a revert.

TronContractCall

Promise<TronSimulation>


protected simulateRaw(tx): Promise<TronSimulation>

Defined in: wallet-tron/src/read-only-account.ts:260

TronRawTransaction

Promise<TronSimulation>


simulateTransaction(tx): Promise<TronSimulation>

Defined in: wallet-tron/src/read-only-account.ts:250

Predict the outcome without signing: contract calls run through /wallet/triggerconstantcontract (revert reason ABI-decoded); TRX transfers check that the balance covers amount + fees. Transport failures throw, predicted failures don’t.

TronTransaction

Promise<TronSimulation>


protected trc20TransferParams(recipient, amount): ({ type: string; value: string; } | { type: string; value: bigint; })[]

Defined in: wallet-tron/src/read-only-account.ts:357

string

string | number | bigint

({ type: string; value: string; } | { type: string; value: bigint; })[]


verify(message, signature): Promise<boolean>

Defined in: wallet-tron/src/read-only-account.ts:393

Verify a TIP-191 signature produced by sign (0x + r||s||v, v = 27|28 or 0|1).

string | Uint8Array<ArrayBufferLike>

string

Promise<boolean>

IWalletAccountReadOnly.verify