Skip to content
docs

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.

  • IWalletAccountReadOnly

new WalletAccountReadOnlySolana(addr, config?): WalletAccountReadOnlySolana

Defined in: wallet-solana/src/read-only-account.ts:148

string

SolanaConfig = {}

WalletAccountReadOnlySolana

protected readonly _commitment: Commitment

Defined in: wallet-solana/src/read-only-account.ts:146


protected readonly _config: SolanaConfig

Defined in: wallet-solana/src/read-only-account.ts:144


protected readonly _rpc: Rpc<SolanaRpcApiForTestClusters> | undefined

Defined in: wallet-solana/src/read-only-account.ts:145


readonly address: Address

Defined in: wallet-solana/src/read-only-account.ts:141

Base58 address.


readonly chain: string

Defined in: wallet-solana/src/read-only-account.ts:143

CAIP-2 id of the cluster.

IWalletAccountReadOnly.chain

protected assertWalletRecipient(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.

string

Promise<void>


protected ata(mint, owner, tokenProgram?): Promise<Address>

Defined in: wallet-solana/src/read-only-account.ts:262

Address

Address

Address = TOKEN_PROGRAM_ADDRESS

Promise<Address>


protected buildNativeTransfer(to, value): Promise<TransactionMessage>

Defined in: wallet-solana/src/read-only-account.ts:326

string

string | number | bigint

Promise<TransactionMessage>


protected buildTokenTransfer(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.

string

string

string | number | bigint

Promise<{ message: TransactionMessage; tokenFee: bigint; }>


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.

string

SerializedTxGuard

PlanOptions = {}

Promise<SerializedCheck>


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.

SolanaTransaction

TransactionDescription


protected enforce(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).

TransactionDescription

boolean

void


protected enforceAuthorities(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.

TransactionDescription

void


protected enforceCompiledSigners(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.

TransactionDescription

PlanOptions = {}

void


protected feeForBase64(messageBase64): Promise<bigint>

Defined in: wallet-solana/src/read-only-account.ts:981

string

Promise<bigint>


protected feeForMessage(msg): Promise<bigint>

Defined in: wallet-solana/src/read-only-account.ts:976

TransactionMessage

Promise<bigint>


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.

readonly string[]

Promise<(SolanaAccountData | null)[]>


getAddress(): Promise<string>

Defined in: wallet-solana/src/read-only-account.ts:163

The base58 address.

Promise<string>

IWalletAccountReadOnly.getAddress


getBalance(): Promise<bigint>

Defined in: wallet-solana/src/read-only-account.ts:166

Native balance in lamports.

Promise<bigint>

IWalletAccountReadOnly.getBalance


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.

string

Promise<MintInfo>


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.

string

Promise<string | undefined>


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

string

Promise<bigint>

IWalletAccountReadOnly.getTokenBalance


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.

string[]

Promise<Record<string, bigint>>


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.

string

Promise<TokenInfo>

IWalletAccountReadOnly.getTokenInfo


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.

string

Promise<SolanaReceipt | undefined>

IWalletAccountReadOnly.getTransactionReceipt


protected latestBlockhash(): Promise<Readonly<{ }>>

Defined in: wallet-solana/src/read-only-account.ts:311

Promise<Readonly<{ }>>


protected lookupAddresses(tables): Promise<Record<string, readonly string[]> | 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.

readonly string[]

Promise<Record<string, readonly string[]> | undefined>


protected plan(tx, opts?): Promise<SolanaPlan>

Defined in: wallet-solana/src/read-only-account.ts:960

Plan any accepted input.

SolanaTransaction

PlanOptions = {}

Promise<SolanaPlan>


protected planCompiled(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.

string | Readonly<{ }>

PlanOptions = {}

Promise<SolanaPlan>


protected planMessage(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.

TransactionMessage

PlanOptions & object = {}

Promise<SolanaPlan>


protected planTransfer(o, opts?): Promise<SolanaPlan>

Defined in: wallet-solana/src/read-only-account.ts:965

SolanaTransferOptions

PlanOptions = {}

Promise<SolanaPlan>


protected prepareMessage(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.

SolanaTransaction

Promise<TransactionMessage>


protected quoteCompiled(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.

Transaction

TransactionDescription

Promise<SolanaFeeQuote>


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.

SolanaTransaction

Promise<SolanaFeeQuote>

IWalletAccountReadOnly.quoteSendTransaction


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.

SolanaTransferOptions

Promise<SolanaFeeQuote>

IWalletAccountReadOnly.quoteTransfer


protected requireRpc(what): SolanaRpc

Defined in: wallet-solana/src/read-only-account.ts:157

string

SolanaRpc


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.

string

SerializedTxGuard

Promise<{ check: SerializedCheck; ok: true; } | { code?: string; ok: false; reason: string; }>


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.

SolanaTransaction

Promise<SimulationResult>


verify(message, signature): Promise<boolean>

Defined in: wallet-solana/src/read-only-account.ts:1012

ed25519 over the UTF-8 message; signature hex.

string | Uint8Array<ArrayBufferLike>

string

Promise<boolean>

IWalletAccountReadOnly.verify


protected withLookupTables(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).

TransactionMessage

string[] | undefined

Promise<TransactionMessage>


static transferFeeFor(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).

MintInfo

bigint

bigint