Wallet Solana API Reference
Complete API documentation for @tetherto/wdk-wallet-solana
Table of Contents
| Class | Description | Methods |
|---|---|---|
| WalletManagerSolana | Main class for managing Solana wallets. Extends WalletManager from @tetherto/wdk-wallet. | Constructor, Methods |
| WalletAccountSolana | Individual Solana wallet account implementation. Extends WalletAccountReadOnlySolana and implements IWalletAccount. | Constructor, Methods, Properties |
| WalletAccountReadOnlySolana | Read-only Solana wallet account. | Constructor, Methods |
The package root re-exports AssertionError, DisposalError, InvalidSignerError, MaximumFeeExceededError, NoSuchElementError, ProviderRequiredError, TimeoutError, UnsupportedOperationError, ValueError, and WdkError from @tetherto/wdk-wallet.
WalletManagerSolana
The main class for managing Solana wallets.
Extends WalletManager from @tetherto/wdk-wallet.
Constructor
new WalletManagerSolana(seedOrSigner, config?)Parameters:
seedOrSigner(string | Uint8Array | ISignerSolana): BIP-39 mnemonic, raw 16–64-byte master seed, or a derivableISignerSolanafrom@tetherto/wdk-wallet-solana/signers. A supplied default signer must support derivation.config(object): Configuration objectprovider(string | SolanaRpc | Array<string | SolanaRpc>, optional): RPC URL, constructed Solana RPC client, or an ordered list mixing both for failoverrpcUrl(string | string[], optional): Deprecated alias forprovider. If both are set,providertakes precedencecommitment(string, optional): Commitment level ('processed', 'confirmed', or 'finalized')retries(number, optional): Additional retry attempts for ordered provider failover (default: 3)transferMaxFee(number | bigint, optional): Maximum fee amount for SPL token transfer operations (in lamports)transactionMaxFee(number | bigint, optional): Maximum fee amount for native SOL send/sign operations (in lamports)
A seed-backed manager derives accounts through its default signer. Retain any seed your application needs independently of the manager.
Example:
const wallet = new WalletManagerSolana(seedPhrase, {
provider: 'https://api.mainnet-beta.solana.com',
commitment: 'confirmed',
transferMaxFee: 5000, // Maximum SPL transfer fee in lamports
transactionMaxFee: 5000 // Maximum native send/sign fee in lamports
})Methods
| Method | Description | Returns |
|---|---|---|
getAccount(indexOrSignerName?, options?) | Derives an indexed account or returns the account for a named signer | Promise<WalletAccountSolana> |
getAccountByPath(path, options?) | Derives an account at a path relative to the selected signer | Promise<WalletAccountSolana> |
addSigner(name, signer) | Registers a caller-owned ISignerSolana | this |
getSigner(name?) | Returns the default signer or the named signer | ISignerSolana |
getFeeRates() | Returns current fee rates for transactions | Promise<{normal: bigint, fast: bigint}> |
dispose() | Initiates cleanup of wallet accounts | void |
getAccount(index)
Derives {index}'/0' relative to the selected signer. With the default seed-backed signer, derivation starts at m/44'/501'.
Parameters:
indexOrSignerName(number | string, optional): A zero-based index from 0 through 2³¹ − 1 (default: 0), or a registered signer name. A string selects that signer directly without deriving a child.options.signerName(string, optional): Selects a registered root signer for numeric derivation. Omit to use the default signer.
Returns: Promise<WalletAccountSolana> - The wallet account
Throws: ValueError for an invalid index, NoSuchElementError for an unknown signer, InvalidSignerError when a numeric index selects a non-derivable signer, or DisposalError when the manager is disposed.
Example:
const account = await wallet.getAccount(0)getAccountByPath(path)
Derives an account relative to the selected signer.
Parameters:
path(string): Relative SLIP-0010 path, for example"0'/0'/0'". Every segment must be hardened for the bundled seed signer.options.signerName(string, optional): Selects a registered root signer. Omit to use the default signer.
Returns: Promise<WalletAccountSolana> - The wallet account
Throws: ValueError if a derivation-path segment is not hardened.
Example:
const account = await wallet.getAccountByPath("0'/0'/1'")getFeeRates()
Returns current fee rates for transactions based on recent prioritization fees.
Returns: Promise<{normal: bigint, fast: bigint}> - Object containing fee rates in lamports
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const feeRates = await wallet.getFeeRates()
console.log('Normal fee rate:', feeRates.normal, 'lamports')
console.log('Fast fee rate:', feeRates.fast, 'lamports')dispose()
Disposes the default signer created from a seed, disposes cached accounts that expose a private key at cleanup time, and clears the account cache. Call account.dispose() on any retained account backed by a signer that does not expose private keys, and dispose caller-owned signers separately.
Example:
wallet.dispose()WalletAccountSolana
Represents an individual Solana wallet account. Extends WalletAccountReadOnlySolana and implements IWalletAccount.
Constructor
new WalletAccountSolana(seed, path, config?)
new WalletAccountSolana(signer, config?)Parameters:
seed(string | Uint8Array): BIP-39 mnemonic seed phrase or raw BIP-32 master seed (16–64 bytes)path(string): SLIP-0010 derivation path (e.g., "0'/0'/0'")signer(ISignerSolana): An account signer. Pass config as the second argument in this form.config(SolanaWalletConfig, optional): Configuration object. SetshouldWipeSignerOnDisposal: trueto let the account dispose a supplied signer.
A direct account that creates its own signer from a seed or via fromPrivateKey(privateKey, config?) disposes that signer during cleanup.
Throws: ValueError if a string seed is not a valid BIP-39 mnemonic or a derivation-path segment is not hardened.
In v1.0.0-beta.9 the constructor was made public. The static factory method WalletAccountSolana.at() still works but is deprecated; use the constructor directly instead.
Methods
| Method | Description | Returns |
|---|---|---|
getAddress() | Returns the account's Solana address | Promise<string> |
sign(message) | Signs a message using the account's private key | Promise<string> |
signTransaction(tx) | Signs a Solana transaction without broadcasting it, including a base64-encoded serialized transaction | Promise<FullySignedTransaction> |
verify(message, signature) | Verifies a message signature | Promise<boolean> |
sendTransaction(tx) | Builds and sends a transaction, signs and sends a base64-encoded serialized transaction, or broadcasts a fully signed transaction | Promise<{hash: string, fee: bigint}> |
quoteSendTransaction(tx) | Estimates the fee for a transaction, serialized transaction, or fully signed transaction | Promise<{fee: bigint}> |
transfer(options, solanaOptions?) | Transfers SPL tokens to another address | Promise<{hash: string, fee: bigint}> |
quoteTransfer(options, solanaOptions?) | Estimates the fee for an SPL token transfer | Promise<{fee: bigint}> |
getBalance() | Returns the native SOL balance (in lamports) | Promise<bigint> |
getTokenBalance(tokenMint) | Returns the balance of a specific SPL token | Promise<bigint> |
getTokenBalances(tokenAddresses) | Returns balances for multiple SPL tokens | Promise<Record<string, bigint>> |
getTransactionReceipt(hash) | Gets a native transaction object; deprecated in favor of getTransaction() | Promise<SolanaTransactionReceipt | null> |
getTransaction(hash) | Returns normalized finality for a Solana signature | Promise<TransactionReceipt & SolanaTransactionDetails> |
waitForTransaction(hash, options?) | Waits for confirmed or final finality | Promise<TransactionReceipt & SolanaTransactionDetails> |
toReadOnlyAccount() | Returns a read-only copy of the account | Promise<WalletAccountReadOnlySolana> |
dispose() | Initiates the account cleanup process | void |
getAddress()
Returns the account's Solana address.
Returns: Promise<string> - The account's base58-encoded Solana address
Example:
const address = await account.getAddress()
console.log('Account address:', address)sign(message)
Signs the UTF-8 bytes of the supplied text using the account's private key.
Parameters:
message(string): The message to sign
Returns: Promise<string> - The message signature (hex-encoded)
Throws: DisposalError if the account has been disposed.
Example:
const signature = await account.sign('Hello, Solana!')
console.log('Signature:', signature)signTransaction(tx)
Signs a Solana transaction without broadcasting it. Use this method when a relay, review flow, or separate submission path needs a fully signed transaction.
Parameters:
tx(SolanaTransaction): A simple transfer object, a prebuiltTransactionMessage, or a base64-encoded serialized transaction
When tx is a TransactionMessage, WDK preserves an existing recent blockhash or durable nonce lifetime. If no lifetime is present, WDK fetches the latest blockhash before signing. If you set an explicit feePayer, it must match the wallet address.
When tx is a base64-encoded serialized transaction, WDK decodes it, requires its fee payer to match the account address, and signs it. After this account adds its signature, the transaction must be fully signed; pre-existing signatures may be retained. This form is useful for serialized swap or bridge transactions produced by another service.
Treat serialized transactions from another service as untrusted. Decode and independently review every instruction, account, amount, and transaction lifetime before signing. WDK's fee-payer and signature checks do not validate the transaction's intended effects.
Returns: Promise<FullySignedTransaction> - The signed transaction
Throws:
DisposalErrorif the account has been disposed.ProviderRequiredErrorif the wallet is not connected to a provider.MaximumFeeExceededErrorif the estimated fee is greater thantransactionMaxFee.ValueErrorif the transaction fee payer does not match the account or the provider cannot calculate the fee.- A Solana error with code
SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSINGif required signatures remain missing after this account signs a serialized transaction.
Example:
const signedTransaction = await account.signTransaction({
to: '11111111111111111111111111111112',
value: 1000000000 // 1 SOL in lamports
})
console.log('Signed transaction:', signedTransaction)verify(message, signature)
Verifies a signature over the UTF-8 bytes of the supplied text against the account's address.
Parameters:
message(string): The original messagesignature(string): The signature to verify (hex-encoded)
Returns: Promise<boolean> - True if the signature is valid
Example:
const isValid = await account.verify('Hello, Solana!', signature)
console.log('Signature valid:', isValid)sendTransaction(tx)
Sends a Solana transaction.
Parameters:
tx(SolanaTransaction | FullySignedTransaction): A simple transfer object, prebuiltTransactionMessage, base64-encoded serialized transaction, or fully signed transactionto(string): Recipient's Solana address (base58-encoded)value(number | bigint): Amount in lamports
When tx is a TransactionMessage, WDK preserves an existing recent blockhash or durable nonce lifetime. If no lifetime is present, WDK fetches the latest blockhash before quoting or sending. If you set an explicit feePayer, it must match the wallet address.
When tx is a FullySignedTransaction, WDK quotes it again, enforces transactionMaxFee, and broadcasts its exact wire bytes. It does not refresh the recent blockhash or durable nonce and does not re-sign the transaction.
When tx is a base64-encoded serialized transaction, WDK signs it with this account and then broadcasts the resulting transaction. Its fee payer must match the account address. Before sending an externally supplied transaction, independently review its instructions, accounts, amounts, and lifetime; WDK does not validate its intended effects.
Returns: Promise<{hash: string, fee: bigint}> - Object containing transaction hash and fee (in lamports)
Throws:
DisposalErrorif the account has been disposed.ProviderRequiredErrorif the wallet is not connected to a provider.MaximumFeeExceededErrorif the estimated fee is greater thantransactionMaxFee.ValueErrorif the transaction fee payer does not match the account or the provider cannot calculate the fee.- A Solana error with code
SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSINGif required signatures remain missing after this account signs a serialized transaction.
Example:
const result = await account.sendTransaction({
to: '11111111111111111111111111111112',
value: 1000000000 // 1 SOL in lamports
})
console.log('Transaction hash:', result.hash)
console.log('Transaction fee:', result.fee, 'lamports')quoteSendTransaction(tx)
Estimates the fee for a Solana transaction.
Parameters:
tx(SolanaTransaction | FullySignedTransaction): A transaction input or fully signed transaction (same forms assendTransaction)
For a base64-encoded serialized transaction, WDK decodes the transaction and quotes the compiled message without signing or broadcasting it.
Returns: Promise<{fee: bigint}> - Object containing fee estimate (in lamports)
Throws:
ProviderRequiredErrorif the wallet is not connected to a provider.ValueErrorif the fee payer does not match this account or the provider cannot calculate the fee.
Example:
const quote = await account.quoteSendTransaction({
to: '11111111111111111111111111111112',
value: 1000000000
})
console.log('Estimated fee:', quote.fee, 'lamports')transfer(options)
Signature: transfer(options, solanaOptions?)
Transfers SPL tokens to another address, with an optional UTF-8 memo. Token-2022 mints and native SOL are not supported by this method.
Parameters:
-
options(TransferOptions): Transfer optionstoken(string): Token mint address (base58-encoded)recipient(string): Recipient's Solana address (base58-encoded)amount(number | bigint): Amount in token's base units
-
solanaOptions(SolanaTransferOptions, optional):{ memo?: string }; omitted or empty memos add no instruction
Returns: Promise<{hash: string, fee: bigint}> - Object containing transaction hash and fee (in lamports)
Throws:
DisposalErrorif the account has been disposed.ProviderRequiredErrorif the wallet is not connected to a provider.MaximumFeeExceededErrorif the estimated fee is greater thantransferMaxFee.ValueErrorif the token amount exceeds the supported integer range, the memo is not a string, the transaction exceeds the size limit, or the provider cannot calculate the fee.
Example:
const result = await account.transfer({
token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDt mint
recipient: '11111111111111111111111111111112',
amount: 1000000 // 1 USDt (6 decimals)
})
console.log('Transfer hash:', result.hash)
console.log('Transfer fee:', result.fee, 'lamports')quoteTransfer(options)
Signature: quoteTransfer(options, solanaOptions?)
Estimates the fee for an SPL token transfer, including an optional memo. Token-2022 mints and native SOL are not supported by this method.
Parameters:
-
options(TransferOptions): Transfer options (same as transfer) -
solanaOptions(SolanaTransferOptions, optional):{ memo?: string }; omitted or empty memos add no instruction
Returns: Promise<{fee: bigint}> - Object containing fee estimate (in lamports)
Throws:
ProviderRequiredErrorif the wallet is not connected to a provider.ValueErrorif the token amount exceeds the supported integer range, the memo is not a string, the transaction exceeds the size limit, or the provider cannot calculate the fee.
Example:
const quote = await account.quoteTransfer({
token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
recipient: '11111111111111111111111111111112',
amount: 1000000
})
console.log('Transfer fee estimate:', quote.fee, 'lamports')getBalance()
Returns the native SOL balance (in lamports).
Returns: Promise<bigint> - Balance in lamports
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const balance = await account.getBalance()
console.log('SOL balance:', balance, 'lamports')getTokenBalance(tokenMint)
Returns the balance of a specific SPL token.
Parameters:
tokenMint(string): Token mint address (base58-encoded)
Returns: Promise<bigint> - Token balance in base units
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const tokenBalance = await account.getTokenBalance('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
console.log('USDt balance:', tokenBalance)getTokenBalances(tokenAddresses)
Returns balances for multiple SPL tokens. The wallet batches associated token account lookups with getMultipleAccounts, returns balances in base units, and reports 0n for token accounts that do not exist.
Parameters:
tokenAddresses(string[]): Token mint addresses (base58-encoded)
Returns: Promise<Record<string, bigint>> - Mapping of token mint address to token balance in base units
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const tokenBalances = await account.getTokenBalances([
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
'So11111111111111111111111111111111111111112'
])
console.log('Token balances:', tokenBalances)getTransactionReceipt(hash)
Gets the native transaction object for a signature. This method is deprecated; use getTransaction() and read its transaction field when native data is needed.
Parameters:
hash(string): Transaction hash
Returns: Promise<SolanaTransactionReceipt \| null> - Transaction receipt details, or null if not found
Throws:
ProviderRequiredErrorif the wallet is not connected to a provider.ValueErrorifhashis not a valid Solana signature.
Example:
const receipt = await account.getTransactionReceipt('5....')
console.log('Transaction receipt:', receipt)getTransaction(hash)
Returns normalized status for a valid base58 Solana transaction signature. The method queries signature status with transaction-history search enabled.
const receipt = await account.getTransaction(signature)
console.log(receipt.finality) // pending, confirmed, or final
console.log(receipt.success) // Set after confirmed or finalized processing
console.log(receipt.confirmations) // Number, or null after finalization
console.log(receipt.transaction) // Native transaction object, or nullSolana processed maps to pending, confirmed maps to confirmed, and finalized maps to final. The block field is the slot and fee is the native transaction fee when available. A settled transaction reports success: false when its status contains an error. The native transaction can still be null when the RPC does not return it at the configured commitment.
No configured provider throws ProviderRequiredError. An invalid signature throws ValueError; a well-formed signature absent from status history throws NoSuchElementError.
waitForTransaction(hash, options?)
Polls until the target is reached. The default target is confirmed, interval is four seconds, and timeout is 60 seconds.
const receipt = await account.waitForTransaction(signature, {
target: 'final',
timeout: 60000,
interval: 4000,
maxPollErrors: 3
})waitForTransaction() immediately propagates ProviderRequiredError and ValueError, treats NoSuchElementError as transient while the signature can still propagate, and throws TimeoutError if the target is not reached. The Solana implementation does not currently classify an evicted or never-landed signature as dropped. Reaching a finality target does not guarantee execution success, so inspect success.
toReadOnlyAccount()
Returns a read-only copy of the account. After the first call, subsequent calls reuse the same read-only account instance.
Returns: Promise<WalletAccountReadOnlySolana> - The read-only account
Example:
const readOnlyAccount = await account.toReadOnlyAccount()dispose()
Disposes the account. It also disposes its signer when it owns the signer or was configured with shouldWipeSignerOnDisposal: true. A signer supplied directly is caller-owned by default.
Example:
account.dispose()Properties
Each account exposes its signer’s full path when available. If you need the numeric index later, retain the index you used to retrieve the account.
| Property | Type | Description |
|---|---|---|
path | string | null | The full SLIP-0010 path, or null for a non-HD signer |
keyPair | {publicKey: Uint8Array, privateKey: Uint8Array | null} | null | The signer’s key pair, or null if it does not expose one. For bundled signers, privateKey becomes null when the signer is disposed. |
⚠️ Security Note: The keyPair property contains sensitive cryptographic material. Never log, display, mutate, or expose the private key.
WalletAccountReadOnlySolana
Represents a read-only Solana wallet account.
Constructor
new WalletAccountReadOnlySolana(publicKey, config)Parameters:
publicKey(string): The account's public key (base58-encoded)config(SolanaWalletConfig, optional): Configuration object
Methods
| Method | Description | Returns |
|---|---|---|
getAddress() | Returns the account's Solana address | Promise<string> |
getBalance() | Returns the native SOL balance (in lamports) | Promise<bigint> |
getTokenBalance(tokenMint) | Returns the balance of a specific SPL token | Promise<bigint> |
getTokenBalances(tokenAddresses) | Returns balances for multiple SPL tokens | Promise<Record<string, bigint>> |
verify(message, signature) | Verifies a message signature | Promise<boolean> |
quoteSendTransaction(tx) | Estimates the fee for a transaction or base64-encoded serialized transaction | Promise<{fee: bigint}> |
quoteTransfer(options, solanaOptions?) | Estimates the fee for an SPL token transfer | Promise<{fee: bigint}> |
getTransactionReceipt(hash) | Gets a native transaction object; deprecated in favor of getTransaction() | Promise<SolanaTransactionReceipt | null> |
getTransaction(hash) | Returns normalized finality for a Solana signature | Promise<TransactionReceipt & SolanaTransactionDetails> |
waitForTransaction(hash, options?) | Waits for confirmed or final finality | Promise<TransactionReceipt & SolanaTransactionDetails> |
getAddress()
Returns the account's Solana address.
Returns: Promise<string> - The account's base58-encoded Solana address
Example:
const address = await readOnlyAccount.getAddress()
console.log('Account address:', address)getBalance()
Returns the native SOL balance (in lamports).
Returns: Promise<bigint> - Balance in lamports
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const balance = await readOnlyAccount.getBalance()
console.log('SOL balance:', balance, 'lamports')getTokenBalance(tokenMint)
Returns the balance of a specific SPL token.
Parameters:
tokenMint(string): Token mint address (base58-encoded)
Returns: Promise<bigint> - Token balance in base units
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const tokenBalance = await readOnlyAccount.getTokenBalance('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
console.log('USDt balance:', tokenBalance)getTokenBalances(tokenAddresses)
Returns balances for multiple SPL tokens from the read-only account address.
Parameters:
tokenAddresses(string[]): Token mint addresses (base58-encoded)
Returns: Promise<Record<string, bigint>> - Mapping of token mint address to token balance in base units
Throws: ProviderRequiredError if the wallet is not connected to a provider.
Example:
const tokenBalances = await readOnlyAccount.getTokenBalances([
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
'So11111111111111111111111111111111111111112'
])
console.log('Read-only token balances:', tokenBalances)verify(message, signature)
Verifies a signature over the UTF-8 bytes of the supplied text.
Parameters:
message(string): The original messagesignature(string): The signature to verify (hex-encoded)
Returns: Promise<boolean> - True if the signature is valid
Example:
const isValid = await readOnlyAccount.verify('Hello, Solana!', signature)
console.log('Signature valid:', isValid)quoteSendTransaction(tx)
Estimates the fee for a transaction.
Parameters:
tx(SolanaTransaction): A simple transfer object, prebuiltTransactionMessage, or a base64-encoded serialized transactionto(string): Recipient's Solana address (base58-encoded)value(number): Amount in lamports
Returns: Promise<{fee: bigint}> - Object containing fee estimate (in lamports)
Throws:
ProviderRequiredErrorif the wallet is not connected to a provider.ValueErrorif the fee payer does not match this account or the provider cannot calculate the fee.
Example:
const quote = await readOnlyAccount.quoteSendTransaction({
to: '11111111111111111111111111111112',
value: 1000000000
})
console.log('Estimated fee:', quote.fee, 'lamports')Pass a base64-encoded serialized transaction to quote a message created by another service. The read-only account decodes the transaction and does not sign or broadcast it.
quoteTransfer(options)
Signature: quoteTransfer(options, solanaOptions?)
Estimates the fee for an SPL token transfer, including an optional memo. Token-2022 mints and native SOL are not supported by this method.
Parameters:
-
options(TransferOptions): Transfer optionstoken(string): Token mint address (base58-encoded)recipient(string): Recipient's Solana address (base58-encoded)amount(number | bigint): Amount in token's base units
-
solanaOptions(SolanaTransferOptions, optional):{ memo?: string }; omitted or empty memos add no instruction
Returns: Promise<{fee: bigint}> - Object containing fee estimate (in lamports)
Throws:
ProviderRequiredErrorif the wallet is not connected to a provider.ValueErrorif the token amount exceeds the supported integer range, the memo is not a string, the transaction exceeds the size limit, or the provider cannot calculate the fee.
Example:
const quote = await readOnlyAccount.quoteTransfer({
token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
recipient: '11111111111111111111111111111112',
amount: 1000000
})
console.log('Transfer fee estimate:', quote.fee, 'lamports')getTransaction(hash) and waitForTransaction(hash, options?)
Read-only accounts expose the same normalized signature-status methods as owned accounts. getTransaction() maps processed, confirmed, and finalized to pending, confirmed, and final; it throws ProviderRequiredError without a provider, ValueError for an invalid signature, and NoSuchElementError when a valid signature is absent from history. waitForTransaction() propagates the provider and input errors, treats an absent history entry as transient, and throws TimeoutError if the target is not reached within its default 60 seconds. Inspect success after settlement. getTransactionReceipt() remains available for the native object but is deprecated.
Types
Normalized Transaction Types
type Finality = 'pending' | 'confirmed' | 'final' | 'dropped'
type WaitForTransactionTarget = 'confirmed' | 'final'
interface TransactionReceipt {
hash: string
finality: Finality
success?: boolean
block?: number
fee?: bigint
}
interface WaitForTransactionOptions {
target?: WaitForTransactionTarget // Default: 'confirmed'
timeout?: number // Milliseconds; Solana default: 60,000
interval?: number // Milliseconds; default: 4,000
maxPollErrors?: number // Default: 3
}
interface SolanaTransactionDetails {
confirmations: number | null
transaction: SolanaTransactionReceipt | null
}The package re-exports these types. dropped is part of the shared union, but the Solana implementation does not currently emit it.
SolanaWalletConfig
A manager shares one initialized RPC client with every derived account and their read-only conversions. Every failover entry must use the same network. A supplied client is reused as-is.
import { createSolanaRpc } from '@solana/rpc'
type SolanaRpc = ReturnType<typeof createSolanaRpc>
interface SolanaWalletConfig {
provider?: string | SolanaRpc | Array<string | SolanaRpc>;
/** Deprecated alias for provider. provider takes precedence when both are set. */
rpcUrl?: string | string[];
commitment?: 'processed' | 'confirmed' | 'finalized';
retries?: number;
transferMaxFee?: number | bigint;
transactionMaxFee?: number | bigint;
}SolanaTransferOptions
Import this public type from the package root when annotating the optional second argument to SPL transfer or quote methods:
import type { SolanaTransferOptions } from '@tetherto/wdk-wallet-solana'
const solanaOptions: SolanaTransferOptions = { memo: 'Invoice 1042' }memo?: string is encoded as UTF-8 and added before the SPL transfer instruction. An empty string is ignored. A non-string memo or an oversized complete transaction raises ValueError; the available memo length depends on the other transaction instructions. Token-2022 memo-transfer extensions remain unsupported.
FullySignedTransaction
signTransaction() returns the FullySignedTransaction type defined by @solana/transactions. The WDK package does not re-export this type; import it from the Solana package when an explicit annotation is needed.
import type { FullySignedTransaction } from '@solana/transactions'The signed value contains the compiled message bytes and all required signatures. Its transaction lifetime is sealed at signing time.
SolanaTransaction
type SolanaTransaction = SimpleSolanaTransaction | TransactionMessage | stringThe string form is a base64-encoded serialized Solana transaction. Owned accounts can sign and send this form when its fee payer matches the account; read-only accounts can quote it.
TransferOptions
interface TransferOptions {
token: string;
recipient: string;
amount: number | bigint;
}KeyPair
interface KeyPair {
publicKey: Uint8Array
privateKey: Uint8Array | null
}Node.js Quickstart
Get started with WDK in a Node.js environment
React Native Quickstart
Build mobile wallets with React Native Expo
WDK Solana Wallet Usage
Get started with WDK's Solana Wallet Usage
WDK Solana Wallet Configuration
Get started with WDK's Solana Wallet Configuration