Wallets
A combination of generalized and low-level wallet tools.
Overview
When interacting with either Qi or Quai, it is necessary to use a private key authenticate actions by signing a payload.
Wallets are the simplest way to expose the concept of an Externally Owner Account (EOA) or UTXO account as it wraps a private key and supports high-level methods to sign common types of interaction and send transactions.
The class most developers will want to use is Wallet, which can load a private key directly or from any common wallet format.
The SDK also supports Hierarchical Deterministic (HD) wallets for both Quai and Qi ledgers. Developers who need access to low-level wallet details can opt to use the QuaiHDWallet and QiHDWallet classes.
Usage
Developers working on the account model Quai ledger have two options for wallet configurations:
- Base Wallet: The simplest implementation of a Quai Wallet
- Quai HD Wallet: A Hierarchical Deterministic (HD) wallet for the Quai ledger
Developers working on the UTXO model Qi ledger currently have a single option for wallet configuration:
- Qi HD Wallet: A Hierarchical Deterministic (HD) wallet for the Qi ledger
Quai Wallets
Quai wallets can be initialized using either the Wallet class or the QuaiHDWallet class.
The simplest wallet configuration is using the Wallet class. All that is needed to initiate a wallet is a private key and a provider. Once configured, the wallet acts similar to a Signer.
The QuaiHDWallet class provides additional low-level functionality on top of the base Wallet class, allowing for more granular control.
Qi Wallets
Qi wallets can only be initialized using the QiHDWallet class.
Was this page helpful?