Skip to content
docs

WalletAccountTron

Defined in: wallet-tron/src/account.ts:41

Signing Tron account. The key lives in a secp256k1 Signer (a local key zeroized by dispose(), or an external hardware / MPC / backend signer). The full node builds raw_data; we check it, simulate it, have the signer sign txID (= sha256(raw_data)) as recoverable ECDSA (context tron-tx) and broadcast.

  • IWalletAccount

new WalletAccountTron(signer, publicKey, path, config?): WalletAccountTron

Defined in: wallet-tron/src/account.ts:59

Signer

Uint8Array

string

TronConfig = {}

WalletAccountTron

WalletAccountReadOnlyTron.constructor

protected readonly _client: TronFetch | undefined

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

WalletAccountReadOnlyTron._client


protected readonly _config: TronConfig

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

WalletAccountReadOnlyTron._config


readonly address: string

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

base58 T…

WalletAccountReadOnlyTron.address


readonly addressHex: string

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

Hex form (41…).

WalletAccountReadOnlyTron.addressHex


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

IWalletAccount.chain

WalletAccountReadOnlyTron.chain


readonly needsNetwork: true = true

Defined in: wallet-tron/src/account.ts:43

ref block / expiration come from the node, so building needs the network.

IWalletAccount.needsNetwork


readonly path: string

Defined in: wallet-tron/src/account.ts:45

Derivation path, or external for an external signer.


readonly publicKey: Uint8Array

Defined in: wallet-tron/src/account.ts:47

Compressed secp256k1 key (33 bytes); needed synchronously for the address.


readonly signerKind: "seed" | "key" | "external"

Defined in: wallet-tron/src/account.ts:55

What holds the key: seed, key (one imported key) or external.

get index(): number | undefined

Defined in: wallet-tron/src/account.ts:73

Account index for the standard m/44’/195’/0’/0/i path.

number | undefined

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>

WalletAccountReadOnlyTron.accountExists


protected assertRefBlock(tx): Promise<void>

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

A Tron transaction is bound to its network only by its reference block (TaPoS), and the key is the same on every network. With a provider, the block at ref_block_bytes (the latest one with those low 16 bits) must have the ref_block_hash the transaction names; offline, only a mainnet account signs, unless allowOfflineTestnetSigning (scan 2026-10-27 F22, F27).

TronRawTransaction

Promise<void>


protected assertSafe(tx, now?, limit?): void

Defined in: wallet-tron/src/account.ts:183

Refuse to sign what cannot be right: a foreign owner, a missing or expired (or >24h) expiration, no ref block, more than one contract, a TRX / TRC-20 transfer to the zero address (unless allowBurn), a fee_limit above transactionMaxFee or the call’s cap (limit), an AccountPermissionUpdateContract (unless allowPermissionChanges), a contract type the wallet cannot decode (unless allowUndecodedContracts; VoteWitnessContract only re-assigns votes and passes).

TronRawTransaction

number = ...

number | bigint

void


protected assertWorstFee(tx, cap): Promise<void>

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

What prebuilt bytes may burn at worst, held to cap: fee_limit of energy, plus the bandwidth, memo and activation fees fee_limit does not cover — the bound prepare() applies (round 3, M8). A contract call without fee_limit, or no provider to price the rest, is refused (scan 2026-10-27 F25).

TronRawTransaction

bigint

Promise<void>


protected asTransaction(o): TronTransaction

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

TronTransferOptions

TronTransaction

WalletAccountReadOnlyTron.asTransaction


protected buildTransaction(tx): Promise<TronRawTransaction>

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

TronTransaction

Promise<TronRawTransaction>

WalletAccountReadOnlyTron.buildTransaction


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; }>

WalletAccountReadOnlyTron.buildWithSimulation


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>

WalletAccountReadOnlyTron.constantCall


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>

WalletAccountReadOnlyTron.describeTransactionOnline


dispose(): void

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

Dispose the signer (zeroizes a local key). Idempotent.

void

IWalletAccount.dispose


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>

WalletAccountReadOnlyTron.estimateFee


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>

WalletAccountReadOnlyTron.estimateRaw


getAddress(): Promise<string>

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

The base58 address.

Promise<string>

IWalletAccount.getAddress

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

WalletAccountReadOnlyTron.getAllowance


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>

IWalletAccount.getBalance

WalletAccountReadOnlyTron.getBalance


protected getChainParameter(key): Promise<bigint>

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

string

Promise<bigint>

WalletAccountReadOnlyTron.getChainParameter


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

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

Promise<Record<string, bigint>>

WalletAccountReadOnlyTron.getChainParameters


protected getResources(): Promise<Resources>

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

Promise<Resources>

WalletAccountReadOnlyTron.getResources


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>

IWalletAccount.getTokenBalance

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

WalletAccountReadOnlyTron.getTokenBalances


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>

IWalletAccount.getTransactionReceipt

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

WalletAccountReadOnlyTron.post


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>

IWalletAccount.quoteSendTransaction

WalletAccountReadOnlyTron.quoteSendTransaction


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

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

TronRawTransaction

TronSimulation

Promise<TronQuote>

WalletAccountReadOnlyTron.quoteTransaction


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>

IWalletAccount.quoteTransfer

WalletAccountReadOnlyTron.quoteTransfer


protected requireClient(what): TronFetch

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

string

TronFetch

WalletAccountReadOnlyTron.requireClient


sendTransaction(tx, options?): Promise<TronTransferResult>

Defined in: wallet-tron/src/account.ts:267

Sign and broadcast.

string | TronTransaction

WriteOptions = {}

Promise<TronTransferResult>

IWalletAccount.sendTransaction


sign(message): Promise<string>

Defined in: wallet-tron/src/account.ts:89

TIP-191 message signature: 0x + r||s||(27 + recovery) hex (tronweb signMessageV2 encoding).

string | Uint8Array<ArrayBufferLike>

Promise<string>

IWalletAccount.sign


signRaw(tx, options?): Promise<TronRawTransaction>

Defined in: wallet-tron/src/account.ts:104

Sign a prebuilt transaction (ours or a dApp’s) and attach signature: [r||s||recovery] (recovery as 00/01, tronweb encoding). The signature covers sha256(raw_data_hex), so that is what is checked and signed: txID must equal it, the JSON raw_data must agree with the bytes field by field, and the hard checks (assertSafe) run on the bytes. A transaction whose JSON says “1 TRX to me” while the bytes say otherwise is refused (raw-mismatch), as is a txID that does not belong to the bytes (txid-mismatch). fee_limit is held to the tighter of transactionMaxFee and options.maxFee (round 3, M8). Signatures already on the transaction (a multisig co-signer’s) are kept; ours is added once (L11).

TronRawTransaction

WriteOptions = {}

Promise<TronRawTransaction>


signTransaction(tx, options?): Promise<string>

Defined in: wallet-tron/src/account.ts:244

Build (via the node), check, simulate and sign; returns broadcast-ready transaction JSON.

TronTransaction

WriteOptions = {}

Promise<string>

IWalletAccount.signTransaction


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>

WalletAccountReadOnlyTron.simulateCall


protected simulateRaw(tx): Promise<TronSimulation>

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

TronRawTransaction

Promise<TronSimulation>

WalletAccountReadOnlyTron.simulateRaw


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>

WalletAccountReadOnlyTron.simulateTransaction


toReadOnlyAccount(): IWalletAccountReadOnly

Defined in: wallet-tron/src/account.ts:285

The same address as a WalletAccountReadOnlyTron.

IWalletAccountReadOnly

IWalletAccount.toReadOnlyAccount


transfer(o, writeOptions?): Promise<TronTransferResult>

Defined in: wallet-tron/src/account.ts:277

TRX (no token) or TRC-20 transfer(address,uint256).

TronTransferOptions

WriteOptions = {}

Promise<TronTransferResult>

IWalletAccount.transfer


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; })[]

WalletAccountReadOnlyTron.trc20TransferParams


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>

IWalletAccount.verify

WalletAccountReadOnlyTron.verify


static fromPrivateKey(privateKey, publicKey, path, config?): WalletAccountTron

Defined in: wallet-tron/src/account.ts:68

Wrap a raw derived key (takes ownership; zeroized on dispose). Kept for callers that derive themselves.

Uint8Array

Uint8Array

string

TronConfig = {}

WalletAccountTron