Establish a JSON RPC connection
URL to the fullnode JSON RPC endpoint
OptionalcommitmentOrConfig: Commitment | ConnectionConfig
optional default commitment level or optional ConnectionConfig configuration object
The default commitment used for requests
The RPC endpoint
The HTTP headers used by this connection for JSON-RPC requests.
Wait until an active subscription has either been established or failed.
This rejects if the supplied subscription id is not active when observation begins, or if the subscription becomes inactive before setup reaches a terminal state.
Optionalconfig: Readonly<{ abortSignal?: AbortSignal }>Optionalcommitment: CommitmentOptionalcommitment: CommitmentInstead, call confirmTransaction and pass in TransactionConfirmationStrategy
Fetch all the account info for the specified public key
OptionalcommitmentOrConfig: Commitment | GetAccountInfoConfigFetch all the account info for the specified public key, return with context
OptionalcommitmentOrConfig: Commitment | GetAccountInfoConfigOptionalconfig: GetAccountInfoConfigFetch the Alpenglow genesis certificate, or null if the node does not
have one.
Fetch the balance for the specified public key
OptionalcommitmentOrConfig: Commitment | GetBalanceConfigFetch the balance for the specified public key, return with context
OptionalcommitmentOrConfig: Commitment | GetBalanceConfigFetch a processed block from the cluster.
OptionalrawConfig: GetBlockConfigFetch a processed block from the cluster.
OptionalrawConfig: GetVersionedBlockConfigOptionalconfigOrCommitment: Commitment | GetBlockProductionConfigFetch confirmed blocks between two slots
OptionalendSlot: number | bigintOptionalcommitment: FinalityFetch confirmed blocks between two slots
OptionalendSlot: number | bigintOptionalconfig: GetBlocksConfigFetch confirmed blocks between two slots
Optionalconfig: GetBlocksConfigFetch a list of Signatures from the cluster for a block, excluding rewards
Optionalcommitment: FinalityFetch confirmed blocks starting at the provided slot, limited to the requested length.
Optionalcommitment: FinalityFetch confirmed blocks starting at the provided slot, limited to the requested length.
Optionalconfig: GetBlocksConfigFetch the estimated production time of a block
Return the list of nodes that are currently participating in the cluster
Fetch a list of Transactions and transaction statuses from the cluster for a confirmed block.
Optionalcommitment: FinalityDeprecated since RPC v1.7.0. Please use getBlock instead.
Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
Optionalcommitment: FinalityDeprecated since RPC v1.7.0. Please use getBlockSignatures instead.
Fetch a transaction details for a confirmed transaction
Optionalcommitment: FinalityDeprecated since RPC v1.7.0. Please use getTransaction instead.
Fetch the Epoch Info parameters
OptionalcommitmentOrConfig: Commitment | GetEpochInfoConfigFetch the Epoch Schedule parameters
Fetch the fee for a message from the cluster, return with context
OptionalcommitmentOrConfig: Commitment | GetFeeForMessageConfigFetch the slot of the lowest confirmed block that has not been purged from the ledger
Fetch the genesis hash
Fetch the RPC node health status.
Fetch the highest full and incremental snapshot slots available on the RPC node.
Fetch the RPC node identity.
Fetch the cluster InflationGovernor parameters
OptionalcommitmentOrConfig: Commitment | GetInflationGovernorConfigFetch the inflation reward for a list of addresses for an epoch
Optionalepoch: number | bigintOptionalcommitmentOrConfig: Commitment | GetInflationRewardConfigFetch the 20 largest accounts with their current balances
Optionalconfig: GetLargestAccountsConfigFetch the latest blockhash from the cluster
OptionalcommitmentOrConfig: Commitment | GetLatestBlockhashConfigFetch the latest blockhash from the cluster
OptionalcommitmentOrConfig: Commitment | GetLatestBlockhashConfigFetch the leader schedule for the current epoch
OptionalslotOrCommitmentOrConfig: number | bigint | Commitment | GetLeaderScheduleConfig | nullOptionalcommitmentOrConfig: Commitment | GetLeaderScheduleConfigFetch the highest slot seen by retransmit stage.
Fetch the highest slot seen by blockstore.
Fetch the minimum balance needed to exempt an account of dataLength
size from rent
OptionalcommitmentOrConfig: Commitment | GetMinimumBalanceForRentExemptionConfigFetch the lowest slot that the node has information about in its ledger. This value may increase over time if the node is configured to purge older ledger data
Fetch all the account info for multiple accounts specified by an array of public keys
OptionalcommitmentOrConfig: Commitment | GetMultipleAccountsConfigFetch all the account info for multiple accounts specified by an array of public keys, return with context
OptionalcommitmentOrConfig: Commitment | GetMultipleAccountsConfigFetch all the account info for multiple accounts specified by an array of public keys, return with context
OptionalrawConfig: GetMultipleAccountsConfigFetch the contents of a Nonce account from the cluster
Durable nonces are planned for deprecation on Solana. They remain valid on mainnet today and no removal date is set. See https://solana.com/upgrades/durable-nonce-deprecation for the timeline and migration guidance.
OptionalcommitmentOrConfig: Commitment | GetNonceConfigFetch the contents of a Nonce account from the cluster, return with context
Durable nonces are planned for deprecation on Solana. They remain valid on mainnet today and no removal date is set. See https://solana.com/upgrades/durable-nonce-deprecation for the timeline and migration guidance.
OptionalcommitmentOrConfig: Commitment | GetNonceAndContextConfigFetch parsed account info for the specified public key
OptionalcommitmentOrConfig: Commitment | GetAccountInfoConfigFetch parsed transaction details for a confirmed or finalized block
Fetch parsed transaction details for a confirmed or finalized block
Fetch parsed transaction details for a confirmed or finalized block
Fetch parsed transaction details for a confirmed or finalized block
OptionalrawConfig: GetVersionedBlockConfigFetch parsed transaction details for a confirmed transaction
Optionalcommitment: FinalityDeprecated since RPC v1.7.0. Please use getParsedTransaction instead.
Fetch parsed transaction details for a batch of confirmed transactions
Optionalcommitment: FinalityDeprecated since RPC v1.7.0. Please use getParsedTransactions instead.
Fetch and parse all the accounts owned by the specified program id
OptionalconfigOrCommitment: Commitment | GetParsedProgramAccountsConfigFetch parsed token accounts owned by the specified account
OptionalcommitmentOrConfig: Commitment | GetParsedTokenAccountsByOwnerConfigFetch parsed transaction details for a confirmed or finalized transaction
OptionalcommitmentOrConfig: Finality | GetVersionedTransactionConfigFetch parsed transaction details for a batch of confirmed transactions
OptionalcommitmentOrConfig: Finality | GetVersionedTransactionConfigFetch all the accounts owned by the specified program id
Fetch all the accounts owned by the specified program id
OptionalconfigOrCommitment: Commitment | GetProgramAccountsConfigFetch recent performance samples
Optionallimit: numberFetch a list of prioritization fees from recent blocks.
Optionalconfig: GetRecentPrioritizationFeesConfigReturns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
queried address
Optionaloptions: SignaturesForAddressOptionsOptionalcommitment: FinalityFetch the current status of a signature
Optionalconfig: SignatureStatusConfigFetch the current statuses of a batch of signatures
Optionalconfig: SignatureStatusConfigFetch the current slot that the node is processing
OptionalcommitmentOrConfig: Commitment | GetSlotConfigFetch the current slot leader of the cluster
OptionalcommitmentOrConfig: Commitment | GetSlotLeaderConfigFetch limit number of slot leaders starting from startSlot
fetch slot leaders starting from this slot
number of slot leaders to return
get the stake minimum delegation
Optionalconfig: GetStakeMinimumDelegationConfigFetch information about the current supply
Optionalconfig: Commitment | GetSupplyConfigFetch the current balance of a token account
OptionalcommitmentOrConfig: Commitment | GetTokenAccountBalanceConfigFetch all the token accounts delegated to the specified account
OptionalcommitmentOrConfig: Commitment | GetTokenAccountsByDelegateConfigFetch all the token accounts owned by the specified account
OptionalcommitmentOrConfig: Commitment | GetTokenAccountsByOwnerConfigFetch the 20 largest token accounts with their current balances for a given mint.
OptionalcommitmentOrConfig: Commitment | GetTokenLargestAccountsConfigFetch the current supply of a token mint
OptionalcommitmentOrConfig: Commitment | GetTokenSupplyConfigFetch a confirmed or finalized transaction from the cluster.
OptionalrawConfig: GetTransactionConfigFetch a confirmed or finalized transaction from the cluster.
Fetch the current transaction count of the cluster
OptionalcommitmentOrConfig: Commitment | GetTransactionCountConfigFetch transaction details for a batch of confirmed transactions. Similar to getParsedTransactions but returns a TransactionResponse.
OptionalcommitmentOrConfig: GetTransactionConfig | FinalityFetch transaction details for a batch of confirmed transactions. Similar to getParsedTransactions but returns a VersionedTransactionResponse.
Fetch the node version
Return the list of nodes that are currently participating in the cluster
OptionalcommitmentOrConfig: Commitment | GetVoteAccountsConfigReturns whether a blockhash is still valid or not
OptionalrawConfig: IsBlockhashValidConfigRegister a callback to be invoked whenever the specified account changes
Public key of the account to monitor
Function to invoke whenever the account is changed
subscription id
Register a callback to be invoked whenever the specified account changes
Public key of the account to monitor
Function to invoke whenever the account is changed
subscription id
Register a callback to be invoked whenever the specified account changes
Public key of the account to monitor
Function to invoke whenever the account is changed
Optionalconfig: Readonly<{ commitment?: Commitment; encoding?: "base64" | "base58" }>subscription id
Optionalcommitment: CommitmentInstead, pass in an AccountSubscriptionConfig
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Optionalconfig: undefined
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Register a callback to be invoked whenever a matching block is observed.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-block-subscription.
Blocks will only be published if they match this filter
Function to invoke whenever a matching block is published
Subscription configuration
subscription id
Registers a callback to be invoked whenever logs are emitted.
Optionalcommitment: CommitmentRegister a callback to be invoked whenever accounts owned by the specified program change
Public key of the program to monitor
Function to invoke whenever the account is changed
subscription id
Register a callback to be invoked whenever accounts owned by the specified program change
Public key of the program to monitor
Function to invoke whenever the account is changed
subscription id
Register a callback to be invoked whenever accounts owned by the specified program change
Public key of the program to monitor
Function to invoke whenever the account is changed
Optionalconfig: Readonly<subscription id
Optionalcommitment: CommitmentOptionalfilters: GetProgramAccountsFilter[]Instead, pass in a ProgramAccountSubscriptionConfig
Register a callback to be invoked upon root changes
Function to invoke whenever the root changes
subscription id
Register a callback to be invoked upon signature updates
Transaction signature string in base 58
Function to invoke on signature notifications
Optionalcommitment: Commitment
Specify the commitment level signature must reach before notification
subscription id
Register a callback to be invoked when a transaction is received and/or processed.
Transaction signature string in base 58
Function to invoke on signature notifications
Optionaloptions: SignatureSubscriptionStatusOptions
Enable received notifications and set the commitment level that signature must reach before notification
subscription id
Register a callback to be invoked when a transaction is received and/or processed.
Transaction signature string in base 58
Function to invoke on signature notifications
Enable received notifications and set the commitment level that signature must reach before notification
subscription id
Register a callback to be invoked upon slot changes
Function to invoke whenever the slot changes
subscription id
Register a callback to be invoked upon slot updates. SlotUpdate's may be useful to track live progress of a cluster.
Function to invoke whenever the slot updates
subscription id
Register a callback to be invoked when a new vote is observed in gossip.
This subscription is unstable and requires the validator to be started with
--rpc-pubsub-enable-vote-subscription.
Function to invoke whenever a vote is observed
subscription id
Deregister an account notification callback
client subscription id to deregister
Deregister a block notification callback
client subscription id to deregister
Deregister a logs callback.
client subscription id to deregister.
Deregister an account notification callback
client subscription id to deregister
Deregister a root notification callback
client subscription id to deregister
Deregister a signature notification callback
client subscription id to deregister
Deregister a slot notification callback
client subscription id to deregister
Deregister a slot update notification callback
client subscription id to deregister
Deregister a vote notification callback
client subscription id to deregister
Request an allocation of lamports to the specified address
import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js";
(async () => {
const connection = new Connection("https://api.testnet.solana.com", "confirmed");
const myAddress = new PublicKey("2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM");
const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL);
await connection.confirmTransaction(signature);
})();
OptionalcommitmentOrConfig: Commitment | RequestAirdropConfigSend a transaction that has already been signed, serialized into the wire format, and encoded as a base64 string
Optionaloptions: SendOptionsSend a transaction that has already been signed and serialized into the wire format
Optionaloptions: SendOptionsSign and send a transaction
Optionaloptions: SendOptionsInstead, call sendTransaction with a VersionedTransaction
Send a signed transaction
Optionaloptions: SendOptionsSimulate a transaction
Optionalsigners: Readonly<OptionalincludeAccounts: boolean | PublicKey[]Instead, call simulateTransaction with VersionedTransaction and SimulateTransactionConfig parameters
Simulate a transaction
Optionalconfig: SimulateTransactionConfig
A connection to a fullnode JSON RPC endpoint