Responses

class RpcResponseContext
api_version
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
to_json()

Convert to a JSON string.

class GetAccountInfoResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetAccountInfoJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetAccountInfoMaybeJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetBalanceResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcBlockCommitment
commitment
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

total_stake
class GetBlockCommitmentResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetBlockHeightResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcBlockProductionRange
first_slot
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

last_slot
to_json()

Convert to a JSON string.

class RpcBlockProduction
by_identity
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

range
to_json()

Convert to a JSON string.

class GetBlockProductionResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetBlockResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetBlocksResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetBlocksWithLimitResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetBlockTimeResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcContactInfo
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

class GetClusterNodesResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetEpochInfoResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetEpochScheduleResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetFeeForMessageResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetFirstAvailableBlockResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetGenesisHashResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetHealthResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcSimulateTransactionResult
accounts
err
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

logs
return_data
to_json()

Convert to a JSON string.

units_consumed
class RpcSnapshotSlotInfo
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

full
incremental
to_json()

Convert to a JSON string.

class GetHighestSnapshotSlotResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcIdentity
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

identity

The current node identity.

Type:

Pubkey

to_json()

Convert to a JSON string.

class GetIdentityResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcInflationGovernor
foundation
foundation_term
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

initial
taper
terminal
to_json()

Convert to a JSON string.

class GetInflationGovernorResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcInflationRate
epoch
foundation
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

total
validator
class GetInflationRateResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcInflationReward
amount
commission
effective_slot
epoch
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

post_balance
to_json()

Convert to a JSON string.

class GetInflationRewardResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcAccountBalance
address
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

lamports
to_json()

Convert to a JSON string.

class GetLargestAccountsResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcBlockhash
blockhash
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

last_valid_block_height
to_json()

Convert to a JSON string.

class GetLatestBlockhashResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetLeaderScheduleResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetMaxRetransmitSlotResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetMaxShredInsertSlotResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetMinimumBalanceForRentExemptionResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetMultipleAccountsResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetMultipleAccountsJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetMultipleAccountsMaybeJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcKeyedAccount
account
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

pubkey
to_json()

Convert to a JSON string.

class RpcKeyedAccountJsonParsed
account
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

pubkey
to_json()

Convert to a JSON string.

class GetProgramAccountsWithContextResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetProgramAccountsWithContextJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetProgramAccountsResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetProgramAccountsJsonParsedResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetProgramAccountsWithContextMaybeJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetProgramAccountsMaybeJsonParsedResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcPerfSample
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

num_non_votetransactions
num_slots
num_transactions
sample_period_secs
slot
to_json()

Convert to a JSON string.

class GetRecentPerformanceSamplesResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcConfirmedTransactionStatusWithSignature
block_time
confirmation_status
err
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

memo
signature
slot
to_json()

Convert to a JSON string.

class GetSignaturesForAddressResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetSignatureStatusesResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetSlotResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetSlotLeaderResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetSlotLeadersResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcSupply
circulating
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

non_circulating
non_circulating_accounts
to_json()

Convert to a JSON string.

total
class GetSupplyResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTokenAccountBalanceResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTokenAccountsByDelegateResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTokenAccountsByDelegateJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTokenAccountsByOwnerResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTokenAccountsByOwnerJsonParsedResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcTokenAccountBalance
address
amount
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

class GetTokenLargestAccountsResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTokenSupplyResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTransactionResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class GetTransactionCountResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcVersionInfo
feature_set
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

solana_core
to_json()

Convert to a JSON string.

class GetVersionResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcVoteAccountInfo
activated_stake
commission
epoch_credits
epoch_vote_account
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

last_vote
node_pubkey
root_slot
to_json()

Convert to a JSON string.

vote_pubkey
class RpcVoteAccountStatus
current
delinquent
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

class GetVoteAccountsResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class IsBlockhashValidResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class MinimumLedgerSlotResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RequestAirdropResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class ValidatorExitResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class SendTransactionResp
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class SimulateTransactionResp
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

Parameters:

raw (str) – The RPC JSON response (can be an error response).

Returns:

Either the deserialized object or RPCError.

to_json()

Convert to a JSON string.

value
class RpcLogsResponse
err
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

logs
signature
to_json()

Convert to a JSON string.

class RpcVote
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

hash
signature
slots
timestamp
to_json()

Convert to a JSON string.

vote_pubkey
class SlotTransactionStats
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

max_transactions_per_entry
num_failed_transactions
num_successful_transactions
num_transaction_entries
to_json()

Convert to a JSON string.

class SlotUpdateFirstShredReceived
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
timestamp
to_json()

Convert to a JSON string.

class SlotUpdateCompleted
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
timestamp
to_json()

Convert to a JSON string.

class SlotUpdateCreatedBank
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

parent
slot
timestamp
to_json()

Convert to a JSON string.

class SlotUpdateDead
err
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
timestamp
to_json()

Convert to a JSON string.

class SlotUpdateOptimisticConfirmation
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
timestamp
to_json()

Convert to a JSON string.

class SlotUpdateRoot
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
timestamp
to_json()

Convert to a JSON string.

class SlotUpdateFrozen
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
stats
timestamp
to_json()

Convert to a JSON string.

class AccountNotificationResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class AccountNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class AccountNotificationJsonParsedResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class AccountNotificationJsonParsed
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class BlockNotificationResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class BlockNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class LogsNotificationResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class LogsNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class ProgramNotificationResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class ProgramNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class ProgramNotificationJsonParsedResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class ProgramNotificationJsonParsed
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class RpcSignatureResponse
err
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

class SignatureNotificationResult
context
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

to_json()

Convert to a JSON string.

value
class SignatureNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class SlotInfo
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

parent
root
slot
to_json()

Convert to a JSON string.

class SlotNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class SlotUpdateNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class RootNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class VoteNotification
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

result
subscription
to_json()

Convert to a JSON string.

class SubscriptionResult
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

id
result
to_json()

Convert to a JSON string.

class SubscriptionError
error
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

id
to_json()

Convert to a JSON string.

class BlockStoreError
BlockStoreError = BlockStoreError.BlockStoreError
class RpcBlockUpdate
block
err
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

slot
to_json()

Convert to a JSON string.

class UnsubscribeResult
static from_bytes(data)

Deserialize from bytes.

Parameters:

data (bytes) – the serialized object.

Returns: the deserialized object.

static from_json(raw)

Build from a JSON string.

id
result
to_json()

Convert to a JSON string.

batch_to_json(resps: Sequence[RpcCustomErrorFieldless | BlockCleanedUpMessage | SendTransactionPreflightFailureMessage | BlockNotAvailableMessage | NodeUnhealthyMessage | TransactionPrecompileVerificationFailureMessage | SlotSkippedMessage | LongTermStorageSlotSkippedMessage | KeyExcludedFromSecondaryIndexMessage | ScanErrorMessage | BlockStatusNotAvailableYetMessage | MinContextSlotNotReachedMessage | UnsupportedTransactionVersionMessage | ParseErrorMessage | InvalidRequestMessage | MethodNotFoundMessage | InvalidParamsMessage | InternalErrorMessage | GetAccountInfoResp | GetAccountInfoJsonParsedResp | GetAccountInfoMaybeJsonParsedResp | GetBalanceResp | GetBlockProductionResp | GetBlockResp | GetBlockCommitmentResp | GetBlockHeightResp | GetBlocksResp | GetBlocksWithLimitResp | GetBlockTimeResp | GetClusterNodesResp | GetEpochInfoResp | GetEpochScheduleResp | GetFeeForMessageResp | GetFirstAvailableBlockResp | GetGenesisHashResp | GetHealthResp | GetHighestSnapshotSlotResp | GetIdentityResp | GetInflationGovernorResp | GetInflationRateResp | GetInflationRewardResp | GetLargestAccountsResp | GetLatestBlockhashResp | GetLeaderScheduleResp | GetMaxRetransmitSlotResp | GetMaxShredInsertSlotResp | GetMinimumBalanceForRentExemptionResp | GetMultipleAccountsResp | GetMultipleAccountsJsonParsedResp | GetMultipleAccountsMaybeJsonParsedResp | GetProgramAccountsWithContextResp | GetProgramAccountsResp | GetProgramAccountsWithContextJsonParsedResp | GetProgramAccountsJsonParsedResp | GetProgramAccountsMaybeJsonParsedResp | GetProgramAccountsWithContextMaybeJsonParsedResp | GetRecentPerformanceSamplesResp | GetSignaturesForAddressResp | GetSignatureStatusesResp | GetSlotResp | GetSlotLeaderResp | GetSlotLeadersResp | GetSupplyResp | GetTokenAccountBalanceResp | GetTokenAccountsByDelegateResp | GetTokenAccountsByDelegateJsonParsedResp | GetTokenAccountsByOwnerResp | GetTokenAccountsByOwnerJsonParsedResp | GetTokenLargestAccountsResp | GetTokenSupplyResp | GetTransactionResp | GetTransactionCountResp | GetVersionResp | RpcVersionInfo | GetVoteAccountsResp | IsBlockhashValidResp | MinimumLedgerSlotResp | RequestAirdropResp | SendTransactionResp | SimulateTransactionResp]) str

Serialize a list of response objects into a single batch response JSON.

Parameters:

resps – A list of response objects.

Returns:

The batch JSON string.

Return type:

str

Example

>>> from solders.rpc.responses import batch_to_json, GetBlockHeightResp, GetFirstAvailableBlockResp
>>> batch_to_json([GetBlockHeightResp(1233), GetFirstAvailableBlockResp(1)])
'[{"id":0,"jsonrpc":"2.0","result":1233},{"id":0,"jsonrpc":"2.0","result":1}]'
batch_from_json(raw: str, parsers: Sequence[Any]) List[RpcCustomErrorFieldless | BlockCleanedUpMessage | SendTransactionPreflightFailureMessage | BlockNotAvailableMessage | NodeUnhealthyMessage | TransactionPrecompileVerificationFailureMessage | SlotSkippedMessage | LongTermStorageSlotSkippedMessage | KeyExcludedFromSecondaryIndexMessage | ScanErrorMessage | BlockStatusNotAvailableYetMessage | MinContextSlotNotReachedMessage | UnsupportedTransactionVersionMessage | ParseErrorMessage | InvalidRequestMessage | MethodNotFoundMessage | InvalidParamsMessage | InternalErrorMessage | GetAccountInfoResp | GetAccountInfoJsonParsedResp | GetAccountInfoMaybeJsonParsedResp | GetBalanceResp | GetBlockProductionResp | GetBlockResp | GetBlockCommitmentResp | GetBlockHeightResp | GetBlocksResp | GetBlocksWithLimitResp | GetBlockTimeResp | GetClusterNodesResp | GetEpochInfoResp | GetEpochScheduleResp | GetFeeForMessageResp | GetFirstAvailableBlockResp | GetGenesisHashResp | GetHealthResp | GetHighestSnapshotSlotResp | GetIdentityResp | GetInflationGovernorResp | GetInflationRateResp | GetInflationRewardResp | GetLargestAccountsResp | GetLatestBlockhashResp | GetLeaderScheduleResp | GetMaxRetransmitSlotResp | GetMaxShredInsertSlotResp | GetMinimumBalanceForRentExemptionResp | GetMultipleAccountsResp | GetMultipleAccountsJsonParsedResp | GetMultipleAccountsMaybeJsonParsedResp | GetProgramAccountsWithContextResp | GetProgramAccountsResp | GetProgramAccountsWithContextJsonParsedResp | GetProgramAccountsJsonParsedResp | GetProgramAccountsMaybeJsonParsedResp | GetProgramAccountsWithContextMaybeJsonParsedResp | GetRecentPerformanceSamplesResp | GetSignaturesForAddressResp | GetSignatureStatusesResp | GetSlotResp | GetSlotLeaderResp | GetSlotLeadersResp | GetSupplyResp | GetTokenAccountBalanceResp | GetTokenAccountsByDelegateResp | GetTokenAccountsByDelegateJsonParsedResp | GetTokenAccountsByOwnerResp | GetTokenAccountsByOwnerJsonParsedResp | GetTokenLargestAccountsResp | GetTokenSupplyResp | GetTransactionResp | GetTransactionCountResp | GetVersionResp | RpcVersionInfo | GetVoteAccountsResp | IsBlockhashValidResp | MinimumLedgerSlotResp | RequestAirdropResp | SendTransactionResp | SimulateTransactionResp]

Deserialize a batch request JSON string into a list of request objects.

Parameters:
  • raw (str) – The batch JSON string.

  • parsers (Sequence) – The classes to parse.

Returns:

A list of response objects.

Example

>>> from solders.rpc.responses import batch_from_json, GetBlockHeightResp, GetFirstAvailableBlockResp
>>> raw = '[{ "jsonrpc": "2.0", "result": 1233, "id": 1 },{ "jsonrpc": "2.0", "result": 111, "id": 1 }]'
>>> batch_from_json(raw, [GetBlockHeightResp, GetFirstAvailableBlockResp])
[GetBlockHeightResp(
    1233,
), GetFirstAvailableBlockResp(
    111,
)]
parse_notification(msg)

Parse a notification received by a Solana websocket subscription.

Parameters:

msg (str) – The raw notification JSON.

Returns:

The parsed message.

Return type:

Notification

Example

>>> from solders.rpc.responses import parse_notification
>>> raw = '{ "jsonrpc": "2.0", "method": "rootNotification", "params": { "result": 4, "subscription": 0 } }'
>>> parse_notification(raw)
RootNotification {
    result: 4,
    subscription: 0,
}
parse_websocket_message(msg)

Parse a message or array of messages received by a Solana websocket subscription.

Parameters:

msg (str) – The raw message JSON.

Returns:

The parsed message.

Return type:

WebsocketMessage

Example

>>> from solders.rpc.responses import parse_websocket_message
>>> raw = '{ "jsonrpc": "2.0", "method": "rootNotification", "params": { "result": 4, "subscription": 0 } }'
>>> parse_websocket_message(raw)
[RootNotification {
    result: 4,
    subscription: 0,
}]
>>> raw_multi = '[{"jsonrpc": "2.0", "result": 0, "id": 1}, {"jsonrpc": "2.0", "result": 1, "id": 2}]'
>>> parse_websocket_message(raw_multi)
[SubscriptionResult {
    jsonrpc: TwoPointOh,
    id: 1,
    result: 0,
}, SubscriptionResult {
    jsonrpc: TwoPointOh,
    id: 2,
    result: 1,
}]