tendermint / flutter

23 stars 10 forks source link

[Feature] [cosmos_node_client] Account derivation #256

Open andrzejchm opened 2 years ago

andrzejchm commented 2 years ago

Add feature of wallet derivation to the cosmos_node_client library

Acceptance criteria

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) { ... }
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,
    }) { ... }
}
Zfinix commented 2 years ago

Would be working on this as soon as #261 and #263 are merged