pub trait Api:
Send
+ Sync
+ 'static {
type BlockSubscriptionStream: Stream<Item = Result<BlockSubscriptionResponse, Status>> + Send + 'static;
type ProofSubscriptionStream: Stream<Item = Result<ProofSubscriptionResponse, Status>> + Send + 'static;
Show 19 methods
// Required methods
fn status<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<RpcStatus>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_limits<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<RpcLimits>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_account<'life0, 'async_trait>(
&'life0 self,
request: Request<AccountRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AccountResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MaybeBlock>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_header_by_number<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockHeaderByNumberRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockHeaderByNumberResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_notes_by_id<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteIdList>,
) -> Pin<Box<dyn Future<Output = Result<Response<CommittedNoteList>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_note_script_by_root<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteScriptRoot>,
) -> Pin<Box<dyn Future<Output = Result<Response<MaybeNoteScript>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction_encryption_key<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionEncryptionKey>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit_proven_tx<'life0, 'async_trait>(
&'life0 self,
request: Request<ProvenTransaction>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockNumber>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit_proven_tx_batch<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionBatch>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockNumber>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_transactions<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncTransactionsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncTransactionsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_notes<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncNotesRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncNotesResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_nullifiers<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncNullifiersRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncNullifiersResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_account_vault<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncAccountVaultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncAccountVaultResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_account_storage_maps<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncAccountStorageMapsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncAccountStorageMapsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_chain_mmr<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncChainMmrRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncChainMmrResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn proof_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<ProofSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ProofSubscriptionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_network_note_status<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteId>,
) -> Pin<Box<dyn Future<Output = Result<Response<GetNetworkNoteStatusResponse>, 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 Associated Types§
Sourcetype BlockSubscriptionStream: Stream<Item = Result<BlockSubscriptionResponse, Status>> + Send + 'static
type BlockSubscriptionStream: Stream<Item = Result<BlockSubscriptionResponse, Status>> + Send + 'static
Server streaming response type for the BlockSubscription method.
Sourcetype ProofSubscriptionStream: Stream<Item = Result<ProofSubscriptionResponse, Status>> + Send + 'static
type ProofSubscriptionStream: Stream<Item = Result<ProofSubscriptionResponse, Status>> + Send + 'static
Server streaming response type for the ProofSubscription method.
Required Methods§
Sourcefn status<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<RpcStatus>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<RpcStatus>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the status info of the node.
Sourcefn get_limits<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<RpcLimits>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_limits<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<RpcLimits>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the query parameter limits configured for RPC methods.
These define the maximum number of each parameter a method will accept. Exceeding the limit will result in the request being rejected and you should instead send multiple smaller requests.
Sourcefn get_account<'life0, 'async_trait>(
&'life0 self,
request: Request<AccountRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AccountResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account<'life0, 'async_trait>(
&'life0 self,
request: Request<AccountRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<AccountResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the latest details of the specified account.
Sourcefn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MaybeBlock>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MaybeBlock>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns raw block data for the specified block number, optionally including the block proof.
Sourcefn get_block_header_by_number<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockHeaderByNumberRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockHeaderByNumberResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_header_by_number<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockHeaderByNumberRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockHeaderByNumberResponse>, 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.
Sourcefn get_notes_by_id<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteIdList>,
) -> Pin<Box<dyn Future<Output = Result<Response<CommittedNoteList>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_notes_by_id<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteIdList>,
) -> Pin<Box<dyn Future<Output = Result<Response<CommittedNoteList>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a list of notes matching the provided note IDs.
Sourcefn get_note_script_by_root<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteScriptRoot>,
) -> Pin<Box<dyn Future<Output = Result<Response<MaybeNoteScript>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note_script_by_root<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteScriptRoot>,
) -> Pin<Box<dyn Future<Output = Result<Response<MaybeNoteScript>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the script for a note by its root.
Sourcefn get_transaction_encryption_key<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionEncryptionKey>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction_encryption_key<'life0, 'async_trait>(
&'life0 self,
request: Request<()>,
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionEncryptionKey>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the public key that clients use to encrypt the private inputs of the transactions they submit, so that validators can decrypt and validate them.
Every validator in the set is provisioned with the same encryption keypair, so the returned public key is identical regardless of which validator attests it. The key carries a list of validator attestations, currently containing a single one. Since all validators vouch for the same key, an attestation verifiable against any chain-recognized validator signing key is sufficient.
Sourcefn submit_proven_tx<'life0, 'async_trait>(
&'life0 self,
request: Request<ProvenTransaction>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockNumber>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_proven_tx<'life0, 'async_trait>(
&'life0 self,
request: Request<ProvenTransaction>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockNumber>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submits proven transaction to the Miden network. Returns the node’s current block height.
Sourcefn submit_proven_tx_batch<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionBatch>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockNumber>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_proven_tx_batch<'life0, 'async_trait>(
&'life0 self,
request: Request<TransactionBatch>,
) -> Pin<Box<dyn Future<Output = Result<Response<BlockNumber>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submits a batch of transactions to the Miden network.
All transactions in this batch will be considered atomic, and be committed together or not all.
Returns the node’s current block height.
Sourcefn sync_transactions<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncTransactionsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncTransactionsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_transactions<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncTransactionsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncTransactionsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns transactions records for specific accounts within a block range.
Sourcefn sync_notes<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncNotesRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncNotesResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_notes<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncNotesRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncNotesResponse>, 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 range to search.
The response contains all blocks with matching notes that fit within the response payload
limit, along with each note’s metadata and inclusion proof.
If response.pagination_info.block_num is less than the requested range end, make
another request starting from response.pagination_info.block_num + 1 to continue syncing.
Sourcefn sync_nullifiers<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncNullifiersRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncNullifiersResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_nullifiers<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncNullifiersRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncNullifiersResponse>, 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.
Sourcefn sync_account_vault<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncAccountVaultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncAccountVaultResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_account_vault<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncAccountVaultRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncAccountVaultResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns account vault updates for specified account within a block range.
Sourcefn sync_account_storage_maps<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncAccountStorageMapsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncAccountStorageMapsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_account_storage_maps<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncAccountStorageMapsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncAccountStorageMapsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns storage map updates for specified account and storage slots within a block range.
Sourcefn sync_chain_mmr<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncChainMmrRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncChainMmrResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_chain_mmr<'life0, 'async_trait>(
&'life0 self,
request: Request<SyncChainMmrRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<SyncChainMmrResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns MMR delta needed to synchronize the chain MMR within the requested block range.
Sourcefn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<BlockSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::BlockSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streams committed blocks starting from the given block number (inclusive).
Replays historical blocks first, then streams live blocks as they are committed. On lag (replica falls too far behind), the stream is closed with a DATA_LOSS error and the client should reconnect from its local tip.
Sourcefn proof_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<ProofSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ProofSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn proof_subscription<'life0, 'async_trait>(
&'life0 self,
request: Request<ProofSubscriptionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ProofSubscriptionStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streams block proofs starting from the given block number (inclusive).
Replays existing proofs first, then streams new proofs as they are generated. On lag, the stream is closed with a DATA_LOSS error.
Sourcefn get_network_note_status<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteId>,
) -> Pin<Box<dyn Future<Output = Result<Response<GetNetworkNoteStatusResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_note_status<'life0, 'async_trait>(
&'life0 self,
request: Request<NoteId>,
) -> Pin<Box<dyn Future<Output = Result<Response<GetNetworkNoteStatusResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the current status of a network note.
The status indicates where the note is in its lifecycle: pending execution, processed (consumed by a transaction in the mempool), or discarded after too many failed attempts.
Returns NOT_FOUND if the note ID is not tracked by the network transaction builder.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".