The RPC endpoint
Fetch the balance for the specified public key, return with context
Optional
commitmentOrConfig: Commitment | GetBalanceConfigFetch all the token accounts owned by the specified account
Optional
commitmentOrConfig: Commitment | GetTokenAccountsByOwnerConfigFetch parsed token accounts owned by the specified account
Optional
commitment: CommitmentFetch the 20 largest token accounts with their current balances for a given mint.
Optional
commitment: CommitmentFetch all the account info for the specified public key, return with context
Optional
commitmentOrConfig: Commitment | GetAccountInfoConfigFetch parsed account info for the specified public key
Optional
commitmentOrConfig: Commitment | GetAccountInfoConfigFetch all the account info for the specified public key
Optional
commitmentOrConfig: Commitment | GetAccountInfoConfigFetch all the account info for multiple accounts specified by an array of public keys, return with context
Optional
rawConfig: GetMultipleAccountsConfigFetch all the account info for multiple accounts specified by an array of public keys, return with context
Optional
commitmentOrConfig: Commitment | GetMultipleAccountsConfigFetch all the account info for multiple accounts specified by an array of public keys
Optional
commitmentOrConfig: Commitment | GetMultipleAccountsConfigReturns epoch activation information for a stake account that has been delegated
Optional
commitmentOrConfig: Commitment | GetStakeActivationConfigOptional
epoch: numberFetch all the accounts owned by the specified program id
Optional
configOrCommitment: Commitment | GetProgramAccountsConfigFetch and parse all the accounts owned by the specified program id
Optional
configOrCommitment: Commitment | GetParsedProgramAccountsConfigOptional
commitment: CommitmentInstead, call confirmTransaction
using a TransactionConfirmationConfig
Optional
commitment: CommitmentFetch the current statuses of a batch of signatures
Optional
config: SignatureStatusConfigFetch the current total currency supply of the cluster in lamports
Deprecated since v1.2.8. Please use getSupply instead.
Optional
commitment: CommitmentFetch the inflation reward for a list of addresses for an epoch
Optional
epoch: numberOptional
commitmentOrConfig: Commitment | GetInflationRewardConfigFetch a recent blockhash from the cluster, return with context
Deprecated since Solana v1.8.0. Please use getLatestBlockhash instead.
Optional
commitment: CommitmentFetch the fee calculator for a recent blockhash from the cluster, return with context
Deprecated since Solana v1.8.0. Please use getFeeForMessage instead.
Optional
commitment: CommitmentFetch a recent blockhash from the cluster
Deprecated since Solana v1.8.0. Please use getLatestBlockhash instead.
Optional
commitment: CommitmentFetch the latest blockhash from the cluster
Optional
commitmentOrConfig: Commitment | GetLatestBlockhashConfigFetch the latest blockhash from the cluster
Optional
commitmentOrConfig: Commitment | GetLatestBlockhashConfigFetch a processed block from the cluster.
Instead, call getBlock
using a GetVersionedBlockConfig
by
setting the maxSupportedTransactionVersion
property.
Optional
rawConfig: GetBlockConfigInstead, call getBlock
using a GetVersionedBlockConfig
by
setting the maxSupportedTransactionVersion
property.
Instead, call getBlock
using a GetVersionedBlockConfig
by
setting the maxSupportedTransactionVersion
property.
Fetch a processed block from the cluster.
Optional
rawConfig: GetVersionedBlockConfigFetch parsed transaction details for a confirmed or finalized block
Optional
rawConfig: GetVersionedBlockConfigOptional
configOrCommitment: Commitment | GetBlockProductionConfigFetch a confirmed or finalized transaction from the cluster.
Instead, call getTransaction
using a
GetVersionedTransactionConfig
by setting the
maxSupportedTransactionVersion
property.
Optional
rawConfig: GetTransactionConfigFetch a confirmed or finalized transaction from the cluster.
Fetch parsed transaction details for a confirmed or finalized transaction
Optional
commitmentOrConfig: GetVersionedTransactionConfig | FinalityFetch parsed transaction details for a batch of confirmed transactions
Optional
commitmentOrConfig: GetVersionedTransactionConfig | FinalityFetch transaction details for a batch of confirmed transactions. Similar to getParsedTransactions but returns a TransactionResponse.
Instead, call getTransactions
using a
GetVersionedTransactionConfig
by setting the
maxSupportedTransactionVersion
property.
Optional
commitmentOrConfig: GetTransactionConfig | FinalityFetch transaction details for a batch of confirmed transactions. Similar to getParsedTransactions but returns a VersionedTransactionResponse.
Fetch a list of Transactions and transaction statuses from the cluster for a confirmed block.
Deprecated since v1.13.0. Please use getBlock instead.
Optional
commitment: FinalityFetch a list of Signatures from the cluster for a confirmed block, excluding rewards
Deprecated since Solana v1.8.0. Please use getBlockSignatures instead.
Optional
commitment: FinalityFetch a transaction details for a confirmed transaction
Deprecated since Solana v1.8.0. Please use getTransaction instead.
Optional
commitment: FinalityFetch parsed transaction details for a confirmed transaction
Deprecated since Solana v1.8.0. Please use getParsedTransaction instead.
Optional
commitment: FinalityFetch parsed transaction details for a batch of confirmed transactions
Deprecated since Solana v1.8.0. Please use getParsedTransactions instead.
Optional
commitment: FinalityFetch a list of all the confirmed signatures for transactions involving an address within a specified slot range. Max range allowed is 10,000 slots.
Deprecated since v1.3. Please use getConfirmedSignaturesForAddress2 instead.
queried address
start slot, inclusive
end slot, inclusive
Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
queried address
Optional
options: ConfirmedSignaturesForAddress2OptionsOptional
commitment: FinalityReturns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
queried address
Optional
options: SignaturesForAddressOptionsOptional
commitment: FinalityFetch the contents of a Nonce account from the cluster, return with context
Optional
commitmentOrConfig: Commitment | GetNonceAndContextConfigRequest 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);
})();
Simulate a transaction
Instead, call simulateTransaction with VersionedTransaction and SimulateTransactionConfig parameters
Optional
signers: Signer[]Optional
includeAccounts: boolean | PublicKey[]Simulate a transaction
Optional
config: SimulateTransactionConfigOptional
options: SendOptionsSend a signed transaction
Optional
options: SendOptionsSend a transaction that has already been signed and serialized into the wire format
Optional
options: SendOptionsRegister a callback to be invoked whenever the specified account changes
subscription id
Public key of the account to monitor
Function to invoke whenever the account is changed
Optional
commitment: CommitmentSpecify the commitment level account changes must reach before notification
Register a callback to be invoked whenever accounts owned by the specified program change
subscription id
Public key of the program to monitor
Function to invoke whenever the account is changed
Optional
commitment: CommitmentSpecify the commitment level account changes must reach before notification
Optional
filters: GetProgramAccountsFilter[]The program account filters to pass into the RPC method
Register a callback to be invoked upon signature updates
subscription id
Transaction signature string in base 58
Function to invoke on signature notifications
Optional
commitment: CommitmentSpecify the commitment level signature must reach before notification
Register a callback to be invoked when a transaction is received and/or processed.
subscription id
Transaction signature string in base 58
Function to invoke on signature notifications
Optional
options: SignatureSubscriptionOptionsEnable received notifications and set the commitment level that signature must reach before notification
Private
callOptional
commitmentOrConfig: Commitment | ConnectionConfigGenerated using TypeDoc
The default commitment used for requests