Skip to main content

WalletExt

Trait WalletExt 

Source
pub trait WalletExt {
    // Required methods
    fn builder_data(&self) -> impl Future<Output = Result<BuilderData>> + Send;
    fn build_transfer(
        &self,
        asset_id: AssetId,
        transfers: &[(Address, u64)],
        utxo_manager: &mut dyn UtxoProvider,
        builder_data: &BuilderData,
        fetch_coins: bool,
    ) -> impl Future<Output = Result<Transaction>> + Send;
    fn build_transaction(
        &self,
        inputs: Vec<Input>,
        outputs: Vec<Output>,
        witnesses: Vec<Witness>,
        tx_policies: TxPolicies,
    ) -> impl Future<Output = Result<Transaction>> + Send;
    fn send_transaction(
        &self,
        chain_id: ChainId,
        tx: &Transaction,
        submit_clients: &[FuelClient],
    ) -> impl Future<Output = Result<SendResult>> + Send;
    fn transfer_many(
        &self,
        asset_id: AssetId,
        transfers: &[(Address, u64)],
        utxo_manager: &mut dyn UtxoProvider,
        builder_data: &BuilderData,
        fetch_coins: bool,
        chunk_size: Option<usize>,
    ) -> impl Future<Output = Result<Vec<FuelTxCoin>>> + Send;
    fn transfer_many_and_wait(
        &self,
        asset_id: AssetId,
        transfers: &[(Address, u64)],
        utxo_manager: &mut dyn UtxoProvider,
        builder_data: &BuilderData,
        fetch_coins: bool,
        chunk_size: Option<usize>,
    ) -> impl Future<Output = Result<Vec<FuelTxCoin>>> + Send;
    fn await_send_result(
        &self,
        tx_id: &TxId,
        tx: &Transaction,
    ) -> impl Future<Output = Result<SendResult>> + Send;
}

Required Methods§

Source

fn builder_data(&self) -> impl Future<Output = Result<BuilderData>> + Send

Source

fn build_transfer( &self, asset_id: AssetId, transfers: &[(Address, u64)], utxo_manager: &mut dyn UtxoProvider, builder_data: &BuilderData, fetch_coins: bool, ) -> impl Future<Output = Result<Transaction>> + Send

Source

fn build_transaction( &self, inputs: Vec<Input>, outputs: Vec<Output>, witnesses: Vec<Witness>, tx_policies: TxPolicies, ) -> impl Future<Output = Result<Transaction>> + Send

Source

fn send_transaction( &self, chain_id: ChainId, tx: &Transaction, submit_clients: &[FuelClient], ) -> impl Future<Output = Result<SendResult>> + Send

Submits tx and awaits its preconfirmation/final status.

submit_clients lets callers fan out submission across several nodes; the first client to return a valid preconfirmation/final status wins and its result is returned. When every client errors, the returned error aggregates each client’s failure message. When a duplicate-tx error is observed on any client, we fall back to awaiting the status on the provider’s client. When submit_clients is empty, the provider’s client is used as the sole submitter.

Source

fn transfer_many( &self, asset_id: AssetId, transfers: &[(Address, u64)], utxo_manager: &mut dyn UtxoProvider, builder_data: &BuilderData, fetch_coins: bool, chunk_size: Option<usize>, ) -> impl Future<Output = Result<Vec<FuelTxCoin>>> + Send

Source

fn transfer_many_and_wait( &self, asset_id: AssetId, transfers: &[(Address, u64)], utxo_manager: &mut dyn UtxoProvider, builder_data: &BuilderData, fetch_coins: bool, chunk_size: Option<usize>, ) -> impl Future<Output = Result<Vec<FuelTxCoin>>> + Send

Source

fn await_send_result( &self, tx_id: &TxId, tx: &Transaction, ) -> impl Future<Output = Result<SendResult>> + Send

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.

Implementations on Foreign Types§

Source§

impl<S> WalletExt for Wallet<Unlocked<S>>
where S: Signer + Clone + Send + Sync + Debug + 'static,

Source§

async fn builder_data(&self) -> Result<BuilderData>

Source§

async fn build_transaction( &self, inputs: Vec<Input>, outputs: Vec<Output>, witnesses: Vec<Witness>, tx_policies: TxPolicies, ) -> Result<Transaction>

Source§

async fn send_transaction( &self, chain_id: ChainId, tx: &Transaction, submit_clients: &[FuelClient], ) -> Result<SendResult>

Source§

async fn build_transfer( &self, asset_id: AssetId, transfers: &[(Address, u64)], utxo_manager: &mut dyn UtxoProvider, builder_data: &BuilderData, fetch_coins: bool, ) -> Result<Transaction>

Source§

async fn transfer_many_and_wait( &self, asset_id: AssetId, transfers: &[(Address, u64)], utxo_manager: &mut dyn UtxoProvider, builder_data: &BuilderData, fetch_coins: bool, chunk_size: Option<usize>, ) -> Result<Vec<FuelTxCoin>>

Source§

async fn transfer_many( &self, asset_id: AssetId, transfers: &[(Address, u64)], utxo_manager: &mut dyn UtxoProvider, builder_data: &BuilderData, fetch_coins: bool, chunk_size: Option<usize>, ) -> Result<Vec<FuelTxCoin>>

Source§

async fn await_send_result( &self, tx_id: &TxId, tx: &Transaction, ) -> Result<SendResult>

Implementors§