SignerMiddleware

Struct SignerMiddleware 

Source
pub struct SignerMiddleware<M, S> { /* private fields */ }

Implementations§

Source§

impl<M: Middleware, S: Signer> SignerMiddleware<M, S>

Source

pub fn new(inner: M, signer: S) -> Self

Source

pub fn change_signer(self, signer: S) -> Self

Trait Implementations§

Source§

impl<M: Debug, S: Debug> Debug for SignerMiddleware<M, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M: Middleware, S: Signer + Debug + Sync + Send> Middleware for SignerMiddleware<M, S>

Source§

type Provider = <M as Middleware>::Provider

The JSON-RPC client type at the bottom of the stack
Source§

type Inner = M

The next-lower middleware in the middleware stack
Source§

fn inner(&self) -> &Self::Inner

Get a reference to the next-lower middleware in the middleware stack
Source§

fn is_signer(&self) -> bool

The function is_signer returns a boolean value indicating whether the inner object is a signer.
Source§

fn send_transaction_without_confirm<'life0, 'async_trait, T>( &'life0 self, tx: CreateTransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>
where T: 'async_trait + Send + DeserializeOwned, Self: 'async_trait, 'life0: 'async_trait,

If there is any signer middleware, will sign it first and then send it.
Source§

fn sign_transaction( &self, tx: &CreateTransactionRequest, ) -> Result<Signature, Error>

Source§

fn sign(&self, data: &[u8]) -> Result<Signature, Error>

Source§

fn provider(&self) -> &Provider<Self::Provider>

The HTTP or Websocket provider.
Source§

fn chainid(&self) -> u16

The chainid function returns the chain ID.
Source§

fn send_transaction<'life0, 'async_trait>( &'life0 self, tx: CreateTransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<Transaction<'_, Self::Provider>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends a transaction and returns a more higher-level response to work with on application layer.
Source§

fn create_transaction<'life0, 'async_trait, T>( &'life0 self, tx: CreateTransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>
where T: 'async_trait + Send + DeserializeOwned, Self: 'async_trait, 'life0: 'async_trait,

Directly calls CreateTransaction JSON-RPC endpoint.
Source§

fn get_transaction_status<'life0, 'life1, 'async_trait>( &'life0 self, tx_hash: &'life1 TxHash, ) -> Pin<Box<dyn Future<Output = Result<TransactionStatus, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The function get_transaction_status retrieves the status of a transaction identified by its hash. Read more
Source§

fn get_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_hash: &'life1 TxHash, ) -> Pin<Box<dyn Future<Output = Result<GetTransactionResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The function get_transaction retrieves a transaction using its hash. Read more
Source§

fn get_soft_confirmed_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx_hash: &'life1 TxHash, ) -> Pin<Box<dyn Future<Output = Result<GetTransactionResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_balance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<BalanceResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_current_ds_comm<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GetCurrentDsCommResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_ds_block<'life0, 'life1, 'async_trait>( &'life0 self, lock_num: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<DsBlock, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_ds_block_verbose<'life0, 'life1, 'async_trait>( &'life0 self, lock_num: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<DsBlockVerbose, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn ds_block_listing<'life0, 'async_trait>( &'life0 self, max: u32, ) -> Pin<Box<dyn Future<Output = Result<BlockList, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_tx_block<'life0, 'life1, 'async_trait>( &'life0 self, block_num: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TxBlock, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_tx_block_verbose<'life0, 'life1, 'async_trait>( &'life0 self, block_num: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TxBlockVerbose, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn tx_block_listing<'life0, 'async_trait>( &'life0 self, max: u32, ) -> Pin<Box<dyn Future<Output = Result<BlockList, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_miner_info<'life0, 'life1, 'async_trait>( &'life0 self, ds_block_number: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<MinerInfo, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_blockchain_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BlockchainInfo, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_node_type<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_sharding_structure<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ShardingStructure, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_latest_ds_block<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<DsBlock, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_num_ds_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_ds_block_rate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<f32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_latest_tx_block<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxBlock, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_num_tx_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_tx_block_rate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<f32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_num_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_transaction_rate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<f32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_current_mini_epoch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_current_ds_epoch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_prev_difficulty<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_num_peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_prev_ds_difficulty<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_total_coin_supply<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_total_coin_supply_as_int<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u128, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_recent_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxList, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_transactions_for_tx_block<'life0, 'life1, 'async_trait>( &'life0 self, tx_block: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<String>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_txn_bodies_for_tx_block_ex<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tx_block: &'life1 str, page_num: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<TxnBodiesForTxBlockEx, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_txn_bodies_for_tx_block<'life0, 'life1, 'async_trait>( &'life0 self, tx_block: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<GetTransactionResponse>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_transactions_for_tx_block_ex<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tx_block: &'life1 str, page_num: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<TransactionsForTxBlockEx, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_num_txns_tx_epoch<'life0, 'life1, 'async_trait>( &'life0 self, epoch: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_num_txns_ds_epoch<'life0, 'life1, 'async_trait>( &'life0 self, epoch: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_minimum_gas_price<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_smart_contracts<'life0, 'life1, 'async_trait>( &'life0 self, owner: &'life1 ZilAddress, ) -> Pin<Box<dyn Future<Output = Result<SmartContracts, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_contract_address_from_transaction_id<'life0, 'life1, 'async_trait>( &'life0 self, tx_hash: &'life1 TxHash, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_smart_contract_code<'life0, 'life1, 'async_trait>( &'life0 self, contract_address: &'life1 ZilAddress, ) -> Pin<Box<dyn Future<Output = Result<SmartContractCode, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_smart_contract_init<'life0, 'life1, 'async_trait>( &'life0 self, contract_address: &'life1 ZilAddress, ) -> Pin<Box<dyn Future<Output = Result<Vec<ScillaVariable>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_smart_contract_state<'life0, 'life1, 'async_trait, T>( &'life0 self, contract_address: &'life1 ZilAddress, ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>
where T: 'async_trait + Send + DeserializeOwned, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_smart_contract_sub_state<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, contract_address: &'life1 ZilAddress, variable_name: &'life2 str, indices: &'life3 [&'life4 str], ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source§

fn get_state_proof<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, contract_address: &'life1 ZilAddress, hash: &'life2 str, tx_block: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Auto Trait Implementations§

§

impl<M, S> Freeze for SignerMiddleware<M, S>
where S: Freeze, M: Freeze,

§

impl<M, S> RefUnwindSafe for SignerMiddleware<M, S>

§

impl<M, S> Send for SignerMiddleware<M, S>
where S: Send, M: Send,

§

impl<M, S> Sync for SignerMiddleware<M, S>
where S: Sync, M: Sync,

§

impl<M, S> Unpin for SignerMiddleware<M, S>
where S: Unpin, M: Unpin,

§

impl<M, S> UnwindSafe for SignerMiddleware<M, S>
where S: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSend for T
where T: Send,