Skip to main content

iota_sdk.wallet.account

AccountMetadata Objects

@dataclass
class AccountMetadata()

Account metadata.

Attributes:

  • alias - The alias name of the account.
  • coinType - The type of coin managed with the account.
  • index - The account index.

Account Objects

class Account()

A wallet account.

Attributes:

  • meta - Some account metadata.
  • handle - The account handle.

__init__

def __init__(meta: dict, handle)

Initializes an account.

Arguments:

  • meta - The account data.
  • handle - The account handle.

get_metadata

def get_metadata() -> AccountMetadata

Get the accounts metadata.

prepare_burn

def prepare_burn(
burn: Burn,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

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

prepare_burn_native_token

def prepare_burn_native_token(
token_id: HexStr,
burn_amount: int,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Burn native tokens. This 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.

prepare_burn_nft

def prepare_burn_nft(
nft_id: HexStr,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Burn an nft output.

prepare_consolidate_outputs

def prepare_consolidate_outputs(
params: ConsolidationParams) -> PreparedTransaction

Consolidate outputs.

prepare_create_alias_output

def prepare_create_alias_output(
params: Optional[CreateAliasOutputParams] = None,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Create an alias output.

prepare_destroy_alias

def prepare_destroy_alias(
alias_id: HexStr,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Destroy an alias output.

prepare_destroy_foundry

def prepare_destroy_foundry(
foundry_id: HexStr,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Destroy a foundry output with a circulating supply of 0.

generate_ed25519_addresses

def generate_ed25519_addresses(amount: int,
options=None) -> List[AccountAddress]

Generate new addresses.

claimable_outputs

def claimable_outputs(outputs_to_claim: List[OutputId])

Get outputs with additional unlock conditions.

get_output

def get_output(output_id: OutputId) -> OutputData

Get output.

get_transaction

def get_transaction(transaction_id: HexStr) -> Transaction

Get transaction.

addresses

def addresses() -> List[AccountAddress]

List addresses.

addresses_with_unspent_outputs

def addresses_with_unspent_outputs() -> List[AddressWithUnspentOutputs]

Returns only addresses of the account with unspent outputs.

outputs

def outputs(
filter_options: Optional[FilterOptions] = None) -> List[OutputData]

Returns all outputs of the account.

unspent_outputs

def unspent_outputs(
filter_options: Optional[FilterOptions] = None) -> List[OutputData]

Returns all unspent outputs of the account.

incoming_transactions

def incoming_transactions() -> List[Transaction]

Returns all incoming transactions of the account.

transactions

def transactions() -> List[Transaction]

Returns all transaction of the account.

pending_transactions

def pending_transactions()

Returns all pending transactions of the account.

prepare_create_native_token

def prepare_create_native_token(
params: CreateNativeTokenParams,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Create native token.

prepare_melt_native_token

def prepare_melt_native_token(
token_id: HexStr,
melt_amount: int,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Melt native tokens. This happens with the foundry output which minted them, by increasing it's melted_tokens field.

prepare_mint_native_token

def prepare_mint_native_token(
token_id: HexStr,
mint_amount: int,
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Mint additional native tokens.

prepare_mint_nfts

def prepare_mint_nfts(
params: List[MintNftParams],
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Mint NFTs.

get_balance

def get_balance() -> Balance

Get account balance information.

prepare_output

def prepare_output(
params: OutputParams,
transaction_options: Optional[TransactionOptions] = None
) -> Union[BasicOutput, NftOutput]

Prepare an 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

prepare_send

def prepare_send(
params: List[SendParams],
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Prepare to send base coins.

prepare_transaction

def prepare_transaction(
outputs: List[Output],
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Prepare transaction.

retry_transaction_until_included

def retry_transaction_until_included(transaction_id: HexStr,
interval=None,
max_attempts=None) -> HexStr

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.

sync

def sync(options: Optional[SyncOptions] = None) -> Balance

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

send

def send(amount: str,
address: str,
options: Optional[TransactionOptions] = None) -> Transaction

Send base coins.

send_with_params

def send_with_params(
params: List[SendParams],
options: Optional[TransactionOptions] = None) -> Transaction

Send base coins to multiple addresses or with additional parameters.

prepare_send_native_tokens

def prepare_send_native_tokens(
params: List[SendNativeTokensParams],
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Send native tokens.

prepare_send_nft

def prepare_send_nft(
params: List[SendNftParams],
options: Optional[TransactionOptions] = None) -> PreparedTransaction

Send nft.

set_alias

def set_alias(alias: str)

Set alias.

set_default_sync_options

def set_default_sync_options(options: SyncOptions)

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

sign_transaction_essence

def sign_transaction_essence(
prepared_transaction_data: PreparedTransactionData
) -> SignedTransactionData

Sign a transaction essence.

sign_and_submit_transaction

def sign_and_submit_transaction(
prepared_transaction_data: PreparedTransactionData) -> Transaction

Validate the transaction, sign it, submit it to a node and store it in the account.

submit_and_store_transaction

def submit_and_store_transaction(
signed_transaction_data: SignedTransactionData) -> Transaction

Submit and store transaction.

claim_outputs

def claim_outputs(output_ids_to_claim: List[OutputId]) -> Transaction

Claim outputs.

send_outputs

def send_outputs(outputs: List[Output],
options: Optional[TransactionOptions] = None) -> Transaction

Send outputs in a transaction.