pub trait Provider {
Show 35 methods
// Required methods
fn spec_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn starknet_version<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_block_with_tx_hashes<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithTxHashes, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_block_with_txs<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithTxs, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_block_with_receipts<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithReceipts, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_state_update<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedStateUpdate, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_storage_at<'life0, 'async_trait, A, K, B>(
&'life0 self,
contract_address: A,
key: K,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
A: AsRef<Felt> + Send + Sync + 'async_trait,
K: AsRef<Felt> + Send + Sync + 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_messages_status<'life0, 'async_trait>(
&'life0 self,
transaction_hash: Hash256,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageStatus>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_transaction_status<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
H: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_transaction_by_hash<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<Transaction, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
H: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_transaction_by_block_id_and_index<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
index: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_transaction_receipt<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<TransactionReceiptWithBlockInfo, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
H: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_class<'life0, 'async_trait, B, H>(
&'life0 self,
block_id: B,
class_hash: H,
) -> Pin<Box<dyn Future<Output = Result<ContractClass, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
H: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_class_hash_at<'life0, 'async_trait, B, A>(
&'life0 self,
block_id: B,
contract_address: A,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
A: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_class_at<'life0, 'async_trait, B, A>(
&'life0 self,
block_id: B,
contract_address: A,
) -> Pin<Box<dyn Future<Output = Result<ContractClass, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
A: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_block_transaction_count<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<u64, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn call<'life0, 'async_trait, R, B>(
&'life0 self,
request: R,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
R: AsRef<FunctionCall> + Send + Sync + 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn estimate_fee<'life0, 'async_trait, R, S, B>(
&'life0 self,
request: R,
simulation_flags: S,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<FeeEstimate>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
R: AsRef<[BroadcastedTransaction]> + Send + Sync + 'async_trait,
S: AsRef<[SimulationFlagForEstimateFee]> + Send + Sync + 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn estimate_message_fee<'life0, 'async_trait, M, B>(
&'life0 self,
message: M,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MessageFeeEstimate, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
M: AsRef<MsgFromL1> + Send + Sync + 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn block_hash_and_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockHashAndNumber, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn chain_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn syncing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatusType, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_events<'life0, 'async_trait>(
&'life0 self,
filter: EventFilter,
continuation_token: Option<String>,
chunk_size: u64,
) -> Pin<Box<dyn Future<Output = Result<EventsPage, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_nonce<'life0, 'async_trait, B, A>(
&'life0 self,
block_id: B,
contract_address: A,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
A: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn get_storage_proof<'life0, 'async_trait, B, H, A, K>(
&'life0 self,
block_id: B,
class_hashes: H,
contract_addresses: A,
contracts_storage_keys: K,
) -> Pin<Box<dyn Future<Output = Result<StorageProof, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<ConfirmedBlockId> + Send + Sync + 'async_trait,
H: AsRef<[Felt]> + Send + Sync + 'async_trait,
A: AsRef<[Felt]> + Send + Sync + 'async_trait,
K: AsRef<[ContractStorageKeys]> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn add_invoke_transaction<'life0, 'async_trait, I>(
&'life0 self,
invoke_transaction: I,
) -> Pin<Box<dyn Future<Output = Result<InvokeTransactionResult, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
I: AsRef<BroadcastedInvokeTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn add_declare_transaction<'life0, 'async_trait, D>(
&'life0 self,
declare_transaction: D,
) -> Pin<Box<dyn Future<Output = Result<DeclareTransactionResult, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
D: AsRef<BroadcastedDeclareTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn add_deploy_account_transaction<'life0, 'async_trait, D>(
&'life0 self,
deploy_account_transaction: D,
) -> Pin<Box<dyn Future<Output = Result<DeployAccountTransactionResult, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
D: AsRef<BroadcastedDeployAccountTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn trace_transaction<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<TransactionTrace, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
H: AsRef<Felt> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn simulate_transactions<'life0, 'async_trait, B, T, S>(
&'life0 self,
block_id: B,
transactions: T,
simulation_flags: S,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimulatedTransaction>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
T: AsRef<[BroadcastedTransaction]> + Send + Sync + 'async_trait,
S: AsRef<[SimulationFlag]> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn trace_block_transactions<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionTraceWithHash>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<ConfirmedBlockId> + Send + Sync + 'async_trait,
Self: 'async_trait;
fn batch_requests<'life0, 'async_trait, R>(
&'life0 self,
requests: R,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProviderResponseData>, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
R: AsRef<[ProviderRequestData]> + Send + Sync + 'async_trait,
Self: 'async_trait;
// Provided methods
fn estimate_fee_single<'life0, 'async_trait, R, S, B>(
&'life0 self,
request: R,
simulation_flags: S,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<FeeEstimate, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
R: AsRef<BroadcastedTransaction> + Send + Sync + 'async_trait,
S: AsRef<[SimulationFlagForEstimateFee]> + Send + Sync + 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
Self: Sync + 'async_trait { ... }
fn simulate_transaction<'life0, 'async_trait, B, T, S>(
&'life0 self,
block_id: B,
transaction: T,
simulation_flags: S,
) -> Pin<Box<dyn Future<Output = Result<SimulatedTransaction, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
B: AsRef<BlockId> + Send + Sync + 'async_trait,
T: AsRef<BroadcastedTransaction> + Send + Sync + 'async_trait,
S: AsRef<[SimulationFlag]> + Send + Sync + 'async_trait,
Self: Sync + 'async_trait { ... }
}Expand description
A generic interface for any type allowing communication with a Starknet network.
Historically, the only official way to access the network is through the sequencer gateway,
implemented by SequencerGatewayProvider, which
has since been deprecated. Currently, the recommended way of accessing the network is via the
JSON-RPC specification, implemented with JsonRpcClient.
The legacy SequencerGatewayProvider still
implements this trait for backward compatibility reasons, but most of its methods no longer work
in practice, as public sequencer servers have generally block access to most methods.
Required Methods§
Sourcefn spec_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn spec_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns the version of the Starknet JSON-RPC specification being used.
Sourcefn starknet_version<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>
fn starknet_version<'life0, 'async_trait, B>( &'life0 self, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>
Returns the version of the Starknet being used.
Sourcefn get_block_with_tx_hashes<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithTxHashes, ProviderError>> + Send + 'async_trait>>
fn get_block_with_tx_hashes<'life0, 'async_trait, B>( &'life0 self, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithTxHashes, ProviderError>> + Send + 'async_trait>>
Gets block information with transaction hashes given the block id.
Sourcefn get_block_with_txs<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithTxs, ProviderError>> + Send + 'async_trait>>
fn get_block_with_txs<'life0, 'async_trait, B>( &'life0 self, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithTxs, ProviderError>> + Send + 'async_trait>>
Gets block information with full transactions given the block id.
Sourcefn get_block_with_receipts<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithReceipts, ProviderError>> + Send + 'async_trait>>
fn get_block_with_receipts<'life0, 'async_trait, B>( &'life0 self, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedBlockWithReceipts, ProviderError>> + Send + 'async_trait>>
Gets block information with full transactions and receipts given the block id.
Sourcefn get_state_update<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedStateUpdate, ProviderError>> + Send + 'async_trait>>
fn get_state_update<'life0, 'async_trait, B>( &'life0 self, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<MaybePreConfirmedStateUpdate, ProviderError>> + Send + 'async_trait>>
Gets the information about the result of executing the requested block.
Sourcefn get_storage_at<'life0, 'async_trait, A, K, B>(
&'life0 self,
contract_address: A,
key: K,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
fn get_storage_at<'life0, 'async_trait, A, K, B>( &'life0 self, contract_address: A, key: K, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
Gets the value of the storage at the given address and key.
Sourcefn get_messages_status<'life0, 'async_trait>(
&'life0 self,
transaction_hash: Hash256,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageStatus>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_messages_status<'life0, 'async_trait>(
&'life0 self,
transaction_hash: Hash256,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageStatus>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Given an l1 tx hash, returns the associated l1_handler tx hashes and statuses for all L1 ->
L2 messages sent by the l1 transaction, ordered by the l1 tx sending order
Sourcefn get_transaction_status<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, ProviderError>> + Send + 'async_trait>>
fn get_transaction_status<'life0, 'async_trait, H>( &'life0 self, transaction_hash: H, ) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, ProviderError>> + Send + 'async_trait>>
Gets the transaction status (possibly reflecting that the tx is still in the mempool, or dropped from it).
Sourcefn get_transaction_by_hash<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<Transaction, ProviderError>> + Send + 'async_trait>>
fn get_transaction_by_hash<'life0, 'async_trait, H>( &'life0 self, transaction_hash: H, ) -> Pin<Box<dyn Future<Output = Result<Transaction, ProviderError>> + Send + 'async_trait>>
Gets the details and status of a submitted transaction.
Sourcefn get_transaction_by_block_id_and_index<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
index: u64,
) -> Pin<Box<dyn Future<Output = Result<Transaction, ProviderError>> + Send + 'async_trait>>
fn get_transaction_by_block_id_and_index<'life0, 'async_trait, B>( &'life0 self, block_id: B, index: u64, ) -> Pin<Box<dyn Future<Output = Result<Transaction, ProviderError>> + Send + 'async_trait>>
Gets the details of a transaction by a given block id and index.
Sourcefn get_transaction_receipt<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<TransactionReceiptWithBlockInfo, ProviderError>> + Send + 'async_trait>>
fn get_transaction_receipt<'life0, 'async_trait, H>( &'life0 self, transaction_hash: H, ) -> Pin<Box<dyn Future<Output = Result<TransactionReceiptWithBlockInfo, ProviderError>> + Send + 'async_trait>>
Gets the details of a transaction by a given block number and index.
Sourcefn get_class<'life0, 'async_trait, B, H>(
&'life0 self,
block_id: B,
class_hash: H,
) -> Pin<Box<dyn Future<Output = Result<ContractClass, ProviderError>> + Send + 'async_trait>>
fn get_class<'life0, 'async_trait, B, H>( &'life0 self, block_id: B, class_hash: H, ) -> Pin<Box<dyn Future<Output = Result<ContractClass, ProviderError>> + Send + 'async_trait>>
Gets the contract class definition in the given block associated with the given hash.
Sourcefn get_class_hash_at<'life0, 'async_trait, B, A>(
&'life0 self,
block_id: B,
contract_address: A,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
fn get_class_hash_at<'life0, 'async_trait, B, A>( &'life0 self, block_id: B, contract_address: A, ) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
Gets the contract class hash in the given block for the contract deployed at the given address.
Sourcefn get_class_at<'life0, 'async_trait, B, A>(
&'life0 self,
block_id: B,
contract_address: A,
) -> Pin<Box<dyn Future<Output = Result<ContractClass, ProviderError>> + Send + 'async_trait>>
fn get_class_at<'life0, 'async_trait, B, A>( &'life0 self, block_id: B, contract_address: A, ) -> Pin<Box<dyn Future<Output = Result<ContractClass, ProviderError>> + Send + 'async_trait>>
Gets the contract class definition in the given block at the given address.
Sourcefn get_block_transaction_count<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<u64, ProviderError>> + Send + 'async_trait>>
fn get_block_transaction_count<'life0, 'async_trait, B>( &'life0 self, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<u64, ProviderError>> + Send + 'async_trait>>
Gets the number of transactions in a block given a block id.
Sourcefn call<'life0, 'async_trait, R, B>(
&'life0 self,
request: R,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, ProviderError>> + Send + 'async_trait>>
fn call<'life0, 'async_trait, R, B>( &'life0 self, request: R, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<Vec<Felt>, ProviderError>> + Send + 'async_trait>>
Calls a starknet function without creating a Starknet transaction.
Sourcefn estimate_fee<'life0, 'async_trait, R, S, B>(
&'life0 self,
request: R,
simulation_flags: S,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<FeeEstimate>, ProviderError>> + Send + 'async_trait>>
fn estimate_fee<'life0, 'async_trait, R, S, B>( &'life0 self, request: R, simulation_flags: S, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeEstimate>, ProviderError>> + Send + 'async_trait>>
Estimates the fee for a given Starknet transaction.
Sourcefn estimate_message_fee<'life0, 'async_trait, M, B>(
&'life0 self,
message: M,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<MessageFeeEstimate, ProviderError>> + Send + 'async_trait>>
fn estimate_message_fee<'life0, 'async_trait, M, B>( &'life0 self, message: M, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<MessageFeeEstimate, ProviderError>> + Send + 'async_trait>>
Estimates the fee for sending an L1-to-L2 message.
Sourcefn block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the most recent accepted block number.
Sourcefn block_hash_and_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockHashAndNumber, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_hash_and_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockHashAndNumber, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Gets the most recent accepted block hash and number.
Sourcefn chain_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn chain_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns the currently configured Starknet chain id.
Sourcefn syncing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatusType, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn syncing<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatusType, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns an object about the sync status, or false if the node is not synching.
Sourcefn get_events<'life0, 'async_trait>(
&'life0 self,
filter: EventFilter,
continuation_token: Option<String>,
chunk_size: u64,
) -> Pin<Box<dyn Future<Output = Result<EventsPage, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_events<'life0, 'async_trait>(
&'life0 self,
filter: EventFilter,
continuation_token: Option<String>,
chunk_size: u64,
) -> Pin<Box<dyn Future<Output = Result<EventsPage, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Returns all events matching the given filter.
Sourcefn get_nonce<'life0, 'async_trait, B, A>(
&'life0 self,
block_id: B,
contract_address: A,
) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
fn get_nonce<'life0, 'async_trait, B, A>( &'life0 self, block_id: B, contract_address: A, ) -> Pin<Box<dyn Future<Output = Result<Felt, ProviderError>> + Send + 'async_trait>>
Gets the nonce associated with the given address in the given block.
Sourcefn get_storage_proof<'life0, 'async_trait, B, H, A, K>(
&'life0 self,
block_id: B,
class_hashes: H,
contract_addresses: A,
contracts_storage_keys: K,
) -> Pin<Box<dyn Future<Output = Result<StorageProof, ProviderError>> + Send + 'async_trait>>
fn get_storage_proof<'life0, 'async_trait, B, H, A, K>( &'life0 self, block_id: B, class_hashes: H, contract_addresses: A, contracts_storage_keys: K, ) -> Pin<Box<dyn Future<Output = Result<StorageProof, ProviderError>> + Send + 'async_trait>>
Get merkle paths in one of the state tries: global state, classes, individual contract. A single request can query for any mix of the three types of storage proofs (classes, contracts, and storage).
Sourcefn add_invoke_transaction<'life0, 'async_trait, I>(
&'life0 self,
invoke_transaction: I,
) -> Pin<Box<dyn Future<Output = Result<InvokeTransactionResult, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
I: AsRef<BroadcastedInvokeTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn add_invoke_transaction<'life0, 'async_trait, I>(
&'life0 self,
invoke_transaction: I,
) -> Pin<Box<dyn Future<Output = Result<InvokeTransactionResult, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
I: AsRef<BroadcastedInvokeTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait,
Submits a new transaction to be added to the chain.
Sourcefn add_declare_transaction<'life0, 'async_trait, D>(
&'life0 self,
declare_transaction: D,
) -> Pin<Box<dyn Future<Output = Result<DeclareTransactionResult, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
D: AsRef<BroadcastedDeclareTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn add_declare_transaction<'life0, 'async_trait, D>(
&'life0 self,
declare_transaction: D,
) -> Pin<Box<dyn Future<Output = Result<DeclareTransactionResult, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
D: AsRef<BroadcastedDeclareTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait,
Submits a new transaction to be added to the chain.
Sourcefn add_deploy_account_transaction<'life0, 'async_trait, D>(
&'life0 self,
deploy_account_transaction: D,
) -> Pin<Box<dyn Future<Output = Result<DeployAccountTransactionResult, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
D: AsRef<BroadcastedDeployAccountTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn add_deploy_account_transaction<'life0, 'async_trait, D>(
&'life0 self,
deploy_account_transaction: D,
) -> Pin<Box<dyn Future<Output = Result<DeployAccountTransactionResult, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
D: AsRef<BroadcastedDeployAccountTransactionV3> + Send + Sync + 'async_trait,
Self: 'async_trait,
Submits a new deploy account transaction.
Sourcefn trace_transaction<'life0, 'async_trait, H>(
&'life0 self,
transaction_hash: H,
) -> Pin<Box<dyn Future<Output = Result<TransactionTrace, ProviderError>> + Send + 'async_trait>>
fn trace_transaction<'life0, 'async_trait, H>( &'life0 self, transaction_hash: H, ) -> Pin<Box<dyn Future<Output = Result<TransactionTrace, ProviderError>> + Send + 'async_trait>>
For a given executed transaction, returns the trace of its execution, including internal calls.
Sourcefn simulate_transactions<'life0, 'async_trait, B, T, S>(
&'life0 self,
block_id: B,
transactions: T,
simulation_flags: S,
) -> Pin<Box<dyn Future<Output = Result<Vec<SimulatedTransaction>, ProviderError>> + Send + 'async_trait>>
fn simulate_transactions<'life0, 'async_trait, B, T, S>( &'life0 self, block_id: B, transactions: T, simulation_flags: S, ) -> Pin<Box<dyn Future<Output = Result<Vec<SimulatedTransaction>, ProviderError>> + Send + 'async_trait>>
Simulates a given sequence of transactions on the requested state, and generate the execution traces. Note that some of the transactions may revert, in which case no error is thrown, but revert details can be seen on the returned trace object.
Note that some of the transactions may revert, this will be reflected by the revert_error
property in the trace. Other types of failures (e.g. unexpected error or failure in the
validation phase) will result in TRANSACTION_EXECUTION_ERROR.
Sourcefn trace_block_transactions<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionTraceWithHash>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
B: AsRef<ConfirmedBlockId> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn trace_block_transactions<'life0, 'async_trait, B>(
&'life0 self,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionTraceWithHash>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
B: AsRef<ConfirmedBlockId> + Send + Sync + 'async_trait,
Self: 'async_trait,
Retrieves traces for all transactions in the given block.
Sourcefn batch_requests<'life0, 'async_trait, R>(
&'life0 self,
requests: R,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProviderResponseData>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
R: AsRef<[ProviderRequestData]> + Send + Sync + 'async_trait,
Self: 'async_trait,
fn batch_requests<'life0, 'async_trait, R>(
&'life0 self,
requests: R,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProviderResponseData>, ProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
R: AsRef<[ProviderRequestData]> + Send + Sync + 'async_trait,
Self: 'async_trait,
Sends multiple requests in parallel. The function call fails if any of the requests fails. Implementations must guarantee that responses follow the exact order as the requests.
Provided Methods§
Sourcefn estimate_fee_single<'life0, 'async_trait, R, S, B>(
&'life0 self,
request: R,
simulation_flags: S,
block_id: B,
) -> Pin<Box<dyn Future<Output = Result<FeeEstimate, ProviderError>> + Send + 'async_trait>>
fn estimate_fee_single<'life0, 'async_trait, R, S, B>( &'life0 self, request: R, simulation_flags: S, block_id: B, ) -> Pin<Box<dyn Future<Output = Result<FeeEstimate, ProviderError>> + Send + 'async_trait>>
Same as estimate_fee, but only with one estimate.
Sourcefn simulate_transaction<'life0, 'async_trait, B, T, S>(
&'life0 self,
block_id: B,
transaction: T,
simulation_flags: S,
) -> Pin<Box<dyn Future<Output = Result<SimulatedTransaction, ProviderError>> + Send + 'async_trait>>
fn simulate_transaction<'life0, 'async_trait, B, T, S>( &'life0 self, block_id: B, transaction: T, simulation_flags: S, ) -> Pin<Box<dyn Future<Output = Result<SimulatedTransaction, ProviderError>> + Send + 'async_trait>>
Same as simulate_transactions, but only with one simulation.
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.