Options
All
  • Public
  • Public/Protected
  • All
Menu

@solana/web3.js

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AccountBalancePair: { address: PublicKey; lamports: number }

Pair of an account address and its balance

Type declaration

AccountChangeCallback: (accountInfo: AccountInfo<Buffer>, context: Context) => void

Type declaration

    • Callback function for account change notifications

      Parameters

      Returns void

AccountInfo<T>: { data: T; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }

Information describing an account

Type parameters

  • T

Type declaration

  • data: T

    Optional data assigned to the account

  • executable: boolean

    true if this account's data contains a loaded program

  • lamports: number

    Number of lamports assigned to the account

  • owner: PublicKey

    Identifier of the program that owns the account

  • Optional rentEpoch?: number

    Optional rent epoch info for account

AccountKeysFromLookups: LoadedAddresses
AccountMeta: { isSigner: boolean; isWritable: boolean; pubkey: PublicKey }

Account metadata used to define instructions

Type declaration

  • isSigner: boolean

    True if an instruction requires a transaction signature matching pubkey

  • isWritable: boolean

    True if the pubkey can be loaded as a read-write account.

  • pubkey: PublicKey

    An account's public key

AddressLookupTableAccountArgs: { key: PublicKey; state: AddressLookupTableState }

Type declaration

AddressLookupTableState: { addresses: PublicKey[]; authority?: PublicKey; deactivationSlot: bigint; lastExtendedSlot: number; lastExtendedSlotStartIndex: number }

Type declaration

  • addresses: PublicKey[]
  • Optional authority?: PublicKey
  • deactivationSlot: bigint
  • lastExtendedSlot: number
  • lastExtendedSlotStartIndex: number
AdvanceNonceParams: { authorizedPubkey: PublicKey; noncePubkey: PublicKey }

Advance nonce account system instruction params

Type declaration

  • authorizedPubkey: PublicKey

    Public key of the nonce authority

  • noncePubkey: PublicKey

    Nonce account

AllocateParams: { accountPubkey: PublicKey; space: number }

Allocate account system transaction params

Type declaration

  • accountPubkey: PublicKey

    Account to allocate

  • space: number

    Amount of space in bytes to allocate

AllocateWithSeedParams: { accountPubkey: PublicKey; basePubkey: PublicKey; programId: PublicKey; seed: string; space: number }

Allocate account with seed system transaction params

Type declaration

  • accountPubkey: PublicKey

    Account to allocate

  • basePubkey: PublicKey

    Base public key to use to derive the address of the allocated account

  • programId: PublicKey

    Public key of the program to assign as the owner of the allocated account

  • seed: string

    Seed to use to derive the address of the allocated account

  • space: number

    Amount of space in bytes to allocate

AssignParams: { accountPubkey: PublicKey; programId: PublicKey }

Assign system transaction params

Type declaration

  • accountPubkey: PublicKey

    Public key of the account which will be assigned a new owner

  • programId: PublicKey

    Public key of the program to assign as the owner

AssignWithSeedParams: { accountPubkey: PublicKey; basePubkey: PublicKey; programId: PublicKey; seed: string }

Assign account with seed system transaction params

Type declaration

  • accountPubkey: PublicKey

    Public key of the account which will be assigned a new owner

  • basePubkey: PublicKey

    Base public key to use to derive the address of the assigned account

  • programId: PublicKey

    Public key of the program to assign as the owner

  • seed: string

    Seed to use to derive the address of the assigned account

AuthorizeNonceParams: { authorizedPubkey: PublicKey; newAuthorizedPubkey: PublicKey; noncePubkey: PublicKey }

Authorize nonce account system transaction params

Type declaration

  • authorizedPubkey: PublicKey

    Public key of the current nonce authority

  • newAuthorizedPubkey: PublicKey

    Public key to set as the new nonce authority

  • noncePubkey: PublicKey

    Nonce account

AuthorizeStakeParams: { authorizedPubkey: PublicKey; custodianPubkey?: PublicKey; newAuthorizedPubkey: PublicKey; stakeAuthorizationType: StakeAuthorizationType; stakePubkey: PublicKey }

Authorize stake instruction params

Type declaration

AuthorizeVoteParams: { authorizedPubkey: PublicKey; newAuthorizedPubkey: PublicKey; voteAuthorizationType: VoteAuthorizationType; votePubkey: PublicKey }

Authorize instruction params

Type declaration

AuthorizeVoteWithSeedParams: { currentAuthorityDerivedKeyBasePubkey: PublicKey; currentAuthorityDerivedKeyOwnerPubkey: PublicKey; currentAuthorityDerivedKeySeed: string; newAuthorizedPubkey: PublicKey; voteAuthorizationType: VoteAuthorizationType; votePubkey: PublicKey }

AuthorizeWithSeed instruction params

Type declaration

AuthorizeWithSeedStakeParams: { authorityBase: PublicKey; authorityOwner: PublicKey; authoritySeed: string; custodianPubkey?: PublicKey; newAuthorizedPubkey: PublicKey; stakeAuthorizationType: StakeAuthorizationType; stakePubkey: PublicKey }

Authorize stake instruction params using a derived key

Type declaration

AuthorizedVoter: Readonly<{ authorizedVoter: PublicKey; epoch: number }>
BlockProduction: Readonly<{ byIdentity: Readonly<Record<string, ReadonlyArray<number>>>; range: Readonly<{ firstSlot: number; lastSlot: number }> }>

recent block production information

BlockResponse: { blockTime: number | null; blockhash: Blockhash; parentSlot: number; previousBlockhash: Blockhash; rewards?: { lamports: number; postBalance: number | null; pubkey: string; rewardType: string | null }[]; transactions: { meta: ConfirmedTransactionMeta | null; transaction: { message: Message; signatures: string[] }; version?: TransactionVersion }[] }

A processed block fetched from the RPC API

Type declaration

  • blockTime: number | null

    The unix timestamp of when the block was processed

  • blockhash: Blockhash

    Blockhash of this block

  • parentSlot: number

    Slot index of this block's parent

  • previousBlockhash: Blockhash

    Blockhash of this block's parent

  • Optional rewards?: { lamports: number; postBalance: number | null; pubkey: string; rewardType: string | null }[]

    Vector of block rewards

  • transactions: { meta: ConfirmedTransactionMeta | null; transaction: { message: Message; signatures: string[] }; version?: TransactionVersion }[]

    Vector of transactions with status meta and original message

BlockSignatures: { blockTime: number | null; blockhash: Blockhash; parentSlot: number; previousBlockhash: Blockhash; signatures: string[] }

A Block on the ledger with signatures only

Type declaration

  • blockTime: number | null

    The unix timestamp of when the block was processed

  • blockhash: Blockhash

    Blockhash of this block

  • parentSlot: number

    Slot index of this block's parent

  • previousBlockhash: Blockhash

    Blockhash of this block's parent

  • signatures: string[]

    Vector of signatures

BlockTimestamp: Readonly<{ slot: number; timestamp: number }>
Blockhash: string

Blockhash as Base58 string.

BlockhashWithExpiryBlockHeight: Readonly<{ blockhash: Blockhash; lastValidBlockHeight: number }>
BlockheightBasedTransactionConfirmationStrategy: { signature: TransactionSignature } & BlockhashWithExpiryBlockHeight

A strategy for confirming transactions that uses the last valid block height for a given blockhash to check for transaction expiration.

CloseLookupTableParams: { authority: PublicKey; lookupTable: PublicKey; recipient: PublicKey }

Type declaration

  • authority: PublicKey

    Account which is the current authority.

  • lookupTable: PublicKey

    Address lookup table account to close.

  • recipient: PublicKey

    Recipient of closed account lamports.

Cluster: "devnet" | "testnet" | "mainnet-beta"
Commitment: "processed" | "confirmed" | "finalized" | "recent" | "single" | "singleGossip" | "root" | "max"

The level of commitment desired when querying state

  'processed': Query the most recent block which has reached 1 confirmation by the connected node
  'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
  'finalized': Query the most recent block which has been finalized by the cluster
CompileLegacyArgs: { instructions: TransactionInstruction[]; payerKey: PublicKey; recentBlockhash: Blockhash }

Type declaration

CompileV0Args: { addressLookupTableAccounts?: AddressLookupTableAccount[]; instructions: TransactionInstruction[]; payerKey: PublicKey; recentBlockhash: Blockhash }

Type declaration

CompiledInnerInstruction: { index: number; instructions: CompiledInstruction[] }

Type declaration

CompiledInstruction: { accounts: number[]; data: string; programIdIndex: number }

An instruction to execute by a program

property

{number} programIdIndex

property

{number[]} accounts

property

{string} data

Type declaration

  • accounts: number[]

    Ordered indices into the transaction keys array indicating which accounts to pass to the program

  • data: string

    The program input data encoded as base 58

  • programIdIndex: number

    Index into the transaction keys array indicating the program account that executes this instruction

ComputeBudgetInstructionType: "RequestUnits" | "RequestHeapFrame" | "SetComputeUnitLimit" | "SetComputeUnitPrice"

An enumeration of valid ComputeBudgetInstructionType's

ConfirmOptions: { commitment?: Commitment; maxRetries?: number; minContextSlot?: number; preflightCommitment?: Commitment; skipPreflight?: boolean }

Options for confirming transactions

Type declaration

  • Optional commitment?: Commitment

    desired commitment level

  • Optional maxRetries?: number

    Maximum number of times for the RPC node to retry sending the transaction to the leader.

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

  • Optional preflightCommitment?: Commitment

    preflight commitment level

  • Optional skipPreflight?: boolean

    disable transaction verification step

ConfirmedBlock: { blockTime: number | null; blockhash: Blockhash; parentSlot: number; previousBlockhash: Blockhash; rewards?: { lamports: number; postBalance: number | null; pubkey: string; rewardType: string | null }[]; transactions: { meta: ConfirmedTransactionMeta | null; transaction: Transaction }[] }

A confirmed block on the ledger

deprecated

Deprecated since Solana v1.8.0.

Type declaration

  • blockTime: number | null

    The unix timestamp of when the block was processed

  • blockhash: Blockhash

    Blockhash of this block

  • parentSlot: number

    Slot index of this block's parent

  • previousBlockhash: Blockhash

    Blockhash of this block's parent

  • Optional rewards?: { lamports: number; postBalance: number | null; pubkey: string; rewardType: string | null }[]

    Vector of block rewards

  • transactions: { meta: ConfirmedTransactionMeta | null; transaction: Transaction }[]

    Vector of transactions and status metas

ConfirmedSignatureInfo: { blockTime?: number | null; err: TransactionError | null; memo: string | null; signature: string; slot: number }

A confirmed signature with its status

Type declaration

  • Optional blockTime?: number | null

    The unix timestamp of when the transaction was processed

  • err: TransactionError | null

    error, if any

  • memo: string | null

    memo associated with the transaction, if any

  • signature: string

    the transaction signature

  • slot: number

    when the transaction was processed

ConfirmedSignaturesForAddress2Options: { before?: TransactionSignature; limit?: number; until?: TransactionSignature }

Options for getConfirmedSignaturesForAddress2

Type declaration

  • Optional before?: TransactionSignature

    Start searching backwards from this transaction signature.

    remark

    If not provided the search starts from the highest max confirmed block.

  • Optional limit?: number

    Maximum transaction signatures to return (between 1 and 1,000, default: 1,000).

  • Optional until?: TransactionSignature

    Search until this transaction signature is reached, if found before limit.

ConfirmedTransaction: { blockTime?: number | null; meta: ConfirmedTransactionMeta | null; slot: number; transaction: Transaction }

A confirmed transaction on the ledger

deprecated

Deprecated since Solana v1.8.0.

Type declaration

  • Optional blockTime?: number | null

    The unix timestamp of when the transaction was processed

  • meta: ConfirmedTransactionMeta | null

    Metadata produced from the transaction

  • slot: number

    The slot during which the transaction was processed

  • transaction: Transaction

    The details of the transaction

ConfirmedTransactionMeta: { computeUnitsConsumed?: number; err: TransactionError | null; fee: number; innerInstructions?: CompiledInnerInstruction[] | null; loadedAddresses?: LoadedAddresses; logMessages?: string[] | null; postBalances: number[]; postTokenBalances?: TokenBalance[] | null; preBalances: number[]; preTokenBalances?: TokenBalance[] | null }

Metadata for a confirmed transaction on the ledger

Type declaration

  • Optional computeUnitsConsumed?: number

    The compute units consumed after processing the transaction

  • err: TransactionError | null

    The error result of transaction processing

  • fee: number

    The fee charged for processing the transaction

  • Optional innerInstructions?: CompiledInnerInstruction[] | null

    An array of cross program invoked instructions

  • Optional loadedAddresses?: LoadedAddresses

    The collection of addresses loaded using address lookup tables

  • Optional logMessages?: string[] | null

    An array of program log messages emitted during a transaction

  • postBalances: number[]

    The balances of the transaction accounts after processing

  • Optional postTokenBalances?: TokenBalance[] | null

    The token balances of the transaction accounts after processing

  • preBalances: number[]

    The balances of the transaction accounts before processing

  • Optional preTokenBalances?: TokenBalance[] | null

    The token balances of the transaction accounts before processing

ConnectionConfig: { commitment?: Commitment; confirmTransactionInitialTimeout?: number; disableRetryOnRateLimit?: boolean; fetch?: FetchFn; fetchMiddleware?: FetchMiddleware; httpHeaders?: HttpHeaders; wsEndpoint?: string }

Configuration for instantiating a Connection

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional confirmTransactionInitialTimeout?: number

    time to allow for the server to initially process a transaction (in milliseconds)

  • Optional disableRetryOnRateLimit?: boolean

    Optional Disable retrying calls when server responds with HTTP 429 (Too Many Requests)

  • Optional fetch?: FetchFn

    Optional custom fetch function

  • Optional fetchMiddleware?: FetchMiddleware

    Optional fetch middleware callback

  • Optional httpHeaders?: HttpHeaders

    Optional HTTP headers object

  • Optional wsEndpoint?: string

    Optional endpoint URL to the fullnode JSON RPC PubSub WebSocket Endpoint

ContactInfo: { gossip: string | null; pubkey: string; rpc: string | null; tpu: string | null; version: string | null }

Information describing a cluster node

Type declaration

  • gossip: string | null

    Gossip network address for the node

  • pubkey: string

    Identity public key of the node

  • rpc: string | null

    JSON RPC network address for the node (null if not available)

  • tpu: string | null

    TPU network address for the node (null if not available)

  • version: string | null

    Software version of the node (null if not available)

Context: { slot: number }

Extra contextual information for RPC responses

Type declaration

  • slot: number
CreateAccountParams: { fromPubkey: PublicKey; lamports: number; newAccountPubkey: PublicKey; programId: PublicKey; space: number }

Create account system transaction params

Type declaration

  • fromPubkey: PublicKey

    The account that will transfer lamports to the created account

  • lamports: number

    Amount of lamports to transfer to the created account

  • newAccountPubkey: PublicKey

    Public key of the created account

  • programId: PublicKey

    Public key of the program to assign as the owner of the created account

  • space: number

    Amount of space in bytes to allocate to the created account

CreateAccountWithSeedParams: { basePubkey: PublicKey; fromPubkey: PublicKey; lamports: number; newAccountPubkey: PublicKey; programId: PublicKey; seed: string; space: number }

Create account with seed system transaction params

Type declaration

  • basePubkey: PublicKey

    Base public key to use to derive the address of the created account. Must be the same as the base key used to create newAccountPubkey

  • fromPubkey: PublicKey

    The account that will transfer lamports to the created account

  • lamports: number

    Amount of lamports to transfer to the created account

  • newAccountPubkey: PublicKey

    Public key of the created account. Must be pre-calculated with PublicKey.createWithSeed()

  • programId: PublicKey

    Public key of the program to assign as the owner of the created account

  • seed: string

    Seed to use to derive the address of the created account. Must be the same as the seed used to create newAccountPubkey

  • space: number

    Amount of space in bytes to allocate to the created account

CreateEd25519InstructionWithPrivateKeyParams: { instructionIndex?: number; message: Uint8Array; privateKey: Uint8Array }

Params for creating an ed25519 instruction using a private key

Type declaration

  • Optional instructionIndex?: number
  • message: Uint8Array
  • privateKey: Uint8Array
CreateEd25519InstructionWithPublicKeyParams: { instructionIndex?: number; message: Uint8Array; publicKey: Uint8Array; signature: Uint8Array }

Params for creating an ed25519 instruction using a public key

Type declaration

  • Optional instructionIndex?: number
  • message: Uint8Array
  • publicKey: Uint8Array
  • signature: Uint8Array
CreateLookupTableParams: { authority: PublicKey; payer: PublicKey; recentSlot: bigint | number }

Type declaration

  • authority: PublicKey

    Account used to derive and control the new address lookup table.

  • payer: PublicKey

    Account that will fund the new address lookup table.

  • recentSlot: bigint | number

    A recent slot must be used in the derivation path for each initialized table.

CreateNonceAccountParams: { authorizedPubkey: PublicKey; fromPubkey: PublicKey; lamports: number; noncePubkey: PublicKey }

Create nonce account system transaction params

Type declaration

  • authorizedPubkey: PublicKey

    Public key to set as authority of the created nonce account

  • fromPubkey: PublicKey

    The account that will transfer lamports to the created nonce account

  • lamports: number

    Amount of lamports to transfer to the created nonce account

  • noncePubkey: PublicKey

    Public key of the created nonce account

CreateNonceAccountWithSeedParams: { authorizedPubkey: PublicKey; basePubkey: PublicKey; fromPubkey: PublicKey; lamports: number; noncePubkey: PublicKey; seed: string }

Create nonce account with seed system transaction params

Type declaration

  • authorizedPubkey: PublicKey

    Public key to set as authority of the created nonce account

  • basePubkey: PublicKey

    Base public key to use to derive the address of the nonce account

  • fromPubkey: PublicKey

    The account that will transfer lamports to the created nonce account

  • lamports: number

    Amount of lamports to transfer to the created nonce account

  • noncePubkey: PublicKey

    Public key of the created nonce account

  • seed: string

    Seed to use to derive the address of the nonce account

CreateSecp256k1InstructionWithEthAddressParams: { ethAddress: Buffer | Uint8Array | number[] | string; instructionIndex?: number; message: Buffer | Uint8Array | number[]; recoveryId: number; signature: Buffer | Uint8Array | number[] }

Params for creating an secp256k1 instruction using an Ethereum address

Type declaration

  • ethAddress: Buffer | Uint8Array | number[] | string
  • Optional instructionIndex?: number
  • message: Buffer | Uint8Array | number[]
  • recoveryId: number
  • signature: Buffer | Uint8Array | number[]
CreateSecp256k1InstructionWithPrivateKeyParams: { instructionIndex?: number; message: Buffer | Uint8Array | number[]; privateKey: Buffer | Uint8Array | number[] }

Params for creating an secp256k1 instruction using a private key

Type declaration

  • Optional instructionIndex?: number
  • message: Buffer | Uint8Array | number[]
  • privateKey: Buffer | Uint8Array | number[]
CreateSecp256k1InstructionWithPublicKeyParams: { instructionIndex?: number; message: Buffer | Uint8Array | number[]; publicKey: Buffer | Uint8Array | number[]; recoveryId: number; signature: Buffer | Uint8Array | number[] }

Params for creating an secp256k1 instruction using a public key

Type declaration

  • Optional instructionIndex?: number
  • message: Buffer | Uint8Array | number[]
  • publicKey: Buffer | Uint8Array | number[]
  • recoveryId: number
  • signature: Buffer | Uint8Array | number[]
CreateStakeAccountParams: { authorized: Authorized; fromPubkey: PublicKey; lamports: number; lockup?: Lockup; stakePubkey: PublicKey }

Create stake account transaction params

Type declaration

  • authorized: Authorized

    Authorities of the new stake account

  • fromPubkey: PublicKey

    Address of the account which will fund creation

  • lamports: number

    Funding amount

  • Optional lockup?: Lockup

    Lockup of the new stake account

  • stakePubkey: PublicKey

    Address of the new stake account

CreateStakeAccountWithSeedParams: { authorized: Authorized; basePubkey: PublicKey; fromPubkey: PublicKey; lamports: number; lockup?: Lockup; seed: string; stakePubkey: PublicKey }

Create stake account with seed transaction params

Type declaration

CreateVoteAccountParams: { fromPubkey: PublicKey; lamports: number; voteInit: VoteInit; votePubkey: PublicKey }

Create vote account transaction params

Type declaration

DataSizeFilter: { dataSize: number }

Data size comparison filter for getProgramAccounts

Type declaration

  • dataSize: number

    Size of data for program account data length comparison

DataSlice: { length: number; offset: number }

Data slice argument for getProgramAccounts

Type declaration

  • length: number

    length of data slice

  • offset: number

    offset of data slice

DeactivateLookupTableParams: { authority: PublicKey; lookupTable: PublicKey }

Type declaration

  • authority: PublicKey

    Account which is the current authority.

  • lookupTable: PublicKey

    Address lookup table account to deactivate.

DeactivateStakeParams: { authorizedPubkey: PublicKey; stakePubkey: PublicKey }

Deactivate stake instruction params

Type declaration

DecodedTransferInstruction: { fromPubkey: PublicKey; lamports: bigint; toPubkey: PublicKey }

Decoded transfer system transaction instruction

Type declaration

  • fromPubkey: PublicKey

    Account that will transfer lamports

  • lamports: bigint

    Amount of lamports to transfer

  • toPubkey: PublicKey

    Account that will receive transferred lamports

DecodedTransferWithSeedInstruction: { basePubkey: PublicKey; fromPubkey: PublicKey; lamports: bigint; programId: PublicKey; seed: string; toPubkey: PublicKey }

Decoded transferWithSeed system transaction instruction

Type declaration

  • basePubkey: PublicKey

    Base public key to use to derive the funding account address

  • fromPubkey: PublicKey

    Account that will transfer lamports

  • lamports: bigint

    Amount of lamports to transfer

  • programId: PublicKey

    Program id to use to derive the funding account address

  • seed: string

    Seed to use to derive the funding account address

  • toPubkey: PublicKey

    Account that will receive transferred lamports

DecompileArgs: { accountKeysFromLookups: AccountKeysFromLookups } | { addressLookupTableAccounts: AddressLookupTableAccount[] }
DelegateStakeParams: { authorizedPubkey: PublicKey; stakePubkey: PublicKey; votePubkey: PublicKey }

Delegate stake instruction params

Type declaration

EpochCredits: Readonly<{ credits: number; epoch: number; prevCredits: number }>

History of how many credits earned by the end of each epoch

EpochInfo: { absoluteSlot: number; blockHeight?: number; epoch: number; slotIndex: number; slotsInEpoch: number; transactionCount?: number }

Information about the current epoch

Type declaration

  • absoluteSlot: number
  • Optional blockHeight?: number
  • epoch: number
  • slotIndex: number
  • slotsInEpoch: number
  • Optional transactionCount?: number
ExtendLookupTableParams: { addresses: PublicKey[]; authority: PublicKey; lookupTable: PublicKey; payer?: PublicKey }

Type declaration

  • addresses: PublicKey[]

    List of Public Keys to be added to the lookup table.

  • authority: PublicKey

    Account which is the current authority.

  • lookupTable: PublicKey

    Address lookup table account to extend.

  • Optional payer?: PublicKey

    Account that will fund the table reallocation. Not required if the reallocation has already been funded.

FetchFn: typeof fetchImpl

The type of the JavaScript fetch() API

FetchMiddleware: (info: Parameters<FetchFn>[0], init: Parameters<FetchFn>[1], fetch: (...a: Parameters<FetchFn>) => void) => void

Type declaration

    • (info: Parameters<FetchFn>[0], init: Parameters<FetchFn>[1], fetch: (...a: Parameters<FetchFn>) => void): void
    • A callback used to augment the outgoing HTTP request

      Parameters

      • info: Parameters<FetchFn>[0]
      • init: Parameters<FetchFn>[1]
      • fetch: (...a: Parameters<FetchFn>) => void
          • Parameters

            Returns void

      Returns void

Finality: "confirmed" | "finalized"

A subset of Commitment levels, which are at least optimistically confirmed

  'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
  'finalized': Query the most recent block which has been finalized by the cluster
FreezeLookupTableParams: { authority: PublicKey; lookupTable: PublicKey }

Type declaration

  • authority: PublicKey

    Account which is the current authority.

  • lookupTable: PublicKey

    Address lookup table account to freeze.

GetAccountInfoConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getAccountInfo query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetAccountKeysArgs: { accountKeysFromLookups?: AccountKeysFromLookups | null } | { addressLookupTableAccounts?: AddressLookupTableAccount[] | null }
GetBalanceConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getBalance query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetBlockConfig: { commitment?: Finality }

Configuration object for changing getBlock query behavior

Type declaration

  • Optional commitment?: Finality

    The level of finality desired

GetBlockHeightConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getBlockHeight query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetBlockProductionConfig: { commitment?: Commitment; identity?: string; range?: { firstSlot: number; lastSlot?: number } }

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional identity?: string

    Only return results for this validator identity (base-58 encoded)

  • Optional range?: { firstSlot: number; lastSlot?: number }

    Slot range to return block production for. If parameter not provided, defaults to current epoch.

    • firstSlot: number

      first slot to return block production information for (inclusive)

    • Optional lastSlot?: number

      last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot

GetEpochInfoConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getEpochInfo query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetInflationRewardConfig: { commitment?: Commitment; epoch?: number; minContextSlot?: number }

Configuration object for changing getInflationReward query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional epoch?: number

    An epoch for which the reward occurs. If omitted, the previous epoch will be used

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetLargestAccountsConfig: { commitment?: Commitment; filter?: LargestAccountsFilter }

Configuration object for changing getLargestAccounts query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional filter?: LargestAccountsFilter

    Filter largest accounts by whether they are part of the circulating supply

GetLatestBlockhashConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getLatestBlockhash query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetMultipleAccountsConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for getMultipleAccounts

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetParsedProgramAccountsConfig: { commitment?: Commitment; filters?: GetProgramAccountsFilter[]; minContextSlot?: number }

Configuration object for getParsedProgramAccounts

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional filters?: GetProgramAccountsFilter[]

    Optional array of filters to apply to accounts

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetProgramAccountsConfig: { commitment?: Commitment; dataSlice?: DataSlice; encoding?: "base64"; filters?: GetProgramAccountsFilter[]; minContextSlot?: number }

Configuration object for getProgramAccounts requests

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional dataSlice?: DataSlice

    Optional data slice to limit the returned account data

  • Optional encoding?: "base64"

    Optional encoding for account data (default base64) To use "jsonParsed" encoding, please refer to getParsedProgramAccounts in connection.ts

  • Optional filters?: GetProgramAccountsFilter[]

    Optional array of filters to apply to accounts

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetProgramAccountsFilter: MemcmpFilter | DataSizeFilter

A filter object for getProgramAccounts

GetSlotConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getSlot query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetSlotLeaderConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for changing getSlotLeader query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetStakeActivationConfig: { commitment?: Commitment; epoch?: number; minContextSlot?: number }

Configuration object for getStakeActivation

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional epoch?: number

    Epoch for which to calculate activation details. If parameter not provided, defaults to current epoch

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetStakeMinimumDelegationConfig: { commitment?: Commitment }

Configuration object for changing getStakeMinimumDelegation query behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

GetSupplyConfig: { commitment?: Commitment; excludeNonCirculatingAccountsList?: boolean }

Configuration object for changing getSupply request behavior

Type declaration

  • Optional commitment?: Commitment

    The level of commitment desired

  • Optional excludeNonCirculatingAccountsList?: boolean

    Exclude non circulating accounts list from response

GetTokenAccountsByOwnerConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for getStakeActivation

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetTransactionConfig: { commitment?: Finality }

Configuration object for changing getTransaction query behavior

Type declaration

  • Optional commitment?: Finality

    The level of finality desired

GetTransactionCountConfig: { commitment?: Commitment; minContextSlot?: number }

Configuration object for getStakeActivation

Type declaration

  • Optional commitment?: Commitment

    Optional commitment level

  • Optional minContextSlot?: number

    The minimum slot that the request can be evaluated at

GetVersionedBlockConfig: { commitment?: Finality; maxSupportedTransactionVersion?: number }

Configuration object for changing getBlock query behavior

Type declaration

  • Optional commitment?: Finality

    The level of finality desired

  • Optional maxSupportedTransactionVersion?: number

    The max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned

GetVersionedTransactionConfig: { commitment?: Finality; maxSupportedTransactionVersion?: number }

Configuration object for changing getTransaction query behavior

Type declaration

  • Optional commitment?: Finality

    The level of finality desired

  • Optional maxSupportedTransactionVersion?: number

    The max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned

HttpHeaders: {} & { solana-client?: never }

An object defining headers to be passed to the RPC server

InflationGovernor: { foundation: number; foundationTerm: number; initial: number; taper: number; terminal: number }

Type declaration

  • foundation: number
  • foundationTerm: number
  • initial: number
  • taper: number
  • terminal: number
InflationReward: { amount: number; effectiveSlot: number; epoch: number; postBalance: number }

The inflation reward for an epoch

Type declaration

  • amount: number

    reward amount in lamports

  • effectiveSlot: number

    the slot in which the rewards are effective

  • epoch: number

    epoch for which the reward occurs

  • postBalance: number

    post balance of the account in lamports

Info: { details?: string; keybaseUsername?: string; name: string; website?: string }

Info used to identity validators.

Type declaration

  • Optional details?: string

    optional, extra information the validator chose to share

  • Optional keybaseUsername?: string

    optional, used to identify validators on keybase.io

  • name: string

    validator name

  • Optional website?: string

    optional, validator website

InitializeAccountParams: { nodePubkey: PublicKey; voteInit: VoteInit; votePubkey: PublicKey }

InitializeAccount instruction params

Type declaration

InitializeNonceParams: { authorizedPubkey: PublicKey; noncePubkey: PublicKey }

Initialize nonce account system instruction params

Type declaration

  • authorizedPubkey: PublicKey

    Public key to set as authority of the initialized nonce account

  • noncePubkey: PublicKey

    Nonce account which will be initialized

InitializeStakeParams: { authorized: Authorized; lockup?: Lockup; stakePubkey: PublicKey }

Initialize stake instruction params

Type declaration

KeyedAccountInfo: { accountId: PublicKey; accountInfo: AccountInfo<Buffer> }

Account information identified by pubkey

Type declaration

LargestAccountsFilter: "circulating" | "nonCirculating"

Filter for largest accounts query

  'circulating':    Return the largest accounts that are part of the circulating supply
  'nonCirculating': Return the largest accounts that are not part of the circulating supply
LeaderSchedule: {}

Type declaration

  • [address: string]: number[]
LoadedAddresses: { readonly: PublicKey[]; writable: PublicKey[] }

Collection of addresses loaded by a transaction using address table lookups

Type declaration

Lockout: { confirmationCount: number; slot: number }

Type declaration

  • confirmationCount: number
  • slot: number
Logs: { err: TransactionError | null; logs: string[]; signature: string }

Logs result.

Type declaration

LogsCallback: (logs: Logs, ctx: Context) => void

Type declaration

    • Callback function for log notifications.

      Parameters

      Returns void

LogsFilter: PublicKey | "all" | "allWithVotes"

Filter for log subscriptions.

LookupTableInstructionType: "CreateLookupTable" | "ExtendLookupTable" | "CloseLookupTable" | "FreezeLookupTable" | "DeactivateLookupTable"

An enumeration of valid LookupTableInstructionType's

MemcmpFilter: { memcmp: { bytes: string; offset: number } }

Memory comparison filter for getProgramAccounts

Type declaration

  • memcmp: { bytes: string; offset: number }
    • bytes: string

      data to match, as base-58 encoded string and limited to less than 129 bytes

    • offset: number

      offset into program account data to start comparison

MergeStakeParams: { authorizedPubkey: PublicKey; sourceStakePubKey: PublicKey; stakePubkey: PublicKey }

Merge stake instruction params

Type declaration

MessageAddressTableLookup: { accountKey: PublicKey; readonlyIndexes: number[]; writableIndexes: number[] }

An address table lookup used to load additional accounts

Type declaration

  • accountKey: PublicKey
  • readonlyIndexes: number[]
  • writableIndexes: number[]
MessageArgs: { accountKeys: string[] | PublicKey[]; header: MessageHeader; instructions: CompiledInstruction[]; recentBlockhash: Blockhash }

Message constructor arguments

Type declaration

  • accountKeys: string[] | PublicKey[]

    All the account keys used by this transaction

  • header: MessageHeader

    The message header, identifying signed and read-only accountKeys

  • instructions: CompiledInstruction[]

    Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.

  • recentBlockhash: Blockhash

    The hash of a recent ledger block

MessageCompiledInstruction: { accountKeyIndexes: number[]; data: Uint8Array; programIdIndex: number }

An instruction to execute by a program

property

{number} programIdIndex

property

{number[]} accountKeyIndexes

property

{Uint8Array} data

Type declaration

  • accountKeyIndexes: number[]

    Ordered indices into the transaction keys array indicating which accounts to pass to the program

  • data: Uint8Array

    The program input data

  • programIdIndex: number

    Index into the transaction keys array indicating the program account that executes this instruction

MessageHeader: { numReadonlySignedAccounts: number; numReadonlyUnsignedAccounts: number; numRequiredSignatures: number }

The message header, identifying signed and read-only account

Type declaration

  • numReadonlySignedAccounts: number

    The last numReadonlySignedAccounts of the signed keys are read-only accounts

  • numReadonlyUnsignedAccounts: number

    The last numReadonlySignedAccounts of the unsigned keys are read-only accounts

  • numRequiredSignatures: number

    The number of signatures required for this message to be considered valid. The signatures must match the first numRequiredSignatures of accountKeys.

MessageV0Args: { addressTableLookups: MessageAddressTableLookup[]; compiledInstructions: MessageCompiledInstruction[]; header: MessageHeader; recentBlockhash: Blockhash; staticAccountKeys: PublicKey[] }

Message constructor arguments

Type declaration

  • addressTableLookups: MessageAddressTableLookup[]

    Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.

  • compiledInstructions: MessageCompiledInstruction[]

    Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.

  • header: MessageHeader

    The message header, identifying signed and read-only accountKeys

  • recentBlockhash: Blockhash

    The hash of a recent ledger block

  • staticAccountKeys: PublicKey[]

    The static account keys used by this transaction

NonceInformation: { nonce: Blockhash; nonceInstruction: TransactionInstruction }

Nonce information to be used to build an offline Transaction.

Type declaration

ParsedAccountData: { parsed: any; program: string; space: number }

Parsed account data

Type declaration

  • parsed: any

    Parsed account data

  • program: string

    Name of the program that owns this account

  • space: number

    Space used by account data

ParsedAddressTableLookup: { accountKey: PublicKey; readonlyIndexes: number[]; writableIndexes: number[] }

A parsed address table lookup

Type declaration

  • accountKey: PublicKey

    Address lookup table account key

  • readonlyIndexes: number[]

    Parsed instruction info

  • writableIndexes: number[]

    Parsed instruction info

ParsedConfirmedTransaction: ParsedTransactionWithMeta

A parsed and confirmed transaction on the ledger

deprecated

Deprecated since Solana v1.8.0. Please use ParsedTransactionWithMeta instead.

ParsedConfirmedTransactionMeta: ParsedTransactionMeta

Metadata for a parsed confirmed transaction on the ledger

deprecated

Deprecated since Solana v1.8.0. Please use ParsedTransactionMeta instead.

ParsedInnerInstruction: { index: number; instructions: (ParsedInstruction | PartiallyDecodedInstruction)[] }

Type declaration

ParsedInstruction: { parsed: any; program: string; programId: PublicKey }

A parsed transaction instruction

Type declaration

  • parsed: any

    Parsed instruction info

  • program: string

    Name of the program for this instruction

  • programId: PublicKey

    ID of the program for this instruction

ParsedMessage: { accountKeys: ParsedMessageAccount[]; addressTableLookups?: ParsedAddressTableLookup[] | null; instructions: (ParsedInstruction | PartiallyDecodedInstruction)[]; recentBlockhash: string }

A parsed transaction message

Type declaration

ParsedMessageAccount: { pubkey: PublicKey; signer: boolean; source?: "transaction" | "lookupTable"; writable: boolean }

A parsed transaction message account

Type declaration

  • pubkey: PublicKey

    Public key of the account

  • signer: boolean

    Indicates if the account signed the transaction

  • Optional source?: "transaction" | "lookupTable"

    Indicates if the account key came from the transaction or a lookup table

  • writable: boolean

    Indicates if the account is writable for this transaction

ParsedTransaction: { message: ParsedMessage; signatures: string[] }

A parsed transaction

Type declaration

  • message: ParsedMessage

    Message of the transaction

  • signatures: string[]

    Signatures for the transaction

ParsedTransactionMeta: { computeUnitsConsumed?: number; err: TransactionError | null; fee: number; innerInstructions?: ParsedInnerInstruction[] | null; loadedAddresses?: LoadedAddresses; logMessages?: string[] | null; postBalances: number[]; postTokenBalances?: TokenBalance[] | null; preBalances: number[]; preTokenBalances?: TokenBalance[] | null }

Metadata for a parsed transaction on the ledger

Type declaration

  • Optional computeUnitsConsumed?: number

    The compute units consumed after processing the transaction

  • err: TransactionError | null

    The error result of transaction processing

  • fee: number

    The fee charged for processing the transaction

  • Optional innerInstructions?: ParsedInnerInstruction[] | null

    An array of cross program invoked parsed instructions

  • Optional loadedAddresses?: LoadedAddresses

    The collection of addresses loaded using address lookup tables

  • Optional logMessages?: string[] | null

    An array of program log messages emitted during a transaction

  • postBalances: number[]

    The balances of the transaction accounts after processing

  • Optional postTokenBalances?: TokenBalance[] | null

    The token balances of the transaction accounts after processing

  • preBalances: number[]

    The balances of the transaction accounts before processing

  • Optional preTokenBalances?: TokenBalance[] | null

    The token balances of the transaction accounts before processing

ParsedTransactionWithMeta: { blockTime?: number | null; meta: ParsedTransactionMeta | null; slot: number; transaction: ParsedTransaction; version?: TransactionVersion }

A parsed transaction on the ledger with meta

Type declaration

  • Optional blockTime?: number | null

    The unix timestamp of when the transaction was processed

  • meta: ParsedTransactionMeta | null

    Metadata produced from the transaction

  • slot: number

    The slot during which the transaction was processed

  • transaction: ParsedTransaction

    The details of the transaction

  • Optional version?: TransactionVersion

    The version of the transaction message

PartiallyDecodedInstruction: { accounts: PublicKey[]; data: string; programId: PublicKey }

A partially decoded transaction instruction

Type declaration

  • accounts: PublicKey[]

    Public keys of accounts passed to this instruction

  • data: string

    Raw base-58 instruction data

  • programId: PublicKey

    Program id called by this instruction

PerfSample: { numSlots: number; numTransactions: number; samplePeriodSecs: number; slot: number }

A performance sample

Type declaration

  • numSlots: number

    Number of slots in a sample window

  • numTransactions: number

    Number of transactions in a sample window

  • samplePeriodSecs: number

    Sample window in seconds

  • slot: number

    Slot number of sample

PriorVoter: Readonly<{ authorizedPubkey: PublicKey; epochOfLastAuthorizedSwitch: number; targetEpoch: number }>
ProgramAccountChangeCallback: (keyedAccountInfo: KeyedAccountInfo, context: Context) => void

Type declaration

PublicKeyData: { }

JSON object representation of PublicKey class

Type declaration

    PublicKeyInitData: number | string | Uint8Array | number[] | PublicKeyData

    Value to be converted into public key

    RequestHeapFrameParams: { bytes: number }

    Request heap frame instruction params

    Type declaration

    • bytes: number

      Requested transaction-wide program heap size in bytes. Must be multiple of 1024. Applies to each program, including CPIs.

    RootChangeCallback: (root: number) => void

    Type declaration

      • (root: number): void
      • Callback function for root change notifications

        Parameters

        • root: number

        Returns void

    RpcResponseAndContext<T>: { context: Context; value: T }

    RPC Response with extra contextual information

    Type parameters

    • T

    Type declaration

    • context: Context

      response context

    • value: T

      response value

    SendOptions: { maxRetries?: number; minContextSlot?: number; preflightCommitment?: Commitment; skipPreflight?: boolean }

    Options for sending transactions

    Type declaration

    • Optional maxRetries?: number

      Maximum number of times for the RPC node to retry sending the transaction to the leader.

    • Optional minContextSlot?: number

      The minimum slot that the request can be evaluated at

    • Optional preflightCommitment?: Commitment

      preflight commitment level

    • Optional skipPreflight?: boolean

      disable transaction verification step

    SerializeConfig: { requireAllSignatures?: boolean; verifySignatures?: boolean }

    Configuration object for Transaction.serialize()

    Type declaration

    • Optional requireAllSignatures?: boolean

      Require all transaction signatures be present (default: true)

    • Optional verifySignatures?: boolean

      Verify provided signatures (default: true)

    SignaturePubkeyPair: { publicKey: PublicKey; signature: Buffer | null }

    Pair of signature and corresponding public key

    Type declaration

    SignatureReceivedNotification: { type: "received" }

    Signature received notification

    Type declaration

    • type: "received"
    SignatureResult: { err: TransactionError | null }

    Signature result

    Type declaration

    SignatureResultCallback: (signatureResult: SignatureResult, context: Context) => void

    Type declaration

    SignatureStatus: { confirmationStatus?: TransactionConfirmationStatus; confirmations: number | null; err: TransactionError | null; slot: number }

    Signature status

    Type declaration

    • Optional confirmationStatus?: TransactionConfirmationStatus

      cluster confirmation status, if data available. Possible responses: processed, confirmed, finalized

    • confirmations: number | null

      the number of blocks that have been confirmed and voted on in the fork containing slot

    • err: TransactionError | null

      transaction error, if any

    • slot: number

      when the transaction was processed

    SignatureStatusConfig: { searchTransactionHistory: boolean }

    Configuration object for changing query behavior

    Type declaration

    • searchTransactionHistory: boolean

      enable searching status history, not needed for recent transactions

    SignatureStatusNotification: { result: SignatureResult; type: "status" }

    Signature status notification with transaction result

    Type declaration

    SignatureSubscriptionCallback: (notification: SignatureStatusNotification | SignatureReceivedNotification, context: Context) => void

    Type declaration

    SignatureSubscriptionOptions: { commitment?: Commitment; enableReceivedNotification?: boolean }

    Signature subscription options

    Type declaration

    • Optional commitment?: Commitment
    • Optional enableReceivedNotification?: boolean
    SignaturesForAddressOptions: { before?: TransactionSignature; limit?: number; minContextSlot?: number; until?: TransactionSignature }

    Options for getSignaturesForAddress

    Type declaration

    • Optional before?: TransactionSignature

      Start searching backwards from this transaction signature.

      remark

      If not provided the search starts from the highest max confirmed block.

    • Optional limit?: number

      Maximum transaction signatures to return (between 1 and 1,000, default: 1,000).

    • Optional minContextSlot?: number

      The minimum slot that the request can be evaluated at

    • Optional until?: TransactionSignature

      Search until this transaction signature is reached, if found before limit.

    SimulateTransactionConfig: { accounts?: { addresses: string[]; encoding: "base64" }; commitment?: Commitment; minContextSlot?: number; replaceRecentBlockhash?: boolean; sigVerify?: boolean }

    Type declaration

    • Optional accounts?: { addresses: string[]; encoding: "base64" }

      Optional parameter used to specify a list of account addresses to return post simulation state for

      • addresses: string[]
      • encoding: "base64"
    • Optional commitment?: Commitment

      Optional parameter used to set the commitment level when selecting the latest block

    • Optional minContextSlot?: number

      Optional parameter used to specify the minimum block slot that can be used for simulation

    • Optional replaceRecentBlockhash?: boolean

      Optional parameter used to replace the simulated transaction's recent blockhash with the latest blockhash

    • Optional sigVerify?: boolean

      Optional parameter used to enable signature verification before simulation

    SimulatedTransactionAccountInfo: { data: string[]; executable: boolean; lamports: number; owner: string; rentEpoch?: number }

    Type declaration

    • data: string[]

      Optional data assigned to the account

    • executable: boolean

      true if this account's data contains a loaded program

    • lamports: number

      Number of lamports assigned to the account

    • owner: string

      Identifier of the program that owns the account

    • Optional rentEpoch?: number

      Optional rent epoch info for account

    SimulatedTransactionResponse: { accounts?: (SimulatedTransactionAccountInfo | null)[] | null; err: TransactionError | string | null; logs: string[] | null; returnData?: TransactionReturnData | null; unitsConsumed?: number }

    Type declaration

    SlotChangeCallback: (slotInfo: SlotInfo) => void

    Type declaration

      • Callback function for slot change notifications

        Parameters

        Returns void

    SlotInfo: { parent: number; root: number; slot: number }

    Information about the latest slot being processed by a node

    Type declaration

    • parent: number

      Parent of the current slot

    • root: number

      The root block of the current slot's fork

    • slot: number

      Currently processing slot

    SlotUpdate: { slot: number; timestamp: number; type: "firstShredReceived" } | { slot: number; timestamp: number; type: "completed" } | { parent: number; slot: number; timestamp: number; type: "createdBank" } | { slot: number; stats: { maxTransactionsPerEntry: number; numFailedTransactions: number; numSuccessfulTransactions: number; numTransactionEntries: number }; timestamp: number; type: "frozen" } | { err: string; slot: number; timestamp: number; type: "dead" } | { slot: number; timestamp: number; type: "optimisticConfirmation" } | { slot: number; timestamp: number; type: "root" }

    Slot updates which can be used for tracking the live progress of a cluster.

    • "firstShredReceived": connected node received the first shred of a block. Indicates that a new block that is being produced.
    • "completed": connected node has received all shreds of a block. Indicates a block was recently produced.
    • "optimisticConfirmation": block was optimistically confirmed by the cluster. It is not guaranteed that an optimistic confirmation notification will be sent for every finalized blocks.
    • "root": the connected node rooted this block.
    • "createdBank": the connected node has started validating this block.
    • "frozen": the connected node has validated this block.
    • "dead": the connected node failed to validate this block.
    SlotUpdateCallback: (slotUpdate: SlotUpdate) => void

    Type declaration

      • Callback function for slot update notifications

        Parameters

        Returns void

    SolanaJSONRPCErrorCodeEnum: typeof SolanaJSONRPCErrorCode[keyof typeof SolanaJSONRPCErrorCode]
    SplitStakeParams: { authorizedPubkey: PublicKey; lamports: number; splitStakePubkey: PublicKey; stakePubkey: PublicKey }

    Split stake instruction params

    Type declaration

    SplitStakeWithSeedParams: { authorizedPubkey: PublicKey; basePubkey: PublicKey; lamports: number; seed: string; splitStakePubkey: PublicKey; stakePubkey: PublicKey }

    Split with seed transaction params

    Type declaration

    StakeActivationData: { active: number; inactive: number; state: "active" | "inactive" | "activating" | "deactivating" }

    Stake Activation data

    Type declaration

    • active: number

      stake active during the epoch

    • inactive: number

      stake inactive during the epoch

    • state: "active" | "inactive" | "activating" | "deactivating"

      the stake account's activation state

    StakeAuthorizationType: { index: number }

    Stake authorization type

    Type declaration

    • index: number

      The Stake Authorization index (from solana-stake-program)

    StakeInstructionType: "Authorize" | "AuthorizeWithSeed" | "Deactivate" | "Delegate" | "Initialize" | "Merge" | "Split" | "Withdraw"

    An enumeration of valid StakeInstructionType's

    Supply: { circulating: number; nonCirculating: number; nonCirculatingAccounts: PublicKey[]; total: number }

    Supply

    Type declaration

    • circulating: number

      Circulating supply in lamports

    • nonCirculating: number

      Non-circulating supply in lamports

    • nonCirculatingAccounts: PublicKey[]

      List of non-circulating account addresses

    • total: number

      Total supply in lamports

    SystemInstructionType: "AdvanceNonceAccount" | "Allocate" | "AllocateWithSeed" | "Assign" | "AssignWithSeed" | "AuthorizeNonceAccount" | "Create" | "CreateWithSeed" | "InitializeNonceAccount" | "Transfer" | "TransferWithSeed" | "WithdrawNonceAccount" | "UpgradeNonceAccount"

    An enumeration of valid SystemInstructionType's

    TokenAccountBalancePair: { address: PublicKey; amount: string; decimals: number; uiAmount: number | null; uiAmountString?: string }

    Token address and balance.

    Type declaration

    • address: PublicKey

      Address of the token account

    • amount: string

      Raw amount of tokens as string ignoring decimals

    • decimals: number

      Number of decimals configured for token's mint

    • uiAmount: number | null

      Token amount as float, accounts for decimals

    • Optional uiAmountString?: string

      Token amount as string, accounts for decimals

    TokenAccountsFilter: { mint: PublicKey } | { programId: PublicKey }
    TokenAmount: { amount: string; decimals: number; uiAmount: number | null; uiAmountString?: string }

    Token amount object which returns a token amount in different formats for various client use cases.

    Type declaration

    • amount: string

      Raw amount of tokens as string ignoring decimals

    • decimals: number

      Number of decimals configured for token's mint

    • uiAmount: number | null

      Token amount as float, accounts for decimals

    • Optional uiAmountString?: string

      Token amount as string, accounts for decimals

    TokenBalance: { accountIndex: number; mint: string; owner?: string; uiTokenAmount: TokenAmount }

    Type declaration

    • accountIndex: number
    • mint: string
    • Optional owner?: string
    • uiTokenAmount: TokenAmount
    TransactionBlockhashCtor: { blockhash: Blockhash; feePayer?: PublicKey | null; lastValidBlockHeight: number; signatures?: SignaturePubkeyPair[] }

    List of Transaction object fields that may be initialized at construction

    Type declaration

    • blockhash: Blockhash

      A recent blockhash

    • Optional feePayer?: PublicKey | null

      The transaction fee payer

    • lastValidBlockHeight: number

      the last block chain can advance to before tx is declared expired

    • Optional signatures?: SignaturePubkeyPair[]

      One or more signatures

    TransactionConfirmationStatus: "processed" | "confirmed" | "finalized"

    Transaction confirmation status

      'processed': Transaction landed in a block which has reached 1 confirmation by the connected node
      'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster
      'finalized': Transaction landed in a block which has been finalized by the cluster
    
    TransactionCtorFields: TransactionCtorFields_DEPRECATED
    TransactionCtorFields_DEPRECATED: { feePayer?: PublicKey | null; nonceInfo?: NonceInformation | null; recentBlockhash?: Blockhash; signatures?: SignaturePubkeyPair[] }

    List of Transaction object fields that may be initialized at construction

    Type declaration

    • Optional feePayer?: PublicKey | null

      The transaction fee payer

    • Optional nonceInfo?: NonceInformation | null

      Optional nonce information used for offline nonce'd transactions

    • Optional recentBlockhash?: Blockhash

      A recent blockhash

    • Optional signatures?: SignaturePubkeyPair[]

      One or more signatures

    TransactionError: {} | string

    Transaction error

    TransactionInstructionCtorFields: { data?: Buffer; keys: AccountMeta[]; programId: PublicKey }

    List of TransactionInstruction object fields that may be initialized at construction

    Type declaration

    TransactionMessageArgs: { instructions: TransactionInstruction[]; payerKey: PublicKey; recentBlockhash: Blockhash }

    Type declaration

    TransactionResponse: { blockTime?: number | null; meta: ConfirmedTransactionMeta | null; slot: number; transaction: { message: Message; signatures: string[] } }

    A processed transaction from the RPC API

    Type declaration

    • Optional blockTime?: number | null

      The unix timestamp of when the transaction was processed

    • meta: ConfirmedTransactionMeta | null

      Metadata produced from the transaction

    • slot: number

      The slot during which the transaction was processed

    • transaction: { message: Message; signatures: string[] }

      The transaction

      • message: Message

        The transaction message

      • signatures: string[]

        The transaction signatures

    TransactionReturnData: { data: [string, TransactionReturnDataEncoding]; programId: string }

    Type declaration

    TransactionReturnDataEncoding: "base64"
    TransactionSignature: string

    Transaction signature as base-58 encoded string

    TransactionVersion: "legacy" | 0
    TransferParams: { fromPubkey: PublicKey; lamports: number | bigint; toPubkey: PublicKey }

    Transfer system transaction params

    Type declaration

    • fromPubkey: PublicKey

      Account that will transfer lamports

    • lamports: number | bigint

      Amount of lamports to transfer

    • toPubkey: PublicKey

      Account that will receive transferred lamports

    TransferWithSeedParams: { basePubkey: PublicKey; fromPubkey: PublicKey; lamports: number | bigint; programId: PublicKey; seed: string; toPubkey: PublicKey }

    Transfer with seed system transaction params

    Type declaration

    • basePubkey: PublicKey

      Base public key to use to derive the funding account address

    • fromPubkey: PublicKey

      Account that will transfer lamports

    • lamports: number | bigint

      Amount of lamports to transfer

    • programId: PublicKey

      Program id to use to derive the funding account address

    • seed: string

      Seed to use to derive the funding account address

    • toPubkey: PublicKey

      Account that will receive transferred lamports

    Version: { feature-set?: number; solana-core: string }

    Version info for a node

    Type declaration

    • Optional feature-set?: number
    • solana-core: string

      Version of solana-core

    VersionedBlockResponse: { blockTime: number | null; blockhash: Blockhash; parentSlot: number; previousBlockhash: Blockhash; rewards?: { lamports: number; postBalance: number | null; pubkey: string; rewardType: string | null }[]; transactions: { meta: ConfirmedTransactionMeta | null; transaction: { message: VersionedMessage; signatures: string[] }; version?: TransactionVersion }[] }

    A processed block fetched from the RPC API

    Type declaration

    • blockTime: number | null

      The unix timestamp of when the block was processed

    • blockhash: Blockhash

      Blockhash of this block

    • parentSlot: number

      Slot index of this block's parent

    • previousBlockhash: Blockhash

      Blockhash of this block's parent

    • Optional rewards?: { lamports: number; postBalance: number | null; pubkey: string; rewardType: string | null }[]

      Vector of block rewards

    • transactions: { meta: ConfirmedTransactionMeta | null; transaction: { message: VersionedMessage; signatures: string[] }; version?: TransactionVersion }[]

      Vector of transactions with status meta and original message

    VersionedMessage: Message | MessageV0
    VersionedTransactionResponse: { blockTime?: number | null; meta: ConfirmedTransactionMeta | null; slot: number; transaction: { message: VersionedMessage; signatures: string[] }; version?: TransactionVersion }

    A processed transaction from the RPC API

    Type declaration

    • Optional blockTime?: number | null

      The unix timestamp of when the transaction was processed

    • meta: ConfirmedTransactionMeta | null

      Metadata produced from the transaction

    • slot: number

      The slot during which the transaction was processed

    • transaction: { message: VersionedMessage; signatures: string[] }

      The transaction

      • message: VersionedMessage

        The transaction message

      • signatures: string[]

        The transaction signatures

    • Optional version?: TransactionVersion

      The transaction version

    VoteAccountInfo: { activatedStake: number; commission: number; epochCredits: [number, number, number][]; epochVoteAccount: boolean; lastVote: number; nodePubkey: string; votePubkey: string }

    Information describing a vote account

    Type declaration

    • activatedStake: number

      The stake, in lamports, delegated to this vote account and activated

    • commission: number

      A percentage (0-100) of rewards payout owed to the voter

    • epochCredits: [number, number, number][]

      Recent epoch voting credit history for this voter

    • epochVoteAccount: boolean

      Whether the vote account is staked for this epoch

    • lastVote: number

      Most recent slot voted on by this vote account

    • nodePubkey: string

      Identity public key of the node voting with this account

    • votePubkey: string

      Public key of the vote account

    VoteAccountStatus: { current: VoteAccountInfo[]; delinquent: VoteAccountInfo[] }

    A collection of cluster vote accounts

    Type declaration

    VoteAuthorizationType: { index: number }

    VoteAuthorize type

    Type declaration

    • index: number

      The VoteAuthorize index (from solana-vote-program)

    VoteInstructionType: "Authorize" | "AuthorizeWithSeed" | "InitializeAccount" | "Withdraw"

    An enumeration of valid VoteInstructionType's

    WithdrawFromVoteAccountParams: { authorizedWithdrawerPubkey: PublicKey; lamports: number; toPubkey: PublicKey; votePubkey: PublicKey }

    Withdraw from vote account transaction params

    Type declaration

    WithdrawNonceParams: { authorizedPubkey: PublicKey; lamports: number; noncePubkey: PublicKey; toPubkey: PublicKey }

    Withdraw nonce account system transaction params

    Type declaration

    • authorizedPubkey: PublicKey

      Public key of the nonce authority

    • lamports: number

      Amount of lamports to withdraw from the nonce account

    • noncePubkey: PublicKey

      Nonce account

    • toPubkey: PublicKey

      Public key of the account which will receive the withdrawn nonce account balance

    WithdrawStakeParams: { authorizedPubkey: PublicKey; custodianPubkey?: PublicKey; lamports: number; stakePubkey: PublicKey; toPubkey: PublicKey }

    Withdraw stake instruction params

    Type declaration

    Variables

    BPF_LOADER_DEPRECATED_PROGRAM_ID: PublicKey = ...
    BPF_LOADER_PROGRAM_ID: PublicKey = ...
    LAMPORTS_PER_SOL: 1000000000 = 1000000000

    There are 1-billion lamports in one SOL

    MAX_SEED_LENGTH: 32 = 32

    Maximum length of derived pubkey seed

    NONCE_ACCOUNT_LENGTH: number = NonceAccountLayout.span
    PACKET_DATA_SIZE: number = ...

    Maximum over-the-wire size of a Transaction

    1280 is IPv6 minimum MTU 40 bytes is the size of the IPv6 header 8 bytes is the size of the fragment header

    PUBLIC_KEY_LENGTH: 32 = 32

    Size of public key in bytes

    SIGNATURE_LENGTH_IN_BYTES: 64 = 64
    SOLANA_SCHEMA: Map<Function, any> = ...
    STAKE_CONFIG_ID: PublicKey = ...

    Address of the stake config account which configures the rate of stake warmup and cooldown as well as the slashing penalty.

    SYSVAR_CLOCK_PUBKEY: PublicKey = ...
    SYSVAR_EPOCH_SCHEDULE_PUBKEY: PublicKey = ...
    SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey = ...
    SYSVAR_RECENT_BLOCKHASHES_PUBKEY: PublicKey = ...
    SYSVAR_RENT_PUBKEY: PublicKey = ...
    SYSVAR_REWARDS_PUBKEY: PublicKey = ...
    SYSVAR_SLOT_HASHES_PUBKEY: PublicKey = ...
    SYSVAR_SLOT_HISTORY_PUBKEY: PublicKey = ...
    SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey = ...
    SolanaJSONRPCErrorCode: { JSON_RPC_SCAN_ERROR: -32012; JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001; JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004; JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014; JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010; JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009; JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016; JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005; JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008; JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002; JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007; JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011; JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006; JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013; JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003; JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015 } = ...

    Type declaration

    • JSON_RPC_SCAN_ERROR: -32012
    • JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001
    • JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004
    • JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014
    • JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010
    • JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009
    • JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016
    • JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005
    • JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008
    • JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002
    • JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007
    • JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011
    • JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006
    • JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013
    • JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003
    • JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015
    StakeAuthorizationLayout: Readonly<{ Staker: { index: number }; Withdrawer: { index: number } }> = ...

    An enumeration of valid StakeAuthorizationLayout's

    VALIDATOR_INFO_KEY: PublicKey = ...
    VERSION_PREFIX_MASK: 127 = 0x7f
    VOTE_PROGRAM_ID: PublicKey = ...
    VersionedMessage: { deserialize: (serializedMessage: Uint8Array) => VersionedMessage; deserializeMessageVersion: any }

    Type declaration

    • deserialize: (serializedMessage: Uint8Array) => VersionedMessage
    • deserializeMessageVersion:function
      • deserializeMessageVersion(serializedMessage: Uint8Array): number | "legacy"
    VoteAuthorizationLayout: Readonly<{ Voter: { index: number }; Withdrawer: { index: number } }> = ...

    An enumeration of valid VoteAuthorization layouts.

    Functions

    • clusterApiUrl(cluster?: Cluster, tls?: boolean): string
    • Retrieves the RPC API URL for the specified cluster

      Parameters

      • Optional cluster: Cluster
      • Optional tls: boolean

      Returns string

    Generated using TypeDoc