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.
Extends
Section titled “Extends”Implements
Section titled “Implements”IWalletAccount
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountTron(
signer,publicKey,path,config?):WalletAccountTron
Defined in: wallet-tron/src/account.ts:59
Parameters
Section titled “Parameters”signer
Section titled “signer”Signer
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”TronConfig = {}
Returns
Section titled “Returns”WalletAccountTron
Overrides
Section titled “Overrides”WalletAccountReadOnlyTron.constructor
Properties
Section titled “Properties”_client
Section titled “_client”
protectedreadonly_client:TronFetch|undefined
Defined in: wallet-tron/src/read-only-account.ts:108
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron._client
_config
Section titled “_config”
protectedreadonly_config:TronConfig
Defined in: wallet-tron/src/read-only-account.ts:107
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron._config
address
Section titled “address”
readonlyaddress:string
Defined in: wallet-tron/src/read-only-account.ts:103
base58 T…
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.address
addressHex
Section titled “addressHex”
readonlyaddressHex:string
Defined in: wallet-tron/src/read-only-account.ts:105
Hex form (41…).
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.addressHex
readonlychain: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”.
Implementation of
Section titled “Implementation of”IWalletAccount.chain
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.chain
needsNetwork
Section titled “needsNetwork”
readonlyneedsNetwork:true=true
Defined in: wallet-tron/src/account.ts:43
ref block / expiration come from the node, so building needs the network.
Implementation of
Section titled “Implementation of”IWalletAccount.needsNetwork
readonlypath:string
Defined in: wallet-tron/src/account.ts:45
Derivation path, or external for an external signer.
publicKey
Section titled “publicKey”
readonlypublicKey:Uint8Array
Defined in: wallet-tron/src/account.ts:47
Compressed secp256k1 key (33 bytes); needed synchronously for the address.
signerKind
Section titled “signerKind”
readonlysignerKind:"seed"|"key"|"external"
Defined in: wallet-tron/src/account.ts:55
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-tron/src/account.ts:73
Account index for the standard m/44’/195’/0’/0/i path.
Returns
Section titled “Returns”number | undefined
Methods
Section titled “Methods”accountExists()
Section titled “accountExists()”accountExists(
address):Promise<boolean>
Defined in: wallet-tron/src/read-only-account.ts:168
Does an account exist on chain (/wallet/getaccount non-empty)?
Parameters
Section titled “Parameters”address
Section titled “address”string
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.accountExists
assertRefBlock()
Section titled “assertRefBlock()”
protectedassertRefBlock(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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
assertSafe()
Section titled “assertSafe()”
protectedassertSafe(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).
Parameters
Section titled “Parameters”number = ...
limit?
Section titled “limit?”number | bigint
Returns
Section titled “Returns”void
assertWorstFee()
Section titled “assertWorstFee()”
protectedassertWorstFee(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).
Parameters
Section titled “Parameters”bigint
Returns
Section titled “Returns”Promise<void>
asTransaction()
Section titled “asTransaction()”
protectedasTransaction(o):TronTransaction
Defined in: wallet-tron/src/read-only-account.ts:361
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.asTransaction
buildTransaction()
Section titled “buildTransaction()”
protectedbuildTransaction(tx):Promise<TronRawTransaction>
Defined in: wallet-tron/src/read-only-account.ts:214
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronRawTransaction>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.buildTransaction
buildWithSimulation()
Section titled “buildWithSimulation()”
protectedbuildWithSimulation(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.
Parameters
Section titled “Parameters”number | bigint
Returns
Section titled “Returns”Promise<{ built: TronRawTransaction; sim?: TronSimulation; }>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.buildWithSimulation
constantCall()
Section titled “constantCall()”
protectedconstantCall(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.
Parameters
Section titled “Parameters”contract
Section titled “contract”string
functionSelector
Section titled “functionSelector”string
parameters
Section titled “parameters”object[]
string
extra?
Section titled “extra?”Record<string, unknown> = {}
Returns
Section titled “Returns”Promise<ConstantCallResponse>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.constantCall
describeTransactionOnline()
Section titled “describeTransactionOnline()”describeTransactionOnline(
tx,ctx?):Promise<TronTxDescription>
Defined in: wallet-tron/src/read-only-account.ts:377
describeTransaction plus the unactivated-recipient check against the node.
Parameters
Section titled “Parameters”DescribeContext = {}
Returns
Section titled “Returns”Promise<TronTxDescription>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.describeTransactionOnline
dispose()
Section titled “dispose()”dispose():
void
Defined in: wallet-tron/src/account.ts:291
Dispose the signer (zeroizes a local key). Idempotent.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IWalletAccount.dispose
estimateFee()
Section titled “estimateFee()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronFeeEstimate>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.estimateFee
estimateRaw()
Section titled “estimateRaw()”
protectedestimateRaw(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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronFeeEstimate>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.estimateRaw
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: wallet-tron/src/read-only-account.ts:131
The base58 address.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.getAddress
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getAddress
getAllowance()
Section titled “getAllowance()”getAllowance(
token,spender):Promise<bigint>
Defined in: wallet-tron/src/read-only-account.ts:162
TRC-20 allowance(owner, spender) in base units.
Parameters
Section titled “Parameters”string
spender
Section titled “spender”string
Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getAllowance
getBalance()
Section titled “getBalance()”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.
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getBalance
getChainParameter()
Section titled “getChainParameter()”
protectedgetChainParameter(key):Promise<bigint>
Defined in: wallet-tron/src/read-only-account.ts:291
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getChainParameter
getChainParameters()
Section titled “getChainParameters()”
protectedgetChainParameters():Promise<Record<string,bigint>>
Defined in: wallet-tron/src/read-only-account.ts:284
Returns
Section titled “Returns”Promise<Record<string, bigint>>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getChainParameters
getResources()
Section titled “getResources()”
protectedgetResources():Promise<Resources>
Defined in: wallet-tron/src/read-only-account.ts:280
Returns
Section titled “Returns”Promise<Resources>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getResources
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
token):Promise<bigint>
Defined in: wallet-tron/src/read-only-account.ts:149
TRC-20 balanceOf in the token’s base units.
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”WalletAccountReadOnlyTron.getTokenBalance
getTokenBalances()
Section titled “getTokenBalances()”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.
Parameters
Section titled “Parameters”tokens
Section titled “tokens”string[]
Returns
Section titled “Returns”Promise<Record<string, bigint>>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getTokenBalances
getTransactionReceipt()
Section titled “getTransactionReceipt()”getTransactionReceipt(
hash):Promise<TronReceipt|undefined>
Defined in: wallet-tron/src/read-only-account.ts:384
The receipt, or undefined while the transaction is unconfirmed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<TronReceipt | undefined>
Implementation of
Section titled “Implementation of”IWalletAccount.getTransactionReceipt
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.getTransactionReceipt
post()
Section titled “post()”
protectedpost<T>(path,body,what):Promise<T>
Defined in: wallet-tron/src/read-only-account.ts:124
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
unknown
string
Returns
Section titled “Returns”Promise<T>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.post
quoteSendTransaction()
Section titled “quoteSendTransaction()”quoteSendTransaction(
tx):Promise<TronQuote>
Defined in: wallet-tron/src/read-only-account.ts:351
fee = the sun the sender burns, after staked / free resources.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronQuote>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteSendTransaction
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.quoteSendTransaction
quoteTransaction()
Section titled “quoteTransaction()”
protectedquoteTransaction(tx,sim?):Promise<TronQuote>
Defined in: wallet-tron/src/read-only-account.ts:345
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronQuote>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.quoteTransaction
quoteTransfer()
Section titled “quoteTransfer()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronQuote>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteTransfer
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.quoteTransfer
requireClient()
Section titled “requireClient()”
protectedrequireClient(what):TronFetch
Defined in: wallet-tron/src/read-only-account.ts:119
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.requireClient
sendTransaction()
Section titled “sendTransaction()”sendTransaction(
tx,options?):Promise<TronTransferResult>
Defined in: wallet-tron/src/account.ts:267
Sign and broadcast.
Parameters
Section titled “Parameters”string | TronTransaction
options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TronTransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.sendTransaction
sign()
Section titled “sign()”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).
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
signRaw()
Section titled “signRaw()”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).
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TronRawTransaction>
signTransaction()
Section titled “signTransaction()”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.
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.signTransaction
simulateCall()
Section titled “simulateCall()”
protectedsimulateCall(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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronSimulation>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.simulateCall
simulateRaw()
Section titled “simulateRaw()”
protectedsimulateRaw(tx):Promise<TronSimulation>
Defined in: wallet-tron/src/read-only-account.ts:260
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronSimulation>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.simulateRaw
simulateTransaction()
Section titled “simulateTransaction()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TronSimulation>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.simulateTransaction
toReadOnlyAccount()
Section titled “toReadOnlyAccount()”toReadOnlyAccount():
IWalletAccountReadOnly
Defined in: wallet-tron/src/account.ts:285
The same address as a WalletAccountReadOnlyTron.
Returns
Section titled “Returns”IWalletAccountReadOnly
Implementation of
Section titled “Implementation of”IWalletAccount.toReadOnlyAccount
transfer()
Section titled “transfer()”transfer(
o,writeOptions?):Promise<TronTransferResult>
Defined in: wallet-tron/src/account.ts:277
TRX (no token) or TRC-20 transfer(address,uint256).
Parameters
Section titled “Parameters”writeOptions?
Section titled “writeOptions?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TronTransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.transfer
trc20TransferParams()
Section titled “trc20TransferParams()”
protectedtrc20TransferParams(recipient,amount): ({type:string;value:string; } | {type:string;value:bigint; })[]
Defined in: wallet-tron/src/read-only-account.ts:357
Parameters
Section titled “Parameters”recipient
Section titled “recipient”string
amount
Section titled “amount”string | number | bigint
Returns
Section titled “Returns”({ type: string; value: string; } | { type: string; value: bigint; })[]
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyTron.trc20TransferParams
verify()
Section titled “verify()”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).
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”WalletAccountReadOnlyTron.verify
fromPrivateKey()
Section titled “fromPrivateKey()”
staticfromPrivateKey(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.
Parameters
Section titled “Parameters”privateKey
Section titled “privateKey”Uint8Array
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”TronConfig = {}
Returns
Section titled “Returns”WalletAccountTron