solana_kit library

The Solana Kit Dart SDK.

Use this umbrella library when you want one import that re-exports the core Solana Kit packages for addresses, RPC, accounts, transactions, signers, and supporting codecs.

Program-specific packages such as solana_kit_system and solana_kit_token should be imported explicitly so applications only pull in the program clients they actually use.

Create an RPC client

Start with a typed RPC client. It gives you method-specific helpers instead of building raw JSON-RPC requests by hand, while still letting you swap transports or request middleware later.

import 'package:solana_kit/solana_kit.dart';

Future<void> main() async {
  final rpc = createSolanaRpc(url: 'https://api.devnet.solana.com');

  final slot = await rpc.getSlot().send();
  final latestBlockhash = await rpc.getLatestBlockhashValue().send();

  print('Current slot: $slot');
  print('Latest blockhash: ${latestBlockhash.value.blockhash}');
}

A call like rpc.getSlot() builds a typed request first and only hits the network when you call .send(). That separation makes it easier to compose, cache, batch, or decorate RPC interactions.

Use solana_kit_rpc_subscriptions alongside solana_kit_rpc when you also need websocket notifications for accounts, signatures, logs, or slots.

Generate a signer

Most app flows need a signer for fee payment, message signing, or transaction submission. generateKeyPairSigner() creates a new Ed25519 key-pair-backed KeyPairSigner.

import 'package:solana_kit/solana_kit.dart';

Future<void> main() async {
  final signer = generateKeyPairSigner();

  print('Address: ${signer.address}');
}

Use key-pair signers for local development, tests, automation, and server-side flows. For wallet-driven applications, you can also model fee-payer, partial, and sending signers explicitly with solana_kit_signers.

Build a transaction message

Transaction messages are assembled incrementally. The most common pattern is:

  1. Create an empty message.
  2. Set the fee payer.
  3. Set a lifetime constraint using a recent blockhash.
  4. Append one or more instructions.
import 'dart:typed_data';

import 'package:solana_kit/solana_kit.dart';

Future<void> main() async {
  final rpc = createSolanaRpc(url: 'https://api.devnet.solana.com');
  final feePayer = generateKeyPairSigner();
  final latestBlockhash = await rpc.getLatestBlockhashValue().send();

  final instruction = Instruction(
    programAddress: const Address('11111111111111111111111111111111'),
    accounts: [
      AccountMeta(
        address: feePayer.address,
        role: AccountRole.writableSigner,
      ),
    ],
    data: Uint8List(0),
  );

  final message = createTransactionMessage(version: TransactionVersion.v0)
      .withFeePayer(feePayer.address)
      .withBlockhashLifetime(
        BlockhashLifetimeConstraint(
          blockhash: latestBlockhash.value.blockhash.value,
          lastValidBlockHeight: latestBlockhash.value.lastValidBlockHeight,
        ),
      )
      .appendInstruction(instruction);

  print(message);
}

This separation keeps transaction construction explicit and makes it easier to reason about fee payment, expiry, and instruction ordering. If you prefer a more fluent style, the transaction-message extension methods build on the same underlying model.

Classes

Account<TData>
Contains all the information relevant to a Solana account. It includes the account's address and data, as well as the properties of BaseAccount.
AccountInfoBase
Base account information shared by all account info variants.
AccountInfoJsonData
Account info data for jsonParsed encoding - can be either parsed data or fall back to base64 encoding.
AccountInfoJsonDataBase64
Fallback base64-encoded data variant (used when jsonParsed encoding is requested but a parser cannot be found).
AccountInfoJsonDataParsed
Parsed account data variant.
AccountInfoWithBase64EncodedData
Account info with base64-encoded data.
AccountInfoWithBase64EncodedZStdCompressedData
Account info with base64-encoded zstd-compressed data.
AccountInfoWithJsonData
Account info with json-parsed data.
AccountInfoWithPubkey<TAccount extends AccountInfoBase>
Wraps account info with the account's public key.
AccountLookupMeta
Represents a lookup of the account's address in an address lookup table.
AccountMeta
Represents an account's address and metadata about its mutability and whether it must be a signer of the transaction.
AccountSignerMeta
An extension of the AccountMeta type that allows us to store transaction signers inside it.
AddressTableLookup
An address table lookup in a compiled transaction message.
ArrayLikeCodecSize
Determines how the size of an array-like codec is specified.
BaseAccount
Defines the attributes common to all Solana accounts. Namely, it contains everything stored on-chain except the account data itself.
BaseTransactionConfirmationStrategyConfig
Configuration for a confirmation strategy race.
BinaryFixedPoint
A binary fixed-point value.
BinaryFixedPointBase10
Exact base-10 representation of a binary fixed-point value.
BlockhashLifetimeConstraint
A constraint which, when applied to a transaction message, makes that transaction message eligible to land on the network. The transaction message will continue to be eligible to land until the network considers the blockhash to be expired.
BlockHeightExceedenceConfig
Configuration for the block height exceedence promise factory.
BooleanCodecConfig
Configuration options for boolean codecs.
CanceledSingleTransactionPlanResult
A canceled SingleTransactionPlanResult.
CancellationToken
A readable token that completes when an operation is cancelled.
CancellationTokenSource
A source that owns a CancellationToken and can cancel it.
ChannelPool
A pool of channel entries.
ChannelPoolEntry
An entry in the channel pool.
ChannelStreamController
A typed, stream-native publisher for string-keyed compatibility channels.
CleanableClient<T extends Object>
A client value paired with cleanup logic.
ClientWithFetchAccounts
Represents a client that can fetch the encoded content of accounts from their addresses.
ClientWithGetMinimumBalance
Represents a client that can compute the minimum balance for rent exemption.
ClientWithIdentity<TSigner extends Object>
Represents a client that provides a default identity signer.
ClientWithPayer<TSigner extends Object>
Represents a client that provides a default transaction payer.
ClientWithSubscribeToIdentity
Represents a client that advertises ClientWithIdentity.identity as reactive.
ClientWithSubscribeToPayer
Represents a client that advertises ClientWithPayer.payer as reactive.
Codec<TFrom, TTo>
An object that can both encode and decode values.
CompiledInstruction
A compiled instruction with indices referencing the static accounts list.
CompiledTransactionConfigValue
A v1 transaction config value.
CompiledTransactionMessage
A compiled transaction message suitable for encoding and execution on the network.
ConstantNoneValue
null values are replaced with a predefined byte sequence.
ConstantOptionNoneValue
None values are replaced with a predefined byte sequence.
DataSlice
Describes a slice of account data to retrieve.
DecimalFixedPoint
A decimal fixed-point value.
DecodedRpcTransaction
The result of decoding a getTransaction response: the CompiledTransactionMessage (always carrying a lifetimeToken), the loaded ALT addresses pulled from meta (if any), and — for 'base64' and 'base58' responses — the wire-format Transaction.
Decoder<T>
An object that can decode a Uint8List into a value of type T.
DecompileTransactionMessageConfig
Configuration for decompiling a transaction message.
DefaultRpcSubscriptionsChannelConfig
Configuration for creating a default RPC subscriptions channel creator.
DefaultRpcSubscriptionsConfig
Default configuration for Solana RPC subscriptions.
DefaultRpcSubscriptionsTransportConfig
Configuration for createDefaultRpcSubscriptionsTransport.
DependentStructDecoderBuilder
A fluent builder that accumulates field decoders for a struct whose later fields may depend on the values of earlier ones.
DurableNonceConfig
Configuration for setting a durable nonce lifetime on a transaction message.
DurableNonceLifetimeConstraint
A constraint which, when applied to a transaction message, makes that transaction message eligible to land on the network. The transaction message will continue to be eligible to land until the nonce value changes.
Encoder<T>
An object that can encode a value of type T into a Uint8List.
EpochInfo
Information about the current epoch.
ExistingAccount<TData>
An account that exists on-chain.
FailedSingleTransactionPlanResult
A failed SingleTransactionPlanResult.
FailedTransactionExecution
Failed higher-level execution result.
FeeCalculator
A fee calculator containing the lamports per signature cost.
FetchAccountConfig
Optional configuration for fetching accounts.
FixedArraySize
The array has a fixed number of items.
FixedPointCodec<T>
Fixed-size codec for fixed-point values.
FixedPointDecoder<T>
Fixed-size decoder for fixed-point values.
FixedPointEncoder<T>
Fixed-size encoder for fixed-point values.
FixedPointToStringOptions
Options for fixed-point string formatting helpers.
FixedSizeCodec<TFrom, TTo>
A fixed-size codec where encoding always produces fixedSize bytes and decoding always consumes fixedSize bytes.
FixedSizeDecoder<T>
A fixed-size decoder that always reads exactly fixedSize bytes.
FixedSizeEncoder<T>
A fixed-size encoder where every encoded value occupies exactly fixedSize bytes.
GetProgramAccountsDatasizeFilter
A data size filter for getProgramAccounts.
GetProgramAccountsMemcmpFilter
A memory comparison filter for getProgramAccounts.
GetTransactionsForAddressApiResponse<T>
The result envelope shared by every mode of getTransactionsForAddress.
GetTransactionsForAddressFullBase
The base fields shared by every transactionDetails: 'full' entry from getTransactionsForAddress.
GetTransactionsForAddressSignature
A transaction signature entry from getTransactionsForAddress in transactionDetails: 'signatures' mode.
HttpTransportConfig
Configuration for creating an HTTP transport.
InnerInstructionTrace
The trace for an instruction emitted via cross-program invocation.
Instruction
An instruction destined for a given program.
InstructionError
Represents an instruction-level error returned by the Solana runtime.
InstructionErrorCustom
A custom program error with a numeric code.
InstructionErrorLabel
All known simple instruction error labels as constants.
InstructionErrorSimple
A simple instruction error identified by its string label.
InstructionInput
A minimal representation of an instruction containing only its program address.
InstructionPlan
A set of instructions with constraints on how they can be executed.
InstructionTrace
The location of an instruction within a transaction.
InstructionWithByteDelta
An instruction that tracks how many bytes it adds or removes from on-chain accounts.
JsonParsedAccountData<TData>
The data shape returned from parseJsonRpcAccount.
JsonParsedAddressLookupTableInfo
The info payload for a parsed address lookup table account.
JsonParsedAuthorizedVoter
An authorized voter entry in a vote account.
JsonParsedBpfProgram
A parsed BPF Upgradeable Loader 'program' variant.
JsonParsedBpfProgramData
A parsed BPF Upgradeable Loader 'programData' variant.
JsonParsedBpfProgramDataInfo
The info payload for a parsed BPF program data account.
JsonParsedBpfProgramInfo
The info payload for a parsed BPF program account.
JsonParsedBpfUpgradeableLoaderProgramAccount
Parsed account data for a BPF Upgradeable Loader program account.
JsonParsedClockInfo
The info payload for the clock sysvar.
JsonParsedClockSysvar
A parsed sysvar 'clock' variant.
JsonParsedConfigProgramAccount
Parsed account data for a Config program account.
JsonParsedDelegatedStake
A parsed Stake program 'delegated' variant.
JsonParsedEpochCredit
An epoch credit entry in a vote account.
JsonParsedEpochRewardsInfo
The info payload for the epoch rewards sysvar.
JsonParsedEpochRewardsSysvar
A parsed sysvar 'epochRewards' variant.
JsonParsedEpochScheduleInfo
The info payload for the epoch schedule sysvar.
JsonParsedEpochScheduleSysvar
A parsed sysvar 'epochSchedule' variant.
JsonParsedFeeCalculator
A fee calculator containing the lamports per signature.
JsonParsedFeesInfo
The info payload for the fees sysvar (deprecated).
JsonParsedFeesSysvar
A parsed sysvar 'fees' variant.
JsonParsedInitializedStake
A parsed Stake program 'initialized' variant.
JsonParsedLastRestartSlotInfo
The info payload for the last restart slot sysvar.
JsonParsedLastRestartSlotSysvar
A parsed sysvar 'lastRestartSlot' variant.
JsonParsedLastTimestamp
The last timestamp recorded by a vote account.
JsonParsedMintAccount
A parsed Token program 'mint' variant.
JsonParsedMintInfo
The info payload for a parsed mint account.
JsonParsedMultisigAccount
A parsed Token program 'multisig' variant.
JsonParsedMultisigInfo
The info payload for a parsed multisig account.
JsonParsedNonceFeeCalculator
The fee calculator within a nonce account.
JsonParsedNonceInfo
The info payload for a parsed nonce account.
JsonParsedPriorVoter
A prior voter entry in a vote account.
JsonParsedRecentBlockhashEntry
An entry in the recent blockhashes sysvar (deprecated).
JsonParsedRecentBlockhashesSysvar
A parsed sysvar 'recentBlockhashes' variant.
JsonParsedRentInfo
The info payload for the rent sysvar.
JsonParsedRentSysvar
A parsed sysvar 'rent' variant.
JsonParsedSlotHashEntry
An entry in the slot hashes sysvar.
JsonParsedSlotHashesSysvar
A parsed sysvar 'slotHashes' variant.
JsonParsedSlotHistoryInfo
The info payload for the slot history sysvar.
JsonParsedSlotHistorySysvar
A parsed sysvar 'slotHistory' variant.
JsonParsedStakeAccountInfo
The info payload for a parsed stake account.
JsonParsedStakeAuthorized
The authorized staker and withdrawer for a stake account.
JsonParsedStakeConfig
A parsed Config program 'stakeConfig' variant.
JsonParsedStakeConfigInfo
The info payload for a parsed stake config account.
JsonParsedStakeData
The stake delegation data for a stake account.
JsonParsedStakeDelegation
The delegation details for a stake account.
JsonParsedStakeHistoryData
The stake history data for a single epoch.
JsonParsedStakeHistoryEntry
An entry in the stake history sysvar.
JsonParsedStakeHistorySysvar
A parsed sysvar 'stakeHistory' variant.
JsonParsedStakeLockup
The lockup configuration for a stake account.
JsonParsedStakeMeta
Metadata for a parsed stake account.
JsonParsedStakeProgramAccount
Parsed account data for a Stake program account.
JsonParsedSysvarAccount
Parsed account data for a sysvar account.
JsonParsedTokenAccount
The info payload for a parsed token account.
JsonParsedTokenAccountVariant
A parsed Token program 'account' variant.
JsonParsedTokenProgramAccount
Parsed account data for a Token program account.
JsonParsedValidatorInfo
A parsed Config program 'validatorInfo' variant.
JsonParsedValidatorInfoData
The info payload for a parsed validator info account.
JsonParsedValidatorInfoKey
A key entry in a parsed validator info account.
JsonParsedVote
A vote entry in a vote account.
JsonParsedVoteInfo
The info payload for a parsed vote account.
KeyPair
An Ed25519 key pair consisting of a 32-byte private key and a 32-byte public key.
KeyPairSigner
Defines a signer that uses a KeyPair to sign messages and transactions.
LatestBlockhashValue
Typed value returned by getLatestBlockhash.
LifetimeConstraint
Sealed class representing a lifetime constraint for a transaction message.
LoadedAddresses
Loaded ALT addresses as returned by getTransaction's meta.loadedAddresses.
MaybeAccount<TData>
Represents an account that may or may not exist on-chain.
MemcmpFilterBase58
A memory comparison filter for account data, using base58 encoding.
MemcmpFilterBase64
A memory comparison filter for account data, using base64 encoding.
MessageHeader
The header of a compiled transaction message, describing the account roles.
MessageModifyingSigner
A signer interface that potentially modifies the content of the provided SignableMessages before signing them.
MessagePacker
The message packer returned by the MessagePackerInstructionPlan.
MessagePackerInstructionPlan
A plan that can dynamically pack instructions into transaction messages.
MessagePartialSigner
A signer interface that signs an array of SignableMessages without modifying their content.
NonceAccountInfo
The result of fetching a nonce account's current nonce value.
NonceInvalidationConfig
Configuration for the nonce invalidation promise factory.
None<T>
Represents an Option that contains no value.
NoneValue
Specifies how null values are represented in the encoded data.
NonExistingAccount<TData>
An account that does not exist on-chain.
NoopSigner
Defines a Noop (No-Operation) signer that pretends to partially sign messages and transactions.
NotificationStreams
A pair of broadcast streams carrying subscription notifications and errors.
NumberCodecConfig
Configuration for number codecs.
OffchainMessage
A sealed union type for offchain messages.
OffchainMessageContent
Content of a v0 offchain message.
OffchainMessageEnvelope
An envelope wrapping an encoded offchain message with its signatures.
OffchainMessageSignatory
Represents an address that is required to sign an offchain message.
OffchainMessageV0
A version 0 offchain message.
OffchainMessageV1
A version 1 offchain message.
OffsetConfig
Configuration for modifying the offset of an encoder, decoder, or codec.
OmitNoneValue
null values are omitted from encoding (the default).
OmitOptionNoneValue
None values are omitted from encoding (the default).
Option<T>
A Rust-like Option<T> type for representing optional values.
OptionNoneValue
Specifies how None values are represented in the encoded data.
OrderedAccount
An ordered account from the address map.
OuterInstructionTrace
The trace for a top-level instruction in the transaction message.
ParallelInstructionPlan
A plan wrapping other plans that can be executed in parallel.
ParallelTransactionPlan
A plan wrapping other plans that can be executed in parallel.
ParallelTransactionPlanResult
A result for a parallel transaction plan.
ParsedAccountData
Parsed account data from jsonParsed encoding.
ParsedAccountMeta
Parsed account metadata that may be included with jsonParsed accounts.
PendingRpcSubscriptionsRequest<TNotification>
A pending RPC subscription request.
PostOffsetScope
Extended scope for post-offset functions, which also includes the new pre-offset and the original post-offset.
PrefixedArraySize
The array size is prefixed with a number codec.
PreOffsetScope
Scope provided to pre-offset and post-offset functions.
ReactiveActionDispatchView<TArgs extends List<Object?>, TResult>
A dispatch-only view bound to a caller-provided cancellation token.
ReactiveActionStateSnapshot<T>
A unified snapshot of a ReactiveActionStore's current state.
ReactiveActionStore<TArgs extends List<Object?>, TResult>
A reactive store that wraps a cancellable asynchronous action.
ReactiveStreamConnection<T>
The data/error streams produced by a ReactiveStreamStore factory for a single connection window.
ReactiveStreamStateSnapshot<T>
A unified snapshot of a ReactiveStreamStore's current state.
ReactiveStreamStore<T>
A reactive store backed by a data stream.
RecentBlockhashEntry
An entry in the recent blockhashes sysvar.
RecentSignatureConfirmationConfig
Configuration for the recent signature confirmation strategy factory.
RemainderArraySize
The array size is inferred from remaining bytes (only for fixed-size items).
ResolvedInstructionAccount
Represents a resolved account input for an instruction.
ResourceLimitsEstimate
An estimate of the resource limits for a transaction message.
ReturnData
Return data from a transaction.
Reward
Represents a reward credited or debited to an account.
RewardFeeOrRent
A fee or rent reward (no commission).
RewardVotingOrStaking
A voting or staking reward (includes commission).
RpcEnumErrorConfig
Configuration for mapping RPC enum errors to SolanaError instances.
RpcErrorResponsePayload
Represents the error payload of an RPC error response.
RpcParsedInfo<TInfo extends Object>
A parsed RPC account type that carries only an info payload without a type discriminator.
RpcParsedType<TType extends String, TInfo extends Object>
A parsed RPC account type with both a type discriminator and an info payload.
RpcRequest<TParams>
Describes the elements of an RPC or RPC Subscriptions request.
RpcResponseContext
Context information included with every RPC response.
RpcResponseData<TResponse>
Represents the data of an RPC response, which is either an error or a result.
RpcResponseError<TResponse>
An RPC response containing an error.
RpcResponseResult<TResponse>
An RPC response containing a successful result.
RpcSubscribeOptions
Options for subscribing to RPC notifications.
RpcSubscriptions
An RPC subscriptions client.
RpcSubscriptionsApi
An RPC subscriptions API that maps notification names to subscription plan creators.
RpcSubscriptionsConfig
Configuration for creating an RpcSubscriptions instance.
RpcSubscriptionsPlan<TNotification>
Describes a subscription plan, including the request details and how to execute the subscription on a channel.
RpcSubscriptionsRequest
An RPC subscriptions request containing a method name and optional parameters.
RpcSubscriptionsTransportConfig
Configuration passed to an RpcSubscriptionsTransport.
RpcSubscriptionsTransportExecuteConfig
Configuration for executing a subscription on a channel.
RpcTransactionConfirmationConfig
Configuration for polling-based transaction confirmation via an Rpc client.
SelfFetchFunctions<TData>
Methods that allow a decoder to fetch and decode accounts directly.
SelfPlanAndSendFunctions<TInput, TPlan, TResult>
Minimal self-plan/send function bundle for generated program clients.
SendAndConfirmTransactionConfig
Configuration for sendAndConfirmTransaction.
SequentialInstructionPlan
A plan wrapping other plans that must be executed sequentially.
SequentialTransactionPlan
A plan wrapping other plans that must be executed sequentially.
SequentialTransactionPlanResult
A result for a sequential transaction plan.
SignableMessage
Defines a message that needs signing and its current set of signatures if any.
SignatureStatus
The status of a transaction signature.
SignerConfig
The base configuration object for all signers -- including transaction and message signers.
SigningTransactionExecutionBoundaryConfig
Convenience configuration for execution boundaries that resolve signers and create a planner internally.
SingleInstructionPlan
A plan that contains a single instruction.
SingleTransactionPlan
A plan that contains a single transaction message.
SingleTransactionPlanResult
A result for a single transaction plan.
SlotHashEntry
An entry in the slot hashes sysvar.
SlotNotification
A slot notification from the RPC subscription.
SolanaAccountClient
Higher-level account client layered on top of a typed Rpc.
SolanaErrorContextKeys
Shared context key conventions for structured Solana diagnostics.
SolanaKitClient<T extends Object>
A Dart-native client builder for composing Solana Kit capabilities.
SolanaRpcResponse<TValue>
A standard Solana RPC response wrapper containing a context and a value.
Some<T>
Represents an Option that contains a value.
StakeHistoryData
Stake activation/deactivation data for a single epoch.
StakeHistoryEntry
An entry in the stake history sysvar.
SuccessfulSingleTransactionPlanResult
A successful SingleTransactionPlanResult.
SuccessfulTransactionExecution
Successful higher-level execution result.
SysvarClock
Contains data on cluster time, including the current slot, epoch, and estimated wall-clock Unix timestamp. It is updated every slot.
SysvarEpochRewards
Tracks whether the rewards period (including calculation and distribution) is in progress, as well as the details needed to resume distribution when starting from a snapshot during the rewards period.
SysvarEpochSchedule
Includes the number of slots per epoch, timing of leader schedule selection, and information about epoch warm-up time.
SysvarLastRestartSlot
Information about the last restart slot (hard fork).
SysvarRent
Configuration for network rent.
SysvarSlotHistory
A bitvector of slots present over the last epoch.
TokenAmount
Represents a token amount as returned by the Solana RPC.
TokenBalance
Represents a token balance for an account at a specific index in a transaction.
TracedInstruction
An Instruction carrying its location in the transaction as a trace.
Transaction
A compiled transaction consisting of message bytes and a signatures map.
TransactionBlockhashLifetime
A lifetime constraint based on the age of a blockhash observed on the network.
TransactionDurableNonceLifetime
A lifetime constraint based on a durable nonce.
TransactionError
Represents a transaction-level error returned by the Solana runtime.
TransactionErrorDuplicateInstruction
A transaction error indicating a duplicate instruction at the given index.
TransactionErrorInstructionError
A transaction error wrapping an instruction-level error.
TransactionErrorInsufficientFundsForRent
A transaction error indicating insufficient funds for rent at the given account index.
TransactionErrorLabel
All known simple transaction error labels as constants.
TransactionErrorProgramExecutionTemporarilyRestricted
A transaction error indicating that program execution is temporarily restricted for the given account index.
TransactionErrorSimple
A simple transaction error identified by its string label.
TransactionExecutionBoundaryConfig
Configuration for a higher-level transaction execution boundary.
TransactionExecutionOutcome
Base type for higher-level transaction execution results.
TransactionForAccountsMetaBase
Base transaction metadata shared by all transaction detail levels.
TransactionLifetimeConstraint
Base type for lifetime constraints attached to a transaction.
TransactionMessage
A transaction message that can be built step by step.
TransactionMessageInput
A minimal representation of a transaction message containing instructions indexed by their position.
TransactionMessageWithFeePayerSigner
A TransactionMessage that uses a transaction signer as the fee payer.
TransactionModifyingSigner
A signer interface that potentially modifies the provided Transactions before signing them.
TransactionParsedAccount
A parsed account key in a transaction.
TransactionPartialSigner
A signer interface that signs an array of Transactions without modifying their content.
TransactionPlan
A set of transaction messages with constraints on how they can be executed.
TransactionPlanExecutorConfig
Configuration object for creating a new transaction plan executor.
TransactionPlannerConfig
Configuration object for creating a new transaction planner.
TransactionPlanResult
The result of executing a transaction plan.
TransactionPlanResultSummary
A summary of a TransactionPlanResult, categorizing transactions by their execution status.
TransactionSendingSigner
A signer interface that signs one or multiple transactions before sending them immediately to the blockchain.
TransactionSignerConfig
The base configuration object for transaction signers only.
TransactionVersionLegacy
Legacy transaction version.
TransactionVersionV0
Version 0 transaction.
TransactionWithLifetime
A transaction that has a lifetime constraint attached.
Union2<T0, T1>
A typed two-variant union value.
Union2Variant0<T0, T1>
Variant 0 for Union2.
Union2Variant1<T0, T1>
Variant 1 for Union2.
Union3<T0, T1, T2>
A typed three-variant union value.
Union3Variant0<T0, T1, T2>
Variant 0 for Union3.
Union3Variant1<T0, T1, T2>
Variant 1 for Union3.
Union3Variant2<T0, T1, T2>
Variant 2 for Union3.
V1InstructionHeader
A fixed-size v1 instruction header.
V1InstructionPayload
A variable-size v1 instruction payload.
V1TransactionConfig
Transaction-message v1 resource and prioritization configuration.
VariableSizeCodec<TFrom, TTo>
A variable-size codec whose byte size depends on the value being encoded/decoded.
VariableSizeDecoder<T>
A variable-size decoder whose byte consumption depends on the data.
VariableSizeEncoder<T>
A variable-size encoder whose byte length depends on the value being encoded.
ZeroesNoneValue
The bytes allocated for the value are filled with zeroes. This requires a fixed-size codec.
ZeroesOptionNoneValue
The bytes allocated for the value are filled with zeroes. This requires a fixed-size codec for the item.

Enums

AccountEncoding
Encoding format for account data returned by Solana RPC methods.
AccountRole
Describes the purpose for which an account participates in a transaction.
AddressMapEntryType
The type of an address map entry.
Commitment
A union of all possible commitment statuses -- each a measure of the network confirmation and stake levels on a particular block.
FixedPointEndian
Byte order used by fixed-point codecs.
FixedPointRoundingMode
Rounding strategy used by fixed-point operations that must coerce an exact mathematical result into a value with fewer bits of precision.
FixedPointSignedness
Whether a fixed-point value may be negative.
OffchainMessageContentFormat
A restriction on what characters the message text can contain and how long it can be.
OptionalAccountStrategy
How to handle null (optional) account values when converting resolved instruction accounts to account metas.
ReactiveActionState
The lifecycle state of a ReactiveActionStore.
ReactiveStreamState
The lifecycle state of a ReactiveStreamStore.
RoundingMode
Rounding strategy used when parsing a decimal SOL string with more than nine fractional digits.
SolanaErrorCode
All Solana error code constants ported from the TypeScript @solana/errors package.
SolanaErrorDomain
High-level categories for SolanaErrorCode values.
TokenAccountState
The state of a token account.
TransactionEncoding
Encoding format for transaction data returned by Solana RPC methods.
TransactionExecutionFailureStage
High-level execution stages for transaction workflows.
TransactionPlanResultStatus
The status of a single transaction plan result.
TransactionVersion
Transaction version type.
Utf8NullCharacterMode
Controls how UTF-8 decoders handle decoded null (\u0000) characters.
WireTransactionEncoding
Encoding format for serialized wire transactions sent to Solana RPC methods.

Mixins

ToJsonable
Mixin for objects that implement a toJson() method, enabling deterministic stringification via fastStableStringify.

Extension Types

Address
A Solana address represented as a validated base58-encoded string.
Base58EncodedBytes
A base58-encoded byte string.
Base64EncodedBytes
A base64-encoded byte string.
Base64EncodedZStdCompressedBytes
A base64-encoded zstd-compressed byte string.
Blockhash
A Solana blockhash represented as a validated base58-encoded string.
DevnetUrl
A branded URL string for Solana devnet.
Lamports
Represents an integer value denominated in Lamports (ie. 1e-9 SOL).
MainnetUrl
A branded URL string for Solana mainnet.
MicroLamports
Represents a quantity of micro-lamports (0.000001 lamports).
Signature
A base58-encoded 64-byte Ed25519 signature.
SignatureBytes
A raw 64-byte Ed25519 signature as bytes.
Sol
Represents a fixed-point SOL amount with nine decimal places.
StringifiedBigInt
Represents a BigInt which has been encoded as a string for transit over a transport that does not support BigInt values natively. The JSON-RPC is such a transport.
StringifiedNumber
Represents a number which has been encoded as a string for transit over a transport where loss of precision when using the native number type is a concern. The JSON-RPC is such a transport.
TestnetUrl
A branded URL string for Solana testnet.
UnixTimestamp
Represents a Unix timestamp in seconds.

Extensions

Pipe on T
Extension that adds a pipe method to any value, enabling functional pipeline composition.
SolanaErrorCodeDomainExtension on SolanaErrorCode
Typed domain helpers for SolanaErrorCode enum values.
SolanaErrorDomainExtension on SolanaError
Typed domain helpers for SolanaError.
SolanaRpcMethods on Rpc
Typed convenience methods for common Solana JSON-RPC calls.
SolanaRpcSubscriptionsMethods on RpcSubscriptions
Typed convenience methods for common Solana RPC subscription requests.
TransactionMessageFluentX on TransactionMessage
Fluent, Dart-idiomatic helpers for composing TransactionMessage values.

Constants

addressLookupTableProgramAddress → const Address
The address of the Address Lookup Table program.
associatedTokenProgramAddress → const Address
The address of the SPL Associated Token Account program.
baseAccountSize → const int
The number of bytes required to store the BaseAccount information without its data.
bitvecDiscriminator → const int
The bitvector discriminator value.
bitvecLength → const int
The length of the bitvector in 64-bit blocks.
bitvecNumBits → const int
Max number of bits in the bitvector.
bpfLoaderDeprecatedProgramAddress → const Address
The address of the deprecated BPF Loader program (v1).
bpfLoaderProgramAddress → const Address
The address of the BPF Loader program (v2).
bpfLoaderUpgradeableProgramAddress → const Address
The address of the Upgradeable BPF Loader program.
computeBudgetProgramAddress → const Address
The address of the Compute Budget program.
configProgramAddress → const Address
The address of the Config program.
defaultMaxInstructionsPerTransaction → const int
The default maximum number of top-level instructions per planned transaction message.
defaultTransactionConfirmationPollInterval → const Duration
Default interval used by polling-based confirmation helpers.
ed25519ProgramAddress → const Address
The address of the Ed25519 signature verification (precompiled) program.
featureProgramAddress → const Address
The address of the Feature Gate program.
incineratorAddress → const Address
The address of the Incinerator account.
legacyTransactionSizeLimit → const int
Alias for the legacy and version 0 transaction size limit.
loaderV4ProgramAddress → const Address
The address of the Loader V4 program.
maxAccountsPerInstruction → const int
The maximum number of account references in a single instruction.
maxBodyBytes → const int
Maximum body bytes for any v0 message (largest 16-bit unsigned integer).
maxBodyBytesHardwareWalletSignable → const int
Maximum body bytes for hardware-wallet-signable messages.
maxComputeUnitLimit → const int
The maximum compute unit limit accepted by the Compute Budget program.
maxSupportedTransactionVersion → const int
The maximum supported transaction version.
maxTransactionAccountAddresses → const int
The maximum number of unique account addresses in a transaction message.
maxTransactionInstructions → const int
The maximum number of instructions in a transaction message.
maxTransactionSignerAddresses → const int
The maximum number of unique signer addresses in a transaction message.
memoLegacyProgramAddress → const Address
The address of the legacy Memo program (v1).
memoProgramAddress → const Address
The address of the Memo program (v3, on-chain memo).
mplBubblegumProgramAddress → const Address
The address of the Metaplex Bubblegum (v1) program.
mplCoreProgramAddress → const Address
The address of the Metaplex Core program.
mplTokenAuthRulesProgramAddress → const Address
The address of the Metaplex Token Auth Rules program.
nativeLoaderProgramAddress → const Address
The address of the Native Loader program.
noopProgramAddress → const Address
The address of the Noop (Log Wrapper) program.
pingPayload → const Map<String, Object>
The JSON-RPC ping payload sent to keep connections alive.
provisoryComputeUnitLimit → const int
A provisional compute unit limit used as a placeholder before estimation.
provisoryLoadedAccountsDataSizeLimit → const int
A provisional loaded accounts data size limit used as a placeholder before estimation.
recentBlockhashesSysvarAddress → const Address
Backward-compatible alias for sysvarRecentBlockhashesAddress.
secp256k1ProgramAddress → const Address
The address of the Secp256k1 signature verification (precompiled) program.
secp256r1ProgramAddress → const Address
The address of the Secp256r1 signature verification (precompiled) program.
solanaErrorMessages → const Map<SolanaErrorCode, String>
Maps every SolanaErrorCode to its human-readable message template string.
splAccountCompressionProgramAddress → const Address
The address of the SPL Account Compression program.
stakeConfigAddress → const Address
The address of the Stake Config program.
stakeProgramAddress → const Address
The address of the Stake program.
subscriptionsProgramAddress → const Address
The address of the Solana Foundation Subscriptions program.
systemProgramAddress → const Address
The address of the System program.
sysvarClockAddress → const Address
The address of the Clock sysvar.
sysvarClockSize → const int
The size in bytes of the Clock sysvar account data.
sysvarEpochRewardsAddress → const Address
The address of the EpochRewards sysvar.
sysvarEpochRewardsSize → const int
The size in bytes of the EpochRewards sysvar account data.
sysvarEpochScheduleAddress → const Address
The address of the EpochSchedule sysvar.
sysvarEpochScheduleSize → const int
The size in bytes of the EpochSchedule sysvar account data.
sysvarFeesAddress → const Address
The address of the Fees sysvar.
sysvarInstructionsAddress → const Address
The address of the Instructions sysvar.
sysvarLastRestartSlotAddress → const Address
The address of the LastRestartSlot sysvar.
sysvarLastRestartSlotSize → const int
The size in bytes of the LastRestartSlot sysvar account data.
sysvarOwnerAddress → const Address
The owner address for all sysvar accounts.
sysvarRecentBlockhashesAddress → const Address
The address of the RecentBlockhashes sysvar.
sysvarRentAddress → const Address
The address of the Rent sysvar.
sysvarRentSize → const int
The size in bytes of the Rent sysvar account data.
sysvarRewardsAddress → const Address
The address of the Rewards sysvar.
sysvarSlotHashesAddress → const Address
The address of the SlotHashes sysvar.
sysvarSlotHistoryAddress → const Address
The address of the SlotHistory sysvar.
sysvarSlotHistorySize → const int
The size in bytes of the SlotHistory sysvar account data.
sysvarStakeHistoryAddress → const Address
The address of the StakeHistory sysvar.
token2022ProgramAddress → const Address
The address of the SPL Token-2022 (Token Extensions) program.
tokenMetadataProgramAddress → const Address
The address of the Metaplex Token Metadata program.
tokenProgramAddress → const Address
The address of the SPL Token program.
transactionConfigComputeUnitLimitBitMask → const int
Compute unit limit occupies bit 2 of the config mask.
transactionConfigHeapSizeBitMask → const int
Heap size occupies bit 4 of the config mask.
transactionConfigLoadedAccountsDataSizeLimitBitMask → const int
Loaded accounts data size limit occupies bit 3 of the config mask.
transactionConfigPriorityFeeLamportsBitMask → const int
Priority fee lamports occupies the lowest two config-mask bits.
transactionInstructionLimit → const int
The hard maximum number of top-level instructions the transaction format can encode.
transactionPacketHeader → const int
The size of the transaction packet header in bytes. This includes the IPv6 header (40 bytes) and the fragment header (8 bytes).
transactionPacketSize → const int
The maximum size of a transaction packet in bytes.
transactionSizeLimit → const int
The maximum size of a legacy or version 0 transaction in bytes.
transactionV1SizeLimit → const int
The maximum size of a version 1 transaction in bytes.
usdcMintAddress → const Address
The mint address of USDC (USD Coin) on Solana mainnet.
usdtMintAddress → const Address
The mint address of USDT (Tether) on Solana mainnet.
v1TransactionSizeLimit → const int
Alias for the version 1 transaction size limit.
voteProgramAddress → const Address
The address of the Vote program.
wrappedSolMintAddress → const Address
The mint address of Wrapped SOL (native SOL in the Token program).
zkElgamalProofProgramAddress → const Address
The address of the ZK ElGamal Proof program.
zkTokenProofProgramAddress → const Address
The address of the ZK Token Proof program.

Properties

defaultRpcConfig → SolanaRpcApiConfig
Default configuration for the Solana RPC API.
final
lamportsPerSol BigInt
The number of Lamports in one SOL.
final
offchainMessageSigningDomainBytes Uint8List
The bytes representing the string '\xffsolana offchain'.
final

Functions

absoluteBinaryFixedPoint(BinaryFixedPoint value) BinaryFixedPoint
Returns the absolute value of value.
absoluteDecimalFixedPoint(DecimalFixedPoint value) DecimalFixedPoint
Returns the absolute value of value.
addBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) BinaryFixedPoint
Adds two binary fixed-point values of the same shape.
addCodecSentinel<TFrom, TTo>(Codec<TFrom, TTo> codec, Uint8List sentinel) Codec<TFrom, TTo>
Creates a codec that writes a sentinel byte sequence after the encoded value and, when decoding, reads until the sentinel is found.
addCodecSizePrefix<TFrom, TTo>(Codec<TFrom, TTo> codec, Codec<num, num> prefix) Codec<TFrom, TTo>
Stores the byte size of codec as an encoded number prefix.
addDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) DecimalFixedPoint
Adds two decimal fixed-point values of the same shape.
addDecoderSentinel<TTo>(Decoder<TTo> decoder, Uint8List sentinel) Decoder<TTo>
Creates a decoder that continues reading until a given sentinel byte sequence is found.
addDecoderSizePrefix<TTo>(Decoder<TTo> decoder, Decoder<num> prefix) Decoder<TTo>
Bounds the size of the nested decoder by reading its encoded prefix.
addEncoderSentinel<TFrom>(Encoder<TFrom> encoder, Uint8List sentinel) Encoder<TFrom>
Creates an encoder that writes a sentinel byte sequence after the encoded value.
addEncoderSizePrefix<TFrom>(Encoder<TFrom> encoder, Encoder<num> prefix) Encoder<TFrom>
Stores the size of the encoder in bytes as a prefix using the prefix encoder.
address(String putativeAddress) Address
Creates an Address from a string, asserting that it is a valid base58-encoded Solana address.
addSelfFetchFunctions<TData>(Rpc rpc, Decoder<TData> decoder) SelfFetchFunctions<TData>
Augments a Decoder with self-fetch methods by wrapping it in a SelfFetchFunctions instance.
addSelfPlanAndSendFunctions<TInput, TPlan, TResult>({required PlanTransactionFn<TInput, TPlan> planTransaction, required SendTransactionFn<TInput, TResult> sendTransaction, PlanTransactionsFn<TInput, TPlan>? planTransactions, SendTransactionsFn<TInput, TResult>? sendTransactions}) SelfPlanAndSendFunctions<TInput, TPlan, TResult>
Creates a SelfPlanAndSendFunctions wrapper around planning/sending callbacks.
addSignersToInstruction(List<Object> signers, Instruction instruction) Instruction
Attaches the provided transaction signers to the account metas of an instruction when applicable.
addSignersToTransactionMessage(List<Object> signers, TransactionMessage transactionMessage) TransactionMessage
Attaches the provided transaction signers to the account metas of all instructions inside a transaction message and/or the transaction message fee payer, when applicable.
appendTransactionMessageInstruction(Instruction instruction, TransactionMessage message) TransactionMessage
Returns a new transaction message with the given instruction appended to the end of the instructions list.
appendTransactionMessageInstructionPlan(InstructionPlan instructionPlan, TransactionMessage transactionMessage) TransactionMessage
Appends all instructions from an instruction plan to a transaction message.
appendTransactionMessageInstructions(List<Instruction> instructions, TransactionMessage message) TransactionMessage
Returns a new transaction message with the given instructions appended to the end of the instructions list.
applyDecimalsOption(BigInt raw, int currentDecimals, [FixedPointToStringOptions options = const FixedPointToStringOptions()]) → ({int decimals, BigInt raw})
Applies the configured target decimal count to a base-10 scaled integer.
assertAccountDecoded<TData>(Account<TData> account) → void
Asserts that an account stores decoded data, i.e. not a Uint8List.
assertAccountExists<TData>(MaybeAccount<TData> account) → void
Asserts that the given MaybeAccount exists on-chain.
assertAccountsDecoded<TData>(List<Account<TData>> accounts) → void
Asserts that all input accounts store decoded data, i.e. not a Uint8List.
assertAccountsExist<TData>(List<MaybeAccount<TData>> accounts) → void
Asserts that all of the given MaybeAccounts exist on-chain.
assertBigIntIsBetweenForCodec(String codecDescription, BigInt min, BigInt max, BigInt value) → void
Asserts that value is between min and max (inclusive) for a codec named codecDescription, using BigInt comparison.
assertByteArrayHasEnoughBytesForCodec(String codecDescription, int expected, Uint8List bytes, [int offset = 0]) → void
Asserts that the byte array has at least expected bytes remaining after offset.
assertByteArrayIsNotEmptyForCodec(String codecDescription, Uint8List bytes, [int offset = 0]) → void
Asserts that the byte array is not empty after the optional offset.
assertByteArrayOffsetIsNotOutOfRange(String codecDescription, int offset, int bytesLength) → void
Asserts that offset is within the valid range [0, bytesLength].
assertContainsResolvableTransactionSendingSigner(List<Object> signers) → void
Asserts that the provided signers contain at least one TransactionSendingSigner that can be unambiguously resolved.
assertIsAddress(String putativeAddress) → void
Asserts that putativeAddress is a valid base58-encoded Solana address.
assertIsAllowedHttpRequestHeaders(Map<String, String> headers) → void
Asserts that none of the provided headers are forbidden or disallowed.
assertIsBinaryFixedPoint(Object? value, [FixedPointSignedness? signedness, int? totalBits, int? fractionalBits]) → void
Asserts that value is a BinaryFixedPoint matching the optional shape.
assertIsBlockhash(String putativeBlockhash) → void
Asserts that putativeBlockhash is a valid base58-encoded blockhash.
assertIsCanceledSingleTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a canceled SingleTransactionPlanResult.
assertIsDecimalFixedPoint(Object? value, [FixedPointSignedness? signedness, int? totalBits, int? decimals]) → void
Asserts that value is a DecimalFixedPoint matching the optional shape.
assertIsFailedSingleTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a failed SingleTransactionPlanResult.
assertIsFixedSize(Object? object) → void
Asserts that the given object is fixed-size.
assertIsFullySignedOffchainMessageEnvelope(OffchainMessageEnvelope offchainMessage) → void
Asserts that all signatures in the envelope are non-null.
assertIsFullySignedTransaction(Transaction transaction) → void
Asserts that the transaction is fully signed.
assertIsInstructionForProgram(Instruction instruction, Address programAddress) → void
Asserts that instruction is destined for the program at programAddress.
assertIsInstructionWithAccounts(Instruction instruction) → void
Asserts that instruction has an accounts list.
assertIsInstructionWithData(Instruction instruction) → void
Asserts that instruction has data.
assertIsKeyPairSigner(Object? value) → void
Asserts that the provided value implements the KeyPairSigner interface.
assertIsLamports(BigInt putativeLamports) → void
Asserts that putativeLamports is a valid number of Lamports.
assertIsMessageModifyingSigner(Object? value) → void
Asserts that the provided value implements the MessageModifyingSigner interface.
assertIsMessagePackerInstructionPlan(InstructionPlan plan) → void
Asserts that plan is a MessagePackerInstructionPlan.
assertIsMessagePartialSigner(Object? value) → void
Asserts that the provided value implements the MessagePartialSigner interface.
assertIsMessageSigner(Object? value) → void
Asserts that the provided value implements either the MessagePartialSigner or MessageModifyingSigner interface.
assertIsNonDivisibleSequentialInstructionPlan(InstructionPlan plan) → void
Asserts that plan is a non-divisible SequentialInstructionPlan.
assertIsNonDivisibleSequentialTransactionPlan(TransactionPlan plan) → void
Asserts that plan is a non-divisible SequentialTransactionPlan.
assertIsNonDivisibleSequentialTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a non-divisible SequentialTransactionPlanResult.
assertIsOffchainMessageApplicationDomain(String putativeApplicationDomain) → void
Asserts that putativeApplicationDomain is a valid offchain message application domain.
assertIsOffchainMessageContentRestrictedAsciiOf1232BytesMax(OffchainMessageContent content) → void
Asserts that content conforms to restricted ASCII of 1232 bytes max.
assertIsOffchainMessageContentUtf8Of1232BytesMax(OffchainMessageContent content) → void
Asserts that content conforms to UTF-8 of 1232 bytes max.
assertIsOffchainMessageContentUtf8Of65535BytesMax(OffchainMessageContent content) → void
Asserts that content conforms to UTF-8 of 65535 bytes max.
assertIsOffCurveAddress(Address addr) → void
Asserts that the given addr is NOT on the Ed25519 curve.
assertIsOnCurveAddress(Address addr) → void
Asserts that the given addr is on the Ed25519 curve.
assertIsParallelInstructionPlan(InstructionPlan plan) → void
Asserts that plan is a ParallelInstructionPlan.
assertIsParallelTransactionPlan(TransactionPlan plan) → void
Asserts that plan is a ParallelTransactionPlan.
assertIsParallelTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a ParallelTransactionPlanResult.
assertIsPrivateKey(Uint8List bytes) → void
Validates that bytes represents a valid Ed25519 private key.
assertIsSendableTransaction(Transaction transaction) → void
Asserts that a given transaction has all the required conditions to be sent to the network.
assertIsSequentialInstructionPlan(InstructionPlan plan) → void
Asserts that plan is a SequentialInstructionPlan.
assertIsSequentialTransactionPlan(TransactionPlan plan) → void
Asserts that plan is a SequentialTransactionPlan.
assertIsSequentialTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a SequentialTransactionPlanResult.
assertIsSignature(String putativeSignature) → void
Asserts that putativeSignature is a valid base58-encoded Ed25519 signature.
assertIsSignatureBytes(Uint8List putativeSignatureBytes) → void
Asserts that putativeSignatureBytes is a valid Ed25519 signature (exactly 64 bytes).
assertIsSingleInstructionPlan(InstructionPlan plan) → void
Asserts that plan is a SingleInstructionPlan.
assertIsSingleTransactionPlan(TransactionPlan plan) → void
Asserts that plan is a SingleTransactionPlan.
assertIsSingleTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a SingleTransactionPlanResult.
assertIsStringifiedBigInt(String putativeBigInt) → void
Asserts that putativeBigInt can be parsed as a BigInt.
assertIsStringifiedNumber(String putativeNumber) → void
Asserts that putativeNumber can be parsed as a number.
assertIsSuccessfulSingleTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that plan is a successful SingleTransactionPlanResult.
assertIsSuccessfulTransactionPlanResult(TransactionPlanResult plan) → void
Asserts that the entire transaction plan result tree contains only successful single transaction results.
assertIsTransactionMessageWithBlockhashLifetime(TransactionMessage transactionMessage) → void
Asserts that the transaction message has a blockhash-based lifetime constraint.
assertIsTransactionMessageWithDurableNonceLifetime(TransactionMessage transactionMessage) → void
Asserts that the transaction message has a durable nonce lifetime constraint.
assertIsTransactionMessageWithinSizeLimit(TransactionMessage transactionMessage) → void
Asserts that a given transaction message is within the size limit when compiled into a transaction.
assertIsTransactionMessageWithSingleSendingSigner(TransactionMessage transactionMessage) → void
Asserts that the provided transaction message has exactly one TransactionSendingSigner.
assertIsTransactionModifyingSigner(Object? value) → void
Asserts that the provided value implements the TransactionModifyingSigner interface.
assertIsTransactionPartialSigner(Object? value) → void
Asserts that the provided value implements the TransactionPartialSigner interface.
assertIsTransactionSendingSigner(Object? value) → void
Asserts that the provided value implements the TransactionSendingSigner interface.
assertIsTransactionSigner(Object? value) → void
Asserts that the provided value implements any of the transaction signer interfaces.
assertIsTransactionWithBlockhashLifetime(Transaction transaction) → void
Asserts that transaction has a blockhash-based lifetime constraint.
assertIsTransactionWithDurableNonceLifetime(Transaction transaction) → void
Asserts that transaction has a durable nonce-based lifetime constraint.
assertIsTransactionWithinSizeLimit(Transaction transaction) → void
Asserts that a given transaction is within the size limit.
assertIsUnixTimestamp(BigInt putativeTimestamp) → void
Asserts that putativeTimestamp is a valid UnixTimestamp within the i64 range.
assertIsVariableSize(Object? object) → void
Asserts that the given object is variable-size.
assertMaxInstructionsPerTransaction(int numInstructions, int maxInstructions) → void
Throws if numInstructions exceeds maxInstructions.
assertMaybeAccountDecoded<TData>(MaybeAccount<TData> account) → void
Asserts that a MaybeAccount stores decoded data if it exists.
assertMaybeAccountsDecoded<TData>(List<MaybeAccount<TData>> accounts) → void
Asserts that all input MaybeAccounts store decoded data if they exist.
assertNumberIsBetweenForCodec(String codecDescription, num min, num max, num value) → void
Asserts that value is between min and max (inclusive) for a codec named codecDescription.
assertOffchainMessageV1Equal(OffchainMessageV1 receivedMessage, OffchainMessageV1 expectedMessage) → void
Asserts that a version 1 offchain message received from an untrusted source is the message that you expected it to be.
assertTransactionMessageIsWithinLimits(TransactionMessage transactionMessage, {List<OrderedAccount>? orderedAccounts}) → void
Asserts that transactionMessage satisfies the transaction message limits enforced by the Agave runtime.
assertValidBaseString(String alphabet, String testValue, [String? givenValue]) → void
Asserts that a given string contains only characters from the specified alphabet.
assertValidMaxInstructionsPerTransaction(int? maxInstructions) → void
Asserts that a configured maximum number of instructions per transaction is valid.
assertValidNumberOfItemsForCodec(String codecDescription, int expected, int actual) → void
Checks the number of items in an array-like structure is expected.
binaryFixedPoint(FixedPointSignedness signedness, int totalBits, int fractionalBits) BinaryFixedPoint Function(String value, [FixedPointRoundingMode rounding])
Returns a factory that parses decimal strings into BinaryFixedPoint values.
binaryFixedPointToBase10(BinaryFixedPoint value) BinaryFixedPointBase10
Converts value to an exact base-10 (raw, decimals) representation.
binaryFixedPointToNumber(BinaryFixedPoint value) double
Converts a binary fixed-point value to a Dart double.
binaryFixedPointToString(BinaryFixedPoint value, [FixedPointToStringOptions options = const FixedPointToStringOptions()]) String
Formats a binary fixed-point value as a canonical decimal string.
blockhash(String putativeBlockhash) Blockhash
Creates a Blockhash from a string, asserting that it is a valid base58-encoded blockhash.
bridgeStoreToAsyncIterable<T>(ReactiveStreamStore<T> store, {CancellationToken? cancellationToken, bool shouldYield(T value)?}) Stream<T>
Adapts a ReactiveStreamStore into a Stream, so a push-based reactive store can be driven by pull-based code that consumes a stream by await for-ing it.
bytesEqual(Uint8List bytes1, Uint8List bytes2) bool
Returns true if bytes1 and bytes2 are element-wise equal.
canceledSingleTransactionPlanResult(TransactionMessage plannedMessage, [Map<String, Object?>? context]) CanceledSingleTransactionPlanResult
Creates a canceled SingleTransactionPlanResult from a transaction message.
cmpBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) int
Compares two binary fixed-point values with the same fractional bit count.
cmpDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) int
Compares two decimal fixed-point values with the same decimal scale.
combineCodec<TFrom, TTo>(Encoder<TFrom> encoder, Decoder<TTo> decoder) Codec<TFrom, TTo>
Combines an Encoder and a Decoder into a Codec.
commitmentComparator(Commitment a, Commitment b) int
Compares two Commitment values according to their level of finality.
compileOffchainMessageEnvelope(OffchainMessage offchainMessage) OffchainMessageEnvelope
Returns an OffchainMessageEnvelope for the given OffchainMessage.
compileOffchainMessageV0Envelope(OffchainMessageV0 offchainMessage) OffchainMessageEnvelope
Returns an OffchainMessageEnvelope for the given OffchainMessageV0.
compileOffchainMessageV1Envelope(OffchainMessageV1 offchainMessage) OffchainMessageEnvelope
Returns an OffchainMessageEnvelope for the given OffchainMessageV1.
compileTransaction(TransactionMessage transactionMessage) TransactionWithLifetime
Compiles a TransactionMessage into a TransactionWithLifetime.
compileTransactionMessage(TransactionMessage transactionMessage) CompiledTransactionMessage
Converts a TransactionMessage into a CompiledTransactionMessage suitable for encoding and execution on the network.
compressedPointBytesAreOnCurve(Uint8List bytes) bool
Returns true if the given 32 bytes represent a compressed point that lies on the Ed25519 curve.
compressTransactionMessageUsingAddressLookupTables(TransactionMessage transactionMessage, AddressesByLookupTableAddress addressesByLookupTableAddress) TransactionMessage
Given a transaction message and a mapping of lookup tables to the addresses stored in them, this function will return a new transaction message with the same instructions but with all non-signer accounts that are found in the given lookup tables represented by an AccountLookupMeta instead of an AccountMeta.
constantTimeEqual(Uint8List a, Uint8List b) bool
Compares two byte arrays in constant time to prevent timing attacks.
containsBytes(Uint8List data, Uint8List bytes, int offset) bool
Returns true if data contains bytes at the given offset.
createAddressWithSeed({required Address baseAddress, required Address programAddress, required Object seed}) Future<Address>
Creates an address with a seed using SHA-256.
createAdvanceNonceAccountInstruction(Address nonceAccountAddress, Address nonceAuthorityAddress) Instruction
Creates an instruction for the System program to advance a nonce.
createAsyncGeneratorWithInitialValueAndSlotTracking<TRpcValue, TSubscriptionValue, TItem>({required Future<SolanaRpcResponse<TRpcValue>> rpcRequest, required Stream<SolanaRpcResponse<TSubscriptionValue>> rpcSubscription, required SlotTrackingValueMapper<TRpcValue, TItem> rpcValueMapper, required SlotTrackingValueMapper<TSubscriptionValue, TItem> rpcSubscriptionValueMapper}) Stream<SolanaRpcResponse<TItem>>
Alias matching the upstream helper name while returning a Dart Stream.
createBlockHeightExceedencePromiseFactory(BlockHeightExceedenceConfig config) Future<Never> Function({required CancellationToken abortSignal, Commitment? commitment, required BigInt lastValidBlockHeight})
Creates a factory function that returns a promise that rejects when the network block height exceeds the transaction's last valid block height.
createChannelPool() ChannelPool
Creates a new empty ChannelPool.
createClient<T extends Object>([T? value]) SolanaKitClient<T>
Creates a new client builder.
createClientWithFetchAccountsFromRpc(Rpc rpc) ClientWithFetchAccounts
Creates a ClientWithFetchAccounts from a raw Rpc object.
createClientWithGetMinimumBalanceFromRpc(Rpc rpc) ClientWithGetMinimumBalance
Creates a ClientWithGetMinimumBalance from a raw Rpc object.
createClientWithInterfacesFromRpc(Rpc rpc) → ({ClientWithFetchAccounts fetchAccounts, ClientWithGetMinimumBalance getMinimumBalance})
Creates a client from a raw Rpc object, filling in whichever client interfaces the RPC supports.
createDecoderThatConsumesEntireByteArray<T>(Decoder<T> decoder) Decoder<T>
Creates a Decoder that asserts the bytes provided to decode or read are fully consumed by the inner decoder.
createDefaultRpcSubscriptionsChannelCreator(DefaultRpcSubscriptionsChannelConfig config) RpcSubscriptionsChannelCreator
Creates a default RPC subscriptions channel creator with standard JSON serialization.
createDefaultRpcSubscriptionsTransport(DefaultRpcSubscriptionsTransportConfig config) RpcSubscriptionsTransport
Creates an RpcSubscriptionsTransport with default behaviors.
createDefaultRpcTransport({required String url, bool allowInsecureHttp = false, Map<String, String>? headers, Client? client}) → RpcTransport
Creates a default RpcTransport for Solana RPC requests.
createDefaultSolanaRpcSubscriptionsChannelCreator(DefaultRpcSubscriptionsChannelConfig config) RpcSubscriptionsChannelCreator
Creates a default Solana RPC subscriptions channel creator.
createDependentStructDecoder() DependentStructDecoderBuilder
Creates a fluent builder for a struct decoder whose later fields may depend on the decoded values of earlier ones.
createHttpTransport(HttpTransportConfig config, {Client? client}) → RpcTransport
Creates a function you can use to make POST requests with headers suitable for sending JSON data to a server.
createHttpTransportForSolanaRpc({required String url, bool allowInsecureHttp = false, Map<String, String>? headers, bool decodeSolanaJsonInIsolate = false, int solanaJsonIsolateThreshold = 262144, Client? client}) → RpcTransport
Creates an RpcTransport that uses JSON HTTP requests with BigInt-aware JSON handling for Solana RPC requests.
createKeyPairFromBytes(Uint8List bytes) KeyPair
Creates a KeyPair from a 64-byte array where the first 32 bytes represent the private key and the last 32 bytes represent the public key.
createKeyPairFromPrivateKeyBytes(Uint8List bytes) KeyPair
Creates a KeyPair from a 32-byte private key, deriving the corresponding public key.
createKeyPairSignerFromBytes(Uint8List bytes) KeyPairSigner
Creates a new KeyPairSigner from a 64-bytes Uint8List secret key (private key and public key).
createKeyPairSignerFromPrivateKeyBytes(Uint8List bytes) KeyPairSigner
Creates a new KeyPairSigner from a 32-bytes Uint8List private key.
createNonceInvalidationPromiseFactory(NonceInvalidationConfig config) Future<Never> Function({required CancellationToken abortSignal, required Commitment commitment, required String expectedNonceValue, required String nonceAccountAddress})
Creates a factory function that returns a promise that rejects when a durable nonce value changes (nonce has been advanced).
createNoopSigner(Address addr) NoopSigner
Creates a NoopSigner from the provided Address.
createReactiveActionStore<TArgs extends List<Object?>, TResult>(ReactiveAction<TArgs, TResult> action) ReactiveActionStore<TArgs, TResult>
Creates a ReactiveActionStore backed by action.
createReactiveStoreWithInitialValueAndSlotTracking<TInitialValue, TStreamValue, TItem>({required ReactiveActionSource<SolanaRpcResponse<TInitialValue>> initialValueSource, required ReactiveStreamSource<SolanaRpcResponse<TStreamValue>> streamSource, required SlotTrackingValueMapper<TInitialValue, TItem> initialValueMapper, required SlotTrackingValueMapper<TStreamValue, TItem> streamValueMapper}) ReactiveStreamStore<SolanaRpcResponse<TItem>>
Creates a caller-driven reactive store that combines a one-shot initial value with ongoing subscription updates.
createReactiveStreamStore<T>({required ReactiveStreamDataPublisherFactory<T> createDataPublisher}) ReactiveStreamStore<T>
Creates a ReactiveStreamStore backed by the createDataPublisher factory.
createRecentSignatureConfirmationPromiseFactory(RecentSignatureConfirmationConfig config) Future<void> Function({required CancellationToken abortSignal, required Commitment commitment, required String signature})
Creates a factory function for signature confirmation promises.
createRpcMessage<TParams>(RpcRequest<TParams> request) Map<String, Object?>
Returns a spec-compliant JSON RPC 2.0 message, given an RpcRequest.
createRpcSubscriptionsTransportFromChannelCreator(RpcSubscriptionsChannelCreator createChannel) RpcSubscriptionsTransport
Creates an RpcSubscriptionsTransport from a channel creator.
createSignableMessage(Object content, [Map<Address, SignatureBytes>? signatures]) SignableMessage
Creates a SignableMessage from a Uint8List or a UTF-8 string.
createSignerFromKeyPair(KeyPair keyPair) KeyPairSigner
Creates a KeyPairSigner from a provided KeyPair.
createSigningTransactionExecutionBoundary(SigningTransactionExecutionBoundaryConfig config) TransactionExecutionBoundary
Creates a higher-level execution boundary that resolves signers using the existing transaction signing helpers.
createSlotTrackingStream<TRpcValue, TSubscriptionValue, TItem>({required Future<SolanaRpcResponse<TRpcValue>> rpcRequest, required Stream<SolanaRpcResponse<TSubscriptionValue>> rpcSubscription, required SlotTrackingValueMapper<TRpcValue, TItem> rpcValueMapper, required SlotTrackingValueMapper<TSubscriptionValue, TItem> rpcSubscriptionValueMapper}) Stream<SolanaRpcResponse<TItem>>
Combines an initial RPC response with subscription updates, yielding only responses whose slot is not older than the latest yielded response.
createSolanaAccountClient(Rpc rpc) SolanaAccountClient
Creates a higher-level account client layered on top of rpc.
createSolanaError(SolanaErrorCode code, {Map<String, Object?> context = const {}, Object? cause}) SolanaError
Creates a SolanaError using normalized context conventions.
createSolanaErrorContext(Map<String, Object?> context, {Object? cause}) Map<String, Object?>
Creates a normalized Solana error context map.
createSolanaJsonRpcIntegerOverflowError(String methodName, KeyPath keyPath, BigInt value) SolanaError
Creates a SolanaError describing an integer overflow in an RPC request.
createSolanaRpc({required String url, bool allowInsecureHttp = false, Map<String, String>? headers, Client? client}) → Rpc
Creates an Rpc instance that exposes the Solana JSON RPC API given a cluster URL and some optional transport config.
createSolanaRpcFromTransport(RpcTransport transport) → Rpc
Creates an Rpc instance that exposes the Solana JSON RPC API given the supplied RpcTransport.
createSolanaRpcSubscriptions(String clusterUrl, [DefaultRpcSubscriptionsChannelConfig? config]) RpcSubscriptions
Creates a Solana RPC subscriptions client with stable API methods.
createSolanaRpcSubscriptionsFromTransport(RpcSubscriptionsTransport transport) RpcSubscriptions
Creates a Solana RPC subscriptions client from the given transport.
createSolanaRpcSubscriptionsUnstable(String clusterUrl, [DefaultRpcSubscriptionsChannelConfig? config]) RpcSubscriptions
Creates a Solana RPC subscriptions client with stable and unstable API methods.
createStreamFromDataAndErrorStreams<TData>({required Stream<TData> dataStream, required Stream<Object?> errorStream, CancellationToken? cancellationToken}) Stream<TData>
Creates a broadcast stream from data and error streams.
createSubscriptionRpc(RpcSubscriptionsConfig config) RpcSubscriptions
Creates an RpcSubscriptions instance from the given config.
createTransactionExecutionBoundary(TransactionExecutionBoundaryConfig config) TransactionExecutionBoundary
Creates a higher-level execution boundary from explicit planning, signing, and sending functions.
createTransactionMessage({required TransactionVersion version}) TransactionMessage
Creates a new empty TransactionMessage with the given version.
createTransactionPlanExecutor(TransactionPlanExecutorConfig config) TransactionPlanExecutor
Creates a new transaction plan executor based on the provided configuration.
createTransactionPlanner(TransactionPlannerConfig config) TransactionPlanner
Creates a new transaction planner based on the provided configuration.
decimalFixedPoint(FixedPointSignedness signedness, int totalBits, int decimals) DecimalFixedPoint Function(String value, [FixedPointRoundingMode rounding])
Returns a factory that parses decimal strings into DecimalFixedPoint values.
decimalFixedPointToNumber(DecimalFixedPoint value) double
Converts a decimal fixed-point value to a Dart double.
decimalFixedPointToString(DecimalFixedPoint value, [FixedPointToStringOptions options = const FixedPointToStringOptions()]) String
Formats a decimal fixed-point value as a canonical decimal string.
decodeAccount<TData>(EncodedAccount encodedAccount, Decoder<TData> decoder) Account<TData>
Transforms an EncodedAccount into an Account by decoding the account data using the provided Decoder instance.
decodeEncodedContext(String encodedContext) Map<String, Object?>
Decodes a base64-encoded context string back into a Map.
decodeMaybeAccount<TData>(MaybeEncodedAccount maybeEncodedAccount, Decoder<TData> decoder) MaybeAccount<TData>
Transforms a MaybeEncodedAccount into a MaybeAccount by decoding the account data using the provided Decoder instance.
decodeRequiredSignatoryAddresses(Uint8List bytes) List<Address>
Decodes the required signatory addresses from the raw message bytes.
decoderFromCodec<T>(Codec<Object?, T> codec) Decoder<T>
Extracts a Decoder view from a Codec.
decodeTransactionFromRpcResponse(Map<String, Object?>? rpcTx) DecodedRpcTransaction
Decodes a confirmed transaction RPC response (any of encoding: 'base64', 'base58', or 'json') into a DecodedRpcTransaction.
decompileTransactionMessage(CompiledTransactionMessage compiledTransactionMessage, [DecompileTransactionMessageConfig? config]) TransactionMessage
Decompiles a CompiledTransactionMessage back into a TransactionMessage.
deduplicateSigners<T extends Object>(List<T> signers) List<T>
Removes all duplicated signers from a provided list by comparing their addresses.
demultiplexStream<TSourceData, TDestination>({required Stream<TSourceData> source, required String channelName, required MessageTransformer<TSourceData> messageTransformer}) Stream<TDestination>
Splits a stream into per-channel broadcast streams.
devnet(String putativeString) DevnetUrl
Given a URL, casts it to a type that is only accepted where devnet URLs are expected.
divideBinaryFixedPoint(BinaryFixedPoint a, Object b, [FixedPointRoundingMode rounding = FixedPointRoundingMode.strict]) BinaryFixedPoint
Divides a by b and returns a value with a's shape.
divideDecimalFixedPoint(DecimalFixedPoint a, Object b, [FixedPointRoundingMode rounding = FixedPointRoundingMode.strict]) DecimalFixedPoint
Divides a by b and returns a value with a's shape.
downgradeRoleToNonSigner(AccountRole role) AccountRole
Returns the non-signer variant of the supplied role.
downgradeRoleToReadonly(AccountRole role) AccountRole
Returns the read-only variant of the supplied role.
encodeContextObject(Map<String, Object?> context) String
Encodes a context Map into a compact string representation.
encoderFromCodec<T>(Codec<T, Object?> codec) Encoder<T>
Extracts an Encoder view from a Codec.
eqBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) bool
Returns whether a and b represent the same binary fixed-point value.
eqDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) bool
Returns whether a and b represent the same decimal fixed-point value.
estimateAndSetComputeUnitLimitFactory(EstimateComputeUnitLimit estimateComputeUnitLimit) Future<TransactionMessage> Function(TransactionMessage transactionMessage)
Returns a function that estimates and sets the compute unit limit.
estimateAndSetResourceLimitsFactory(EstimateResourceLimits estimateResourceLimits) Future<TransactionMessage> Function(TransactionMessage transactionMessage)
Returns a function that estimates and sets the resource limits on a transaction message.
estimateResourceLimitsFactory(EstimateResourceLimits estimateResourceLimits) EstimateResourceLimits
Returns a function that estimates the resource limits for a transaction message by simulating it via estimateResourceLimits.
everyInstructionPlan(InstructionPlan instructionPlan, bool predicate(InstructionPlan)) bool
Checks if every instruction plan in the tree satisfies the given predicate.
everyTransactionPlan(TransactionPlan transactionPlan, bool predicate(TransactionPlan)) bool
Checks if every transaction plan in the tree satisfies the given predicate.
everyTransactionPlanResult(TransactionPlanResult transactionPlanResult, bool predicate(TransactionPlanResult)) bool
Checks if every transaction plan result in the tree satisfies the given predicate.
extendClient<K, V>(Map<K, V> client, Map<K, V> additions) Map<K, V>
Extends a map-backed client with additions.
failedSingleTransactionPlanResult(TransactionMessage plannedMessage, Object error, [Map<String, Object?>? context]) FailedSingleTransactionPlanResult
Creates a failed SingleTransactionPlanResult from a transaction message and an error.
fastStableStringify(Object? value) String?
Deterministic JSON stringification with sorted object keys.
fetchEncodedAccount(Rpc rpc, Address address, {FetchAccountConfig? config}) Future<MaybeEncodedAccount>
Fetches a MaybeEncodedAccount from the provided RPC client and address.
fetchEncodedAccounts(Rpc rpc, List<Address> addresses, {FetchAccountConfig? config}) Future<List<MaybeEncodedAccount>>
Fetches an array of MaybeEncodedAccounts from the provided RPC client and an array of addresses.
fetchEncodedSysvarAccount(Rpc rpc, Address address, {FetchAccountConfig? config}) Future<MaybeEncodedAccount>
Fetches an encoded sysvar account.
fetchJsonParsedAccount(Rpc rpc, Address address, {FetchAccountConfig? config}) Future<MaybeAccount<Object>>
Fetches a MaybeAccount from the provided RPC client and address by using getAccountInfo under the hood with the jsonParsed encoding.
fetchJsonParsedAccounts(Rpc rpc, List<Address> addresses, {FetchAccountConfig? config}) Future<List<MaybeAccount<Object>>>
Fetches an array of MaybeAccounts from the provided RPC client and an array of addresses by using getMultipleAccounts under the hood with the jsonParsed encoding.
fetchSysvarClock(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarClock>
Fetches the Clock sysvar account using the provided RPC client.
fetchSysvarEpochRewards(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarEpochRewards>
Fetches the EpochRewards sysvar account using the provided RPC client.
fetchSysvarEpochSchedule(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarEpochSchedule>
Fetches the EpochSchedule sysvar account using the provided RPC client.
fetchSysvarLastRestartSlot(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarLastRestartSlot>
Fetches the LastRestartSlot sysvar account using the provided RPC client.
fetchSysvarRecentBlockhashes(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarRecentBlockhashes>
Fetches the RecentBlockhashes sysvar account using the provided RPC client.
fetchSysvarRent(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarRent>
Fetches the Rent sysvar account using the provided RPC client.
fetchSysvarSlotHashes(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarSlotHashes>
Fetches the SlotHashes sysvar account using the provided RPC client.
fetchSysvarSlotHistory(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarSlotHistory>
Fetches the SlotHistory sysvar account using the provided RPC client.
fetchSysvarStakeHistory(Rpc rpc, {FetchAccountConfig? config}) Future<SysvarStakeHistory>
Fetches the StakeHistory sysvar account using the provided RPC client.
fillTransactionMessageProvisoryComputeUnitLimit(TransactionMessage transactionMessage) TransactionMessage
Returns transactionMessage with a provisional compute unit limit if none is already present.
fillTransactionMessageProvisoryResourceLimits(TransactionMessage transactionMessage) TransactionMessage
Returns transactionMessage with provisional compute unit and loaded accounts data size limits if none are already present.
findInstructionPlan(InstructionPlan instructionPlan, bool predicate(InstructionPlan)) InstructionPlan?
Finds the first instruction plan in the tree that matches the given predicate.
findTransactionPlan(TransactionPlan transactionPlan, bool predicate(TransactionPlan)) TransactionPlan?
Finds the first transaction plan in the tree that matches the given predicate.
findTransactionPlanResult(TransactionPlanResult transactionPlanResult, bool predicate(TransactionPlanResult)) TransactionPlanResult?
Finds the first transaction plan result in the tree that matches the given predicate.
fixBytes(Uint8List bytes, int length) Uint8List
Fixes bytes to exactly length bytes.
fixCodecSize<TFrom, TTo>(Codec<TFrom, TTo> codec, int fixedBytes) FixedSizeCodec<TFrom, TTo>
Creates a fixed-size codec from a given codec.
fixDecoderSize<TTo>(Decoder<TTo> decoder, int fixedBytes) FixedSizeDecoder<TTo>
Creates a fixed-size decoder from a given decoder.
fixEncoderSize<TFrom>(Encoder<TFrom> encoder, int fixedBytes) FixedSizeEncoder<TFrom>
Creates a fixed-size encoder from a given encoder.
flattenInstructionPlan(InstructionPlan instructionPlan) List<InstructionPlan>
Retrieves all individual SingleInstructionPlan and MessagePackerInstructionPlan instances from an instruction plan tree.
flattenTransactionPlan(TransactionPlan transactionPlan) List<SingleTransactionPlan>
Retrieves all individual SingleTransactionPlan instances from a transaction plan tree.
flattenTransactionPlanResult(TransactionPlanResult result) List<SingleTransactionPlanResult>
Retrieves all individual SingleTransactionPlanResult instances from a transaction plan result tree.
floatDecoderFactory({required String name, required int size, required double get(ByteData data, int offset, Endian endian), NumberCodecConfig? config}) FixedSizeDecoder<double>
Creates a FixedSizeDecoder for a floating-point type using ByteData operations.
formatBinaryFixedPoint(String formatter(String scientificNotation), BinaryFixedPoint value) String
Formats a binary fixed-point value using a caller-provided formatter.
formatDecimalFixedPoint(String formatter(String scientificNotation), DecimalFixedPoint value) String
Formats a decimal fixed-point value using a caller-provided formatter.
formatScaledBigInt(BigInt raw, int decimals, {bool padTrailingZeros = false}) String
Formats a base-10 scaled integer as a decimal string.
generateKeyPair() KeyPair
Generates a new random Ed25519 key pair.
generateKeyPairSigner() KeyPairSigner
Generates a signer capable of signing messages and transactions by generating a KeyPair and creating a KeyPairSigner from it.
getAbortablePromise<T>(Future<T> future, {CancellationToken? cancellationToken}) Future<T>
Returns a future that completes with the result of future, or rejects with the CancellationToken's reason if it fires first.
getAccountIndex(List<OrderedAccount> orderedAccounts) Map<String, int>
Returns an address-to-index lookup for orderedAccounts.
getAccountMetaFactory(Address programAddress, OptionalAccountStrategy strategy) AccountMeta? Function(String inputName, ResolvedInstructionAccount account)
Creates a factory function that converts resolved instruction accounts to account metas.
getAccountMetasFromCompiledTransactionMessage(CompiledTransactionMessage compiledMessage, {LoadedAddresses? loadedAddresses}) List<AccountMeta>
Builds the full ordered list of AccountMetas for a compiled transaction message.
getAddressCodec() FixedSizeCodec<Address, Address>
Returns a fixed-size codec that encodes and decodes Address values as exactly 32 bytes.
getAddressComparator() Comparator<Address>
Returns a Comparator that sorts Address values using base58 collation rules.
getAddressDecoder() FixedSizeDecoder<Address>
Returns a fixed-size decoder that decodes exactly 32 bytes into an Address.
getAddressEncoder() FixedSizeEncoder<Address>
Returns a fixed-size encoder that encodes an Address into exactly 32 bytes.
getAddressFromPublicKey(Uint8List publicKeyBytes) Address
Returns the Address corresponding to a 32-byte Ed25519 public key.
getAddressFromResolvedInstructionAccount(String inputName, Object? value) Address
Extracts the address from a resolved instruction account.
getAddressTableLookupCodec() Codec<AddressTableLookup, AddressTableLookup>
Returns a variable-size codec for AddressTableLookup.
getAddressTableLookupDecoder() VariableSizeDecoder<AddressTableLookup>
Returns a variable-size decoder for AddressTableLookup.
getAddressTableLookupEncoder() VariableSizeEncoder<AddressTableLookup>
Returns a variable-size encoder for AddressTableLookup.
getArrayCodec<T>(Codec<T, T> item, {ArrayLikeCodecSize? size, String? description}) Codec<List<T>, List<T>>
Returns a codec for encoding and decoding arrays of values.
getArrayDecoder<T>(Decoder<T> item, {ArrayLikeCodecSize? size, String? description}) Decoder<List<T>>
Returns a decoder for arrays of values.
getArrayEncoder<T>(Encoder<T> item, {ArrayLikeCodecSize? size, String? description}) Encoder<List<T>>
Returns an encoder for arrays of values.
getBase10Codec() VariableSizeCodec<String, String>
Returns a codec for encoding and decoding base-10 strings.
getBase10Decoder() VariableSizeDecoder<String>
Returns a decoder for base-10 strings.
getBase10Encoder() VariableSizeEncoder<String>
Returns an encoder for base-10 strings.
getBase16Codec() VariableSizeCodec<String, String>
Returns a codec for encoding and decoding base-16 (hexadecimal) strings.
getBase16Decoder() VariableSizeDecoder<String>
Returns a decoder for base-16 (hexadecimal) strings.
getBase16Encoder() VariableSizeEncoder<String>
Returns an encoder for base-16 (hexadecimal) strings.
getBase58Codec() VariableSizeCodec<String, String>
Returns a codec for encoding and decoding base-58 strings.
getBase58Decoder() VariableSizeDecoder<String>
Returns a decoder for base-58 strings.
getBase58Encoder() VariableSizeEncoder<String>
Returns an encoder for base-58 strings.
getBase64Codec() VariableSizeCodec<String, String>
Returns a codec for encoding and decoding base-64 strings.
getBase64Decoder() VariableSizeDecoder<String>
Returns a decoder for base-64 strings.
getBase64EncodedWireTransaction(Transaction transaction) String
Given a signed transaction, this method returns the transaction as a base64-encoded wire transaction string.
getBase64Encoder() VariableSizeEncoder<String>
Returns an encoder for base-64 strings.
getBaseXCodec(String alphabet) VariableSizeCodec<String, String>
Returns a codec for encoding and decoding base-X strings.
getBaseXDecoder(String alphabet) VariableSizeDecoder<String>
Returns a decoder for base-X encoded strings.
getBaseXEncoder(String alphabet) VariableSizeEncoder<String>
Returns an encoder for base-X encoded strings.
getBaseXResliceCodec(String alphabet, int bits) VariableSizeCodec<String, String>
Returns a codec for encoding and decoding base-X strings using bit re-slicing.
getBaseXResliceDecoder(String alphabet, int bits) VariableSizeDecoder<String>
Returns a decoder for base-X encoded strings using bit re-slicing.
getBaseXResliceEncoder(String alphabet, int bits) VariableSizeEncoder<String>
Returns an encoder for base-X encoded strings using bit re-slicing.
getBinaryFixedPointCodec(FixedPointSignedness signedness, int totalBits, int fractionalBits, {FixedPointEndian endian = FixedPointEndian.little}) FixedPointCodec<BinaryFixedPoint>
Returns a codec for BinaryFixedPoint values with the given shape.
getBinaryFixedPointDecoder(FixedPointSignedness signedness, int totalBits, int fractionalBits, {FixedPointEndian endian = FixedPointEndian.little}) FixedPointDecoder<BinaryFixedPoint>
Returns a decoder for BinaryFixedPoint values with the given shape.
getBinaryFixedPointEncoder(FixedPointSignedness signedness, int totalBits, int fractionalBits, {FixedPointEndian endian = FixedPointEndian.little}) FixedPointEncoder<BinaryFixedPoint>
Returns an encoder for BinaryFixedPoint values with the given shape.
getBitArrayCodec(int size, {bool backward = false}) FixedSizeCodec<List<bool>, List<bool>>
Returns a codec that encodes and decodes boolean arrays as compact bit representations.
getBitArrayDecoder(int size, {bool backward = false}) FixedSizeDecoder<List<bool>>
Returns a decoder that unpacks bits into an array of booleans.
getBitArrayEncoder(int size, {bool backward = false}) FixedSizeEncoder<List<bool>>
Returns an encoder that packs an array of booleans into bits.
getBlockhashCodec() FixedSizeCodec<Blockhash, Blockhash>
Returns a fixed-size codec that encodes and decodes Blockhash values as exactly 32 bytes.
getBlockhashComparator() Comparator<String>
Returns a Comparator that sorts blockhash strings using base58 collation rules.
getBlockhashDecoder() FixedSizeDecoder<Blockhash>
Returns a fixed-size decoder that decodes exactly 32 bytes into a base58-encoded Blockhash.
getBlockhashEncoder() FixedSizeEncoder<Blockhash>
Returns a fixed-size encoder that encodes a base58-encoded blockhash into exactly 32 bytes.
getBooleanCodec({Codec<num, num>? size}) Codec<bool, bool>
Returns a codec for encoding and decoding boolean values.
getBooleanDecoder({Decoder<num>? size}) Decoder<bool>
Returns a decoder for boolean values.
getBooleanEncoder({Encoder<num>? size}) Encoder<bool>
Returns an encoder for boolean values.
getBytesCodec() VariableSizeCodec<Uint8List, Uint8List>
Returns a codec for encoding and decoding raw byte arrays.
getBytesDecoder() VariableSizeDecoder<Uint8List>
Returns a decoder for raw byte arrays.
getBytesEncoder() VariableSizeEncoder<Uint8List>
Returns an encoder for raw byte arrays.
getChannelPoolingChannelCreator(RpcSubscriptionsChannelCreator createChannel, {required int maxSubscriptionsPerChannel, required int minChannels}) RpcSubscriptionsChannelCreator
Wraps a channel creator to pool channels.
getCommitmentComparator() Comparator<Commitment>
Returns a Comparator that sorts Commitment values according to their level of finality in ascending order (processed < confirmed < finalized).
getCompiledAddressTableLookups(List<OrderedAccount> orderedAccounts) List<AddressTableLookup>
Extracts AddressTableLookup entries from the ordered accounts.
getCompiledInstructions(List<Instruction> instructions, List<OrderedAccount> orderedAccounts) List<CompiledInstruction>
Compiles instructions into CompiledInstruction list using the ordered accounts.
getCompiledLifetimeToken(LifetimeConstraint lifetimeConstraint) String
Extracts the lifetime token (blockhash or nonce value) from the lifetime constraint.
getCompiledMessageHeader(List<OrderedAccount> orderedAccounts) MessageHeader
Computes the MessageHeader from the ordered accounts.
getCompiledStaticAccounts(List<OrderedAccount> orderedAccounts) List<Address>
Extracts the static (non-lookup) accounts from the ordered accounts.
getCompiledTransactionMessageCodec() Codec<CompiledTransactionMessage, CompiledTransactionMessage>
Returns a codec that you can use to encode from or decode to CompiledTransactionMessage.
getCompiledTransactionMessageDecoder() VariableSizeDecoder<CompiledTransactionMessage>
Returns a decoder that you can use to decode a byte array representing a CompiledTransactionMessage.
getCompiledTransactionMessageEncoder() VariableSizeEncoder<CompiledTransactionMessage>
Returns an encoder that you can use to encode a CompiledTransactionMessage to a byte array.
getConstantCodec(Uint8List constant) FixedSizeCodec<void, void>
Returns a codec that encodes and decodes a predefined constant byte sequence.
getConstantDecoder(Uint8List constant) FixedSizeDecoder<void>
Returns a decoder that verifies a predefined constant byte sequence.
getConstantEncoder(Uint8List constant) FixedSizeEncoder<void>
Returns an encoder that always writes a predefined constant byte sequence.
getDecimalFixedPointCodec(FixedPointSignedness signedness, int totalBits, int decimals, {FixedPointEndian endian = FixedPointEndian.little}) FixedPointCodec<DecimalFixedPoint>
Returns a codec for DecimalFixedPoint values with the given shape.
getDecimalFixedPointDecoder(FixedPointSignedness signedness, int totalBits, int decimals, {FixedPointEndian endian = FixedPointEndian.little}) FixedPointDecoder<DecimalFixedPoint>
Returns a decoder for DecimalFixedPoint values with the given shape.
getDecimalFixedPointEncoder(FixedPointSignedness signedness, int totalBits, int decimals, {FixedPointEndian endian = FixedPointEndian.little}) FixedPointEncoder<DecimalFixedPoint>
Returns an encoder for DecimalFixedPoint values with the given shape.
getDefaultLamportsCodec() FixedSizeCodec<Lamports, Lamports>
Returns a fixed-size codec that encodes from or decodes to a 64-bit Lamports value.
getDefaultLamportsDecoder() FixedSizeDecoder<Lamports>
Returns a fixed-size decoder that decodes a byte array representing a 64-bit little endian number to a Lamports value.
getDefaultLamportsEncoder() FixedSizeEncoder<Lamports>
Returns a fixed-size encoder that encodes a 64-bit Lamports value to 8 bytes in little endian order.
getDiscriminatedUnionCodec(List<(Object?, Codec<Object?, Object?>)> variants, {String discriminator = '__kind', Codec<num, num>? size}) Codec<Map<String, Object?>, Map<String, Object?>>
Returns a codec for encoding and decoding discriminated unions.
getDiscriminatedUnionDecoder(List<(Object?, Decoder<Object?>)> variants, {String discriminator = '__kind', Decoder<num>? size}) Decoder<Map<String, Object?>>
Returns a decoder for discriminated unions.
getDiscriminatedUnionEncoder(List<(Object?, Encoder<Object?>)> variants, {String discriminator = '__kind', Encoder<num>? size}) Encoder<Map<String, Object?>>
Returns an encoder for discriminated unions.
getEncodedSize<T>(T value, Encoder<T> encoder) int
Gets the encoded size of value using the provided encoder.
getErrorMessage(SolanaErrorCode code, [Map<String, Object?> context = const {}]) String
Returns the human-readable error message for the given error code, with $variable placeholders interpolated from context.
getF32Codec([NumberCodecConfig? config]) FixedSizeCodec<num, double>
Creates a FixedSizeCodec for 32-bit IEEE 754 floating-point numbers (f32).
getF32Decoder([NumberCodecConfig? config]) FixedSizeDecoder<double>
Creates a FixedSizeDecoder for 32-bit IEEE 754 floating-point numbers (f32).
getF32Encoder([NumberCodecConfig? config]) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for 32-bit IEEE 754 floating-point numbers (f32).
getF64Codec([NumberCodecConfig? config]) FixedSizeCodec<num, double>
Creates a FixedSizeCodec for 64-bit IEEE 754 floating-point numbers (f64).
getF64Decoder([NumberCodecConfig? config]) FixedSizeDecoder<double>
Creates a FixedSizeDecoder for 64-bit IEEE 754 floating-point numbers (f64).
getF64Encoder([NumberCodecConfig? config]) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for 64-bit IEEE 754 floating-point numbers (f64).
getFirstFailedSingleTransactionPlanResult(TransactionPlanResult transactionPlanResult) FailedSingleTransactionPlanResult
Retrieves the first failed transaction plan result from a transaction plan result tree.
getFixedSize(Object codec) int?
Returns the fixed size of a codec, encoder, or decoder, or null if it is variable-size.
getHiddenPrefixCodec<T>(Codec<T, T> codec, List<Codec<void, void>> prefixedCodecs) Codec<T, T>
Returns a codec that encodes and decodes values with a hidden prefix.
getHiddenPrefixDecoder<T>(Decoder<T> decoder, List<Decoder<void>> prefixedDecoders) Decoder<T>
Returns a decoder that skips hidden prefixed data before decoding the main value.
getHiddenPrefixEncoder<T>(Encoder<T> encoder, List<Encoder<void>> prefixedEncoders) Encoder<T>
Returns an encoder that prefixes encoded values with hidden data.
getHiddenSuffixCodec<T>(Codec<T, T> codec, List<Codec<void, void>> suffixedCodecs) Codec<T, T>
Returns a codec that encodes and decodes values with a hidden suffix.
getHiddenSuffixDecoder<T>(Decoder<T> decoder, List<Decoder<void>> suffixedDecoders) Decoder<T>
Returns a decoder that skips hidden suffixed data after decoding the main value.
getHiddenSuffixEncoder<T>(Encoder<T> encoder, List<Encoder<void>> suffixedEncoders) Encoder<T>
Returns an encoder that appends hidden data after the encoded value.
getI128Codec([NumberCodecConfig? config]) FixedSizeCodec<BigInt, BigInt>
Creates a FixedSizeCodec for signed 128-bit integers (i128).
getI128Decoder([NumberCodecConfig? config]) FixedSizeDecoder<BigInt>
Creates a FixedSizeDecoder for signed 128-bit integers (i128).
getI128Encoder([NumberCodecConfig? config]) FixedSizeEncoder<BigInt>
Creates a FixedSizeEncoder for signed 128-bit integers (i128).
getI16Codec([NumberCodecConfig? config]) FixedSizeCodec<num, int>
Creates a FixedSizeCodec for signed 16-bit integers (i16).
getI16Decoder([NumberCodecConfig? config]) FixedSizeDecoder<int>
Creates a FixedSizeDecoder for signed 16-bit integers (i16).
getI16Encoder([NumberCodecConfig? config]) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for signed 16-bit integers (i16).
getI32Codec([NumberCodecConfig? config]) FixedSizeCodec<num, int>
Creates a FixedSizeCodec for signed 32-bit integers (i32).
getI32Decoder([NumberCodecConfig? config]) FixedSizeDecoder<int>
Creates a FixedSizeDecoder for signed 32-bit integers (i32).
getI32Encoder([NumberCodecConfig? config]) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for signed 32-bit integers (i32).
getI64Codec([NumberCodecConfig? config]) FixedSizeCodec<BigInt, BigInt>
Creates a FixedSizeCodec for signed 64-bit integers (i64).
getI64Decoder([NumberCodecConfig? config]) FixedSizeDecoder<BigInt>
Creates a FixedSizeDecoder for signed 64-bit integers (i64).
getI64Encoder([NumberCodecConfig? config]) FixedSizeEncoder<BigInt>
Creates a FixedSizeEncoder for signed 64-bit integers (i64).
getI8Codec() FixedSizeCodec<num, int>
Creates a FixedSizeCodec for signed 8-bit integers (i8).
getI8Decoder() FixedSizeDecoder<int>
Creates a FixedSizeDecoder for signed 8-bit integers (i8).
getI8Encoder() FixedSizeEncoder<num>
Creates a FixedSizeEncoder for signed 8-bit integers (i8).
getInnerInstructionsFromMeta(Map<String, Object?>? meta, List<AccountMeta> accountMetas) List<TracedInstruction>
Returns the inner instructions in a getTransaction response as TracedInstructions.
getInstructionCodec() Codec<CompiledInstruction, CompiledInstruction>
Returns a variable-size codec for CompiledInstruction.
getInstructionDecoder() VariableSizeDecoder<CompiledInstruction>
Returns a variable-size decoder for CompiledInstruction.
getInstructionEncoder() VariableSizeEncoder<CompiledInstruction>
Returns a variable-size encoder for CompiledInstruction.
getInstructionHeader(Instruction instruction, Map<String, int> accountIndex) V1InstructionHeader
Returns a v1 instruction header for instruction.
getInstructionPayload(Instruction instruction, Map<String, int> accountIndex) V1InstructionPayload
Returns a v1 instruction payload for instruction.
getInstructionsFromCompiledTransactionMessage(CompiledTransactionMessage compiledMessage, {LoadedAddresses? loadedAddresses}) List<ResolvedInstruction>
Returns the outer instructions of a compiled transaction message as kit Instruction objects.
getLamportsCodec(Object innerCodec) Codec<Lamports, Lamports>
Returns a codec that encodes from or decodes to a Lamports value using the provided innerCodec.
getLamportsDecoder(Decoder<Object?> innerDecoder) Decoder<Lamports>
Returns a decoder that converts an array of bytes representing a number to a Lamports value using the provided innerDecoder.
getLamportsEncoder(Encoder<Object?> innerEncoder) Encoder<Lamports>
Returns an encoder that encodes a Lamports value to a byte array using the provided innerEncoder.
getLinearMessagePackerInstructionPlan({required Instruction getInstruction(int offset, int length), required int totalLength}) MessagePackerInstructionPlan
Creates a MessagePackerInstructionPlan that packs instructions such that each instruction consumes as many bytes as possible from the given totalLength while still being able to fit into the given transaction messages.
getLiteralUnionCodec(List<Object?> variants, {Codec<num, num>? size}) Codec<Object?, Object?>
Returns a codec for encoding and decoding literal unions.
getLiteralUnionDecoder(List<Object?> variants, {Decoder<num>? size}) Decoder<Object?>
Returns a decoder for literal unions.
getLiteralUnionEncoder(List<Object?> variants, {Encoder<num>? size}) Encoder<Object?>
Returns an encoder for literal unions.
getMapCodec<K, V>(Codec<K, K> key, Codec<V, V> value, {ArrayLikeCodecSize? size}) Codec<Map<K, V>, Map<K, V>>
Returns a codec for encoding and decoding maps.
getMapDecoder<K, V>(Decoder<K> key, Decoder<V> value, {ArrayLikeCodecSize? size}) Decoder<Map<K, V>>
Returns a decoder for maps.
getMapEncoder<K, V>(Encoder<K> key, Encoder<V> value, {ArrayLikeCodecSize? size}) Encoder<Map<K, V>>
Returns an encoder for maps.
getMaxSize(Object codec) int?
Returns the max size of a codec, encoder, or decoder. For fixed-size objects, returns the fixed size. For variable-size objects, returns maxSize (which may be null).
getMessageHeaderCodec() FixedSizeCodec<MessageHeader, MessageHeader>
Returns a fixed-size codec for MessageHeader.
getMessageHeaderDecoder() FixedSizeDecoder<MessageHeader>
Returns a fixed-size decoder for MessageHeader.
getMessageHeaderEncoder() FixedSizeEncoder<MessageHeader>
Returns a fixed-size encoder for MessageHeader.
getMessagePackerInstructionPlanFromInstructions(List<Instruction> instructions) MessagePackerInstructionPlan
Creates a MessagePackerInstructionPlan from a list of instructions.
getNonNullResolvedInstructionInput<T>(String inputName, T? value) → T
Ensures a resolved instruction input is not null.
getNullableCodec<T>(Codec<T, T> item, {Codec<num, num>? prefix, bool hasPrefix = true, NoneValue noneValue = const OmitNoneValue()}) Codec<T?, T?>
Returns a codec for encoding and decoding optional (nullable) values.
getNullableDecoder<T>(Decoder<T> item, {Decoder<num>? prefix, bool hasPrefix = true, NoneValue noneValue = const OmitNoneValue()}) Decoder<T?>
Returns a decoder for optional (nullable) values.
getNullableEncoder<T>(Encoder<T> item, {Encoder<num>? prefix, bool hasPrefix = true, NoneValue noneValue = const OmitNoneValue()}) Encoder<T?>
Returns an encoder for optional (nullable) values.
getOffchainMessageApplicationDomainCodec() FixedSizeCodec<OffchainMessageApplicationDomain, OffchainMessageApplicationDomain>
Returns a codec for offchain message application domains.
getOffchainMessageApplicationDomainDecoder() FixedSizeDecoder<OffchainMessageApplicationDomain>
Returns a fixed-size decoder for an offchain message application domain.
getOffchainMessageApplicationDomainEncoder() FixedSizeEncoder<OffchainMessageApplicationDomain>
Returns a fixed-size encoder for an offchain message application domain.
getOffchainMessageCodec() Codec<OffchainMessage, OffchainMessage>
Returns a codec for OffchainMessage.
getOffchainMessageDecoder() Decoder<OffchainMessage>
Returns a variable-size decoder for OffchainMessage that dispatches to the appropriate version-specific decoder.
getOffchainMessageEncoder() Encoder<OffchainMessage>
Returns a variable-size encoder for OffchainMessage that dispatches to the appropriate version-specific encoder.
getOffchainMessageEnvelopeCodec() Codec<OffchainMessageEnvelope, OffchainMessageEnvelope>
Returns a codec for OffchainMessageEnvelope.
getOffchainMessageEnvelopeDecoder() Decoder<OffchainMessageEnvelope>
Returns a variable-size decoder for OffchainMessageEnvelope.
getOffchainMessageEnvelopeEncoder() Encoder<OffchainMessageEnvelope>
Returns a variable-size encoder for OffchainMessageEnvelope.
getOffchainMessageSigningDomainCodec() FixedSizeCodec<void, void>
Returns a codec for the 16-byte signing domain.
getOffchainMessageSigningDomainDecoder() FixedSizeDecoder<void>
Returns a fixed-size decoder that verifies the 16-byte signing domain.
getOffchainMessageSigningDomainEncoder() FixedSizeEncoder<void>
Returns a fixed-size encoder that writes the 16-byte signing domain.
getOffchainMessageV0Codec() Codec<OffchainMessageV0, OffchainMessageV0>
Returns a codec for OffchainMessageV0.
getOffchainMessageV0Decoder() Decoder<OffchainMessageV0>
Returns a variable-size decoder for OffchainMessageV0.
getOffchainMessageV0Encoder() Encoder<OffchainMessageV0>
Returns a variable-size encoder for OffchainMessageV0.
getOffchainMessageV1Codec() Codec<OffchainMessageV1, OffchainMessageV1>
Returns a codec for OffchainMessageV1.
getOffchainMessageV1Decoder() Decoder<OffchainMessageV1>
Returns a variable-size decoder for OffchainMessageV1.
getOffchainMessageV1Encoder() Encoder<OffchainMessageV1>
Returns a variable-size encoder for OffchainMessageV1.
getOptionCodec<TFrom, TTo extends TFrom>(Codec<TFrom, TTo> item, {Codec<num, num>? prefix, bool hasPrefix = true, OptionNoneValue noneValue = const OmitOptionNoneValue()}) Codec<Object?, Option<TTo>>
Returns a codec for encoding and decoding optional values using the Option type.
getOptionDecoder<TTo>(Decoder<TTo> item, {Decoder<num>? prefix, bool hasPrefix = true, OptionNoneValue noneValue = const OmitOptionNoneValue()}) Decoder<Option<TTo>>
Returns a decoder for optional values using the Option type.
getOptionEncoder<TFrom>(Encoder<TFrom> item, {Encoder<num>? prefix, bool hasPrefix = true, OptionNoneValue noneValue = const OmitOptionNoneValue()}) Encoder<Object?>
Returns an encoder for optional values using the Option type.
getOrderedAccountsFromInstructions(Address feePayer, List<Instruction> instructions) List<OrderedAccount>
Builds the address map from fee payer and instructions, then sorts the entries into the canonical account ordering.
getPatternMatchCodec<TFrom, TTo>(List<PatternMatchCodecEntry<TFrom, TTo>> patterns) Codec<TFrom, TTo>
Returns a codec that selects which variant codec to use based on pattern matching.
getPatternMatchDecoder<TTo>(List<PatternMatchDecoderEntry<TTo>> patterns) Decoder<TTo>
Returns a decoder that selects which variant decoder to use based on pattern matching.
getPatternMatchEncoder<TFrom>(List<PatternMatchEncoderEntry<TFrom>> patterns) Encoder<TFrom>
Returns an encoder that selects which variant encoder to use based on pattern matching.
getPredicateCodec<TFrom, TTo extends TFrom>(bool encodePredicate(TFrom value), bool decodePredicate(Uint8List value), Codec<TFrom, TTo> ifTrue, Codec<TFrom, TTo> ifFalse) Codec<TFrom, TTo>
Returns a codec that selects between two codecs using predicates.
getPredicateDecoder<TTo>(bool predicate(Uint8List value), Decoder<TTo> ifTrue, Decoder<TTo> ifFalse) Decoder<TTo>
Returns a decoder that selects between two decoders using predicate.
getPredicateEncoder<TFrom>(bool predicate(TFrom value), Encoder<TFrom> ifTrue, Encoder<TFrom> ifFalse) Encoder<TFrom>
Returns an encoder that selects between two encoders using predicate.
getProgramDerivedAddress({required Address programAddress, required List<Object> seeds}) Future<ProgramDerivedAddress>
Finds a program-derived address by trying bump seeds from 255 down to 0.
getPublicKeyFromAddress(Address addr) Uint8List
Returns the 32-byte Ed25519 public key for the given addr.
getPublicKeyFromPrivateKey(Uint8List privateKeyBytes) Uint8List
Derives the Ed25519 public key bytes from the given privateKeyBytes.
getRawRange(FixedPointSignedness signedness, int totalBits) → ({BigInt max, BigInt min})
Returns the inclusive raw integer range for a fixed-point value.
getReallocMessagePackerInstructionPlan({required Instruction getInstruction(int size), required int totalSize}) MessagePackerInstructionPlan
Creates a MessagePackerInstructionPlan that packs a list of realloc instructions.
getResolvedInstructionAccountAsProgramDerivedAddress(String inputName, Object? value) ProgramDerivedAddress
Extracts a ProgramDerivedAddress from a resolved instruction account.
getResolvedInstructionAccountAsTransactionSigner(String inputName, Object? value) Object
Extracts a transaction signer from a resolved instruction account.
getRpcSubscriptionsChannelWithAutoping({required CancellationToken abortSignal, required RpcSubscriptionsChannel channel, required int intervalMs}) → RpcSubscriptionsChannel
Wraps an RpcSubscriptionsChannel to send periodic ping messages.
getRpcSubscriptionsChannelWithBigIntJsonSerialization(RpcSubscriptionsChannel channel) → RpcSubscriptionsChannel
Wraps an RpcSubscriptionsChannel to serialize outbound messages using BigInt-safe JSON serialization and deserialize inbound 'message' events using BigInt-safe JSON parsing.
getRpcSubscriptionsChannelWithJsonSerialization(RpcSubscriptionsChannel channel) → RpcSubscriptionsChannel
Wraps an RpcSubscriptionsChannel to serialize outbound messages as JSON strings and deserialize inbound 'message' events from JSON strings.
getRpcSubscriptionsTransportWithSubscriptionCoalescing(RpcSubscriptionsTransport transport) RpcSubscriptionsTransport
Wraps an RpcSubscriptionsTransport to coalesce identical subscriptions.
getRpcTransportWithRequestCoalescing(RpcTransport transport, GetDeduplicationKeyFn getDeduplicationKey) → RpcTransport
Wraps the given transport with request coalescing logic.
getSetCodec<T>(Codec<T, T> item, {ArrayLikeCodecSize? size}) Codec<Set<T>, Set<T>>
Returns a codec for encoding and decoding sets.
getSetDecoder<T>(Decoder<T> item, {ArrayLikeCodecSize? size}) Decoder<Set<T>>
Returns a decoder for sets.
getSetEncoder<T>(Encoder<T> item, {ArrayLikeCodecSize? size}) Encoder<Set<T>>
Returns an encoder for sets.
getShortU16Codec() VariableSizeCodec<num, int>
Creates a VariableSizeCodec for Solana's shortU16 compact encoding.
getShortU16Decoder() VariableSizeDecoder<int>
Creates a VariableSizeDecoder for Solana's shortU16 compact encoding.
getShortU16Encoder() VariableSizeEncoder<num>
Creates a VariableSizeEncoder for Solana's shortU16 compact encoding.
getSignatoriesComparator() int Function(Uint8List, Uint8List)
Returns a comparator for byte arrays that sorts lexicographically.
getSignatureFromTransaction(Transaction transaction) Signature
Given a transaction signed by its fee payer, this method will return the Signature that uniquely identifies it.
getSignaturesEncoderWithLength(int size) FixedSizeEncoder<Map<Address, SignatureBytes?>>
Signatures encoder for v1 transactions, which encode signatures as a known-size array with no size prefix.
getSignaturesEncoderWithSizePrefix() VariableSizeEncoder<Map<Address, SignatureBytes?>>
Signatures encoder for legacy and v0 transactions, which encode signatures as an array with a shortU16 size prefix.
getSignerAddress(Object signer) Address
Gets the address from any signer type.
getSignersFromInstruction(Instruction instruction) List<Object>
Extracts and deduplicates all transaction signers stored inside the account metas of an instruction.
getSignersFromTransactionMessage(TransactionMessage transactionMessage) List<Object>
Extracts and deduplicates all transaction signers stored inside a given transaction message.
getSolanaErrorDomain(SolanaErrorCode code) SolanaErrorDomain
Returns the SolanaErrorDomain for an error code.
getSolanaErrorFromInstructionError(num index, Object instructionError) SolanaError
Converts an instruction error from the Solana RPC into a SolanaError.
getSolanaErrorFromJsonRpcError(Object? putativeErrorResponse) SolanaError
Converts a JSON-RPC error response into a SolanaError.
getSolanaErrorFromRpcError(RpcEnumErrorConfig config, Object rpcEnumError) SolanaError
Converts an RPC enum-style error into a SolanaError.
getSolanaErrorFromTransactionError(Object transactionError) SolanaError
Converts a transaction error from the Solana RPC into a SolanaError.
getSolanaRpcPayloadDeduplicationKey(Object? payload) String?
Returns a deduplication key for the given RPC payload, or null if the payload is not a valid JSON-RPC 2.0 payload.
getSolCodec() FixedSizeCodec<Object, Sol>
Returns a codec that encodes Sol or Lamports values and decodes Sol.
getSolDecoder() FixedSizeDecoder<Sol>
Returns a decoder that reads an unsigned 64-bit Lamports count as Sol.
getSolEncoder() FixedSizeEncoder<Object>
Returns an encoder that writes a Sol or Lamports value as an unsigned 64-bit Lamports count in little-endian order.
getStrictUtf8Codec() VariableSizeCodec<String, String>
Returns a codec for encoding and decoding UTF-8 strings that rejects decoded null characters.
getStrictUtf8Decoder() VariableSizeDecoder<String>
Returns a decoder for UTF-8 strings that rejects decoded null characters.
getStructCodec(List<(String, Codec<Object?, Object?>)> fields) Codec<Map<String, Object?>, Map<String, Object?>>
Returns a codec for encoding and decoding custom objects (structs).
getStructDecoder(List<(String, Decoder<Object?>)> fields) Decoder<Map<String, Object?>>
Returns a decoder for custom objects (structs).
getStructEncoder(List<(String, Encoder<Object?>)> fields) Encoder<Map<String, Object?>>
Returns an encoder for custom objects (structs).
getSysvarClockCodec() FixedSizeCodec<SysvarClock, SysvarClock>
Returns a fixed-size codec for the SysvarClock sysvar.
getSysvarClockDecoder() FixedSizeDecoder<SysvarClock>
Returns a fixed-size decoder for the SysvarClock sysvar.
getSysvarClockEncoder() FixedSizeEncoder<SysvarClock>
Returns a fixed-size encoder for the SysvarClock sysvar.
getSysvarEpochRewardsCodec() FixedSizeCodec<SysvarEpochRewards, SysvarEpochRewards>
Returns a fixed-size codec for the SysvarEpochRewards sysvar.
getSysvarEpochRewardsDecoder() FixedSizeDecoder<SysvarEpochRewards>
Returns a fixed-size decoder for the SysvarEpochRewards sysvar.
getSysvarEpochRewardsEncoder() FixedSizeEncoder<SysvarEpochRewards>
Returns a fixed-size encoder for the SysvarEpochRewards sysvar.
getSysvarEpochScheduleCodec() FixedSizeCodec<SysvarEpochSchedule, SysvarEpochSchedule>
Returns a fixed-size codec for the SysvarEpochSchedule sysvar.
getSysvarEpochScheduleDecoder() FixedSizeDecoder<SysvarEpochSchedule>
Returns a fixed-size decoder for the SysvarEpochSchedule sysvar.
getSysvarEpochScheduleEncoder() FixedSizeEncoder<SysvarEpochSchedule>
Returns a fixed-size encoder for the SysvarEpochSchedule sysvar.
getSysvarLastRestartSlotCodec() FixedSizeCodec<SysvarLastRestartSlot, SysvarLastRestartSlot>
Returns a fixed-size codec for the SysvarLastRestartSlot sysvar.
getSysvarLastRestartSlotDecoder() FixedSizeDecoder<SysvarLastRestartSlot>
Returns a fixed-size decoder for the SysvarLastRestartSlot sysvar.
getSysvarLastRestartSlotEncoder() FixedSizeEncoder<SysvarLastRestartSlot>
Returns a fixed-size encoder for the SysvarLastRestartSlot sysvar.
getSysvarRecentBlockhashesCodec() VariableSizeCodec<SysvarRecentBlockhashes, SysvarRecentBlockhashes>
Returns a variable-size codec for the SysvarRecentBlockhashes sysvar.
getSysvarRecentBlockhashesDecoder() VariableSizeDecoder<SysvarRecentBlockhashes>
Returns a variable-size decoder for the SysvarRecentBlockhashes sysvar.
getSysvarRecentBlockhashesEncoder() VariableSizeEncoder<SysvarRecentBlockhashes>
Returns a variable-size encoder for the SysvarRecentBlockhashes sysvar.
getSysvarRentCodec() FixedSizeCodec<SysvarRent, SysvarRent>
Returns a fixed-size codec for the SysvarRent sysvar.
getSysvarRentDecoder() FixedSizeDecoder<SysvarRent>
Returns a fixed-size decoder for the SysvarRent sysvar.
getSysvarRentEncoder() FixedSizeEncoder<SysvarRent>
Returns a fixed-size encoder for the SysvarRent sysvar.
getSysvarSlotHashesCodec() VariableSizeCodec<SysvarSlotHashes, SysvarSlotHashes>
Returns a variable-size codec for the SysvarSlotHashes sysvar.
getSysvarSlotHashesDecoder() VariableSizeDecoder<SysvarSlotHashes>
Returns a variable-size decoder for the SysvarSlotHashes sysvar.
getSysvarSlotHashesEncoder() VariableSizeEncoder<SysvarSlotHashes>
Returns a variable-size encoder for the SysvarSlotHashes sysvar.
getSysvarSlotHistoryCodec() FixedSizeCodec<SysvarSlotHistory, SysvarSlotHistory>
Returns a fixed-size codec for the SysvarSlotHistory sysvar.
getSysvarSlotHistoryDecoder() FixedSizeDecoder<SysvarSlotHistory>
Returns a fixed-size decoder for the SysvarSlotHistory sysvar.
getSysvarSlotHistoryEncoder() FixedSizeEncoder<SysvarSlotHistory>
Returns a fixed-size encoder for the SysvarSlotHistory sysvar.
getSysvarStakeHistoryCodec() VariableSizeCodec<SysvarStakeHistory, SysvarStakeHistory>
Returns a variable-size codec for the SysvarStakeHistory sysvar.
getSysvarStakeHistoryDecoder() VariableSizeDecoder<SysvarStakeHistory>
Returns a variable-size decoder for the SysvarStakeHistory sysvar.
getSysvarStakeHistoryEncoder() VariableSizeEncoder<SysvarStakeHistory>
Returns a variable-size encoder for the SysvarStakeHistory sysvar.
getTimeoutPromise({required CancellationToken abortSignal, required Commitment commitment}) Future<Never>
Returns a Future that rejects after a timeout.
getTransactionCodec() VariableSizeCodec<Transaction, Transaction>
Returns a codec that you can use to encode from or decode to a Transaction.
getTransactionConfigMask([V1TransactionConfig? config]) int
Returns the v1 transaction config mask for config.
getTransactionConfigValues([V1TransactionConfig? config]) List<CompiledTransactionConfigValue>
Returns v1 transaction config values in wire order for config.
getTransactionDecoder() VariableSizeDecoder<Transaction>
Returns a decoder that you can use to convert a byte array in the Solana transaction wire format to a Transaction object.
getTransactionEncoder() VariableSizeEncoder<Transaction>
Returns an encoder that you can use to encode a Transaction to a byte array in a wire format appropriate for sending to the Solana network for execution.
getTransactionLifetimeConstraintFromCompiledTransactionMessage(CompiledTransactionMessage compiledTransactionMessage) Future<TransactionLifetimeConstraint>
Gets the lifetime constraint for a transaction from a compiled transaction message that includes a lifetime token.
getTransactionMessageComputeUnitLimit(TransactionMessage transactionMessage) int?
Returns the compute unit limit set on transactionMessage, if any.
getTransactionMessageLoadedAccountsDataSizeLimit(TransactionMessage transactionMessage) int?
Returns the loaded accounts data size limit set on transactionMessage, if any.
getTransactionMessageSize(TransactionMessage transactionMessage) int
Gets the compiled transaction size of a given transaction message in bytes.
getTransactionMessageSizeLimit(TransactionMessage transactionMessage) int
Gets the maximum transaction size for transactionMessage.
getTransactionSignerAddress(Object value) Address
Gets the address from a transaction signer.
getTransactionSize(Transaction transaction) int
Gets the size of a given transaction in bytes.
getTransactionSizeLimit(Object versionOrTransaction) int
Gets the maximum transaction size for versionOrTransaction.
getTransactionVersionCodec() Codec<TransactionVersion, TransactionVersion>
Returns a codec that you can use to encode from or decode to TransactionVersion.
getTransactionVersionDecoder() VariableSizeDecoder<TransactionVersion>
Returns a decoder that you can use to decode a byte array representing a TransactionVersion.
getTransactionVersionEncoder() VariableSizeEncoder<TransactionVersion>
Returns an encoder that you can use to encode a TransactionVersion to a byte array.
getTupleCodec(List<Codec<Object?, Object?>> items, {String? description}) Codec<List<Object?>, List<Object?>>
Returns a codec for encoding and decoding tuples.
getTupleDecoder(List<Decoder<Object?>> items) Decoder<List<Object?>>
Returns a decoder for tuples (fixed-length lists with heterogeneous item decoders).
getTupleEncoder(List<Encoder<Object?>> items, {String? description}) Encoder<List<Object?>>
Returns an encoder for tuples (fixed-length lists with heterogeneous item encoders).
getU128Codec([NumberCodecConfig? config]) FixedSizeCodec<BigInt, BigInt>
Creates a FixedSizeCodec for unsigned 128-bit integers (u128).
getU128Decoder([NumberCodecConfig? config]) FixedSizeDecoder<BigInt>
Creates a FixedSizeDecoder for unsigned 128-bit integers (u128).
getU128Encoder([NumberCodecConfig? config]) FixedSizeEncoder<BigInt>
Creates a FixedSizeEncoder for unsigned 128-bit integers (u128).
getU16Codec([NumberCodecConfig? config]) FixedSizeCodec<num, int>
Creates a FixedSizeCodec for unsigned 16-bit integers (u16).
getU16Decoder([NumberCodecConfig? config]) FixedSizeDecoder<int>
Creates a FixedSizeDecoder for unsigned 16-bit integers (u16).
getU16Encoder([NumberCodecConfig? config]) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for unsigned 16-bit integers (u16).
getU32Codec([NumberCodecConfig? config]) FixedSizeCodec<num, int>
Creates a FixedSizeCodec for unsigned 32-bit integers (u32).
getU32Decoder([NumberCodecConfig? config]) FixedSizeDecoder<int>
Creates a FixedSizeDecoder for unsigned 32-bit integers (u32).
getU32Encoder([NumberCodecConfig? config]) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for unsigned 32-bit integers (u32).
getU64Codec([NumberCodecConfig? config]) FixedSizeCodec<BigInt, BigInt>
Creates a FixedSizeCodec for unsigned 64-bit integers (u64).
getU64Decoder([NumberCodecConfig? config]) FixedSizeDecoder<BigInt>
Creates a FixedSizeDecoder for unsigned 64-bit integers (u64).
getU64Encoder([NumberCodecConfig? config]) FixedSizeEncoder<BigInt>
Creates a FixedSizeEncoder for unsigned 64-bit integers (u64).
getU8Codec() FixedSizeCodec<num, int>
Creates a FixedSizeCodec for unsigned 8-bit integers (u8).
getU8Decoder() FixedSizeDecoder<int>
Creates a FixedSizeDecoder for unsigned 8-bit integers (u8).
getU8Encoder() FixedSizeEncoder<num>
Creates a FixedSizeEncoder for unsigned 8-bit integers (u8).
getUnion2Codec<T0From, T0To, T1From, T1To>(Codec<T0From, T0To> variant0, Codec<T1From, T1To> variant1, int getIndexFromBytes(Uint8List bytes, int offset)) Codec<Union2<T0From, T1From>, Union2<T0To, T1To>>
Returns a codec for a two-variant typed union.
getUnion2Decoder<T0, T1>(Decoder<T0> variant0, Decoder<T1> variant1, int getIndexFromBytes(Uint8List bytes, int offset)) Decoder<Union2<T0, T1>>
Returns a decoder for a two-variant typed union.
getUnion2Encoder<T0, T1>(Encoder<T0> variant0, Encoder<T1> variant1) Encoder<Union2<T0, T1>>
Returns an encoder for a two-variant typed union.
getUnion3Codec<T0From, T0To, T1From, T1To, T2From, T2To>(Codec<T0From, T0To> variant0, Codec<T1From, T1To> variant1, Codec<T2From, T2To> variant2, int getIndexFromBytes(Uint8List bytes, int offset)) Codec<Union3<T0From, T1From, T2From>, Union3<T0To, T1To, T2To>>
Returns a codec for a three-variant typed union.
getUnion3Decoder<T0, T1, T2>(Decoder<T0> variant0, Decoder<T1> variant1, Decoder<T2> variant2, int getIndexFromBytes(Uint8List bytes, int offset)) Decoder<Union3<T0, T1, T2>>
Returns a decoder for a three-variant typed union.
getUnion3Encoder<T0, T1, T2>(Encoder<T0> variant0, Encoder<T1> variant1, Encoder<T2> variant2) Encoder<Union3<T0, T1, T2>>
Returns an encoder for a three-variant typed union.
getUnionCodec(List<Codec<Object?, Object?>> variants, int getIndexFromValue(Object? value), int getIndexFromBytes(Uint8List bytes, int offset)) Codec<Object?, Object?>
Returns a codec for encoding and decoding union types.
getUnionDecoder(List<Decoder<Object?>> variants, int getIndexFromBytes(Uint8List bytes, int offset)) Decoder<Object?>
Returns a decoder for union types.
getUnionEncoder(List<Encoder<Object?>> variants, int getIndexFromValue(Object? value)) Encoder<Object?>
Returns an encoder for union types.
getUnitCodec() FixedSizeCodec<void, void>
Returns a codec for void values.
getUnitDecoder() FixedSizeDecoder<void>
Returns a decoder for void values.
getUnitEncoder() FixedSizeEncoder<void>
Returns an encoder for void values.
getUtf8Codec({Utf8NullCharacterMode nullCharacterMode = Utf8NullCharacterMode.compatibilityStrip}) VariableSizeCodec<String, String>
Returns a codec for encoding and decoding UTF-8 strings.
getUtf8Decoder({Utf8NullCharacterMode nullCharacterMode = Utf8NullCharacterMode.compatibilityStrip}) VariableSizeDecoder<String>
Returns a decoder for UTF-8 strings.
getUtf8Encoder() VariableSizeEncoder<String>
Returns an encoder for UTF-8 strings.
grindKeyPair({required Object matches, int concurrency = 32}) Future<KeyPair>
Generates one key pair whose base58-encoded public key satisfies matches.
grindKeyPairs({required Object matches, int amount = 1, int concurrency = 32}) Future<List<KeyPair>>
Generates amount key pairs whose base58-encoded public key satisfies matches.
grindKeyPairSigner({required Object matches, int concurrency = 32}) Future<KeyPairSigner>
Generates one key-pair signer whose address satisfies matches.
grindKeyPairSigners({required Object matches, int amount = 1, int concurrency = 32}) Future<List<KeyPairSigner>>
Generates amount key-pair signers whose addresses satisfy matches.
gtBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) bool
Returns whether a is strictly greater than b.
gtDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) bool
Returns whether a is strictly greater than b.
gteBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) bool
Returns whether a is greater than or equal to b.
gteDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) bool
Returns whether a is greater than or equal to b.
isAbortError(Object? error) bool
Returns true if error is an abort/cancellation error.
isAddress(String putativeAddress) bool
Returns true if putativeAddress is a valid base58-encoded Solana address.
isAdvanceNonceAccountInstruction(Instruction instruction) bool
Returns true if the instruction conforms to an AdvanceNonceAccount instruction.
isBinaryFixedPoint(Object? value, [FixedPointSignedness? signedness, int? totalBits, int? fractionalBits]) bool
Returns whether value is a BinaryFixedPoint matching the optional shape.
isBlockhash(String putativeBlockhash) bool
Returns true if putativeBlockhash is a valid base58-encoded blockhash.
isCanceledSingleTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a canceled SingleTransactionPlanResult.
isDecimalFixedPoint(Object? value, [FixedPointSignedness? signedness, int? totalBits, int? decimals]) bool
Returns whether value is a DecimalFixedPoint matching the optional shape.
isFailedSingleTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a failed SingleTransactionPlanResult.
isFixedSize(Object? object) bool
Returns true if the given encoder, decoder, or codec is fixed-size.
isFullySignedOffchainMessageEnvelope(OffchainMessageEnvelope offchainMessage) bool
Returns true if all signatures in the envelope are non-null.
isFullySignedTransaction(Transaction transaction) bool
Returns true if all entries in the transaction's signatures map have non-null signatures.
isInstructionForProgram(Instruction instruction, Address programAddress) bool
Returns true if instruction is destined for the program at programAddress.
isInstructionPlan(Object? value) bool
Returns true if value is an InstructionPlan.
isInstructionWithAccounts(Instruction instruction) bool
Returns true if instruction has an accounts list (even if empty).
isInstructionWithData(Instruction instruction) bool
Returns true if instruction has data (even if empty).
isKeyPairSigner(Object? value) bool
Checks whether the provided value implements the KeyPairSigner interface.
isLamports(BigInt putativeLamports) bool
Returns true if putativeLamports is within the valid range for Lamports (0 to 2^64-1).
isMessageModifyingSigner(Object? value) bool
Checks whether the provided value implements the MessageModifyingSigner interface.
isMessagePackerInstructionPlan(InstructionPlan plan) bool
Returns true if plan is a MessagePackerInstructionPlan.
isMessagePartialSigner(Object? value) bool
Checks whether the provided value implements the MessagePartialSigner interface.
isMessageSigner(Object? value) bool
Checks whether the provided value implements either the MessagePartialSigner or MessageModifyingSigner interface.
isNonDivisibleSequentialInstructionPlan(InstructionPlan plan) bool
Returns true if plan is a non-divisible SequentialInstructionPlan.
isNonDivisibleSequentialTransactionPlan(TransactionPlan plan) bool
Returns true if plan is a non-divisible SequentialTransactionPlan.
isNonDivisibleSequentialTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a non-divisible SequentialTransactionPlanResult.
isNone<T>(Option<T> option) bool
Returns true if option is a None.
isOffchainMessageApplicationDomain(String putativeApplicationDomain) bool
Returns true if putativeApplicationDomain is a valid offchain message application domain.
isOffchainMessageContentRestrictedAsciiOf1232BytesMax(OffchainMessageContent content) bool
Returns true if content conforms to restricted ASCII of 1232 bytes max.
isOffchainMessageContentUtf8Of1232BytesMax(OffchainMessageContent content) bool
Returns true if content conforms to UTF-8 of 1232 bytes max.
isOffchainMessageContentUtf8Of65535BytesMax(OffchainMessageContent content) bool
Returns true if content conforms to UTF-8 of 65535 bytes max.
isOffCurveAddress(Address addr) bool
Returns true if the given addr decodes to a point that is NOT on the Ed25519 curve.
isOnCurveAddress(Address addr) bool
Returns true if the given addr decodes to a point on the Ed25519 curve.
isOption(Object? input) bool
Returns true if input is an Option (either Some or None).
isParallelInstructionPlan(InstructionPlan plan) bool
Returns true if plan is a ParallelInstructionPlan.
isParallelTransactionPlan(TransactionPlan plan) bool
Returns true if plan is a ParallelTransactionPlan.
isParallelTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a ParallelTransactionPlanResult.
isProgramError(Object? error, TransactionMessageInput transactionMessage, Address programAddress, [int? code]) bool
Identifies whether an error -- typically caused by a transaction failure -- is a custom program error from the provided programAddress.
isSendableTransaction(Transaction transaction) bool
Returns true if the transaction has all the required conditions to be sent to the network: fully signed and within the size limit.
isSequentialInstructionPlan(InstructionPlan plan) bool
Returns true if plan is a SequentialInstructionPlan.
isSequentialTransactionPlan(TransactionPlan plan) bool
Returns true if plan is a SequentialTransactionPlan.
isSequentialTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a SequentialTransactionPlanResult.
isSignature(String putativeSignature) bool
Returns true if putativeSignature is a valid base58-encoded Ed25519 signature string, false otherwise.
isSignatureBytes(Uint8List putativeSignatureBytes) bool
Returns true if putativeSignatureBytes is a valid Ed25519 signature (exactly 64 bytes), false otherwise.
isSignerRole(AccountRole role) bool
Returns true if role represents a signer account.
isSingleInstructionPlan(InstructionPlan plan) bool
Returns true if plan is a SingleInstructionPlan.
isSingleTransactionPlan(TransactionPlan plan) bool
Returns true if plan is a SingleTransactionPlan.
isSingleTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a SingleTransactionPlanResult.
isSolanaError(Object? e, [SolanaErrorCode? code]) bool
Returns true if e is a SolanaError.
isSolanaErrorCodeInDomain(SolanaErrorCode code, SolanaErrorDomain domain) bool
Returns true when code belongs to domain.
isSolanaErrorInDomain(Object? error, SolanaErrorDomain domain) bool
Returns true when error is a SolanaError in domain.
isSolanaRequest(Object? payload) bool
Returns true if the given payload is a JSON-RPC 2.0 request for a known Solana RPC method.
isSolanaRpcResponse(Object? notification) bool
Type-guards notification as a SolanaRpcResponse envelope.
isSome<T>(Option<T> option) bool
Returns true if option is a Some.
isStringifiedBigInt(String putativeBigInt) bool
Returns true if putativeBigInt can be parsed as a BigInt.
isStringifiedNumber(String putativeNumber) bool
Returns true if putativeNumber can be parsed as a number.
isSuccessfulSingleTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if plan is a successful SingleTransactionPlanResult.
isSuccessfulTransactionPlanResult(TransactionPlanResult plan) bool
Returns true if the entire transaction plan result tree contains only successful single transaction results.
isTransactionMessageWithBlockhashLifetime(TransactionMessage transactionMessage) bool
Returns true if the transaction message has a blockhash-based lifetime constraint.
isTransactionMessageWithDurableNonceLifetime(TransactionMessage transactionMessage) bool
Returns true if the transaction message has a durable nonce lifetime constraint with a valid advance nonce instruction as the first instruction.
isTransactionMessageWithinSizeLimit(TransactionMessage transactionMessage) bool
Checks if a transaction message is within the size limit when compiled into a transaction.
isTransactionMessageWithSingleSendingSigner(TransactionMessage transactionMessage) bool
Checks whether the provided transaction message has exactly one TransactionSendingSigner.
isTransactionModifyingSigner(Object? value) bool
Checks whether the provided value implements the TransactionModifyingSigner interface.
isTransactionPartialSigner(Object? value) bool
Checks whether the provided value implements the TransactionPartialSigner interface.
isTransactionPlan(Object? value) bool
Returns true if value is a TransactionPlan.
isTransactionPlanResult(Object? value) bool
Returns true if value is a TransactionPlanResult.
isTransactionSendingSigner(Object? value) bool
Checks whether the provided value implements the TransactionSendingSigner interface.
isTransactionSigner(Object? value) bool
Checks whether the provided value implements any of the transaction signer interfaces: TransactionPartialSigner, TransactionModifyingSigner, or TransactionSendingSigner.
isTransactionWithBlockhashLifetime(Transaction transaction) bool
Returns true if transaction has a blockhash-based lifetime constraint.
isTransactionWithDurableNonceLifetime(Transaction transaction) bool
Returns true if transaction has a durable nonce-based lifetime constraint.
isTransactionWithinSizeLimit(Transaction transaction) bool
Returns true if the transaction is within the size limit.
isUnixTimestamp(BigInt putativeTimestamp) bool
Returns true if putativeTimestamp is within the i64 range and thus a valid UnixTimestamp.
isVariableSize(Object? object) bool
Returns true if the given encoder, decoder, or codec is variable-size.
isWritableRole(AccountRole role) bool
Returns true if role represents a writable account.
keccak256(Uint8List input) Uint8List
Computes the Keccak-256 hash of input.
lamports(BigInt putativeLamports) Lamports
Combines asserting that a BigInt is a possible number of Lamports with coercing it to the Lamports type. It's best used with untrusted input.
lamportsToSol(Lamports value) Sol
Converts value to its equivalent SOL fixed-point amount.
ltBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) bool
Returns whether a is strictly less than b.
ltDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) bool
Returns whether a is strictly less than b.
lteBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) bool
Returns whether a is less than or equal to b.
lteDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) bool
Returns whether a is less than or equal to b.
mainnet(String putativeString) MainnetUrl
Given a URL, casts it to a type that is only accepted where mainnet URLs are expected.
maxCodecSizes(List<int?> sizes) int?
Returns the maximum from a list of nullable codec sizes. Returns null if any size is null.
mergeBytes(List<Uint8List> byteArrays) Uint8List
Concatenates a list of Uint8Lists into a single Uint8List.
mergeRoles(AccountRole roleA, AccountRole roleB) AccountRole
Returns the AccountRole that grants the highest privileges of both roleA and roleB.
multiplyBinaryFixedPoint(BinaryFixedPoint a, Object b, [FixedPointRoundingMode rounding = FixedPointRoundingMode.strict]) BinaryFixedPoint
Multiplies a by b and returns a value with a's shape.
multiplyDecimalFixedPoint(DecimalFixedPoint a, Object b, [FixedPointRoundingMode rounding = FixedPointRoundingMode.strict]) DecimalFixedPoint
Multiplies a by b and returns a value with a's shape.
negateBinaryFixedPoint(BinaryFixedPoint value) BinaryFixedPoint
Returns the additive inverse of a signed binary fixed-point value.
negateDecimalFixedPoint(DecimalFixedPoint value) DecimalFixedPoint
Returns the additive inverse of a signed decimal fixed-point value.
nonDivisibleSequentialInstructionPlan(List<Object> plans) SequentialInstructionPlan
Creates a non-divisible SequentialInstructionPlan from an array of nested plans.
nonDivisibleSequentialTransactionPlan(List<Object> plans) SequentialTransactionPlan
Creates a non-divisible SequentialTransactionPlan from an array of nested plans.
nonDivisibleSequentialTransactionPlanResult(List<TransactionPlanResult> plans) SequentialTransactionPlanResult
Creates a non-divisible SequentialTransactionPlanResult.
none<T>() Option<T>
Creates a new Option with no value.
normalizeHeaders(Map<String, String> headers) Map<String, String>
Normalizes the provided headers by lowercasing all header names.
numberDecoderFactory({required String name, required int size, required int get(ByteData data, int offset, Endian endian), NumberCodecConfig? config}) FixedSizeDecoder<int>
Creates a FixedSizeDecoder for a numeric type using ByteData operations.
numberEncoderFactory({required String name, required int size, required void set(ByteData data, int offset, num value, Endian endian), NumberCodecConfig? config, (num, num)? range}) FixedSizeEncoder<num>
Creates a FixedSizeEncoder for a numeric type using ByteData operations.
offchainMessageApplicationDomain(String putativeApplicationDomain) OffchainMessageApplicationDomain
Asserts that putativeApplicationDomain is a valid application domain and returns it as an OffchainMessageApplicationDomain.
offsetCodec<TFrom, TTo>(Codec<TFrom, TTo> codec, OffsetConfig config) Codec<TFrom, TTo>
Moves the offset of a given codec before and/or after encoding and decoding.
offsetDecoder<T>(Decoder<T> decoder, OffsetConfig config) Decoder<T>
Moves the offset of a given decoder before and/or after decoding.
offsetEncoder<T>(Encoder<T> encoder, OffsetConfig config) Encoder<T>
Moves the offset of a given encoder before and/or after encoding.
padBytes(Uint8List bytes, int length) Uint8List
Pads bytes with trailing zeroes to reach length.
padLeftCodec<TFrom, TTo>(Codec<TFrom, TTo> codec, int offset) Codec<TFrom, TTo>
Adds left padding to codec, shifting encoding and decoding positions forward by offset bytes.
padLeftDecoder<T>(Decoder<T> decoder, int offset) Decoder<T>
Adds left padding to decoder, shifting the decoding position forward by offset bytes and increasing the decoder size accordingly.
padLeftEncoder<T>(Encoder<T> encoder, int offset) Encoder<T>
Adds left padding to encoder, shifting the encoded value forward by offset bytes and increasing the encoder size accordingly.
padNullCharacters(String value, int chars) String
Pads a string with null characters (\u0000) at the end to reach a fixed length.
padRightCodec<TFrom, TTo>(Codec<TFrom, TTo> codec, int offset) Codec<TFrom, TTo>
Adds right padding to codec, extending the encoded/decoded value by offset bytes.
padRightDecoder<T>(Decoder<T> decoder, int offset) Decoder<T>
Adds right padding to decoder, extending the post-offset by offset bytes and increasing the decoder size accordingly.
padRightEncoder<T>(Encoder<T> encoder, int offset) Encoder<T>
Adds right padding to encoder, extending the encoded value by offset bytes and increasing the encoder size accordingly.
parallelInstructionPlan(List<Object> plans) ParallelInstructionPlan
Creates a ParallelInstructionPlan from an array of nested plans.
parallelTransactionPlan(List<Object> plans) ParallelTransactionPlan
Creates a ParallelTransactionPlan from an array of nested plans.
parallelTransactionPlanResult(List<TransactionPlanResult> plans) ParallelTransactionPlanResult
Creates a ParallelTransactionPlanResult.
parseBase58RpcAccount(Address address, Map<String, Object?>? rpcAccount) MaybeEncodedAccount
Parses a base58-encoded account provided by the RPC client into an EncodedAccount type or a MaybeEncodedAccount type if the raw data is null.
parseBase64RpcAccount(Address address, Map<String, Object?>? rpcAccount) MaybeEncodedAccount
Parses a base64-encoded account provided by the RPC client into an EncodedAccount type or a MaybeEncodedAccount type if the raw data is null.
parseBaseAccount(Map<String, Object?> rpcAccount) BaseAccount
Parses the base account properties from an RPC account map.
parseInstructionOrTransactionPlanInput(Object input) Object
Parses a flexible input and returns an InstructionPlan or TransactionPlan.
parseInstructionPlanInput(Object input) InstructionPlan
Parses a flexible input and returns an InstructionPlan.
parseJsonRpcAccount(Address address, Map<String, Object?>? rpcAccount) MaybeAccount<JsonParsedAccountData<Map<String, Object?>>>
Parses an arbitrary jsonParsed account provided by the RPC client into an Account type or a MaybeAccount type if the raw data is null.
parseJsonWithBigInts(String json) Object?
Parses a JSON string, converting all integer values to BigInt.
parseJsonWithBigIntsAsync(String json, {bool runInIsolate = false, int isolateThreshold = 262144}) Future<Object?>
Parses a JSON string using parseJsonWithBigInts, optionally in an isolate.
parseTransactionPlanInput(Object input) TransactionPlan
Parses a flexible input and returns a TransactionPlan.
partiallySignOffchainMessageEnvelope(List<KeyPair> keyPairs, OffchainMessageEnvelope offchainMessageEnvelope) OffchainMessageEnvelope
Partially signs an OffchainMessageEnvelope with the given keyPairs.
partiallySignTransaction(List<KeyPair> keyPairs, Transaction transaction) Future<Transaction>
Given a list of KeyPair objects which are key pairs pertaining to addresses that are required to sign a transaction, this method will return a new signed transaction.
partiallySignTransactionMessageWithSigners(TransactionMessage transactionMessage, [TransactionSignerConfig? config]) Future<Transaction>
Extracts all transaction signers inside the provided transaction message and uses them to return a signed transaction.
partiallySignTransactionWithSigners(List<Object> signers, Transaction transaction, [TransactionSignerConfig? config]) Future<Transaction>
Signs a transaction using the provided TransactionModifyingSigners and TransactionPartialSigners.
passthroughFailedTransactionPlanExecution(Future<TransactionPlanResult> future) Future<TransactionPlanResult>
Wraps a transaction plan execution promise to return a TransactionPlanResult even on execution failure.
prependTransactionMessageInstruction(Instruction instruction, TransactionMessage message) TransactionMessage
Returns a new transaction message with the given instruction prepended to the beginning of the instructions list.
prependTransactionMessageInstructions(List<Instruction> instructions, TransactionMessage message) TransactionMessage
Returns a new transaction message with the given instructions prepended to the beginning of the instructions list.
raceStrategies(String signature, BaseTransactionConfirmationStrategyConfig config, List<Future<void>> getSpecificStrategiesForRace({required CancellationToken abortSignal})) Future<void>
Races a signature confirmation promise against specific strategies.
ratioBinaryFixedPoint(FixedPointSignedness signedness, int totalBits, int fractionalBits) BinaryFixedPoint Function(BigInt numerator, BigInt denominator, [FixedPointRoundingMode rounding])
Returns a factory that converts ratios into BinaryFixedPoint values.
ratioDecimalFixedPoint(FixedPointSignedness signedness, int totalBits, int decimals) DecimalFixedPoint Function(BigInt numerator, BigInt denominator, [FixedPointRoundingMode rounding])
Returns a factory that converts ratios into DecimalFixedPoint values.
rawBinaryFixedPoint(FixedPointSignedness signedness, int totalBits, int fractionalBits) BinaryFixedPoint Function(BigInt raw)
Returns a factory that wraps raw scaled integers as BinaryFixedPoint values.
rawDecimalFixedPoint(FixedPointSignedness signedness, int totalBits, int decimals) DecimalFixedPoint Function(BigInt raw)
Returns a factory that wraps raw scaled integers as DecimalFixedPoint values.
readBigIntSigned(Uint8List bytes, int offset, int size, Endian endian) BigInt
Reads a signed BigInt value from bytes starting at offset, using size bytes in the given endian byte order.
readBigIntUnsigned(Uint8List bytes, int offset, int size, Endian endian) BigInt
Reads an unsigned BigInt value from bytes starting at offset, using size bytes in the given endian byte order.
removeNullCharacters(String value) String
Removes all null characters (\u0000) from a string.
rescaleBinaryFixedPoint(BinaryFixedPoint value, int newTotalBits, int newFractionalBits, [FixedPointRoundingMode rounding = FixedPointRoundingMode.strict]) BinaryFixedPoint
Rescales value to newTotalBits and newFractionalBits.
rescaleDecimalFixedPoint(DecimalFixedPoint value, int newTotalBits, int newDecimals, [FixedPointRoundingMode rounding = FixedPointRoundingMode.strict]) DecimalFixedPoint
Rescales value to newTotalBits and newDecimals.
resizeCodec<TFrom, TTo>(Codec<TFrom, TTo> codec, int resize(int size)) Codec<TFrom, TTo>
Updates the size of a given codec using a resize function.
resizeDecoder<T>(Decoder<T> decoder, int resize(int size)) Decoder<T>
Updates the size of a given decoder using a resize function.
resizeEncoder<T>(Encoder<T> encoder, int resize(int size)) Encoder<T>
Updates the size of a given encoder using a resize function.
resolveMaxInstructions(int? maxInstructions) int
Resolves the effective maximum number of instructions allowed in a transaction message.
reverseCodec<TFrom, TTo>(FixedSizeCodec<TFrom, TTo> codec) FixedSizeCodec<TFrom, TTo>
Reverses the bytes of a fixed-size codec.
reverseDecoder<TTo>(FixedSizeDecoder<TTo> decoder) FixedSizeDecoder<TTo>
Reverses the bytes of a fixed-size decoder.
reverseEncoder<TFrom>(FixedSizeEncoder<TFrom> encoder) FixedSizeEncoder<TFrom>
Reverses the bytes of a fixed-size encoder.
safeRace<T>(List<Future<T>> futures) Future<T>
Races futures without leaking unhandled rejections from the losers.
sendAndConfirmTransaction({required Rpc rpc, required Transaction transaction, SendAndConfirmTransactionConfig config = const SendAndConfirmTransactionConfig()}) Future<Signature>
Sends transaction over rpc and waits for it to confirm.
sequentialInstructionPlan(List<Object> plans) SequentialInstructionPlan
Creates a divisible SequentialInstructionPlan from an array of nested plans.
sequentialTransactionPlan(List<Object> plans) SequentialTransactionPlan
Creates a divisible SequentialTransactionPlan from an array of nested plans.
sequentialTransactionPlanResult(List<TransactionPlanResult> plans) SequentialTransactionPlanResult
Creates a divisible SequentialTransactionPlanResult.
setTransactionMessageComputeUnitLimit(int? computeUnitLimit, TransactionMessage transactionMessage) TransactionMessage
Sets or removes the compute unit limit on transactionMessage.
setTransactionMessageConfig(V1TransactionConfig config, TransactionMessage transactionMessage) TransactionMessage
Returns transactionMessage with config merged into its v1 config.
setTransactionMessageFeePayer(Address feePayer, TransactionMessage transactionMessage) TransactionMessage
Given a base58-encoded address of a system account, this method will return a new transaction message with the fee payer set to the given address.
setTransactionMessageFeePayerSigner(Object feePayer, TransactionMessage transactionMessage) TransactionMessageWithFeePayerSigner
Sets the fee payer of a transaction message using a transaction signer.
setTransactionMessageLifetimeUsingBlockhash(BlockhashLifetimeConstraint blockhashLifetimeConstraint, TransactionMessage transactionMessage) TransactionMessage
Given a blockhash and the last block height at which that blockhash is considered usable, this method will return a new transaction message with the lifetime constraint set to the given blockhash constraint.
setTransactionMessageLifetimeUsingDurableNonce(DurableNonceConfig config, TransactionMessage transactionMessage) TransactionMessage
Given a nonce, the account where the value of the nonce is stored, and the address of the account authorized to consume that nonce, this method will return a new transaction message with a durable nonce lifetime.
setTransactionMessageLoadedAccountsDataSizeLimit(int? limit, TransactionMessage transactionMessage) TransactionMessage
Sets or removes the loaded accounts data size limit on transactionMessage.
signAndSendTransactionMessageWithSigners(TransactionMessage transactionMessage, [TransactionSignerConfig? config]) Future<SignatureBytes>
Extracts all transaction signers inside the provided transaction message and uses them to sign it before sending it immediately to the blockchain.
signAndSendTransactionWithSigners(List<Object> signers, Transaction transaction, [TransactionSignerConfig? config]) Future<SignatureBytes>
Signs a transaction using the provided signers and sends it immediately to the blockchain.
signature(String value) Signature
Asserts and coerces value to a Signature.
signatureBytes(Uint8List value) SignatureBytes
Asserts and coerces value to SignatureBytes.
signBytes(Uint8List privateKeyBytes, Uint8List data) SignatureBytes
Signs data using the provided 32-byte privateKeyBytes and returns the 64-byte Ed25519 signature.
signOffchainMessageEnvelope(List<KeyPair> keyPairs, OffchainMessageEnvelope offchainMessageEnvelope) OffchainMessageEnvelope
Signs an OffchainMessageEnvelope with the given keyPairs.
signTransaction(List<KeyPair> keyPairs, Transaction transaction) Future<Transaction>
Given a list of KeyPair objects, signs the transaction and asserts that it is fully signed.
signTransactionMessageWithSigners(TransactionMessage transactionMessage, [TransactionSignerConfig? config]) Future<Transaction>
Extracts all transaction signers inside the provided transaction message and uses them to return a signed transaction before asserting that all signatures required by the transaction are present.
signTransactionWithSigners(List<Object> signers, Transaction transaction, [TransactionSignerConfig? config]) Future<Transaction>
Signs a transaction using the provided signers and asserts that all signatures required by the transaction are present.
singleInstructionPlan(Instruction instruction) SingleInstructionPlan
Creates a SingleInstructionPlan from an Instruction.
singleTransactionPlan(TransactionMessage message) SingleTransactionPlan
Creates a SingleTransactionPlan from a TransactionMessage.
sol(String value, {RoundingMode rounding = RoundingMode.strict}) Sol
Parses value as a SOL fixed-point amount.
solToLamports(Sol value) Lamports
Converts value to its equivalent Lamports amount.
some<T>(T value) Option<T>
Creates a new Option containing value.
stringifiedBigInt(String putativeBigInt) StringifiedBigInt
Combines asserting that a string will parse as a BigInt with coercing it to the StringifiedBigInt type. It's best used with untrusted input.
stringifiedNumber(String putativeNumber) StringifiedNumber
Combines asserting that a string will parse as a number with coercing it to the StringifiedNumber type. It's best used with untrusted input.
stringifyJsonWithBigInts(Object? value, {Object? space}) String
Converts a value to a JSON string, rendering BigInt values as large unsafe integers (without quotes).
subtractBinaryFixedPoint(BinaryFixedPoint a, BinaryFixedPoint b) BinaryFixedPoint
Subtracts b from a, requiring both values to have the same shape.
subtractDecimalFixedPoint(DecimalFixedPoint a, DecimalFixedPoint b) DecimalFixedPoint
Subtracts b from a, requiring both values to have the same shape.
successfulSingleTransactionPlanResult(TransactionMessage plannedMessage, Map<String, Object?> context) SuccessfulSingleTransactionPlanResult
Creates a successful SingleTransactionPlanResult from a transaction message and a context containing at least a signature.
successfulSingleTransactionPlanResultFromTransaction(TransactionMessage plannedMessage, Transaction transaction, [Map<String, Object?>? context]) SuccessfulSingleTransactionPlanResult
Creates a successful SingleTransactionPlanResult from a transaction message and a Transaction.
sumCodecSizes(List<int?> sizes) int?
Sums a list of nullable codec sizes. Returns null if any size is null.
summarizeTransactionPlanResult(TransactionPlanResult result) TransactionPlanResultSummary
Summarizes a TransactionPlanResult into a TransactionPlanResultSummary.
testnet(String putativeString) TestnetUrl
Given a URL, casts it to a type that is only accepted where testnet URLs are expected.
toSignedBinaryFixedPoint(BinaryFixedPoint value) BinaryFixedPoint
Converts value to a signed binary fixed-point value with the same raw value, total bit width, and fractional bit count.
toSignedDecimalFixedPoint(DecimalFixedPoint value) DecimalFixedPoint
Converts value to a signed decimal fixed-point value with the same raw value, total bit width, and decimal scale.
toUnsignedBinaryFixedPoint(BinaryFixedPoint value) BinaryFixedPoint
Converts value to an unsigned binary fixed-point value with the same raw value, total bit width, and fractional bit count.
toUnsignedDecimalFixedPoint(DecimalFixedPoint value) DecimalFixedPoint
Converts value to an unsigned decimal fixed-point value with the same raw value, total bit width, and decimal scale.
transactionConfigMaskHasComputeUnitLimit(int mask) bool
Returns true when mask indicates a compute unit limit value.
transactionConfigMaskHasHeapSize(int mask) bool
Returns true when mask indicates a heap size value.
transactionConfigMaskHasLoadedAccountsDataSizeLimit(int mask) bool
Returns true when mask indicates a loaded accounts data size limit value.
transactionConfigMaskHasPriorityFee(int mask) bool
Returns true when mask indicates a priority fee value.
transformCodec<TOldFrom, TNewFrom, TOldTo, TNewTo>(Codec<TOldFrom, TOldTo> codec, TOldFrom unmap(TNewFrom value), [TNewTo map(TOldTo value, Uint8List bytes, int offset)?]) Codec<TNewFrom, TNewTo>
Transforms a codec by mapping its input and output values.
transformDecoder<TOldTo, TNewTo>(Decoder<TOldTo> decoder, TNewTo map(TOldTo value, Uint8List bytes, int offset)) Decoder<TNewTo>
Transforms a decoder by mapping its output values.
transformEncoder<TOldFrom, TNewFrom>(Encoder<TOldFrom> encoder, TOldFrom unmap(TNewFrom value)) Encoder<TNewFrom>
Transforms an encoder by mapping its input values.
transformInstructionPlan(InstructionPlan instructionPlan, InstructionPlan fn(InstructionPlan)) InstructionPlan
Transforms an instruction plan tree using a bottom-up approach.
transformTransactionPlan(TransactionPlan transactionPlan, TransactionPlan fn(TransactionPlan)) TransactionPlan
Transforms a transaction plan tree using a bottom-up approach.
transformTransactionPlanResult(TransactionPlanResult transactionPlanResult, TransactionPlanResult fn(TransactionPlanResult)) TransactionPlanResult
Transforms a transaction plan result tree using a bottom-up approach.
unixTimestamp(BigInt putativeTimestamp) UnixTimestamp
Combines asserting that a BigInt represents a Unix timestamp with coercing it to the UnixTimestamp type. It's best used with untrusted input.
unwrapOption<T>(Option<T> option) → T?
Unwraps the value of an Option, returning its contained value or null.
unwrapOptionOr<T>(Option<T> option, T fallback()) → T
Unwraps the value of an Option, returning its contained value or the result of fallback.
unwrapOptionRecursively(Object? input, [Object? fallback()?]) Object?
Recursively unwraps all nested Option types within a value.
unwrapSimulationError(Object? error) Object?
Extracts the underlying cause from a simulation-related error.
upgradeRoleToSigner(AccountRole role) AccountRole
Returns the signer variant of the supplied role.
upgradeRoleToWritable(AccountRole role) AccountRole
Returns the writable variant of the supplied role.
verifyOffchainMessageEnvelope(OffchainMessageEnvelope offchainMessageEnvelope) → void
Verifies that all required signatories have valid signatures.
verifySignature(Uint8List publicKeyBytes, SignatureBytes signature, Uint8List data) bool
Verifies that signature was produced by signing data with the private key corresponding to publicKeyBytes.
waitForDurableNonceTransactionConfirmation({required CancellationToken abortSignal, required Commitment commitment, required Future<Never> getNonceInvalidationPromise({required CancellationToken abortSignal, required Commitment commitment, required String expectedNonceValue, required String nonceAccountAddress}), required GetRecentSignatureConfirmationPromise getRecentSignatureConfirmationPromise, required String nonceAccountAddress, required String nonceValue, required String signature}) Future<void>
Waits for a transaction using a durable nonce to confirm.
waitForRecentTransactionConfirmation({required CancellationToken abortSignal, required Commitment commitment, required Future<Never> getBlockHeightExceedencePromise({required CancellationToken abortSignal, Commitment? commitment, required BigInt lastValidBlockHeight}), required GetRecentSignatureConfirmationPromise getRecentSignatureConfirmationPromise, required BigInt lastValidBlockHeight, required String signature}) Future<void>
Waits for a transaction using block height for lifetime to confirm.
waitForRecentTransactionConfirmationUntilTimeout({required CancellationToken abortSignal, required Commitment commitment, required Future<Never> getTimeoutPromise({required CancellationToken abortSignal, required Commitment commitment}), required GetRecentSignatureConfirmationPromise getRecentSignatureConfirmationPromise, required String signature}) Future<void>
Waits for a transaction to confirm using a timeout strategy.
waitForTransactionConfirmation({required Rpc rpc, required Signature signature, required Transaction transaction, RpcTransactionConfirmationConfig config = const RpcTransactionConfirmationConfig()}) Future<void>
Waits for transaction to confirm using RPC polling only.
walkInstructions({required CompiledTransactionMessage compiledMessage, LoadedAddresses? loadedAddresses, Map<String, Object?>? meta}) List<TracedInstruction>
Returns every instruction in a confirmed transaction as TracedInstructions, in the order an explorer displays them: each outer instruction followed immediately by the inner instructions its CPIs produced.
withCleanup<T extends Object>(T client, FutureOr<void> cleanup()) CleanableClient<T>
Wraps client with cleanup logic.
wrapNullable<T>(T? nullable) Option<T>
Wraps a nullable value into an Option.
wrapSolanaError(SolanaErrorCode code, Object cause, {Map<String, Object?> context = const {}}) SolanaError
Creates a SolanaError that wraps an underlying cause.
writeBigIntSigned(Uint8List bytes, int offset, int size, BigInt value, Endian endian) → void
Writes a signed BigInt value to bytes starting at offset, using size bytes in the given endian byte order.
writeBigIntUnsigned(Uint8List bytes, int offset, int size, BigInt value, Endian endian) → void
Writes an unsigned BigInt value to bytes starting at offset, using size bytes in the given endian byte order.
writeKeyPair(KeyPair keyPair, String path, {bool unsafelyOverwriteExistingKeyPair = false}) Future<void>
Writes a KeyPair to disk using the JSON byte-array format produced by solana-keygen.
writeKeyPairSigner(KeyPairSigner signer, String path, {bool unsafelyOverwriteExistingKeyPair = false}) Future<void>
Writes a KeyPairSigner's key pair to disk using the JSON byte-array format produced by solana-keygen.

Typedefs

AddressesByLookupTableAddress = Map<Address, List<Address>>
A mapping of lookup table addresses to the addresses of the accounts that are stored in them.
Base58EncodedDataResponse = (Base58EncodedBytes, String)
A tuple of base58-encoded data and the encoding label 'base58'.
Base64EncodedDataResponse = (Base64EncodedBytes, String)
A tuple of base64-encoded data and the encoding label 'base64'.
Base64EncodedZStdCompressedDataResponse = (Base64EncodedZStdCompressedBytes, String)
A tuple of base64-encoded zstd-compressed data and the encoding label 'base64+zstd'.
ClientPlugin<TInput extends Object, TOutput extends Object> = FutureOr<TOutput> Function(TInput client)
A plugin that transforms a Solana Kit client value.
ClusterUrl = String
A union type of all cluster URL types.
CreateTransactionMessage = Future<TransactionMessage> Function()
A function that creates a new transaction message.
DependentStructDecoderFieldFactory = Decoder<Object?> Function(Map<String, Object?> fields)
A factory that builds a Decoder for a struct field whose shape depends on the values of previously decoded fields in the same struct.
EncodedAccount = Account<Uint8List>
Represents an encoded account, equivalent to an Account with Uint8List account data.
Epoch = BigInt
Represents an epoch number on the Solana blockchain.
EstimateComputeUnitLimit = Future<int> Function(TransactionMessage transactionMessage)
A function that estimates the compute unit limit for transactionMessage.
EstimateResourceLimits = Future<ResourceLimitsEstimate> Function(TransactionMessage transactionMessage)
A function that estimates the resource limits for transactionMessage.
ExecuteTransactionMessage = Future<Object> Function(Map<String, Object?> context, TransactionMessage message)
A function called whenever a transaction message must be sent to the blockchain.
F64UnsafeSeeDocumentation = double
A floating-point number returned by the RPC.
GetDeduplicationKeyFn = String? Function(Object? payload)
A function that produces a deduplication key for a given payload.
GetRecentSignatureConfirmationPromise = Future<void> Function({required CancellationToken abortSignal, required Commitment commitment, required String signature})
The type of a function that creates a recent signature confirmation promise.
GrindKeyPairPredicate = bool Function(String address)
A predicate used to test whether a generated address satisfies a key grind.
JsonParsedAddressLookupTableAccount = RpcParsedInfo<JsonParsedAddressLookupTableInfo>
Parsed account data for an address lookup table account.
JsonParsedNonceAccount = RpcParsedInfo<JsonParsedNonceInfo>
Parsed account data for a nonce account.
JsonParsedVoteAccount = RpcParsedInfo<JsonParsedVoteInfo>
Parsed account data for a vote account.
MaybeEncodedAccount = MaybeAccount<Uint8List>
Represents an encoded account that may or may not exist on-chain.
MessageTransformer<TSourceData> = (String, Object?)? Function(TSourceData message)
A function that transforms a source message into a destination channel name and message pair, or returns null to drop the message.
OffchainMessageApplicationDomain = Address
A 32-byte application domain identifying the application requesting off-chain message signing.
OffchainMessageVersion = int
The version of an offchain message.
OnTransactionMessageUpdated = Future<TransactionMessage> Function(TransactionMessage message)
A function called whenever a transaction message is updated.
PatternMatchCodecEntry<TFrom, TTo> = (bool Function(TFrom value), bool Function(Uint8List bytes), Codec<TFrom, TTo>)
A pattern entry for getPatternMatchCodec: a value predicate, a byte predicate, and a codec.
PatternMatchDecoderEntry<TTo> = (bool Function(Uint8List bytes), Decoder<TTo>)
A pattern entry for getPatternMatchDecoder: a byte predicate and a decoder.
PatternMatchEncoderEntry<TFrom> = (bool Function(TFrom value), Encoder<TFrom>)
A pattern entry for getPatternMatchEncoder: a predicate and an encoder.
PlanTransactionFn<TInput, TPlan> = Future<TPlan> Function(TInput input)
Plans a single transaction input.
PlanTransactionsFn<TInput, TPlan> = Future<List<TPlan>> Function(List<TInput> inputs)
Plans a batch of transaction inputs.
PostOffsetFunction = int Function(PostOffsetScope scope)
A function that modifies the post-offset after encoding or decoding.
PreOffsetFunction = int Function(PreOffsetScope scope)
A function that modifies the pre-offset before encoding or decoding.
ProgramDerivedAddress = (Address, int)
A program-derived address and its associated bump seed.
ReactiveAction<TArgs, TResult> = Future<TResult> Function(CancellationToken signal, TArgs args)
An action wrapped by a ReactiveActionStore.
ReactiveActionSource<TResult> = ReactiveActionStore<List<Object?>, TResult> Function()
A source that creates a fresh reactive action store on demand.
ReactiveActionSubscriber = void Function()
A callback invoked when a ReactiveActionStore changes.
ReactiveStoreSubscriber = void Function()
A callback invoked when a reactive store changes.
ReactiveStreamDataPublisherFactory<T> = Future<ReactiveStreamConnection<T>> Function(CancellationToken signal)
A factory that opens a fresh ReactiveStreamConnection each time a ReactiveStreamStore is (re)connected.
ReactiveStreamSource<T> = ReactiveStreamStore<T> Function()
A source that creates a fresh reactive stream store on demand.
ReactiveStreamSubscriber = void Function()
A callback invoked when a ReactiveStreamStore changes.
ResolvedInstruction = Instruction
An outer transaction instruction with its account indices resolved to full AccountMetas and its data exposed as a Uint8List.
RpcRequestTransformer = RpcRequest<Object?> Function(RpcRequest<Object?> request)
A function that accepts an RpcRequest and returns another RpcRequest.
RpcResponseTransformer<TResponse> = TResponse Function(Object? response, RpcRequest<Object?> request)
A function that accepts an RPC response and returns a transformed response.
RpcSubscriptionsChannelCreator = Future<RpcSubscriptionsChannel> Function({required CancellationToken abortSignal})
A function that creates an RpcSubscriptionsChannel.
RpcSubscriptionsTransport = Future<NotificationStreams> Function(RpcSubscriptionsTransportConfig config)
A function that acts as an RPC subscriptions transport.
SendSignedTransaction = Future<Signature> Function(Transaction transaction)
Sends a signed transaction and returns its signature.
SendTransactionFn<TInput, TResult> = Future<TResult> Function(TInput input)
Sends a single transaction input.
SendTransactionsFn<TInput, TResult> = Future<List<TResult>> Function(List<TInput> inputs)
Sends a batch of transaction inputs.
SignedLamports = BigInt
Represents a signed quantity of lamports that can be negative.
SignTransactionMessage = Future<Transaction> Function(TransactionMessage message)
Signs a compiled transaction message before submission.
Slot = BigInt
Represents a slot number on the Solana blockchain.
SlotTrackingValueMapper<TValue, TItem> = TItem Function(TValue value)
Maps an RPC or subscription value to a yielded item.
Subscriber<T> = void Function(T data)
A function that receives published data of type T.
SubscribeToFn = void Function() Function(void listener())
Registers a listener for changes to a reactive client capability.
SysvarRecentBlockhashes = List<RecentBlockhashEntry>
Information about recent blocks and their fee calculators.
SysvarSlotHashes = List<SlotHashEntry>
The most recent hashes of a slot's parent banks.
SysvarStakeHistory = List<StakeHistoryEntry>
History of stake activations and de-activations.
TransactionExecutionBoundary = Future<TransactionExecutionOutcome> Function(InstructionPlan instructionPlan)
Creates a transaction execution boundary that accepts an instruction plan and returns a structured execution outcome.
TransactionPlanExecutor = Future<TransactionPlanResult> Function(TransactionPlan transactionPlan)
Executes a transaction plan and returns the execution results.
TransactionPlanner = Future<TransactionPlan> Function(InstructionPlan instructionPlan, {int? maxInstructionsPerTransaction})
Plans one or more transactions according to the provided instruction plan.
UnsubscribeCallback = void Function()
A callback that can be invoked to unsubscribe from a store.
UnsubscribeFn = void Function()
A function that unsubscribes a listener from a channel.

Exceptions / Errors

ReactiveActionCancellationException
Thrown when an action dispatch is cancelled internally by its store.
SolanaError
The core error class for all Solana Kit errors.