Task Managed Wallet Methods Overview
Task managed wallet methods in the Komodo DeFi Framework provide advanced features for HD wallets, hardware wallet integration, and secure transaction management. These methods are designed to support asynchronous operations and hardware wallet flows, making them suitable for modern wallet applications.
- Account Balance Tasks: Track balances across multiple addresses under a specified account index.
- Create New Account Tasks: Create and manage new HD accounts.
- Get New Address Tasks: Generate new HD wallet addresses.
- Scan For New Addresses Tasks: Scan for new addresses in HD wallets.
- Withdraw Tasks: Prepare and manage withdrawals from your wallet.
For coin activation tasks, see the Task Managed Coin Activation section.
Hierarchical Deterministic (HD) Wallets are different from other wallets, as they use a key pair management system that allows generating multiple new addresses from a single seed phrase or private key.
Hierarchical
refers to the structure of HD wallets, which resembles a tree, where parent keys can produce children keys, which can produce grandchildren keys, and so on, all from the same root seed.
Deterministic
means that the addresses generated in this tree will always be the same for the same root seed phrase.
HD wallets offer several advantages over traditional wallets:
- Convenience: HD wallets allow users to generate multiple public and private keys from a single seed phrase, making it easier to manage multiple addresses in one place.
- Privacy: HD wallets can generate new addresses for each transaction, making it more difficult for malicious parties to track a user's transaction history.
- Access Control: A user who controls the root seed can create new addresses and key pairs, which can be shared with a third party, providing limited or regulated access to funds held under specific pairs.
To use HD wallet functionality with the Komodo DeFi Framework API, you must include "enable_hd": true
in your MM2.json file.
Hardware wallets like Trezor are always in HD mode, and this parameter must be set to true
.
In some cases, the methods used to interact with HD wallets are the same as those used with legacy wallets. However, there are some differences, which are detailed in the links below.
- Initialize connection with your Trezor with task::init_trezor::init
- Check the status of the connection with task::init_trezor::status
- Cancel authentication process with task::init_trezor::cancel
- Authenticate using PIN or phrase with task::init_trezor::user_action
These methods (and others with a task::
prefix) will be linked to a numeric task_id
value, which is used to query the status or outcome of the task.
As HD mode activation performs address scanning to return addresses and balances for enabled accounts, we use task
methods because fetching this data can take some time.
- Use task::enable_bch::init for BCH/SLP coins.
- Check the activation status with task::enable_bch::status
- Authenticate the activation with task::enable_bch::user_action (hardware wallet only)
- Cancel activation with task::enable_bch::cancel
- Use task::enable_eth::init for EVM type coins like ETH, AVAX, BNB.
- Check the activation status with task::enable_eth::status
- Authenticate the activation with task::enable_eth::user_action (hardware wallet only)
- Cancel activation with task::enable_eth::cancel
- Use task::enable_qtum::init for QTUM Ecosystem coins.
- Check the activation status with task::enable_qtum::status
- Authenticate the activation with task::enable_qtum::user_action (hardware wallet only)
- Cancel activation with task::enable_qtum::cancel
- Use task::enable_tendermint::init for TENDERMINT coins like ATOM, OSMO, and IRIS.
- Check the activation status with task::enable_tendermint::status
- Authenticate the activation with task::enable_tendermint::user_action (hardware wallet only)
- Cancel activation with task::enable_tendermint::cancel
- Use task::enable_utxo::init for UTXO coins like KMD, BTC, and DOGE.
- Check the activation status with task::enable_utxo::status
- Authenticate the activation with task::enable_utxo::user_action (hardware wallet only)
- Cancel activation with task::enable_utxo::cancel
- Use task::enable_z_coin::init for ZHTLC coins PIRATE and ZOMBIE.
- Check the activation status with task::enable_z_coin::status
- Authenticate the activation with task::enable_z_coin::user_action (hardware wallet only)
- Cancel activation with task::enable_z_coin::cancel
When using the activation methods with a Trezor, "priv_key_policy": "Trezor"
needs to be included in the request.
- Prepare a transaction with task::withdraw::init
- Check the status of the transaction preparation with task::withdraw::status
- Cancel the transaction preparation with task::withdraw::cancel
After preparing the transaction, it needs to be broadcast to the network with send_raw_transaction
- Initialize the balance request with task::account_balance::init
- Check the status of the balance request with task::account_balance::status
- Create new HD wallet addresses with task::get_new_address::init to generate new addresses
- Transaction history using an
account_id
my_tx_history - Transaction history using an
address_id
my_tx_history