Responses
- class RpcResponseContext(slot, api_version=None)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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(total_stake, commitment=None)
- 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(value)
- 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(value)
- 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, last_slot)
- 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, range)
- 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(value, context)
- 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(value=None)
- 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(value)
- 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(value)
- 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(value=None)
- 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(pubkey, gossip=None, tpu=None, tpu_quic=None, rpc=None, pubsub=None, version=None, feature_set=None, shred_version=None, tvu=None, tpu_forwards=None, tpu_forwards_quic=None, tpu_vote=None, serve_repair=None)
- 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.
- gossip
- pubkey
- pubsub
- rpc
- serve_repair
- shred_version
- to_json()
Convert to a JSON string.
- tpu
- tpu_forwards
- tpu_forwards_quic
- tpu_quic
- tpu_vote
- tvu
- version
- class GetClusterNodesResp(value)
- 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(value)
- 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(value)
- 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(value, context)
- 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(value)
- 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(value)
- 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(value)
- 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(err=None, logs=None, accounts=None, units_consumed=None, return_data=None, inner_instructions=None, replacement_blockhash=None, fee=None, loaded_accounts_data_size=None, pre_balances=None, post_balances=None, pre_token_balances=None, post_token_balances=None, loaded_addresses=None)
- accounts
- err
- fee
- 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.
- inner_instructions
- loaded_accounts_data_size
- loaded_addresses
- logs
- post_balances
- post_token_balances
- pre_balances
- pre_token_balances
- replacement_blockhash
- return_data
- to_json()
Convert to a JSON string.
- units_consumed
- class RpcSnapshotSlotInfo(full, incremental=None)
- 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(value)
- 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(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.
- to_json()
Convert to a JSON string.
- class GetIdentityResp(value)
- 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(initial, terminal, taper, foundation, foundation_term)
- 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(value)
- 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(total, validator, foundation, epoch)
- 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(value)
- 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(epoch, effective_slot, amount, post_balance, commission=None)
- 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(value)
- 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, lamports)
- 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(value, context)
- 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, last_valid_block_height)
- 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(value, context)
- 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(value)
- 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(value)
- 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(value)
- 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(value)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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(pubkey, account)
- 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(pubkey, account)
- 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(value, context)
- 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(value, context)
- 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(value)
- 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(value)
- 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(value, context)
- 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(value)
- 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(slot, num_transactions, num_slots, sample_period_secs, num_non_vote_transactions=None)
- 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(value)
- 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 RpcPrioritizationFee(slot, prioritization_fee)
- 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.
- prioritization_fee
- slot
- to_json()
Convert to a JSON string.
- class GetRecentPrioritizationFeesResp(value)
- 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(signature, slot, err=None, memo=None, block_time=None, confirmation_status=None)
- 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(value)
- 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(value, context)
- 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(value)
- 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(value)
- 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(value)
- 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(total, circulating, non_circulating, non_circulating_accounts)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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(value, context)
- 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)
- 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(value, context)
- 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(value, context)
- 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(value=None)
- 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(value)
- 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(solana_core, feature_set=None)
- 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(value)
- 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(vote_pubkey, node_pubkey, activated_stake, commission, epoch_vote_account, epoch_credits, last_vote, root_slot)
- 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)
- 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(value)
- 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(value, context)
- 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(value)
- 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(value)
- 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(value)
- 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(value)
- 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(value, context)
- 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(signature, err, logs)
- 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(vote_pubkey, slots, hash, timestamp, signature)
- 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(num_transaction_entries, num_successful_transactions, num_failed_transactions, max_transactions_per_entry)
- 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(slot, timestamp)
- 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(slot, timestamp)
- 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(slot, timestamp, parent)
- 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(slot, timestamp, err)
- 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(slot, timestamp)
- 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(slot, timestamp)
- 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(slot, timestamp, stats)
- 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(value, context)
- 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(result, subscription)
- 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(value, context)
- 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(result, subscription)
- 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(value, context)
- 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(result, subscription)
- 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(value, context)
- 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(result, subscription)
- 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(value, context)
- 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(result, subscription)
- 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(value, context)
- 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(result, subscription)
- 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=None)
- 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(value, context)
- 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(result, subscription)
- 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(slot, parent, root)
- 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(result, subscription)
- 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(result, subscription)
- 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(result, subscription)
- 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(result, subscription)
- 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(id, result)
- 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(id, error)
- 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 RpcBlockUpdate(slot, block=None, err=None)
- 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(id, result)
- 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 | GetRecentPrioritizationFeesResp | 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 | GetRecentPrioritizationFeesResp | 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, }]