pub trait Api:
    Send
    + Sync
    + 'static {
Show 14 methods // Required methods fn apply_block<'life0, 'async_trait>( &'life0 self, request: Request<ApplyBlockRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ApplyBlockResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn check_nullifiers<'life0, 'async_trait>( &'life0 self, request: Request<CheckNullifiersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CheckNullifiersResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn check_nullifiers_by_prefix<'life0, 'async_trait>( &'life0 self, request: Request<CheckNullifiersByPrefixRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CheckNullifiersByPrefixResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_account_details<'life0, 'async_trait>( &'life0 self, request: Request<GetAccountDetailsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetAccountDetailsResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_account_proofs<'life0, 'async_trait>( &'life0 self, request: Request<GetAccountProofsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetAccountProofsResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_account_state_delta<'life0, 'async_trait>( &'life0 self, request: Request<GetAccountStateDeltaRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetAccountStateDeltaResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_block_by_number<'life0, 'async_trait>( &'life0 self, request: Request<GetBlockByNumberRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockByNumberResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_block_header_by_number<'life0, 'async_trait>( &'life0 self, request: Request<GetBlockHeaderByNumberRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockHeaderByNumberResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_block_inputs<'life0, 'async_trait>( &'life0 self, request: Request<GetBlockInputsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockInputsResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_note_authentication_info<'life0, 'async_trait>( &'life0 self, request: Request<GetNoteAuthenticationInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNoteAuthenticationInfoResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_notes_by_id<'life0, 'async_trait>( &'life0 self, request: Request<GetNotesByIdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNotesByIdResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_transaction_inputs<'life0, 'async_trait>( &'life0 self, request: Request<GetTransactionInputsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetTransactionInputsResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_notes<'life0, 'async_trait>( &'life0 self, request: Request<SyncNoteRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SyncNoteResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_state<'life0, 'async_trait>( &'life0 self, request: Request<SyncStateRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SyncStateResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with ApiServer.

Required Methods§

Source

fn apply_block<'life0, 'async_trait>( &'life0 self, request: Request<ApplyBlockRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<ApplyBlockResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Applies changes of a new block to the DB and in-memory data structures.

Source

fn check_nullifiers<'life0, 'async_trait>( &'life0 self, request: Request<CheckNullifiersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CheckNullifiersResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a nullifier proof for each of the requested nullifiers.

Source

fn check_nullifiers_by_prefix<'life0, 'async_trait>( &'life0 self, request: Request<CheckNullifiersByPrefixRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<CheckNullifiersByPrefixResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of nullifiers that match the specified prefixes and are recorded in the node.

Note that only 16-bit prefixes are supported at this time.

Source

fn get_account_details<'life0, 'async_trait>( &'life0 self, request: Request<GetAccountDetailsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetAccountDetailsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the latest state of an account with the specified ID.

Source

fn get_account_proofs<'life0, 'async_trait>( &'life0 self, request: Request<GetAccountProofsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetAccountProofsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the latest state proofs of the specified accounts.

Source

fn get_account_state_delta<'life0, 'async_trait>( &'life0 self, request: Request<GetAccountStateDeltaRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetAccountStateDeltaResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns delta of the account states in the range from from_block_num (exclusive) to to_block_num (inclusive).

Source

fn get_block_by_number<'life0, 'async_trait>( &'life0 self, request: Request<GetBlockByNumberRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockByNumberResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns raw block data for the specified block number.

Source

fn get_block_header_by_number<'life0, 'async_trait>( &'life0 self, request: Request<GetBlockHeaderByNumberRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockHeaderByNumberResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves block header by given block number. Optionally, it also returns the MMR path and current chain length to authenticate the block’s inclusion.

Source

fn get_block_inputs<'life0, 'async_trait>( &'life0 self, request: Request<GetBlockInputsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockInputsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns data required to prove the next block.

Source

fn get_note_authentication_info<'life0, 'async_trait>( &'life0 self, request: Request<GetNoteAuthenticationInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNoteAuthenticationInfoResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of Note inclusion proofs for the specified Note IDs.

Source

fn get_notes_by_id<'life0, 'async_trait>( &'life0 self, request: Request<GetNotesByIdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetNotesByIdResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of notes matching the provided note IDs.

Source

fn get_transaction_inputs<'life0, 'async_trait>( &'life0 self, request: Request<GetTransactionInputsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetTransactionInputsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns data required to validate a new transaction.

Source

fn sync_notes<'life0, 'async_trait>( &'life0 self, request: Request<SyncNoteRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SyncNoteResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns info which can be used by the client to sync up to the tip of chain for the notes they are interested in.

Client specifies the note_tags they are interested in, and the block height from which to search for new for matching notes for. The request will then return the next block containing any note matching the provided tags.

The response includes each note’s metadata and inclusion proof.

A basic note sync can be implemented by repeatedly requesting the previous response’s block until reaching the tip of the chain.

Source

fn sync_state<'life0, 'async_trait>( &'life0 self, request: Request<SyncStateRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SyncStateResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns info which can be used by the client to sync up to the latest state of the chain for the objects (accounts, notes, nullifiers) the client is interested in.

This request returns the next block containing requested data. It also returns chain_tip which is the latest block number in the chain. Client is expected to repeat these requests in a loop until response.block_header.block_num == response.chain_tip, at which point the client is fully synchronized with the chain.

Each request also returns info about new notes, nullifiers etc. created. It also returns Chain MMR delta that can be used to update the state of Chain MMR. This includes both chain MMR peaks and chain MMR nodes.

For preserving some degree of privacy, note tags and nullifiers filters contain only high part of hashes. Thus, returned data contains excessive notes and nullifiers, client can make additional filtering of that data on its side.

Implementors§