Skip to content
docs

WalletAccountSolana

Defined in: wallet-solana/src/account.ts:34

Signing Solana account. The account never touches a private key: every signature is one signer.sign(bytes, {scheme: 'ed25519', context}) call over the compiled message bytes — a LocalSigner for seed wallets, anything else (hardware, MPC, backend) through externalSigner(). No WebCrypto anywhere, so it runs unchanged in Node and Hermes.

Every broadcast goes through the same plan: hard checks (fee payer, burn address, missing co-signers) → compute budget → simulation → fee guard → sign → send. A failing step throws before the signer is asked for anything.

  • IWalletAccount

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

Defined in: wallet-solana/src/account.ts:51

Signer

Uint8Array

string

SolanaConfig = {}

WalletAccountSolana

WalletAccountReadOnlySolana.constructor

protected readonly _commitment: Commitment

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

WalletAccountReadOnlySolana._commitment


protected readonly _config: SolanaConfig

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

WalletAccountReadOnlySolana._config


protected readonly _rpc: Rpc<SolanaRpcApiForTestClusters> | undefined

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

WalletAccountReadOnlySolana._rpc


readonly address: Address

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

Base58 address.

WalletAccountReadOnlySolana.address


readonly chain: string

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

CAIP-2 id of the cluster.

IWalletAccount.chain

WalletAccountReadOnlySolana.chain


readonly needsNetwork: true = true

Defined in: wallet-solana/src/account.ts:36

Blockhash and fee come from the network before signing.

IWalletAccount.needsNetwork


readonly path: string

Defined in: wallet-solana/src/account.ts:38

Derivation path, or external for an external signer.


readonly publicKey: Uint8Array

Defined in: wallet-solana/src/account.ts:40

The signer’s 32-byte ed25519 public key (needed synchronously for the address).


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

Defined in: wallet-solana/src/account.ts:48

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

get index(): number | undefined

Defined in: wallet-solana/src/account.ts:65

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

number | undefined

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>

WalletAccountReadOnlySolana.assertWalletRecipient


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>

WalletAccountReadOnlySolana.ata


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

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

string

string | number | bigint

Promise<TransactionMessage>

WalletAccountReadOnlySolana.buildNativeTransfer


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

WalletAccountReadOnlySolana.buildTokenTransfer


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>

WalletAccountReadOnlySolana.checkSerialized


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

WalletAccountReadOnlySolana.describeTransaction


dispose(): void

Defined in: wallet-solana/src/account.ts:187

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

void

IWalletAccount.dispose


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

WalletAccountReadOnlySolana.enforce


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

WalletAccountReadOnlySolana.enforceAuthorities


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

WalletAccountReadOnlySolana.enforceCompiledSigners


protected feeForBase64(messageBase64): Promise<bigint>

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

string

Promise<bigint>

WalletAccountReadOnlySolana.feeForBase64


protected feeForMessage(msg): Promise<bigint>

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

TransactionMessage

Promise<bigint>

WalletAccountReadOnlySolana.feeForMessage


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

WalletAccountReadOnlySolana.getAccountInfos


getAddress(): Promise<string>

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

The base58 address.

Promise<string>

IWalletAccount.getAddress

WalletAccountReadOnlySolana.getAddress


getBalance(): Promise<bigint>

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

Native balance in lamports.

Promise<bigint>

IWalletAccount.getBalance

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

WalletAccountReadOnlySolana.getMintInfo


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>

WalletAccountReadOnlySolana.getTokenAccountOwner


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>

IWalletAccount.getTokenBalance

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

WalletAccountReadOnlySolana.getTokenBalances


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>

IWalletAccount.getTokenInfo

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

IWalletAccount.getTransactionReceipt

WalletAccountReadOnlySolana.getTransactionReceipt


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

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

Promise<Readonly<{ }>>

WalletAccountReadOnlySolana.latestBlockhash


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>

WalletAccountReadOnlySolana.lookupAddresses


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

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

Plan any accepted input.

SolanaTransaction

PlanOptions = {}

Promise<SolanaPlan>

WalletAccountReadOnlySolana.plan


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>

WalletAccountReadOnlySolana.planCompiled


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>

WalletAccountReadOnlySolana.planMessage


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

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

SolanaTransferOptions

PlanOptions = {}

Promise<SolanaPlan>

WalletAccountReadOnlySolana.planTransfer


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>

WalletAccountReadOnlySolana.prepareMessage


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>

WalletAccountReadOnlySolana.quoteCompiled


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>

IWalletAccount.quoteSendTransaction

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

IWalletAccount.quoteTransfer

WalletAccountReadOnlySolana.quoteTransfer


protected requireRpc(what): SolanaRpc

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

string

SolanaRpc

WalletAccountReadOnlySolana.requireRpc


sendSerialized(base64, guard, options?): Promise<SolanaSendResult & object>

Defined in: wallet-solana/src/account.ts:171

Sign and broadcast a provider-built transaction (base64 wire) after checkSerialized proved it only does what guard.expect allows. Signatures already present (other parties) are preserved. The checked fee is held to the tighter of transactionMaxFee and options.maxFee.

string

SerializedTxGuard

SolanaWriteOptions = {}

Promise<SolanaSendResult & object>


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

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

Sign and broadcast.

SolanaTransaction

SolanaWriteOptions = {}

Promise<SolanaSendResult>

IWalletAccount.sendTransaction


sign(message): Promise<string>

Defined in: wallet-solana/src/account.ts:77

Hex ed25519 signature over the raw message bytes (UTF-8 for a string; context solana-offchain). Throws MessageIsTransactionError when the bytes are a Solana transaction this account would sign for (see isSolanaTransactionPayload): that must go through signTransaction. On an external signer (path ‘external’) a 32-byte message is refused too: the same ed25519 key may also be a TON or NEAR wallet, whose transactions are signed over a 32-byte digest.

string | Uint8Array<ArrayBufferLike>

Promise<string>

IWalletAccount.sign


signCompiled(tx, options?): Promise<Readonly<{ }>>

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

Add this wallet’s signature to a compiled transaction (other signatures are preserved). Runs the same checks as every signing path (round 3): a drainer shape, a burn or a durable nonce is refused unless the config or options opt in. No simulation and no fee quote: it is a primitive.

Transaction

SolanaWriteOptions = {}

Promise<Readonly<{ }>>


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

Defined in: wallet-solana/src/account.ts:120

Sign without broadcasting. Returns the base64 wire transaction. Simulation still runs (a reverting tx is refused).

SolanaTransaction

SolanaWriteOptions = {}

Promise<string>

IWalletAccount.signTransaction


signTransactionMessage(msg, options?): Promise<Readonly<{ }>>

Defined in: wallet-solana/src/account.ts:95

Compile and sign a message; returns the kit Transaction (for callers that want to inspect or co-sign). Checked like signCompiled.

TransactionMessage

SolanaWriteOptions = {}

Promise<Readonly<{ }>>


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

WalletAccountReadOnlySolana.simulateSerialized


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>

WalletAccountReadOnlySolana.simulateTransaction


toReadOnlyAccount(): IWalletAccountReadOnly

Defined in: wallet-solana/src/account.ts:181

The same address as a WalletAccountReadOnlySolana.

IWalletAccountReadOnly

IWalletAccount.toReadOnlyAccount


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

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

SOL (no token), SPL or Token-2022 transfer; the recipient’s ATA is created when missing.

SolanaTransferOptions

WriteOptions = {}

Promise<SolanaSendResult>

IWalletAccount.transfer


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>

IWalletAccount.verify

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

WalletAccountReadOnlySolana.withLookupTables


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

Defined in: wallet-solana/src/account.ts:60

Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).

Uint8Array

Uint8Array

string

SolanaConfig = {}

WalletAccountSolana


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

WalletAccountReadOnlySolana.transferFeeFor