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 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 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 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 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 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 EpochInfo

Information about the current epoch.

Parameters:
  • epoch (int) – The current epoch.

  • slot_index (int) – The current slot, relative to the start of the current epoch.

  • slots_in_epoch (int) – The number of slots in this epoch.

  • absolute_slot (int) – The absolute current slot.

  • block_height (int) – The current block height.

  • transaction_count (Optional[int]) – Total number of transactions processed without error since genesis

absolute_slot

The absolute current slot

Type:

int

block_height

The current block height

Type:

int

epoch

The current epoch

Type:

int

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_index

The current slot, relative to the start of the current epoch

Type:

int

slots_in_epoch

The number of slots in this epoch

Type:

int

to_json()

Convert to a JSON string.

transaction_count

Total number of transactions processed without error since genesis

Type:

Optional[int]

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 BlockStoreError
BlockStoreError = BlockStoreError.BlockStoreError
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)

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, parsers)

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_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,
}]
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,
}