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.
Extended by
Section titled “Extended by”Implements
Section titled “Implements”IWalletAccountReadOnly
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountReadOnlyTron(
address,config?):WalletAccountReadOnlyTron
Defined in: wallet-tron/src/read-only-account.ts:110
Parameters
Section titled “Parameters”address
Section titled “address”string
config?
Section titled “config?”TronConfig = {}
Returns
Section titled “Returns”WalletAccountReadOnlyTron
Properties
Section titled “Properties”_client
Section titled “_client”
protectedreadonly_client:TronFetch|undefined
Defined in: wallet-tron/src/read-only-account.ts:108
_config
Section titled “_config”
protectedreadonly_config:TronConfig
Defined in: wallet-tron/src/read-only-account.ts:107
address
Section titled “address”
readonlyaddress:string
Defined in: wallet-tron/src/read-only-account.ts:103
base58 T…
addressHex
Section titled “addressHex”
readonlyaddressHex:string
Defined in: wallet-tron/src/read-only-account.ts:105
Hex form (41…).
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”IWalletAccountReadOnly.chain
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>
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”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>
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; }>
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>
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>
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>
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>
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”IWalletAccountReadOnly.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>
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”IWalletAccountReadOnly.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>
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>>
getResources()
Section titled “getResources()”
protectedgetResources():Promise<Resources>
Defined in: wallet-tron/src/read-only-account.ts:280
Returns
Section titled “Returns”Promise<Resources>
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”IWalletAccountReadOnly.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>>
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”IWalletAccountReadOnly.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>
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”IWalletAccountReadOnly.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>
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”IWalletAccountReadOnly.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”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>
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>
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>
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; })[]
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”IWalletAccountReadOnly.verify