[Feature] [cosmos_node_client] Account derivation
Opened this issue · 1 comments
andrzejchm commented
Add feature of wallet derivation to the cosmos_node_client
library
Acceptance criteria
- introduce new type
Mnemonic
that has the constructorMnemonic.generate(MnemonicLength length)
enum MnemonicLength {
words12,
words24,
}
class Mnemonic {
final String value;
List<String> get words {} // generate list of words based on the `value`
const Mnemonic._(this.value);
factory Mnemonic.generate(MnemonicLength length) { ... }
- introduce new type
Account
with a factoryderiveFromMnemonic
that acceptsMnemonic mnemonic
.
class Account extends Equatable {
static const defaultDerivationPath = "m/44'/118'/0'/0/0";
final String bech32Address;
final Uint8List publicKey;
final Uint8List privateKey;
factory Account.derive({
required Mnemonic mnemonic,
String derivationPath = defaultDerivationPath,
}) { ... }
}