Trait iota_json_rpc_api::ReadApiServer

source ·
pub trait ReadApiServer: Sized + Send + Sync + 'static {
Show 15 methods // Required methods fn get_transaction_block<'life0, 'async_trait>( &'life0 self, digest: TransactionDigest, options: Option<IotaTransactionBlockResponseOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaTransactionBlockResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn multi_get_transaction_blocks<'life0, 'async_trait>( &'life0 self, digests: Vec<TransactionDigest>, options: Option<IotaTransactionBlockResponseOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaTransactionBlockResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_object<'life0, 'async_trait>( &'life0 self, object_id: ObjectID, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaObjectResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn multi_get_objects<'life0, 'async_trait>( &'life0 self, object_ids: Vec<ObjectID>, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaObjectResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn try_get_past_object<'life0, 'async_trait>( &'life0 self, object_id: ObjectID, version: SequenceNumber, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaPastObjectResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn try_get_object_before_version<'life0, 'async_trait>( &'life0 self, object_id: ObjectID, version: SequenceNumber, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaPastObjectResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn try_multi_get_past_objects<'life0, 'async_trait>( &'life0 self, past_objects: Vec<IotaGetPastObjectRequest>, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaPastObjectResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_checkpoint<'life0, 'async_trait>( &'life0 self, id: CheckpointId, ) -> Pin<Box<dyn Future<Output = RpcResult<Checkpoint>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_checkpoints<'life0, 'async_trait>( &'life0 self, cursor: Option<BigInt<u64>>, limit: Option<usize>, descending_order: bool, ) -> Pin<Box<dyn Future<Output = RpcResult<CheckpointPage>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_events<'life0, 'async_trait>( &'life0 self, transaction_digest: TransactionDigest, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_total_transaction_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<BigInt<u64>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_latest_checkpoint_sequence_number<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<BigInt<u64>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_protocol_config<'life0, 'async_trait>( &'life0 self, version: Option<BigInt<u64>>, ) -> Pin<Box<dyn Future<Output = RpcResult<ProtocolConfigResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_chain_identifier<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided method fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the ReadApi RPC API.

Required Methods§

source

fn get_transaction_block<'life0, 'async_trait>( &'life0 self, digest: TransactionDigest, options: Option<IotaTransactionBlockResponseOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaTransactionBlockResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the transaction response object.

source

fn multi_get_transaction_blocks<'life0, 'async_trait>( &'life0 self, digests: Vec<TransactionDigest>, options: Option<IotaTransactionBlockResponseOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaTransactionBlockResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns an ordered list of transaction responses The method will throw an error if the input contains any duplicate or the input size exceeds QUERY_MAX_RESULT_LIMIT

source

fn get_object<'life0, 'async_trait>( &'life0 self, object_id: ObjectID, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaObjectResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the object information for a specified object

source

fn multi_get_objects<'life0, 'async_trait>( &'life0 self, object_ids: Vec<ObjectID>, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaObjectResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the object data for a list of objects

source

fn try_get_past_object<'life0, 'async_trait>( &'life0 self, object_id: ObjectID, version: SequenceNumber, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaPastObjectResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version

source

fn try_get_object_before_version<'life0, 'async_trait>( &'life0 self, object_id: ObjectID, version: SequenceNumber, ) -> Pin<Box<dyn Future<Output = RpcResult<IotaPastObjectResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Returns the latest object information with a version less than or equal to the given version

source

fn try_multi_get_past_objects<'life0, 'async_trait>( &'life0 self, past_objects: Vec<IotaGetPastObjectRequest>, options: Option<IotaObjectDataOptions>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaPastObjectResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version

source

fn get_checkpoint<'life0, 'async_trait>( &'life0 self, id: CheckpointId, ) -> Pin<Box<dyn Future<Output = RpcResult<Checkpoint>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a checkpoint

source

fn get_checkpoints<'life0, 'async_trait>( &'life0 self, cursor: Option<BigInt<u64>>, limit: Option<usize>, descending_order: bool, ) -> Pin<Box<dyn Future<Output = RpcResult<CheckpointPage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return paginated list of checkpoints

source

fn get_events<'life0, 'async_trait>( &'life0 self, transaction_digest: TransactionDigest, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IotaEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return transaction events.

source

fn get_total_transaction_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<BigInt<u64>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the total number of transaction blocks known to the server.

source

fn get_latest_checkpoint_sequence_number<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<BigInt<u64>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the sequence number of the latest checkpoint that has been executed

source

fn get_protocol_config<'life0, 'async_trait>( &'life0 self, version: Option<BigInt<u64>>, ) -> Pin<Box<dyn Future<Output = RpcResult<ProtocolConfigResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the protocol config table for the given version number. If the version number is not specified, If none is specified, the node uses the version of the latest epoch it has processed.

source

fn get_chain_identifier<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the first four bytes of the chain’s genesis checkpoint digest.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§