pub trait Account: ViewOnlyAccount {
// Provided methods
fn add_witnesses<Tb: TransactionBuilder>(&self, _tb: &mut Tb) -> Result<()> { ... }
fn transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32Address,
amount: u64,
asset_id: AssetId,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(TxId, Vec<Receipt>)>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn force_transfer_to_contract<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32ContractId,
balance: u64,
asset_id: AssetId,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(String, Vec<Receipt>)>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn withdraw_to_base_layer<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32Address,
amount: u64,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(TxId, Nonce, Vec<Receipt>)>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Provided Methods§
fn add_witnesses<Tb: TransactionBuilder>(&self, _tb: &mut Tb) -> Result<()>
Sourcefn transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32Address,
amount: u64,
asset_id: AssetId,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(TxId, Vec<Receipt>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transfer<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32Address,
amount: u64,
asset_id: AssetId,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(TxId, Vec<Receipt>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transfer funds from this account to another Address
.
Fails if amount for asset ID is larger than address’s spendable coins.
Returns the transaction ID that was sent and the list of receipts.
Sourcefn force_transfer_to_contract<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32ContractId,
balance: u64,
asset_id: AssetId,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(String, Vec<Receipt>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn force_transfer_to_contract<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32ContractId,
balance: u64,
asset_id: AssetId,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(String, Vec<Receipt>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unconditionally transfers balance
of type asset_id
to
the contract at to
.
Fails if balance for asset_id
is larger than this account’s spendable balance.
Returns the corresponding transaction ID and the list of receipts.
CAUTION !!!
This will transfer coins to a contract, possibly leading to the PERMANENT LOSS OF COINS if not used with care.
Sourcefn withdraw_to_base_layer<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32Address,
amount: u64,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(TxId, Nonce, Vec<Receipt>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn withdraw_to_base_layer<'life0, 'life1, 'async_trait>(
&'life0 self,
to: &'life1 Bech32Address,
amount: u64,
tx_policies: TxPolicies,
) -> Pin<Box<dyn Future<Output = Result<(TxId, Nonce, Vec<Receipt>)>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Withdraws an amount of the base asset to an address on the base chain. Returns the transaction ID, message ID and the list of receipts.
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.