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

property

{PublicKey} address

property

{number} lamports

Type declaration

AccountChangeCallback

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

Callback function for account change notifications

Type declaration

AccountInfo

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

Information describing an account

property

{number} lamports Number of lamports assigned to the account

property

{PublicKey} owner Identifier of the program that owns the account

property

{T} data Optional data assigned to the account

property

{boolean} executable true if this account's data contains a loaded program

Type parameters

  • T

Type declaration

  • data: T
  • executable: boolean
  • lamports: number
  • owner: PublicKey

AccountMeta

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

Account metadata used to define instructions

property

{PublicKey} pubkey An account's public key

property

{boolean} isSigner True if an instruction requires a transaction signature matching pubkey

property

{boolean} isWritable True if the pubkey can be loaded as a read-write account.

Type declaration

  • isSigner: boolean
  • isWritable: boolean
  • pubkey: PublicKey

AdvanceNonceParams

AdvanceNonceParams: { authorizedPubkey: PublicKey; noncePubkey: PublicKey }

Advance nonce account system instruction params

property

{PublicKey} noncePubkey

property

{PublicKey} authorizedPubkey

Type declaration

AllocateParams

AllocateParams: { accountPubkey: PublicKey; space: number }

Allocate account system transaction params

property

{PublicKey} accountPubkey

property

{number} space

Type declaration

AllocateWithSeedParams

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

Allocate account with seed system transaction params

property

{PublicKey} accountPubkey

property

{PublicKey} basePubkey

property

{string} seed

property

{number} space

property

{PublicKey} programId

Type declaration

AssignParams

AssignParams: { accountPubkey: PublicKey; programId: PublicKey }

Assign system transaction params

property

{PublicKey} accountPubkey

property

{PublicKey} programId

Type declaration

AssignWithSeedParams

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

Assign account with seed system transaction params

property

{PublicKey} accountPubkey

property

{PublicKey} basePubkey

property

{string} seed

property

{PublicKey} programId

Type declaration

AuthorizeNonceParams

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

Authorize nonce account system transaction params

property

{PublicKey} noncePubkey

property

{PublicKey} authorizedPubkey

property

{PublicKey} newAuthorizedPubkey

Type declaration

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

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 Index into the transaction keys array indicating the program account that executes this instruction

property

{number[]} accounts Ordered indices into the transaction keys array indicating which accounts to pass to the program

property

{string} data The program input data encoded as base 58

Type declaration

  • accounts: number[]
  • data: string
  • programIdIndex: number

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

property

{Blockhash} blockhash Blockhash of this block

property

{Blockhash} previousBlockhash Blockhash of this block's parent

property

{number} parentSlot Slot index of this block's parent

property

{Array} transactions Vector of transactions and status metas

property

{Array} rewards Vector of block rewards

property

{number|null} blockTime The unix timestamp of when the block was processed

Type declaration

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

ConfirmedSignatureInfo

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

A confirmed signature with its status

property

{string} signature the transaction signature

property

{number} slot when the transaction was processed

property

{TransactionError | null} err error, if any

property

{string | null} memo memo associated with the transaction, if any

property

{number | null | undefined} blockTime The unix timestamp of when the transaction was processed

Type declaration

  • Optional blockTime?: number | null
  • err: TransactionError | null
  • memo: string | null
  • signature: string
  • slot: number

ConfirmedSignaturesForAddress2Options

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

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

ConfirmedTransaction

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

A confirmed transaction on the ledger

property

{number} slot The slot during which the transaction was processed

property

{Transaction} transaction The details of the transaction

property

{ConfirmedTransactionMeta|null} meta Metadata produced from the transaction

property

{number|null|undefined} blockTime The unix timestamp of when the transaction was processed

Type declaration

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

property

{number} fee The fee charged for processing the transaction

property

{Array} innerInstructions An array of cross program invoked instructions

property

{Array} preBalances The balances of the transaction accounts before processing

property

{Array} postBalances The balances of the transaction accounts after processing

property

{Array} logMessages An array of program log messages emitted during a transaction

property

{Array} preTokenBalances The token balances of the transaction accounts before processing

property

{Array} postTokenBalances The token balances of the transaction accounts after processing

property

{object|null} err The error result of transaction processing

Type declaration

ContactInfo

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

Information describing a cluster node

property

{string} pubkey Identity public key of the node

property

{string|null} gossip Gossip network address for the node

property

{string|null} tpu TPU network address for the node (null if not available)

property

{string|null} rpc JSON RPC network address for the node (null if not available)

property

{string|null} version Software version of the node (null if not available)

Type declaration

  • gossip: string | null
  • pubkey: string
  • rpc: string | null
  • tpu: string | null
  • version: string | null

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

property

{PublicKey} fromPubkey

property

{PublicKey} newAccountPubkey

property

{number} lamports

property

{number} space

property

{PublicKey} programId

Type declaration

CreateAccountWithSeedParams

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

Create account with seed system transaction params

property

{PublicKey} fromPubkey

property

{PublicKey} newAccountPubkey

property

{PublicKey} basePubkey

property

{string} seed

property

{number} lamports

property

{number} space

property

{PublicKey} programId

Type declaration

CreateNonceAccountParams

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

Create nonce account system transaction params

property

{PublicKey} fromPubkey

property

{PublicKey} noncePubkey

property

{PublicKey} authorizedPubkey

property

{number} lamports

Type declaration

CreateNonceAccountWithSeedParams

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

Create nonce account with seed system transaction params

property

{PublicKey} fromPubkey

property

{PublicKey} noncePubkey

property

{PublicKey} authorizedPubkey

property

{PublicKey} basePubkey

property

{string} seed

property

{number} lamports

Type declaration

CreateSecp256k1InstructionWithEthAddressParams

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

Params for creating an secp256k1 instruction using an Ethereum address

property

{Buffer | Uint8Array | Array} ethAddress

property

{Buffer | Uint8Array | Array} message

property

{Buffer | Uint8Array | Array} signature

property

{number} recoveryId

Type declaration

  • ethAddress: Buffer | Uint8Array | number[] | string
  • message: Buffer | Uint8Array | number[]
  • recoveryId: number
  • signature: Buffer | Uint8Array | number[]

CreateSecp256k1InstructionWithPrivateKeyParams

CreateSecp256k1InstructionWithPrivateKeyParams: { message: Buffer | Uint8Array | number[]; privateKey: Buffer | Uint8Array | number[] }

Params for creating an secp256k1 instruction using a private key

property

{Buffer | Uint8Array | Array} privateKey

property

{Buffer | Uint8Array | Array} message

Type declaration

  • message: Buffer | Uint8Array | number[]
  • privateKey: Buffer | Uint8Array | number[]

CreateSecp256k1InstructionWithPublicKeyParams

CreateSecp256k1InstructionWithPublicKeyParams: { message: Buffer | Uint8Array | number[]; publicKey: Buffer | Uint8Array | number[]; recoveryId: number; signature: Buffer | Uint8Array | number[] }

Params for creating an secp256k1 instruction using a public key

property

{Buffer | Uint8Array | Array} publicKey

property

{Buffer | Uint8Array | Array} message

property

{Buffer | Uint8Array | Array} signature

property

{number} recoveryId

Type declaration

  • 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

  • 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

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

property

{number} epoch

property

{number} slotIndex

property

{number} slotsInEpoch

property

{number} absoluteSlot

property

{number} blockHeight

property

{number} transactionCount

Type declaration

  • absoluteSlot: number
  • Optional blockHeight?: number
  • epoch: number
  • slotIndex: number
  • slotsInEpoch: number
  • Optional transactionCount?: number

EpochSchedule

EpochSchedule: { firstNormalEpoch: number; firstNormalSlot: number; leaderScheduleSlotOffset: number; slotsPerEpoch: number; warmup: boolean }
property

{number} slotsPerEpoch The maximum number of slots in each epoch

property

{number} leaderScheduleSlotOffset The number of slots before beginning of an epoch to calculate a leader schedule for that epoch

property

{boolean} warmup Indicates whether epochs start short and grow

property

{number} firstNormalEpoch The first epoch with slotsPerEpoch slots

property

{number} firstNormalSlot The first slot of firstNormalEpoch

Type declaration

  • firstNormalEpoch: number
  • firstNormalSlot: number
  • leaderScheduleSlotOffset: number
  • slotsPerEpoch: number
  • warmup: boolean

GetLargestAccountsConfig

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

Configuration object for changing getLargestAccounts query behavior

property

{Commitment|undefined} commitment The level of commitment desired

property

{LargestAccountsFilter|undefined} filter Filter largest accounts by whether they are part of the circulating supply

Type declaration

InflationGovernor

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

{number} foundation

property

{number} foundation_term

property

{number} initial

property

{number} taper

property

{number} terminal

Type declaration

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

Info

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

Info used to identity validators.

property

{string} name validator name

property

{?string} website optional, validator website

property

{?string} details optional, extra information the validator chose to share

property

{?string} keybaseUsername optional, used to identify validators on keybase.io

Type declaration

  • Optional details?: string
  • Optional keybaseUsername?: string
  • name: string
  • Optional website?: string

InitializeNonceParams

InitializeNonceParams: { authorizedPubkey: PublicKey; noncePubkey: PublicKey }

Initialize nonce account system instruction params

property

{PublicKey} noncePubkey

property

{PublicKey} authorizedPubkey

Type declaration

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

property

{PublicKey} accountId

property

{AccountInfo} accountInfo

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

MessageArgs

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

Message constructor arguments

property

{MessageHeader} header The message header, identifying signed and read-only accountKeys

property

{string[]} accounts All the account keys used by this transaction

property

{Blockhash} recentBlockhash The hash of a recent ledger block

property

{CompiledInstruction[]} instructions Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.

Type declaration

MessageHeader

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

The message header, identifying signed and read-only account

property

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

property

{number} numReadonlySignedAccounts: The last numReadonlySignedAccounts of the signed keys are read-only accounts

property

{number} numReadonlyUnsignedAccounts The last numReadonlySignedAccounts of the unsigned keys are read-only accounts

Type declaration

  • numReadonlySignedAccounts: number
  • numReadonlyUnsignedAccounts: number
  • numRequiredSignatures: number

ParsedAccountData

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

Parsed account data

property

{string} program Name of the program that owns this account

property

{any} parsed Parsed account data

property

{number} space Space used by account data

Type declaration

  • parsed: any
  • program: string
  • space: number

ParsedConfirmedTransaction

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

A parsed and confirmed transaction on the ledger

property

{number} slot The slot during which the transaction was processed

property

{ParsedTransaction} transaction The details of the transaction

property

{ConfirmedTransactionMeta|null} meta Metadata produced from the transaction

property

{number|null|undefined} blockTime The unix timestamp of when the transaction was processed

Type declaration

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

property

{number} fee The fee charged for processing the transaction

property

{Array} innerInstructions An array of cross program invoked parsed instructions

property

{Array} preBalances The balances of the transaction accounts before processing

property

{Array} postBalances The balances of the transaction accounts after processing

property

{Array} logMessages An array of program log messages emitted during a transaction

property

{Array} preTokenBalances The token balances of the transaction accounts before processing

property

{Array} postTokenBalances The token balances of the transaction accounts after processing

property

{object|null} err The error result of transaction processing

Type declaration

ParsedInnerInstruction

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

Type declaration

ParsedInstruction

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

A parsed transaction instruction

property

{string} program Name of the program for this instruction

property

{PublicKey} programId ID of the program for this instruction

property

{any} parsed Parsed instruction info

Type declaration

  • parsed: any
  • program: string
  • programId: PublicKey

ParsedMessage

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

A parsed transaction message

property

{Array} accountKeys Accounts used in the instructions

property

{Array<ParsedInstruction | PartiallyDecodedInstruction>} instructions The atomically executed instructions for the transaction

property

{string} recentBlockhash Recent blockhash

Type declaration

ParsedMessageAccount

ParsedMessageAccount: { pubkey: PublicKey; signer: boolean; writable: boolean }

A parsed transaction message account

property

{PublicKey} pubkey Public key of the account

property

{boolean} signer Indicates if the account signed the transaction

property

{boolean} writable Indicates if the account is writable for this transaction

Type declaration

  • pubkey: PublicKey
  • signer: boolean
  • writable: boolean

ParsedTransaction

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

A parsed transaction

property

{Array} signatures Signatures for the transaction

property

{ParsedMessage} message Message of the transaction

Type declaration

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

property

{number} slot Slot number of sample

property

{number} numTransactions Number of transactions in a sample window

property

{number} numSlots Number of slots in a sample window

property

{number} samplePeriodSecs Sample window in seconds

Type declaration

  • numSlots: number
  • numTransactions: number
  • samplePeriodSecs: number
  • slot: number

ProgramAccountChangeCallback

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

Callback function for program account change notifications

Type declaration

RootChangeCallback

RootChangeCallback: (root: number) => void

Callback function for root change notifications

Type declaration

    • (root: number): void
    • 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()

property

{boolean|undefined} requireAllSignatures Require all transaction signatures be present (default: true)

property

{boolean|undefined} verifySignatures Verify provided signatures (default: true)

Type declaration

  • Optional requireAllSignatures?: boolean
  • Optional verifySignatures?: boolean

SignatureResult

SignatureResult: { err: TransactionError | null }

Signature result

Type declaration

SignatureResultCallback

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

Callback function for signature notifications

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

property

{boolean} searchTransactionHistory enable searching status history, not needed for recent transactions

Type declaration

  • searchTransactionHistory: boolean

SimulatedTransactionResponse

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

Type declaration

SlotChangeCallback

SlotChangeCallback: (slotInfo: SlotInfo) => void

Callback function for slot change notifications

Type declaration

SlotInfo

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

Information about the latest slot being processed by a node

property

{number} slot Currently processing slot

property

{number} parent Parent of the current slot

property

{number} root The root block of the current slot's fork

Type declaration

  • parent: number
  • root: number
  • slot: number

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

property

{string} state: <string - the stake account's activation state, one of: active, inactive, activating, deactivating

property

{number} active: stake active during the epoch

property

{number} inactive: stake inactive during the epoch

Type declaration

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

StakeAuthorizationType

StakeAuthorizationType: { index: number }
property

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

Type declaration

  • index: number

StakeInstructionType

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

An enumeration of valid StakeInstructionType's

Supply

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

Supply

property

{number} total Total supply in lamports

property

{number} circulating Circulating supply in lamports

property

{number} nonCirculating Non-circulating supply in lamports

property

{Array} nonCirculatingAccounts List of non-circulating account addresses

Type declaration

  • circulating: number
  • nonCirculating: number
  • nonCirculatingAccounts: PublicKey[]
  • total: number

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.

property

{PublicKey} address Address of the token account

property

{string} amount Raw amount of tokens as string ignoring decimals

property

{number} decimals Number of decimals configured for token's mint

property

{number | null} uiAmount Token amount as float, accounts for decimals

property

{string | undefined} uiAmountString Token amount as string, accounts for decimals

Type declaration

  • address: PublicKey
  • amount: string
  • decimals: number
  • uiAmount: number | null
  • Optional uiAmountString?: string

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.

property

{string} amount Raw amount of tokens as string ignoring decimals

property

{number} decimals Number of decimals configured for token's mint

property

{number | null} uiAmount Token amount as float, accounts for decimals

property

{string | undefined} uiAmountString Token amount as string, accounts for decimals

Type declaration

  • amount: string
  • decimals: number
  • uiAmount: number | null
  • Optional uiAmountString?: string

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

TransactionError

TransactionError: {}

Transaction error

Type declaration

TransactionInstructionCtorFields

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

List of TransactionInstruction object fields that may be initialized at construction

property

{Array} keys

property

{PublicKey} programId

property

{?Buffer} data

Type declaration

TransactionSignature

TransactionSignature: string

TransferParams

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

Transfer system transaction params

property

{PublicKey} fromPubkey

property

{PublicKey} toPubkey

property

{number} lamports

Type declaration

TransferWithSeedParams

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

Transfer with seed system transaction params

property

{PublicKey} fromPubkey

property

{PublicKey} basePubkey

property

{PublicKey} toPubkey

property

{number} lamports

property

{string} seed

property

{PublicKey} programId

Type declaration

Version

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

Type declaration

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

VoteAccountInfo

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

Information describing a vote account

property

{string} votePubkey Public key of the vote account

property

{string} nodePubkey Identity public key of the node voting with this account

property

{number} activatedStake The stake, in lamports, delegated to this vote account and activated

property

{boolean} epochVoteAccount Whether the vote account is staked for this epoch

property

{Array<Array>} epochCredits Recent epoch voting credit history for this voter

property

{number} commission A percentage (0-100) of rewards payout owed to the voter

property

{number} lastVote Most recent slot voted on by this vote account

Type declaration

  • activatedStake: number
  • commission: number
  • epochCredits: [number, number, number][]
  • epochVoteAccount: boolean
  • lastVote: number
  • nodePubkey: string
  • votePubkey: string

VoteAccountStatus

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

A collection of cluster vote accounts

property

{Array} current Active vote accounts

property

{Array} delinquent Inactive vote accounts

Type declaration

WithdrawNonceParams

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

Withdraw nonce account system transaction params

property

{PublicKey} noncePubkey

property

{PublicKey} authorizedPubkey

property

{PublicKey} toPubkey

property

{number} lamports

Type declaration

WithdrawStakeParams

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

Withdraw stake instruction params

Type declaration

Variables

Const BPF_LOADER_DEPRECATED_PROGRAM_ID

BPF_LOADER_DEPRECATED_PROGRAM_ID: PublicKey = ...

Const BPF_LOADER_PROGRAM_ID

BPF_LOADER_PROGRAM_ID: PublicKey = ...

Const GetConfirmedBlockRpcResult

GetConfirmedBlockRpcResult: Struct<{ id: string; jsonrpc: "2.0"; result: null | { blockhash: string; previousBlockhash: string; parentSlot: number; transactions: { transaction: Transaction; meta: { err: {} | null; fee: number; preBalances: number[]; postBalances: number[]; innerInstructions?: { ...; }[] | ... 1 more ... | undefined; logMessages?: string[] | ... 1 more ... | undefined; preTokenB... } | { error: { message: string; code: unknown; data?: any; }; id: string; jsonrpc: "2.0" }, null> = ...

Expected JSON RPC response for the "getConfirmedBlock" message

Const LAMPORTS_PER_SOL

LAMPORTS_PER_SOL: 1000000000 = 1000000000

There are 1-billion lamports in one SOL

Const MAX_SEED_LENGTH

MAX_SEED_LENGTH: 32 = 32

Maximum length of derived pubkey seed

Const NONCE_ACCOUNT_LENGTH

NONCE_ACCOUNT_LENGTH: any = ...

Const 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

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

Const STAKE_INSTRUCTION_LAYOUTS

STAKE_INSTRUCTION_LAYOUTS: {[ type in StakeInstructionType]: InstructionType } = ...

An enumeration of valid stake InstructionType's

Const SYSTEM_INSTRUCTION_LAYOUTS

SYSTEM_INSTRUCTION_LAYOUTS: {[ type in SystemInstructionType]: InstructionType } = ...

An enumeration of valid system InstructionType's

Const SYSVAR_CLOCK_PUBKEY

SYSVAR_CLOCK_PUBKEY: PublicKey = ...

Const SYSVAR_INSTRUCTIONS_PUBKEY

SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey = ...

Const SYSVAR_RECENT_BLOCKHASHES_PUBKEY

SYSVAR_RECENT_BLOCKHASHES_PUBKEY: PublicKey = ...

Const SYSVAR_RENT_PUBKEY

SYSVAR_RENT_PUBKEY: PublicKey = ...

Const SYSVAR_REWARDS_PUBKEY

SYSVAR_REWARDS_PUBKEY: PublicKey = ...

Const SYSVAR_STAKE_HISTORY_PUBKEY

SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey = ...

Const StakeAuthorizationLayout

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

An enumeration of valid StakeAuthorizationLayout's

Const VALIDATOR_INFO_KEY

VALIDATOR_INFO_KEY: PublicKey = ...

Const 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

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Static method

Generated using TypeDoc