Options
All
  • Public
  • Public/Protected
  • All
Menu

@solana/web3.js

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AccountBalancePair

AccountBalancePair: { address: PublicKey; lamports: number }

Pair of an account address and its balance

Type declaration

AccountChangeCallback

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

Type declaration

    • Callback function for account change notifications

      Parameters

      Returns void

AccountInfo

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 infor for account

AccountMeta

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

AdvanceNonceParams

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

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

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

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

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

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

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

Authorize stake instruction params

Type declaration

AuthorizeWithSeedStakeParams

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

BlockResponse

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

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

    Vector of transactions with status meta and original message

Blockhash

Blockhash: string

Blockhash as Base58 string.

Cluster

Cluster: "devnet" | "testnet" | "mainnet-beta"

Commitment

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

CompiledInnerInstruction

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

Type declaration

CompiledInstruction

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

ConfirmOptions

ConfirmOptions: { commitment?: Commitment; preflightCommitment?: Commitment; skipPreflight?: boolean }

Options for confirming transactions

Type declaration

  • Optional commitment?: Commitment

    desired commitment level

  • Optional preflightCommitment?: Commitment

    preflight commitment level

  • Optional skipPreflight?: boolean

    disable transaction verification step

ConfirmedBlock

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 ConfirmedBlock on the ledger

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

ConfirmedBlockSignatures

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

A ConfirmedBlock 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

ConfirmedSignatureInfo

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

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

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

A confirmed transaction on the ledger

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

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

Metadata for a confirmed transaction on the ledger

Type declaration

  • 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 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

ConnectionConfig: { commitment?: Commitment; confirmTransactionInitialTimeout?: number; disableRetryOnRateLimit?: boolean; 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 retring calls when server responds with HTTP 429 (Too Many Requests)

  • 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

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

Context: { slot: number }

Extra contextual information for RPC responses

Type declaration

  • slot: number

CreateAccountParams

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

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

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

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

CreateNonceAccountParams

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

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

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

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

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

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

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

Create stake account with seed transaction params

Type declaration

DataSizeFilter

DataSizeFilter: { dataSize: number }

Data size comparison filter for getProgramAccounts

Type declaration

  • dataSize: number

    Size of data for program account data length comparison

DataSlice

DataSlice: { length: number; offset: number }

Data slice argument for getProgramAccounts

Type declaration

  • length: number

    length of data slice

  • offset: number

    offset of data slice

DeactivateStakeParams

DeactivateStakeParams: { authorizedPubkey: PublicKey; stakePubkey: PublicKey }

Deactivate stake instruction params

Type declaration

DelegateStakeParams

DelegateStakeParams: { authorizedPubkey: PublicKey; stakePubkey: PublicKey; votePubkey: PublicKey }

Delegate stake instruction params

Type declaration

EpochCredits

EpochCredits: { credits: number; epoch: number; prevCredits: number }

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

Type declaration

  • credits: number
  • epoch: number
  • prevCredits: number

EpochInfo

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

FetchMiddleware

FetchMiddleware: (url: string, options: any, fetch: Function) => void

Type declaration

    • (url: string, options: any, fetch: Function): void
    • A callback used to augment the outgoing HTTP request

      Parameters

      • url: string
      • options: any
      • fetch: Function

      Returns void

Finality

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

GetLargestAccountsConfig

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

GetParsedProgramAccountsConfig

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

Configuration object for getParsedProgramAccounts

Type declaration

GetProgramAccountsConfig

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

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

GetProgramAccountsFilter

GetProgramAccountsFilter: MemcmpFilter | DataSizeFilter

A filter object for getProgramAccounts

GetSupplyConfig

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

HttpHeaders

HttpHeaders: {}

An object defining headers to be passed to the RPC server

Type declaration

  • [header: string]: string

InflationGovernor

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

Type declaration

  • foundation: number
  • foundationTerm: number
  • initial: number
  • taper: number
  • terminal: number

InflationReward

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

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

InitializeNonceParams

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

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

Initialize stake instruction params

Type declaration

KeyedAccountInfo

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

Account information identified by pubkey

Type declaration

LargestAccountsFilter

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

LeaderSchedule: {}

Type declaration

  • [address: string]: number[]

Lockout

Lockout: { confirmationCount: number; slot: number }

Type declaration

  • confirmationCount: number
  • slot: number

Logs

Logs: { err: TransactionError | null; logs: string[]; signature: string }

Logs result.

Type declaration

LogsCallback

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

Type declaration

    • Callback function for log notifications.

      Parameters

      Returns void

LogsFilter

LogsFilter: PublicKey | "all" | "allWithVotes"

Filter for log subscriptions.

MemcmpFilter

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

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

Merge stake instruction params

Type declaration

MessageArgs

MessageArgs: { accountKeys: string[]; header: MessageHeader; instructions: CompiledInstruction[]; recentBlockhash: Blockhash }

Message constructor arguments

Type declaration

  • accountKeys: string[]

    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

MessageHeader

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.

NonceInformation

NonceInformation: { nonce: Blockhash; nonceInstruction: TransactionInstruction }

Nonce information to be used to build an offline Transaction.

Type declaration

ParsedAccountData

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

ParsedConfirmedTransaction

ParsedConfirmedTransaction: { blockTime?: number | null; meta: ParsedConfirmedTransactionMeta | null; slot: number; transaction: ParsedTransaction }

A parsed and confirmed transaction on the ledger

Type declaration

  • Optional blockTime?: number | null

    The unix timestamp of when the transaction was processed

  • meta: ParsedConfirmedTransactionMeta | null

    Metadata produced from the transaction

  • slot: number

    The slot during which the transaction was processed

  • transaction: ParsedTransaction

    The details of the transaction

ParsedConfirmedTransactionMeta

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

Metadata for a parsed confirmed transaction on the ledger

Type declaration

  • 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 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

ParsedInnerInstruction

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

Type declaration

ParsedInstruction

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

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

A parsed transaction message

Type declaration

ParsedMessageAccount

ParsedMessageAccount: { pubkey: PublicKey; signer: boolean; 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

  • writable: boolean

    Indicates if the account is writable for this transaction

ParsedTransaction

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

A parsed transaction

Type declaration

  • message: ParsedMessage

    Message of the transaction

  • signatures: string[]

    Signatures for the transaction

PartiallyDecodedInstruction

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

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

ProgramAccountChangeCallback

ProgramAccountChangeCallback: (keyedAccountInfo: KeyedAccountInfo, context: Context) => void

Type declaration

PublicKeyData

PublicKeyData: { }

JSON object representation of PublicKey class

Type declaration

    PublicKeyInitData

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

    Value to be converted into public key

    RootChangeCallback

    RootChangeCallback: (root: number) => void

    Type declaration

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

        Parameters

        • root: number

        Returns void

    RpcResponseAndContext

    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

    SendOptions: { preflightCommitment?: Commitment; skipPreflight?: boolean }

    Options for sending transactions

    Type declaration

    • Optional preflightCommitment?: Commitment

      preflight commitment level

    • Optional skipPreflight?: boolean

      disable transaction verification step

    SerializeConfig

    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

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

    Pair of signature and corresponding public key

    Type declaration

    SignatureReceivedNotification

    SignatureReceivedNotification: { type: "received" }

    Signature received notification

    Type declaration

    • type: "received"

    SignatureResult

    SignatureResult: { err: TransactionError | null }

    Signature result

    Type declaration

    SignatureResultCallback

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

    Type declaration

    SignatureStatus

    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

    SignatureStatusConfig: { searchTransactionHistory: boolean }

    Configuration object for changing query behavior

    Type declaration

    • searchTransactionHistory: boolean

      enable searching status history, not needed for recent transactions

    SignatureStatusNotification

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

    Signature status notification with transaction result

    Type declaration

    SignatureSubscriptionCallback

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

    Type declaration

    SignatureSubscriptionOptions

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

    Signature subscription options

    Type declaration

    • Optional commitment?: Commitment
    • Optional enableReceivedNotification?: boolean

    SignaturesForAddressOptions

    SignaturesForAddressOptions: { before?: TransactionSignature; limit?: 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 until?: TransactionSignature

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

    SimulatedTransactionAccountInfo

    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

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

    Type declaration

    SlotChangeCallback

    SlotChangeCallback: (slotInfo: SlotInfo) => void

    Type declaration

      • Callback function for slot change notifications

        Parameters

        Returns void

    SlotInfo

    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

    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

    SlotUpdateCallback: (slotUpdate: SlotUpdate) => void

    Type declaration

      • Callback function for slot update notifications

        Parameters

        Returns void

    SplitStakeParams

    SplitStakeParams: { authorizedPubkey: PublicKey; lamports: number; splitStakePubkey: PublicKey; stakePubkey: PublicKey }

    Split stake instruction params

    Type declaration

    StakeActivationData

    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

    StakeAuthorizationType: { index: number }

    Stake authorization type

    Type declaration

    • index: number

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

    StakeInstructionType

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

    An enumeration of valid StakeInstructionType's

    Supply

    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

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

    An enumeration of valid SystemInstructionType's

    TokenAccountBalancePair

    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

    TokenAccountsFilter: { mint: PublicKey } | { programId: PublicKey }

    TokenAmount

    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

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

    Type declaration

    • accountIndex: number
    • mint: string
    • uiTokenAmount: TokenAmount

    TransactionConfirmationStatus

    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: { feePayer?: PublicKey | null; nonceInfo?: NonceInformation | null; recentBlockhash?: Blockhash | null; 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 | null

      A recent blockhash

    • Optional signatures?: SignaturePubkeyPair[]

      One or more signatures

    TransactionError

    TransactionError: {} | string

    Transaction error

    TransactionInstructionCtorFields

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

    List of TransactionInstruction object fields that may be initialized at construction

    Type declaration

    TransactionResponse

    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

    TransactionSignature

    TransactionSignature: string

    Transaction signature as base-58 encoded string

    TransferParams

    TransferParams: { fromPubkey: PublicKey; lamports: number; toPubkey: PublicKey }

    Transfer system transaction params

    Type declaration

    • fromPubkey: PublicKey

      Account that will transfer lamports

    • lamports: number

      Amount of lamports to transfer

    • toPubkey: PublicKey

      Account that will receive transferred lamports

    TransferWithSeedParams

    TransferWithSeedParams: { basePubkey: PublicKey; fromPubkey: PublicKey; lamports: number; 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

      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

    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

    VoteAccountInfo

    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

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

    A collection of cluster vote accounts

    Type declaration

    WithdrawNonceParams

    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

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

    Withdraw stake instruction params

    Type declaration

    Variables

    BPF_LOADER_DEPRECATED_PROGRAM_ID

    BPF_LOADER_DEPRECATED_PROGRAM_ID: PublicKey = ...

    BPF_LOADER_PROGRAM_ID

    BPF_LOADER_PROGRAM_ID: PublicKey = ...

    LAMPORTS_PER_SOL

    LAMPORTS_PER_SOL: 1000000000 = 1000000000

    There are 1-billion lamports in one SOL

    MAX_SEED_LENGTH

    MAX_SEED_LENGTH: 32 = 32

    Maximum length of derived pubkey seed

    NONCE_ACCOUNT_LENGTH

    NONCE_ACCOUNT_LENGTH: number = NonceAccountLayout.span

    PACKET_DATA_SIZE

    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

    SOLANA_SCHEMA

    SOLANA_SCHEMA: Map<Function, any> = ...

    STAKE_CONFIG_ID

    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

    SYSVAR_CLOCK_PUBKEY: PublicKey = ...

    SYSVAR_INSTRUCTIONS_PUBKEY

    SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey = ...

    SYSVAR_RECENT_BLOCKHASHES_PUBKEY

    SYSVAR_RECENT_BLOCKHASHES_PUBKEY: PublicKey = ...

    SYSVAR_RENT_PUBKEY

    SYSVAR_RENT_PUBKEY: PublicKey = ...

    SYSVAR_REWARDS_PUBKEY

    SYSVAR_REWARDS_PUBKEY: PublicKey = ...

    SYSVAR_STAKE_HISTORY_PUBKEY

    SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey = ...

    StakeAuthorizationLayout

    StakeAuthorizationLayout: Readonly<{ Staker: { index: number }; Withdrawer: { index: number } }> = ...

    An enumeration of valid StakeAuthorizationLayout's

    VALIDATOR_INFO_KEY

    VALIDATOR_INFO_KEY: PublicKey = ...

    VOTE_PROGRAM_ID

    VOTE_PROGRAM_ID: PublicKey = ...

    Functions

    clusterApiUrl

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

      Parameters

      • Optional cluster: Cluster
      • Optional tls: boolean

      Returns string

    sendAndConfirmRawTransaction

    sendAndConfirmTransaction

    Generated using TypeDoc