Establish a JSON RPC connection
URL to the fullnode JSON RPC endpoint
optional default commitment level or optional ConnectionConfig configuration object
The default commitment used for requests
The RPC endpoint
Fetch all the account info for the specified public key
Fetch all the account info for the specified public key, return with context
Fetch the balance for the specified public key
Fetch the balance for the specified public key, return with context
Fetch a processed block from the cluster.
Fetch a processed block from the cluster.
Fetch a list of Signatures from the cluster for a block, excluding rewards
Fetch the estimated production time of a block
Fetch confirmed blocks between two slots
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.
Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
Fetch a list of all the confirmed signatures for transactions involving an address within a specified slot range. Max range allowed is 10,000 slots.
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
Fetch a transaction details for a confirmed transaction
Fetch the Epoch Info parameters
Fetch the Epoch Schedule parameters
Fetch the fee calculator for a recent blockhash from the cluster, return with context
Fetch the fee for a message from the cluster, return with context
Fetch the slot of the lowest confirmed block that has not been purged from the ledger
Fetch the genesis hash
Fetch the cluster InflationGovernor parameters
Fetch the specific inflation values for the current epoch
Fetch the inflation reward for a list of addresses for an epoch
Fetch the 20 largest accounts with their current balances
Fetch the latest blockhash from the cluster
Fetch the latest blockhash from the cluster
Fetch the leader schedule for the current epoch
Fetch the minimum balance needed to exempt an account of dataLength
size from rent
Fetch 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
Fetch all the account info for multiple accounts specified by an array of public keys, return with context
Fetch all the account info for multiple accounts specified by an array of public keys, return with context
Fetch the contents of a Nonce account from the cluster
Fetch the contents of a Nonce account from the cluster, return with context
Fetch parsed account info for the specified public key
Fetch parsed transaction details for a confirmed or finalized block
Fetch parsed transaction details for a confirmed transaction
Fetch parsed transaction details for a batch of confirmed transactions
Fetch and parse all the accounts owned by the specified program id
}
Fetch parsed token accounts owned by the specified account
}
Fetch parsed transaction details for a confirmed or finalized transaction
Fetch parsed transaction details for a batch of confirmed transactions
Fetch all the accounts owned by the specified program id
}
Fetch a recent blockhash from the cluster
}
Fetch a recent blockhash from the cluster, return with context
}
Fetch recent performance samples
Fetch the current status of a signature
Fetch the current statuses of a batch of signatures
Returns confirmed signatures for transactions involving an address backwards in time from the provided signature or most recent confirmed block
queried address
Fetch the current slot that the node is processing
Fetch the current slot leader of the cluster
Fetch limit
number of slot leaders starting from startSlot
fetch slot leaders starting from this slot
number of slot leaders to return
Returns epoch activation information for a stake account that has been delegated
get the stake minimum delegation
Fetch information about the current supply
Fetch the current balance of a token account
Fetch all the token accounts owned by the specified account
}
Fetch the 20 largest token accounts with their current balances for a given mint.
Fetch the current supply of a token mint
Fetch the current total currency supply of the cluster in lamports
Fetch a confirmed or finalized transaction from the cluster.
Fetch a confirmed or finalized transaction from the cluster.
Fetch the current transaction count of the cluster
Fetch transaction details for a batch of confirmed transactions. Similar to getParsedTransactions but returns a TransactionResponse.
Fetch 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
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
Specify the commitment level account changes must reach before notification
subscription id
Registers a callback to be invoked whenever logs are emitted.
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
Specify the commitment level account changes must reach before notification
The program account filters to pass into the RPC method
subscription id
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
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
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
Deregister an account notification callback
Deregister a logs callback.
Deregister an account notification callback
Deregister a root notification callback
Deregister a signature notification callback
Deregister a slot notification callback
Deregister a slot update notification callback
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);
})();
Send a transaction that has already been signed, serialized into the wire format, and encoded as a base64 string
Send a transaction that has already been signed and serialized into the wire format
Sign and send a transaction
Send a signed transaction
Simulate a transaction
Simulate a transaction
Generated using TypeDoc
A connection to a fullnode JSON RPC endpoint