Skip to main content

Account Methods

getAccountInfo

Get information about an account. Parameters:
pubkey
string
required
Account public key as base-58 encoded string
config
object
Configuration objectFields:
  • commitment (string): Commitment level
  • encoding (string): Data encoding (base58, base64, base64+zstd, jsonParsed)
  • dataSlice (object): Limit returned data with {offset: number, length: number}
  • minContextSlot (number): Minimum slot for the request
Response:
{
  "context": {"slot": 12345},
  "value": {
    "lamports": 1000000,
    "owner": "11111111111111111111111111111111",
    "data": ["<base64-data>", "base64"],
    "executable": false,
    "rentEpoch": 361
  }
}
Example:
curl -X POST http://localhost:8899 -H "Content-Type: application/json" -d '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAccountInfo",
  "params": [
    "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
    {"encoding": "base64"}
  ]
}'

getBalance

Get the lamport balance of an account. Parameters:
pubkey
string
required
Account public key as base-58 encoded string
config
object
Configuration with commitment and minContextSlot fields
Response:
{
  "context": {"slot": 12345},
  "value": 1000000
}

getMultipleAccounts

Get information for multiple accounts in a single request. Parameters:
pubkeys
string[]
required
Array of account public keys (max 100)
config
object
Same configuration options as getAccountInfo
Response:
{
  "context": {"slot": 12345},
  "value": [
    {"lamports": 1000000, "owner": "...", "data": [...], ...},
    null,  // Account not found
    {"lamports": 5000000, "owner": "...", "data": [...], ...}
  ]
}

getProgramAccounts

Get all accounts owned by a program. Parameters:
programId
string
required
Program public key as base-58 encoded string
config
object
Configuration objectFields:
  • commitment, encoding, dataSlice, minContextSlot (same as getAccountInfo)
  • filters (array): Filter results by account data
  • withContext (bool): Wrap result in RpcResponse
Filters:
{
  "filters": [
    {"dataSize": 165},  // Filter by data size
    {"memcmp": {"offset": 0, "bytes": "base58data"}}  // Filter by data content
  ]
}
Response:
[
  {
    "pubkey": "account-pubkey-1",
    "account": {"lamports": 1000, "owner": "...", "data": [...], ...}
  },
  {
    "pubkey": "account-pubkey-2",
    "account": {"lamports": 2000, "owner": "...", "data": [...], ...}
  }
]

Block Methods

getBlock

Get a confirmed block. Parameters:
slot
number
required
Slot number
config
object
Configuration objectFields:
  • encoding (string): base58, base64, json, jsonParsed
  • transactionDetails (string): full, signatures, none
  • rewards (bool): Include rewards
  • commitment (string): Commitment level (finalized or confirmed only)
  • maxSupportedTransactionVersion (number): Max transaction version
Response:
{
  "blockhash": "...",
  "previousBlockhash": "...",
  "parentSlot": 12344,
  "transactions": [...],
  "rewards": [...],
  "blockTime": 1234567890,
  "blockHeight": 10000
}

getBlocks

Get a list of confirmed blocks between two slots. Parameters:
start_slot
number
required
Start slot (inclusive)
end_slot
number
End slot (inclusive). If not provided, returns up to 500,000 blocks.
config
object
Configuration with commitment field
Response:
[12345, 12346, 12347, 12348]

getBlockHeight

Get the current block height. Parameters:
config
object
Configuration with commitment and minContextSlot
Response:
12345

getBlockTime

Get the estimated production time of a block. Parameters:
slot
number
required
Slot number
Response:
1234567890
Unix timestamp or null if not available.

Transaction Methods

sendTransaction

Submit a signed transaction to the cluster. Parameters:
transaction
string
required
Fully-signed transaction as base64 or base58 encoded string
config
object
Configuration objectFields:
  • encoding (string): base58 or base64
  • skipPreflight (bool): Skip preflight checks
  • preflightCommitment (string): Commitment for preflight
  • maxRetries (number): Max retry attempts
  • minContextSlot (number): Minimum slot for processing
Response:
"5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"
Returns the transaction signature.

getTransaction

Get a confirmed transaction. Parameters:
signature
string
required
Transaction signature as base-58 string
config
object
Configuration objectFields:
  • encoding (string): json, jsonParsed, base64, base58
  • commitment (string): Commitment level
  • maxSupportedTransactionVersion (number): Max version
Response:
{
  "slot": 12345,
  "transaction": {...},
  "meta": {
    "err": null,
    "fee": 5000,
    "preBalances": [1000000, 5000000],
    "postBalances": [995000, 5005000],
    "logMessages": [...],
    "computeUnitsConsumed": 12345
  },
  "blockTime": 1234567890
}

getSignatureStatuses

Get statuses for multiple transaction signatures. Parameters:
signatures
string[]
required
Array of transaction signatures (max 256)
config
object
Configuration with searchTransactionHistory (bool) field
Response:
{
  "context": {"slot": 12345},
  "value": [
    {
      "slot": 12345,
      "confirmations": 10,
      "err": null,
      "confirmationStatus": "confirmed"
    },
    null  // Not found
  ]
}

simulateTransaction

Simulate a transaction without committing it. Parameters:
transaction
string
required
Transaction as base64 or base58 string
config
object
Configuration objectFields:
  • commitment (string): Commitment level
  • encoding (string): base58 or base64
  • replaceRecentBlockhash (bool): Replace blockhash with latest
  • accounts (object): Account overrides
  • minContextSlot (number): Minimum slot
Response:
{
  "context": {"slot": 12345},
  "value": {
    "err": null,
    "logs": ["Program log: ..."],
    "accounts": [...],
    "unitsConsumed": 12345,
    "returnData": {"programId": "...", "data": ["...", "base64"]}
  }
}

Slot Methods

getSlot

Get the current slot. Parameters:
config
object
Configuration with commitment and minContextSlot
Response:
12345

getSlotLeader

Get the current slot leader. Parameters:
config
object
Configuration with commitment and minContextSlot
Response:
"ENvAW7JScgYq6o4VZk9wWhzKnKtnEKdsdkjn6dWqTHvx"

getSlotLeaders

Get the slot leaders for a range of slots. Parameters:
start_slot
number
required
Start slot
limit
number
required
Number of leaders to return (max 5000)
Response:
[
  "pubkey1",
  "pubkey2",
  "pubkey3"
]

Network Methods

getVersion

Get the current validator version. Response:
{
  "solana-core": "3.0.0",
  "feature-set": 4215500110
}

getHealth

Check node health. Response:
  • "ok" if healthy
  • Error if unhealthy

getClusterNodes

Get information about all nodes in the cluster. Response:
[
  {
    "pubkey": "node-pubkey",
    "gossip": "127.0.0.1:8001",
    "tpu": "127.0.0.1:8003",
    "rpc": "127.0.0.1:8899",
    "version": "3.0.0",
    "featureSet": 4215500110
  }
]

Utility Methods

getRecentBlockhash (Deprecated)

Get a recent blockhash. Deprecated: Use getLatestBlockhash instead.

getLatestBlockhash

Get the latest blockhash. Parameters:
config
object
Configuration with commitment and minContextSlot
Response:
{
  "context": {"slot": 12345},
  "value": {
    "blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
    "lastValidBlockHeight": 123456
  }
}

isBlockhashValid

Check if a blockhash is still valid. Parameters:
blockhash
string
required
Blockhash as base-58 string
config
object
Configuration with commitment and minContextSlot
Response:
{
  "context": {"slot": 12345},
  "value": true
}

minimumLedgerSlot

Get the minimum slot available in the ledger. Response:
1234

getEpochInfo

Get information about the current epoch. Parameters:
config
object
Configuration with commitment and minContextSlot
Response:
{
  "absoluteSlot": 123456,
  "blockHeight": 12345,
  "epoch": 100,
  "slotIndex": 1234,
  "slotsInEpoch": 432000,
  "transactionCount": 987654321
}

See Also

Build docs developers (and LLMs) love