List Accounts
As your application may handle many accounts or addresses, the IOTA SDK provides a convenient function to list
all of the Accounts
related to a wallet,
wallet.getAccounts()
.
This allows you to provide accurate and up-to-date information to your users, such as the account name, balance, transaction history, and other relevant metadata, facilitating seamless management of multiple accounts within your platform.
Accounts and Addresses
The SDK supports a multi-account approach and a single-account approach.
Example Code
- Rust
- Typescript (Node.js)
- Python
- Instantiate a
Wallet
. - Call the
Wallet.get_accounts()
function to retrieve all theAccounts
related to the wallet.
- Instantiate a
Wallet
. - Call the
Wallet.getAccounts()
function to retrieve all theAccounts
related to the wallet.
- Instantiate a
Wallet
. - Call the
Wallet.get_accounts()
function to retrieve all theAccounts
related to the wallet.
Full Example Code
- Rust
- Typescript (Node.js)
- Python
sdk/examples/how_tos/accounts_and_addresses/list_accounts.rs
loading...
bindings/nodejs/examples/how_tos/accounts_and_addresses/list-accounts.ts
loading...
bindings/python/examples/how_tos/accounts_and_addresses/list_accounts.py
loading...
Expected Output
Alice