pub trait NodeRpcClient: Send + Sync {
Show 29 methods
// Required methods
fn set_genesis_commitment<'life0, 'async_trait>(
&'life0 self,
commitment: Word,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn has_genesis_commitment(&self) -> Option<Word>;
fn submit_proven_transaction<'life0, 'async_trait>(
&'life0 self,
proven_transaction: ProvenTransaction,
transaction_inputs: TransactionInputs,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit_proven_batch<'life0, 'async_trait>(
&'life0 self,
proven_batch: ProvenBatch,
proposed_batch: ProposedBatch,
transaction_inputs: Vec<TransactionInputs>,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_num: Option<BlockNumber>,
include_mmr_proof: bool,
) -> Pin<Box<dyn Future<Output = Result<(BlockHeader, Option<MmrProof>), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
include_proof: bool,
) -> Pin<Box<dyn Future<Output = Result<ProvenBlock, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_notes_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
note_ids: &'life1 [NoteId],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedNote>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sync_chain_mmr<'life0, 'async_trait>(
&'life0 self,
current_block_height: BlockNumber,
upper_bound: SyncTarget,
) -> Pin<Box<dyn Future<Output = Result<ChainMmrInfo, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_notes<'life0, 'life1, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
note_tags: &'life1 BTreeSet<NoteTag>,
) -> Pin<Box<dyn Future<Output = Result<Vec<NoteSyncBlock>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sync_nullifiers<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 [u16],
block_from: BlockNumber,
block_to: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Vec<NullifierUpdate>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
request: GetAccountRequest,
) -> Pin<Box<dyn Future<Output = Result<(BlockNumber, AccountProof), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_note_script_by_root<'life0, 'async_trait>(
&'life0 self,
root: Word,
) -> Pin<Box<dyn Future<Output = Result<Option<NoteScript>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_storage_maps<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<StorageMapInfo, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_account_vault<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<AccountVaultInfo, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_transactions<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_ids: Vec<AccountId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_network_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkId, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_rpc_limits<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RpcLimits, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn has_rpc_limits(&self) -> Option<RpcLimits>;
fn set_rpc_limits<'life0, 'async_trait>(
&'life0 self,
limits: RpcLimits,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_status_unversioned<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RpcStatusInfo, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_network_note_status<'life0, 'async_trait>(
&'life0 self,
note_id: NoteId,
) -> Pin<Box<dyn Future<Output = Result<NetworkNoteStatusInfo, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn get_account_details<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn sync_notes_with_details<'life0, 'life1, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
note_tags: &'life1 BTreeSet<NoteTag>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<NoteSyncBlock>, BTreeMap<NoteId, SyncedNoteDetails>), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn resolve_oversize_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: AccountId,
block_to: BlockNumber,
details: &'life1 mut AccountDetails,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn resolve_oversize_storage_maps<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: AccountId,
block_to: BlockNumber,
details: &'life1 mut AccountDetails,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_nullifier_commit_heights<'life0, 'async_trait>(
&'life0 self,
requested_nullifiers: BTreeSet<Nullifier>,
block_from: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Nullifier, Option<BlockNumber>>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_public_note_records<'life0, 'life1, 'async_trait>(
&'life0 self,
note_ids: &'life1 [NoteId],
current_timestamp: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_block_header_with_proof<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<(BlockHeader, MmrProof), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_note_by_id<'life0, 'async_trait>(
&'life0 self,
note_id: NoteId,
) -> Pin<Box<dyn Future<Output = Result<FetchedNote, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Defines the interface for communicating with the Miden node.
The implementers are responsible for connecting to the Miden node, handling endpoint requests/responses, and translating responses into domain objects relevant for each of the endpoints.
Required Methods§
Sourcefn set_genesis_commitment<'life0, 'async_trait>(
&'life0 self,
commitment: Word,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_genesis_commitment<'life0, 'async_trait>(
&'life0 self,
commitment: Word,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the genesis commitment for the client and reconnects to the node providing the genesis commitment in the request headers. If the genesis commitment is already set, this method does nothing.
Sourcefn has_genesis_commitment(&self) -> Option<Word>
fn has_genesis_commitment(&self) -> Option<Word>
Returns the genesis commitment if it has been set, without fetching from the node.
Sourcefn submit_proven_transaction<'life0, 'async_trait>(
&'life0 self,
proven_transaction: ProvenTransaction,
transaction_inputs: TransactionInputs,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_proven_transaction<'life0, 'async_trait>(
&'life0 self,
proven_transaction: ProvenTransaction,
transaction_inputs: TransactionInputs,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Given a Proven Transaction, send it to the node for it to be included in a future block
using the /SubmitProvenTransaction RPC endpoint.
Returns the node’s chain tip at submission (not the block the transaction is committed in).
Sourcefn submit_proven_batch<'life0, 'async_trait>(
&'life0 self,
proven_batch: ProvenBatch,
proposed_batch: ProposedBatch,
transaction_inputs: Vec<TransactionInputs>,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_proven_batch<'life0, 'async_trait>(
&'life0 self,
proven_batch: ProvenBatch,
proposed_batch: ProposedBatch,
transaction_inputs: Vec<TransactionInputs>,
) -> Pin<Box<dyn Future<Output = Result<BlockNumber, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Given a Proven Batch together with the corresponding ProposedBatch and the list of
TransactionInputs (one per transaction, matching the ordering of the batch), sends
the batch to the node for inclusion in a future block using the /SubmitProvenBatch
RPC endpoint. All transactions in the batch must build on the current mempool state
following normal transaction submission rules.
Returns the node’s chain tip at submission (not the block the batch is committed in).
Sourcefn get_block_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_num: Option<BlockNumber>,
include_mmr_proof: bool,
) -> Pin<Box<dyn Future<Output = Result<(BlockHeader, Option<MmrProof>), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_header_by_number<'life0, 'async_trait>(
&'life0 self,
block_num: Option<BlockNumber>,
include_mmr_proof: bool,
) -> Pin<Box<dyn Future<Output = Result<(BlockHeader, Option<MmrProof>), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Given a block number, fetches the block header corresponding to that height from the node
using the /GetBlockHeaderByNumber endpoint.
If include_mmr_proof is set to true and the function returns an Ok, the second value
of the return tuple should always be Some(MmrProof).
When None is provided, returns info regarding the latest block.
Sourcefn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
include_proof: bool,
) -> Pin<Box<dyn Future<Output = Result<ProvenBlock, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_by_number<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
include_proof: bool,
) -> Pin<Box<dyn Future<Output = Result<ProvenBlock, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Given a block number, fetches the block corresponding to that height from the node using
the /GetBlockByNumber RPC endpoint.
If include_proof is set to true, the block proof will be included in the response.
Sourcefn get_notes_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
note_ids: &'life1 [NoteId],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedNote>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_notes_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
note_ids: &'life1 [NoteId],
) -> Pin<Box<dyn Future<Output = Result<Vec<FetchedNote>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches note-related data for a list of NoteId using the /GetNotesById
RPC endpoint.
For miden_protocol::note::NoteType::Private notes, the response includes only the
miden_protocol::note::NoteMetadata.
For miden_protocol::note::NoteType::Public notes, the response includes all note details
(recipient, assets, script, etc.).
In both cases, a miden_protocol::note::NoteInclusionProof is returned so the caller can
verify that each note is part of the block’s note tree.
Sourcefn sync_chain_mmr<'life0, 'async_trait>(
&'life0 self,
current_block_height: BlockNumber,
upper_bound: SyncTarget,
) -> Pin<Box<dyn Future<Output = Result<ChainMmrInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_chain_mmr<'life0, 'async_trait>(
&'life0 self,
current_block_height: BlockNumber,
upper_bound: SyncTarget,
) -> Pin<Box<dyn Future<Output = Result<ChainMmrInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the MMR delta for a given block range using the /SyncChainMmr RPC endpoint.
current_block_heightis the last block number already present in the caller’s MMR.upper_bounddetermines the upper bound of the sync range. Can be a specific block number (BlockNumber), or a chain tip finality level:CommittedChainTipsyncs up to the latest committed block (the chain tip), whileProvenChainTipsyncs up to the latest proven block which may be behind the committed tip.
Sourcefn sync_notes<'life0, 'life1, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
note_tags: &'life1 BTreeSet<NoteTag>,
) -> Pin<Box<dyn Future<Output = Result<Vec<NoteSyncBlock>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sync_notes<'life0, 'life1, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
note_tags: &'life1 BTreeSet<NoteTag>,
) -> Pin<Box<dyn Future<Output = Result<Vec<NoteSyncBlock>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches notes related to the specified tags using the /SyncNotes RPC endpoint,
paginating over the full block range and returning, in block-number order, every block in
that range that contains at least one note matching the requested tags.
block_from: The starting block number for the range (inclusive).block_to: The ending block number for the range (inclusive).note_tagsis the set of tags used to filter the notes the client is interested in.
Notes with attachments will have header-only metadata after this call; use
NodeRpcClient::sync_notes_with_details to also resolve their full metadata and
fetch public note bodies in a single follow-up call.
Sourcefn sync_nullifiers<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 [u16],
block_from: BlockNumber,
block_to: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Vec<NullifierUpdate>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sync_nullifiers<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 [u16],
block_from: BlockNumber,
block_to: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<Vec<NullifierUpdate>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches the nullifiers corresponding to a list of prefixes using the
/SyncNullifiers RPC endpoint.
prefixis a list of nullifiers prefixes to search for.block_from: The starting block number for the range (inclusive).block_to: The ending block number for the range (inclusive).
Sourcefn get_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
request: GetAccountRequest,
) -> Pin<Box<dyn Future<Output = Result<(BlockNumber, AccountProof), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
request: GetAccountRequest,
) -> Pin<Box<dyn Future<Output = Result<(BlockNumber, AccountProof), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the account from the node, using the /GetAccount endpoint.
The response carries an
AccountWitness and the target
block. Public accounts additionally get AccountDetails; for private accounts the
other request fields are ignored.
For a fully oversize-resolved account, use NodeRpcClient::get_account_details.
Errors if the account isn’t found.
Sourcefn get_note_script_by_root<'life0, 'async_trait>(
&'life0 self,
root: Word,
) -> Pin<Box<dyn Future<Output = Result<Option<NoteScript>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note_script_by_root<'life0, 'async_trait>(
&'life0 self,
root: Word,
) -> Pin<Box<dyn Future<Output = Result<Option<NoteScript>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the note script with the specified root, returning None if the node has no script
registered for that root.
Implementations must verify that a returned script’s root matches the requested root and
return RpcError::InvalidResponse otherwise; callers may rely on this invariant.
Errors:
RpcError::InvalidResponseif the node returns a script whose root does not match the requestedroot.
Sourcefn sync_storage_maps<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<StorageMapInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_storage_maps<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<StorageMapInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches storage map updates for specified account and storage slots within a block range,
using the /SyncStorageMaps RPC endpoint.
block_from: The starting block number for the range (inclusive).block_to: The ending block number for the range (inclusive). The node rejects values greater than the chain tip.account_id: The account ID for which to fetch storage map updates.
Sourcefn sync_account_vault<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<AccountVaultInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_account_vault<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<AccountVaultInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches account vault updates for specified account within a block range,
using the /SyncAccountVault RPC endpoint.
block_from: The starting block number for the range (inclusive).block_to: The ending block number for the range (inclusive). The node rejects values greater than the chain tip.account_id: The account ID for which to fetch storage map updates.
Sourcefn sync_transactions<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_ids: Vec<AccountId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_transactions<'life0, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
account_ids: Vec<AccountId>,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionRecord>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches transaction records for specific accounts within a block range using the
/SyncTransactions RPC endpoint.
block_from: The starting block number for the range (inclusive).block_to: The ending block number for the range (inclusive).account_ids: The account IDs for which to fetch transactions.
Sourcefn get_network_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkId, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkId, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the network ID of the node. Errors:
RpcError::ExpectedDataMissingif the note with the specified root is not found.
Sourcefn get_rpc_limits<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RpcLimits, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_rpc_limits<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RpcLimits, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the RPC limits configured on the node.
Implementations may cache the result internally to avoid repeated network calls.
Sourcefn has_rpc_limits(&self) -> Option<RpcLimits>
fn has_rpc_limits(&self) -> Option<RpcLimits>
Returns the RPC limits if they have been set, without fetching from the node.
Sourcefn set_rpc_limits<'life0, 'async_trait>(
&'life0 self,
limits: RpcLimits,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_rpc_limits<'life0, 'async_trait>(
&'life0 self,
limits: RpcLimits,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the RPC limits internally to be used by the client.
Sourcefn get_status_unversioned<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RpcStatusInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_status_unversioned<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RpcStatusInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the RPC status without requiring Accept header validation.
This is useful for diagnostics when version negotiation fails, as it allows retrieving node information even when there’s a version mismatch.
Sourcefn get_network_note_status<'life0, 'async_trait>(
&'life0 self,
note_id: NoteId,
) -> Pin<Box<dyn Future<Output = Result<NetworkNoteStatusInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_note_status<'life0, 'async_trait>(
&'life0 self,
note_id: NoteId,
) -> Pin<Box<dyn Future<Output = Result<NetworkNoteStatusInfo, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the status of a specific network note ID.
This is useful for debugging when a network note fails.
Provided Methods§
Sourcefn get_account_details<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_account_details<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the full state of a public account from the node using the /GetAccount endpoint,
and then resolves oversized vault and storage map entries via the SyncVault and
SyncStorageMap endpoints when needed.
account_idis the ID of the wanted account.
Returns Ok(None) for accounts without public state.
Sourcefn sync_notes_with_details<'life0, 'life1, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
note_tags: &'life1 BTreeSet<NoteTag>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<NoteSyncBlock>, BTreeMap<NoteId, SyncedNoteDetails>), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sync_notes_with_details<'life0, 'life1, 'async_trait>(
&'life0 self,
block_from: BlockNumber,
block_to: BlockNumber,
note_tags: &'life1 BTreeSet<NoteTag>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<NoteSyncBlock>, BTreeMap<NoteId, SyncedNoteDetails>), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calls NodeRpcClient::sync_notes for the requested range, then makes a single
NodeRpcClient::get_notes_by_id call to fetch full note bodies (scripts, assets,
recipient) for public notes and attachment content for private notes that carry
attachments.
All public notes in the range are fetched (not just the ones the client tracks) to avoid revealing which specific notes the client is interested in. Private notes are only fetched when their synced metadata indicates non-empty attachments, since the sync record carries attachment scheme markers but not the attachment content, which is needed to reconstruct the note’s ID.
Returns the resolved note blocks paired with a map of the fetched content (public note bodies and private-note attachments), keyed by note ID.
Sourcefn resolve_oversize_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: AccountId,
block_to: BlockNumber,
details: &'life1 mut AccountDetails,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_oversize_vault<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: AccountId,
block_to: BlockNumber,
details: &'life1 mut AccountDetails,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fills in the asset list when the vault came back flagged too_many_assets, by
querying NodeRpcClient::sync_account_vault over [GENESIS, block_to]. No-op when
the flag isn’t set.
Sourcefn resolve_oversize_storage_maps<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: AccountId,
block_to: BlockNumber,
details: &'life1 mut AccountDetails,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_oversize_storage_maps<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: AccountId,
block_to: BlockNumber,
details: &'life1 mut AccountDetails,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fills in the entries of any storage map flagged too_many_entries, by querying
NodeRpcClient::sync_storage_maps over [GENESIS, block_to]. No-op when no map
has the flag set.
Sourcefn get_nullifier_commit_heights<'life0, 'async_trait>(
&'life0 self,
requested_nullifiers: BTreeSet<Nullifier>,
block_from: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Nullifier, Option<BlockNumber>>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_nullifier_commit_heights<'life0, 'async_trait>(
&'life0 self,
requested_nullifiers: BTreeSet<Nullifier>,
block_from: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Nullifier, Option<BlockNumber>>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the commit height where the nullifier was consumed. If the nullifier isn’t found,
then None is returned.
The block_num parameter is the block number to start the search from (inclusive).
The default implementation of this method makes two RPC requests: one to
NodeRpcClient::get_block_header_by_number to resolve the chain tip, and one to
NodeRpcClient::sync_nullifiers to search up to that tip.
Sourcefn get_public_note_records<'life0, 'life1, 'async_trait>(
&'life0 self,
note_ids: &'life1 [NoteId],
current_timestamp: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_public_note_records<'life0, 'life1, 'async_trait>(
&'life0 self,
note_ids: &'life1 [NoteId],
current_timestamp: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<InputNoteRecord>, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches public note-related data for a list of NoteId and builds InputNoteRecords
with it. If a note is not found or it’s private, it is ignored and will not be included
in the returned list.
The default implementation of this method uses NodeRpcClient::get_notes_by_id.
Sourcefn get_block_header_with_proof<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<(BlockHeader, MmrProof), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_header_with_proof<'life0, 'async_trait>(
&'life0 self,
block_num: BlockNumber,
) -> Pin<Box<dyn Future<Output = Result<(BlockHeader, MmrProof), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Given a block number, fetches the block header corresponding to that height from the node along with the MMR proof.
The default implementation of this method uses
NodeRpcClient::get_block_header_by_number.
Sourcefn get_note_by_id<'life0, 'async_trait>(
&'life0 self,
note_id: NoteId,
) -> Pin<Box<dyn Future<Output = Result<FetchedNote, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note_by_id<'life0, 'async_trait>(
&'life0 self,
note_id: NoteId,
) -> Pin<Box<dyn Future<Output = Result<FetchedNote, RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetches the note with the specified ID.
The default implementation of this method uses NodeRpcClient::get_notes_by_id.
Errors:
RpcError::NoteNotFoundif the note with the specified ID is not found.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl NodeRpcClient for GrpcClient
tonic only.impl NodeRpcClient for MockRpcApi
testing only.