WalletAccountReadOnlySolana
Defined in: wallet-solana/src/read-only-account.ts:139
A Solana address without a key: balances, mint info, fee quotes, simulation, the serialized- transaction guard, receipts and signature checks.
Extended by
Section titled “Extended by”Implements
Section titled “Implements”IWalletAccountReadOnly
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountReadOnlySolana(
addr,config?):WalletAccountReadOnlySolana
Defined in: wallet-solana/src/read-only-account.ts:148
Parameters
Section titled “Parameters”string
config?
Section titled “config?”SolanaConfig = {}
Returns
Section titled “Returns”WalletAccountReadOnlySolana
Properties
Section titled “Properties”_commitment
Section titled “_commitment”
protectedreadonly_commitment:Commitment
Defined in: wallet-solana/src/read-only-account.ts:146
_config
Section titled “_config”
protectedreadonly_config:SolanaConfig
Defined in: wallet-solana/src/read-only-account.ts:144
protectedreadonly_rpc:Rpc<SolanaRpcApiForTestClusters> |undefined
Defined in: wallet-solana/src/read-only-account.ts:145
address
Section titled “address”
readonlyaddress:Address
Defined in: wallet-solana/src/read-only-account.ts:141
Base58 address.
readonlychain:string
Defined in: wallet-solana/src/read-only-account.ts:143
CAIP-2 id of the cluster.
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.chain
Methods
Section titled “Methods”assertWalletRecipient()
Section titled “assertWalletRecipient()”
protectedassertWalletRecipient(recipient):Promise<void>
Defined in: wallet-solana/src/read-only-account.ts:337
A transfer’s recipient must be a wallet (round 3, M10). A token account or a mint as recipient gets an associated token account nobody can sign for, and SOL or tokens sent to a program are lost: an account owned by Token / Token-2022, or an executable one, is refused. An address with no account yet is an ordinary wallet.
Parameters
Section titled “Parameters”recipient
Section titled “recipient”string
Returns
Section titled “Returns”Promise<void>
protectedata(mint,owner,tokenProgram?):Promise<Address>
Defined in: wallet-solana/src/read-only-account.ts:262
Parameters
Section titled “Parameters”Address
Address
tokenProgram?
Section titled “tokenProgram?”Address = TOKEN_PROGRAM_ADDRESS
Returns
Section titled “Returns”Promise<Address>
buildNativeTransfer()
Section titled “buildNativeTransfer()”
protectedbuildNativeTransfer(to,value):Promise<TransactionMessage>
Defined in: wallet-solana/src/read-only-account.ts:326
Parameters
Section titled “Parameters”string
string | number | bigint
Returns
Section titled “Returns”Promise<TransactionMessage>
buildTokenTransfer()
Section titled “buildTokenTransfer()”
protectedbuildTokenTransfer(token,recipient,amount):Promise<{message:TransactionMessage;tokenFee:bigint; }>
Defined in: wallet-solana/src/read-only-account.ts:348
SPL / Token-2022 transfer via transferChecked (mint + decimals verified on chain); the recipient ATA is created when missing.
Parameters
Section titled “Parameters”string
recipient
Section titled “recipient”string
amount
Section titled “amount”string | number | bigint
Returns
Section titled “Returns”Promise<{ message: TransactionMessage; tokenFee: bigint; }>
checkSerialized()
Section titled “checkSerialized()”checkSerialized(
base64,guard,options?):Promise<SerializedCheck>
Defined in: wallet-solana/src/read-only-account.ts:793
Prove what a provider-built transaction does before anyone signs it (see
serialized.ts). Throws UnsafeTransactionError (allowlist, authority
changes, balance violations), MissingSignersError or
SimulationError; returns the evidence otherwise. Nothing is signed.
Parameters
Section titled “Parameters”base64
Section titled “base64”string
options?
Section titled “options?”PlanOptions = {}
Returns
Section titled “Returns”Promise<SerializedCheck>
describeTransaction()
Section titled “describeTransaction()”describeTransaction(
tx):TransactionDescription
Defined in: wallet-solana/src/read-only-account.ts:998
Decode without the network: what the transaction does and what to be wary of.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”enforce()
Section titled “enforce()”
protectedenforce(description,options?):void
Defined in: wallet-solana/src/read-only-account.ts:530
Hard checks shared by every signing path. options carries the per-call opt-ins (SolanaWriteOptions).
Parameters
Section titled “Parameters”description
Section titled “description”options?
Section titled “options?”allowDurableNonce?
Section titled “allowDurableNonce?”boolean
Returns
Section titled “Returns”void
enforceAuthorities()
Section titled “enforceAuthorities()”
protectedenforceAuthorities(description):void
Defined in: wallet-solana/src/read-only-account.ts:552
The drainer shapes a wallet never signs by default: this wallet’s account reassigned, allocated
or created under a program; a nonce, token, metadata or group authority handed away; lamports
moved out by an instruction the description does not show as a transfer (a token account
closed, excess or wrapped lamports withdrawn, a nonce or seed account emptied) to anyone but
this wallet; a token Batch (it can carry any of these); an undecodable System / Token
instruction. Instructions whose accounts sit in unresolved lookup tables are judged by their
identified name (this wallet, a signer, is always a static key). A program this wallet signs
for can still do any of this by CPI; sendSerialized proves the outcome by simulation instead.
Parameters
Section titled “Parameters”description
Section titled “description”Returns
Section titled “Returns”void
enforceCompiledSigners()
Section titled “enforceCompiledSigners()”
protectedenforceCompiledSigners(description,options?):void
Defined in: wallet-solana/src/read-only-account.ts:709
Signer checks shared by every compiled-transaction path: this wallet must be a required signer and nobody else may still be missing.
Parameters
Section titled “Parameters”description
Section titled “description”options?
Section titled “options?”PlanOptions = {}
Returns
Section titled “Returns”void
feeForBase64()
Section titled “feeForBase64()”
protectedfeeForBase64(messageBase64):Promise<bigint>
Defined in: wallet-solana/src/read-only-account.ts:981
Parameters
Section titled “Parameters”messageBase64
Section titled “messageBase64”string
Returns
Section titled “Returns”Promise<bigint>
feeForMessage()
Section titled “feeForMessage()”
protectedfeeForMessage(msg):Promise<bigint>
Defined in: wallet-solana/src/read-only-account.ts:976
Parameters
Section titled “Parameters”TransactionMessage
Returns
Section titled “Returns”Promise<bigint>
getAccountInfos()
Section titled “getAccountInfos()”getAccountInfos(
addresses):Promise<(SolanaAccountData|null)[]>
Defined in: wallet-solana/src/read-only-account.ts:767
Raw accounts in the order asked (null where none exists), batched 100 per getMultipleAccounts:
for modules that check a provider’s figures against the chain state they claim to describe.
Parameters
Section titled “Parameters”addresses
Section titled “addresses”readonly string[]
Returns
Section titled “Returns”Promise<(SolanaAccountData | null)[]>
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: wallet-solana/src/read-only-account.ts:163
The base58 address.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.getAddress
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: wallet-solana/src/read-only-account.ts:166
Native balance in lamports.
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.getBalance
getMintInfo()
Section titled “getMintInfo()”getMintInfo(
mint):Promise<MintInfo>
Defined in: wallet-solana/src/read-only-account.ts:174
Mint owner program, decimals and (Token-2022) the transfer fee in force this epoch.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<MintInfo>
getTokenAccountOwner()
Section titled “getTokenAccountOwner()”getTokenAccountOwner(
tokenAccount):Promise<string|undefined>
Defined in: wallet-solana/src/read-only-account.ts:201
The owner of a Token / Token-2022 token account — whom an SPL transfer into it pays — or undefined when the address holds no initialized token account (a wallet, a mint, nothing). Network errors throw. The kit’s policies read SPL transfer recipients through it.
Parameters
Section titled “Parameters”tokenAccount
Section titled “tokenAccount”string
Returns
Section titled “Returns”Promise<string | undefined>
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
token):Promise<bigint>
Defined in: wallet-solana/src/read-only-account.ts:272
Balance of a mint in this wallet’s associated token account (Token or Token-2022, whichever owns the mint), in base units; 0 when that account does not exist or the address is not a mint. A network error throws: it is never read as a zero balance (round 3, L10).
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-solana/src/read-only-account.ts:287
Batched over getMultipleAccounts (100 addresses per call). Both programs’ associated token accounts are read for every mint, so Token-2022 balances count (round 3, L10); the amount comes from the token-account layout (offset 64) of the account that holds that mint.
Parameters
Section titled “Parameters”tokens
Section titled “tokens”string[]
Returns
Section titled “Returns”Promise<Record<string, bigint>>
getTokenInfo()
Section titled “getTokenInfo()”getTokenInfo(
token):Promise<TokenInfo>
Defined in: wallet-solana/src/read-only-account.ts:222
Decimals, symbol, name, supply and the holder-relevant flags of a mint, read from the chain: a live mint or freeze authority, and the Token-2022 extensions that let someone take, tax, hook, freeze or pause holders’ tokens. Name and symbol come from the Token-2022 metadata extension, else from the Metaplex metadata account (“” when there is neither). Throws NotATokenError when the address is not an initialized Token / Token-2022 mint.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<TokenInfo>
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.getTokenInfo
getTransactionReceipt()
Section titled “getTransactionReceipt()”getTransactionReceipt(
hash):Promise<SolanaReceipt|undefined>
Defined in: wallet-solana/src/read-only-account.ts:1003
The receipt, or undefined while the transaction has not landed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<SolanaReceipt | undefined>
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.getTransactionReceipt
latestBlockhash()
Section titled “latestBlockhash()”
protectedlatestBlockhash():Promise<Readonly<{ }>>
Defined in: wallet-solana/src/read-only-account.ts:311
Returns
Section titled “Returns”Promise<Readonly<{ }>>
lookupAddresses()
Section titled “lookupAddresses()”
protectedlookupAddresses(tables):Promise<Record<string, readonlystring[]> |undefined>
Defined in: wallet-solana/src/read-only-account.ts:756
Addresses of a lookup-table set, fetched once; undefined when the message uses none.
Parameters
Section titled “Parameters”tables
Section titled “tables”readonly string[]
Returns
Section titled “Returns”Promise<Record<string, readonly string[]> | undefined>
plan()
Section titled “plan()”
protectedplan(tx,opts?):Promise<SolanaPlan>
Defined in: wallet-solana/src/read-only-account.ts:960
Plan any accepted input.
Parameters
Section titled “Parameters”PlanOptions = {}
Returns
Section titled “Returns”Promise<SolanaPlan>
planCompiled()
Section titled “planCompiled()”
protectedplanCompiled(input,opts?):Promise<SolanaPlan>
Defined in: wallet-solana/src/read-only-account.ts:717
Plan a compiled transaction (kit Transaction or base64 wire): hard checks, simulation, fee quote. The bytes are never altered.
Parameters
Section titled “Parameters”string | Readonly<{ }>
PlanOptions = {}
Returns
Section titled “Returns”Promise<SolanaPlan>
planMessage()
Section titled “planMessage()”
protectedplanMessage(input,opts?):Promise<SolanaPlan>
Defined in: wallet-solana/src/read-only-account.ts:664
Plan a message-based transaction: lookup tables, compute budget (priority price + unit limit), simulation and the fee quote. Shared by quote / sign / send so the network is consulted once per fact.
Parameters
Section titled “Parameters”TransactionMessage
PlanOptions & object = {}
Returns
Section titled “Returns”Promise<SolanaPlan>
planTransfer()
Section titled “planTransfer()”
protectedplanTransfer(o,opts?):Promise<SolanaPlan>
Defined in: wallet-solana/src/read-only-account.ts:965
Parameters
Section titled “Parameters”PlanOptions = {}
Returns
Section titled “Returns”Promise<SolanaPlan>
prepareMessage()
Section titled “prepareMessage()”
protectedprepareMessage(tx):Promise<TransactionMessage>
Defined in: wallet-solana/src/read-only-account.ts:372
Normalise {to, value} or a kit message into a message with lifetime + this account as fee payer.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<TransactionMessage>
quoteCompiled()
Section titled “quoteCompiled()”
protectedquoteCompiled(transaction,description):Promise<SolanaFeeQuote>
Defined in: wallet-solana/src/read-only-account.ts:736
Fee of a compiled transaction: signatures + the compute budget it carries, floored by the RPC’s own quote.
Parameters
Section titled “Parameters”transaction
Section titled “transaction”Transaction
description
Section titled “description”Returns
Section titled “Returns”Promise<SolanaFeeQuote>
quoteSendTransaction()
Section titled “quoteSendTransaction()”quoteSendTransaction(
tx):Promise<SolanaFeeQuote>
Defined in: wallet-solana/src/read-only-account.ts:988
Full fee breakdown (base + priority, Token-2022 fee for transfers). Simulation runs too, so a reverting tx is reported here.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SolanaFeeQuote>
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.quoteSendTransaction
quoteTransfer()
Section titled “quoteTransfer()”quoteTransfer(
o):Promise<SolanaFeeQuote>
Defined in: wallet-solana/src/read-only-account.ts:993
Fee breakdown of a transfer, including the compute budget and any Token-2022 transfer fee.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SolanaFeeQuote>
Implementation of
Section titled “Implementation of”IWalletAccountReadOnly.quoteTransfer
requireRpc()
Section titled “requireRpc()”
protectedrequireRpc(what):SolanaRpc
Defined in: wallet-solana/src/read-only-account.ts:157
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”simulateSerialized()
Section titled “simulateSerialized()”simulateSerialized(
base64,guard):Promise<{check:SerializedCheck;ok:true; } | {code?:string;ok:false;reason:string; }>
Defined in: wallet-solana/src/read-only-account.ts:949
checkSerialized without throwing for a refusal: the check or the reason.
Parameters
Section titled “Parameters”base64
Section titled “base64”string
Returns
Section titled “Returns”Promise<{ check: SerializedCheck; ok: true; } | { code?: string; ok: false; reason: string; }>
simulateTransaction()
Section titled “simulateTransaction()”simulateTransaction(
tx):Promise<SimulationResult>
Defined in: wallet-solana/src/read-only-account.ts:522
simulateTransaction for any accepted input; never throws for an on-chain failure, only for transport errors.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SimulationResult>
verify()
Section titled “verify()”verify(
message,signature):Promise<boolean>
Defined in: wallet-solana/src/read-only-account.ts:1012
ed25519 over the UTF-8 message; signature hex.
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
withLookupTables()
Section titled “withLookupTables()”
protectedwithLookupTables(msg,tables):Promise<TransactionMessage>
Defined in: wallet-solana/src/read-only-account.ts:389
Compress a v0 message with the given address lookup tables (fetched from the RPC).
Parameters
Section titled “Parameters”TransactionMessage
tables
Section titled “tables”string[] | undefined
Returns
Section titled “Returns”Promise<TransactionMessage>
transferFeeFor()
Section titled “transferFeeFor()”
statictransferFeeFor(info,amount):bigint
Defined in: wallet-solana/src/read-only-account.ts:256
Token-2022 transfer fee for amount under info (0 for plain mints).
Parameters
Section titled “Parameters”amount
Section titled “amount”bigint
Returns
Section titled “Returns”bigint