pub trait ChainQuery {
// Required methods
fn get_network(&self) -> Network;
fn query_system_start(
&self,
) -> impl Future<Output = Result<DateTime<Utc>, ChainQueryError>>;
fn query_era_summaries(
&self,
) -> impl Future<Output = Result<Vec<EraSummary>, ChainQueryError>>;
fn query_protocol_params(
&self,
) -> impl Future<Output = Result<ProtocolParameters, ChainQueryError>>;
fn query_tip(
&self,
) -> impl Future<Output = Result<ChainTip, ChainQueryError>>;
fn query_utxos_by_addr(
&self,
address: &Address,
) -> impl Future<Output = Result<BTreeMap<TransactionInput, FullTransactionOutput>, ChainQueryError>>;
fn query_utxos_by_ref(
&self,
references: Vec<&TransactionInput>,
) -> impl Future<Output = Result<BTreeMap<TransactionInput, FullTransactionOutput>, ChainQueryError>>;
}
Expand description
A chain query client responsible for all read actions from the blockchain (no write)
Required Methods§
Sourcefn get_network(&self) -> Network
fn get_network(&self) -> Network
Query the network id (not identical to network magic)
fn query_system_start( &self, ) -> impl Future<Output = Result<DateTime<Utc>, ChainQueryError>>
fn query_era_summaries( &self, ) -> impl Future<Output = Result<Vec<EraSummary>, ChainQueryError>>
Sourcefn query_protocol_params(
&self,
) -> impl Future<Output = Result<ProtocolParameters, ChainQueryError>>
fn query_protocol_params( &self, ) -> impl Future<Output = Result<ProtocolParameters, ChainQueryError>>
Query protocol parameters
fn query_tip(&self) -> impl Future<Output = Result<ChainTip, ChainQueryError>>
Sourcefn query_utxos_by_addr(
&self,
address: &Address,
) -> impl Future<Output = Result<BTreeMap<TransactionInput, FullTransactionOutput>, ChainQueryError>>
fn query_utxos_by_addr( &self, address: &Address, ) -> impl Future<Output = Result<BTreeMap<TransactionInput, FullTransactionOutput>, ChainQueryError>>
Query UTxOs at an address
fn query_utxos_by_ref( &self, references: Vec<&TransactionInput>, ) -> impl Future<Output = Result<BTreeMap<TransactionInput, FullTransactionOutput>, ChainQueryError>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.