cake_wallet/cw_bitcoin/lib/bitcoin_mnemonics_bip39.dart
Konstantin Ullrich ce21098e98
Cw 488 seed offset (#1631)
* CW-488 minor code cleanup

* Add Derivation Path selector for BTC and LTC

* CW-488 Initial Passphrase Impl

* CW-488 Final Passphrase Impl

* Quick Fix of language Service

* CW-488 Implement PR Suggestions

* CW-488 Implement PR Suggestions

* CW-488 Implement Passphrase for Bitcoin Cash

* CW-488 Implement Passphrase for Bitcoin Cash

* CW-488 Implement Passphrase for Bitcoin Cash

* remove monero and wownero support for passphrase until merged [skip ci]

* CW-488 Apply requested change

* CW-488 Add Passphrase to QR

* CW-488 Fix Seed generation

* CW-488 Implement Electrum Passphrases

* CW-488 Add Seed Length Selector to BIP39 Seeds

* CW-488 Minor fix [skip ci]

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-08-26 20:06:54 +03:00

12 lines
394 B
Dart

import 'dart:typed_data';
import 'package:bip39/bip39.dart' as bip39;
class MnemonicBip39 {
/// Generate bip39 mnemonic
static String generate({int strength = 128}) => bip39.generateMnemonic(strength: strength);
/// Create root seed from mnemonic
static Uint8List toSeed(String mnemonic, {String? passphrase}) =>
bip39.mnemonicToSeed(mnemonic, passphrase: passphrase ?? '');
}