Struct iota_sdk::wallet::account::Account

source ·
pub struct Account<S: SecretManage = SecretManager> { /* private fields */ }
Available on crate feature wallet only.
Expand description

A thread guard over an account, so we can lock the account during operations.

Implementations§

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn generate_ed25519_addresses( &self, amount: u32, options: impl Into<Option<GenerateAddressOptions>> + Send ) -> Result<Vec<AccountAddress>>

Generate addresses and stores them in the account

let public_addresses = account.generate_ed25519_addresses(2, None).await?;
// internal addresses are used for remainder outputs, if the RemainderValueStrategy for transactions is set to ChangeAddress
let internal_addresses = account
    .generate_ed25519_addresses(
        1,
        Some(GenerateAddressOptions {
            internal: true,
            ..Default::default()
        }),
    )
    .await?;
source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn balance(&self) -> Result<Balance>

Get the balance of the account.

source

pub async fn addresses_balance( &self, addresses: Vec<impl ConvertTo<Bech32Address>> ) -> Result<Balance>

Get the balance of the given addresses.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn claimable_outputs( &self, outputs_to_claim: OutputsToClaim ) -> Result<Vec<OutputId>>

Get basic and nft outputs that have ExpirationUnlockCondition, StorageDepositReturnUnlockCondition or TimelockUnlockCondition and can be unlocked now and also get basic outputs with only an AddressUnlockCondition unlock condition, for additional inputs

source

pub async fn claim_outputs<I: IntoIterator<Item = OutputId> + Send>( &self, output_ids_to_claim: I ) -> Result<Transaction>
where I::IntoIter: Send,

Try to claim basic or nft outputs that have additional unlock conditions to their AddressUnlockCondition from Account::claimable_outputs().

source

pub async fn prepare_claim_outputs<I: IntoIterator<Item = OutputId> + Send>( &self, output_ids_to_claim: I ) -> Result<PreparedTransactionData>
where I::IntoIter: Send,

Try to claim basic outputs that have additional unlock conditions to their AddressUnlockCondition.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn consolidate_outputs( &self, params: ConsolidationParams ) -> Result<Transaction>

Consolidates basic outputs with only an AddressUnlockCondition from an account by sending them to a provided address or to an own address again if the output amount is >= the output_threshold. When force is set to true, the threshold is ignored. Only consolidates the amount of outputs that fit into a single transaction.

source

pub async fn prepare_consolidate_outputs( &self, params: ConsolidationParams ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::consolidate_outputs().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn register_participation_events( &self, options: &ParticipationEventRegistrationOptions ) -> Result<HashMap<ParticipationEventId, ParticipationEventWithNodes>>

Stores participation information for the given events locally and returns them all.

This will NOT store the node url and auth inside the client options.

source

pub async fn deregister_participation_event( &self, id: &ParticipationEventId ) -> Result<()>

Removes a previously registered participation event from local storage.

source

pub async fn get_participation_event( &self, id: ParticipationEventId ) -> Result<Option<ParticipationEventWithNodes>>

Retrieves corresponding information for a participation event from local storage.

source

pub async fn get_participation_events( &self ) -> Result<HashMap<ParticipationEventId, ParticipationEventWithNodes>>

Retrieves information for all registered participation events.

source

pub async fn get_participation_event_ids( &self, node: &Node, event_type: Option<ParticipationEventType> ) -> Result<Vec<ParticipationEventId>>

Retrieves IDs of all events tracked by the client options node.

source

pub async fn get_participation_event_status( &self, id: &ParticipationEventId ) -> Result<ParticipationEventStatus>

Retrieves the latest status of a given participation event.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn vote( &self, event_id: impl Into<Option<ParticipationEventId>> + Send, answers: impl Into<Option<Vec<u8>>> + Send ) -> Result<Transaction>

Casts a given number of votes for a given (voting) event.

If voting for other events, continues voting for them. Removes metadata for any event that has expired (uses event IDs to get cached event information, checks event milestones in there against latest network milestone). If already voting for this event, overwrites existing output metadata. If existing voting output(s) do NOT have enough funds (or don’t exist), throws an error. If exceeds output metadata limit, throws an error (although better if automatically handled, but has UX implications). If event has expired, throws an error (do NOT remove previous votes).

This is an add OR update function, not just add. This should use regular client options, NOT specific node for the event.

source

pub async fn prepare_vote( &self, event_id: impl Into<Option<ParticipationEventId>> + Send, answers: impl Into<Option<Vec<u8>>> + Send ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::vote().

source

pub async fn stop_participating( &self, event_id: ParticipationEventId ) -> Result<Transaction>

Removes metadata corresponding to a given (voting) event ID from the voting output if it contains it.

If voting for other events, continues voting for them. Removes metadata for any event that has expired (use event IDs to get cached event information, checks event milestones in there against latest network milestone). If NOT already voting for this event, throws an error.

source

pub async fn prepare_stop_participating( &self, event_id: ParticipationEventId ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::stop_participating().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn get_voting_power(&self) -> Result<u64>

Returns an account’s total voting power (voting or NOT voting).

source

pub async fn increase_voting_power(&self, amount: u64) -> Result<Transaction>

Designates a given amount of tokens towards an account’s “voting power” by creating a special output, which is really a basic one with some metadata.

If not enough funds, throws an error. If voting, use voting output (should only ever have one unless more space for more votes is needed). This will stop voting in most cases (if there is a remainder), but the voting data isn’t lost and calling Vote without parameters will revote. Removes metadata for any events that have expired (uses event IDs to get cached event information, checks event milestones in there against latest network milestone). Prioritizes consuming outputs that are designated for voting but don’t have any metadata (only possible if user increases voting power then increases again immediately after).

source

pub async fn prepare_increase_voting_power( &self, amount: u64 ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::increase_voting_power().

source

pub async fn decrease_voting_power(&self, amount: u64) -> Result<Transaction>

Reduces an account’s “voting power” by a given amount. This will stop voting, but the voting data isn’t lost and calling Vote without parameters will revote.

If amount is higher than actual voting power, throws an error. If voting and amount is equal to voting power, removes tagged data payload and output metadata. Removes metadata for any events that have expired (uses event IDs to get cached event information, checks event milestones in there against latest network milestone). Prioritizes consuming outputs that are designated for voting but don’t have any metadata (only possible if user increases voting power then decreases immediately after).

source

pub async fn prepare_decrease_voting_power( &self, amount: u64 ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::decrease_voting_power().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn get_participation_overview( &self, event_ids: Option<Vec<ParticipationEventId>> ) -> Result<AccountParticipationOverview>

Calculates the voting overview of an account. If event_ids are provided, only return outputs and tracked participations for them.

source

pub async fn get_voting_output(&self) -> Result<Option<OutputData>>

Returns the voting output (“PARTICIPATION” tag).

If multiple outputs with this tag exist, the one with the largest amount will be returned.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn retry_until_included( &self, block_id: &BlockId, interval: Option<u64>, max_attempts: Option<u64> ) -> Result<Vec<(BlockId, Block)>>

Retries (promotes or reattaches) a block for provided block id until it’s included (referenced by a milestone). This function is re-exported from the client library and default interval is as defined there. Returns the included block at first position and additional reattached blocks

source

pub async fn retry_transaction_until_included( &self, transaction_id: &TransactionId, interval: Option<u64>, max_attempts: Option<u64> ) -> Result<BlockId>

Retries (promotes or reattaches) a transaction sent from the account for a provided transaction id until it’s included (referenced by a milestone). Returns the included block id.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn set_default_sync_options(&self, options: SyncOptions) -> Result<()>

Set the fallback SyncOptions for account syncing. If storage is enabled, will persist during restarts.

source

pub async fn default_sync_options(&self) -> SyncOptions

source

pub async fn sync(&self, options: Option<SyncOptions>) -> Result<Balance>

Sync the account by fetching new information from the nodes. Will also retry pending transactions if necessary. A custom default can be set using set_default_sync_options.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn melt_native_token( &self, token_id: TokenId, melt_amount: impl Into<U256> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Melts native tokens.

This happens with the foundry output which minted them, by increasing it’s melted_tokens field. This should be preferred over burning, because after burning, the foundry can never be destroyed anymore.

source

pub async fn prepare_melt_native_token( &self, token_id: TokenId, melt_amount: impl Into<U256> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::melt_native_token().

source§

impl Account

source

pub async fn burn( &self, burn: impl Into<Burn> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

A generic function that can be used to burn native tokens, nfts, foundries and aliases.

Note that burning native tokens doesn’t require the foundry output which minted them, but will not increase the foundries melted_tokens field, which makes it impossible to destroy the foundry output. Therefore it’s recommended to use melting, if the foundry output is available.

source

pub async fn prepare_burn( &self, burn: impl Into<Burn> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>

A generic prepare_burn() function that can be used to prepare the burn of native tokens, nfts, foundries and aliases.

Note that burning native tokens doesn’t require the foundry output which minted them, but will not increase the foundries melted_tokens field, which makes it impossible to destroy the foundry output. Therefore it’s recommended to use melting, if the foundry output is available.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn create_alias_output( &self, params: Option<CreateAliasParams>, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Creates an alias output.

let params = CreateAliasParams {
    address: None,
    immutable_metadata: Some(b"some immutable alias metadata".to_vec()),
    metadata: Some(b"some alias metadata".to_vec()),
    state_metadata: Some(b"some alias state metadata".to_vec()),
};

let transaction = account.create_alias_output(params, None).await?;
println!(
    "Transaction sent: {}/transaction/{}",
    std::env::var("EXPLORER_URL").unwrap(),
    transaction.transaction_id
);
source

pub async fn prepare_create_alias_output( &self, params: Option<CreateAliasParams>, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::create_alias_output().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn create_native_token( &self, params: CreateNativeTokenParams, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<CreateNativeTokenTransaction>

Creates a new foundry output with minted native tokens.

Calls Account::prepare_transaction() internally, the options may define the remainder value strategy or custom inputs.

let params = CreateNativeTokenParams {
    alias_id: None,
    circulating_supply: U256::from(100),
    maximum_supply: U256::from(100),
    foundry_metadata: None
};

let tx = account.create_native_token(params, None).await?;
println!("Transaction created: {}", tx.transaction_id);
if let Some(block_id) = tx.block_id {
    println!("Block sent: {}", block_id);
}
source

pub async fn prepare_create_native_token( &self, params: CreateNativeTokenParams, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedCreateNativeTokenTransaction>

Prepares the transaction for Account::create_native_token().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn mint_native_token( &self, token_id: TokenId, mint_amount: impl Into<U256> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Mints additional native tokens.

The max supply must not be reached yet. The foundry needs to be controlled by this account. Address needs to be Bech32 encoded. This will not change the max supply.

let tx = account.mint_native_token(
            TokenId::from_str("08e68f7616cd4948efebc6a77c4f93aed770ac53860100000000000000000000000000000000")?,
            100,
            None
        ).await?;
println!("Transaction created: {}", tx.transaction_id);
if let Some(block_id) = tx.block_id {
    println!("Block sent: {}", block_id);
}
source

pub async fn prepare_mint_native_token( &self, token_id: TokenId, mint_amount: impl Into<U256> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>

Prepares the transaction for Account::mint_native_token().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn mint_nfts<I: IntoIterator<Item = MintNftParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>
where I::IntoIter: Send,

Mints NFTs.

Calls Account::prepare_transaction() internally. The options may define the remainder value strategy or custom inputs. Note that addresses need to be bech32-encoded.

let nft_id: [u8; 38] =
    prefix_hex::decode("08e68f7616cd4948efebc6a77c4f93aed770ac53860100000000000000000000000000000000")?
        .try_into()
        .unwrap();
let params = [MintNftParams::new()
    try_with_address("rms1qpszqzadsym6wpppd6z037dvlejmjuke7s24hm95s9fg9vpua7vluaw60xu")?
    with_metadata(b"some nft metadata".to_vec())
    with_immutable_metadata(b"some immutable nft metadata".to_vec())
];

let transaction = account.mint_nfts(params, None).await?;
println!(
    "Transaction sent: {}/transaction/{}",
    std::env::var("EXPLORER_URL").unwrap(),
    transaction.transaction_id,
);
source

pub async fn prepare_mint_nfts<I: IntoIterator<Item = MintNftParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>
where I::IntoIter: Send,

Prepares the transaction for Account::mint_nfts().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn send( &self, amount: u64, address: impl ConvertTo<Bech32Address>, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Sends a certain amount of base coins to a single address.

Calls Account::send_with_params() internally. The options may define the remainder value strategy or custom inputs. The provided Addresses provided with SendParams need to be bech32-encoded.

source

pub async fn send_with_params<I: IntoIterator<Item = SendParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>
where I::IntoIter: Send,

Sends a certain amount of base coins with full customizability of the transaction.

Calls Account::send_outputs() internally. The options may define the remainder value strategy or custom inputs. Addresses provided with SendParams need to be bech32-encoded.

let params = [SendParams::new(
    "rms1qpszqzadsym6wpppd6z037dvlejmjuke7s24hm95s9fg9vpua7vluaw60xu",
    1_000_000)?
];

let tx = account.send(params, None ).await?;
println!("Transaction created: {}", tx.transaction_id);
if let Some(block_id) = tx.block_id {
    println!("Block sent: {}", block_id);
}
source

pub async fn prepare_send<I: IntoIterator<Item = SendParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>
where I::IntoIter: Send,

Prepares the transaction for Account::send().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn send_native_tokens<I: IntoIterator<Item = SendNativeTokensParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>
where I::IntoIter: Send,

Sends native tokens in basic outputs with a StorageDepositReturnUnlockCondition and an ExpirationUnlockCondition, so that the storage deposit is returned to the sender and the sender gets access to the output again after a predefined time (default 1 day). Calls Account::send_outputs() internally. The options may define the remainder value strategy or custom inputs. Note that the address needs to be bech32-encoded.

let params = [SendNativeTokensParams {
    address: "rms1qpszqzadsym6wpppd6z037dvlejmjuke7s24hm95s9fg9vpua7vluaw60xu".to_string(),
    native_tokens: vec![(
        TokenId::from_str("08e68f7616cd4948efebc6a77c4f93aed770ac53860100000000000000000000000000000000")?,
        U256::from(50),
    )],
    ..Default::default()
}];

let tx = account.send_native_tokens(params, None).await?;
println!("Transaction created: {}", tx.transaction_id);
if let Some(block_id) = tx.block_id {
    println!("Block sent: {}", block_id);
}
source

pub async fn prepare_send_native_tokens<I: IntoIterator<Item = SendNativeTokensParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>
where I::IntoIter: Send,

Prepares the transaction for Account::send_native_tokens().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn send_nft<I: IntoIterator<Item = SendNftParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>
where I::IntoIter: Send,

Sends an NFT to the provided address. Calls Account::prepare_transaction() internally. The options may define the remainder value strategy. Note that custom inputs will be replaced with the required nft inputs and addresses need to be bech32-encoded.

let params = [SendNftParams::new(
    "rms1qpszqzadsym6wpppd6z037dvlejmjuke7s24hm95s9fg9vpua7vluaw60xu",
    "0xe645042a8a082957cb4bec4927936699ee8e56048834b090379da64213ce231b",
)?];

let transaction = account.send_nft(params, None).await?;

println!(
    "Transaction sent: {}/transaction/{}",
    std::env::var("EXPLORER_URL").unwrap(),
    transaction.transaction_id
);
source

pub async fn prepare_send_nft<I: IntoIterator<Item = SendNftParams> + Send>( &self, params: I, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>
where I::IntoIter: Send,

Prepares the transaction for Account::send_nft().

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn prepare_output( &self, params: OutputParams, transaction_options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Output>

Prepare a basic or NFT output for sending If the amount is below the minimum required storage deposit, by default the remaining amount will automatically be added with a StorageDepositReturn UnlockCondition, when setting the ReturnStrategy to gift, the full minimum required storage deposit will be sent to the recipient. When the assets contain an nft_id, the data from the existing nft output will be used, just with the address unlock conditions replaced

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn prepare_transaction( &self, outputs: impl Into<Vec<Output>> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<PreparedTransactionData>

Get inputs and build the transaction essence

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn sign_transaction_essence( &self, prepared_transaction_data: &PreparedTransactionData ) -> Result<SignedTransactionData>

Signs a transaction essence.

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn send_outputs( &self, outputs: impl Into<Vec<Output>> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Sends a transaction by specifying its outputs.

Note that, if sending a block fails, the method will return None for the block id, but the wallet will retry sending the transaction during syncing.

let outputs = [
   BasicOutputBuilder::new_with_amount(1_000_000)?
   .add_unlock_condition(AddressUnlockCondition::new(
       Address::try_from_bech32("rms1qpszqzadsym6wpppd6z037dvlejmjuke7s24hm95s9fg9vpua7vluaw60xu")?,
   ))
   .finish_output(account.client.get_token_supply().await?;)?,
];
let tx = account
    .send_outputs(
        outputs,
        Some(TransactionOptions {
            remainder_value_strategy: RemainderValueStrategy::ReuseAddress,
            ..Default::default()
        }),
    )
    .await?;
println!("Transaction created: {}", tx.transaction_id);
if let Some(block_id) = tx.block_id {
    println!("Block sent: {}", block_id);
}
source

pub async fn finish_transaction( &self, outputs: impl Into<Vec<Output>> + Send, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Separated function from send, so syncing isn’t called recursively with the consolidation function, which sends transactions

source

pub async fn sign_and_submit_transaction( &self, prepared_transaction_data: PreparedTransactionData, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Signs a transaction, submit it to a node and store it in the account

source

pub async fn submit_and_store_transaction( &self, signed_transaction_data: SignedTransactionData, options: impl Into<Option<TransactionOptions>> + Send ) -> Result<Transaction>

Validates the transaction, submit it to a node and store it in the account

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub async fn set_alias(&self, alias: &str) -> Result<()>

Set the alias for the account

source§

impl<S: SecretManage> Account<S>

source

pub fn get_secret_manager(&self) -> &Arc<RwLock<S>>

source§

impl<S: 'static + SecretManage> Account<S>
where Error: From<S::Error>,

source

pub fn client(&self) -> &Client

source

pub async fn get_foundry_output( &self, native_token_id: TokenId ) -> Result<Output>

Get the Output that minted a native token by the token ID. First try to get it from the account, if it isn’t in the account try to get it from the node

Methods from Deref<Target = AccountInner>§

source

pub async fn details(&self) -> RwLockReadGuard<'_, AccountDetails>

source

pub async fn details_mut(&self) -> RwLockWriteGuard<'_, AccountDetails>

source

pub async fn alias(&self) -> String

source

pub async fn get_output(&self, output_id: &OutputId) -> Option<OutputData>

Get the OutputData of an output stored in the account

source

pub async fn get_transaction( &self, transaction_id: &TransactionId ) -> Option<Transaction>

Get the Transaction of a transaction stored in the account

source

pub async fn get_incoming_transaction( &self, transaction_id: &TransactionId ) -> Option<Transaction>

Get the transaction with inputs of an incoming transaction stored in the account List might not be complete, if the node pruned the data already

source

pub async fn addresses(&self) -> Result<Vec<AccountAddress>>

Returns all addresses of the account

source

pub async fn addresses_with_unspent_outputs( &self ) -> Result<Vec<AddressWithUnspentOutputs>>

Returns only addresses of the account with balance

source

pub async fn outputs( &self, filter: impl Into<Option<FilterOptions>> + Send ) -> Result<Vec<OutputData>>

Returns outputs of the account

source

pub async fn unspent_outputs( &self, filter: impl Into<Option<FilterOptions>> + Send ) -> Result<Vec<OutputData>>

Returns unspent outputs of the account

source

pub async fn unspent_alias_output( &self, alias_id: &AliasId ) -> Result<Option<OutputData>>

Gets the unspent alias output matching the given ID.

source

pub async fn unspent_foundry_output( &self, foundry_id: &FoundryId ) -> Result<Option<OutputData>>

Gets the unspent foundry output matching the given ID.

source

pub async fn unspent_nft_output( &self, nft_id: &NftId ) -> Result<Option<OutputData>>

Gets the unspent nft output matching the given ID.

source

pub async fn incoming_transactions(&self) -> Vec<Transaction>

Returns all incoming transactions of the account

source

pub async fn transactions(&self) -> Vec<Transaction>

Returns all transactions of the account

source

pub async fn pending_transactions(&self) -> Vec<Transaction>

Returns all pending transactions of the account

Trait Implementations§

source§

impl<S: SecretManage> Clone for Account<S>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug + SecretManage> Debug for Account<S>

source§

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

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

impl<S: SecretManage> Deref for Account<S>

§

type Target = AccountInner

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<S> Freeze for Account<S>

§

impl<S = SecretManager> !RefUnwindSafe for Account<S>

§

impl<S> Send for Account<S>

§

impl<S> Sync for Account<S>

§

impl<S> Unpin for Account<S>

§

impl<S = SecretManager> !UnwindSafe for Account<S>

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> ConvertTo<T> for T
where T: Send,

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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> Any for T
where T: Any,

source§

impl<T> CloneAny for T
where T: Any + Clone,