diff --git a/.gitignore b/.gitignore index e71fa6f..e572fbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +.history .dart_tool/ .packages diff --git a/lib/core/hd_wallet.dart b/lib/core/hd_wallet.dart index 1d54038..56df025 100644 --- a/lib/core/hd_wallet.dart +++ b/lib/core/hd_wallet.dart @@ -8,18 +8,24 @@ class HDWallet { } HDWallet({int strength = 128, String passphrase = ""}) { - _nativehandle = TWHDWalletImpl.create(strength: strength, passphrase: passphrase); - if (_nativehandle.hashCode == 0) throw Exception(["HDWallet nativehandle is null"]); + _nativehandle = + TWHDWalletImpl.create(strength: strength, passphrase: passphrase); + if (_nativehandle.hashCode == 0) + throw Exception(["HDWallet nativehandle is null"]); } HDWallet.createWithMnemonic(String mnemonic, {String passphrase = ""}) { - _nativehandle = TWHDWalletImpl.createWithMnemonic(mnemonic, passphrase: passphrase); - if (_nativehandle.hashCode == 0) throw Exception(["HDWallet nativehandle is null"]); + _nativehandle = + TWHDWalletImpl.createWithMnemonic(mnemonic, passphrase: passphrase); + if (_nativehandle.hashCode == 0) + throw Exception(["HDWallet nativehandle is null"]); } HDWallet.createWithData(Uint8List bytes, {String passphrase = ""}) { - _nativehandle = TWHDWalletImpl.createWithEntropy(bytes, passphrase: passphrase); - if (_nativehandle.hashCode == 0) throw Exception(["HDWallet nativehandle is null"]); + _nativehandle = + TWHDWalletImpl.createWithEntropy(bytes, passphrase: passphrase); + if (_nativehandle.hashCode == 0) + throw Exception(["HDWallet nativehandle is null"]); } String getAddressForCoin(int coinType) { @@ -27,7 +33,8 @@ class HDWallet { } PrivateKey getDerivedKey(int coinType, int account, int change, int address) { - final pointer = TWHDWalletImpl.getDerivedKey(_nativehandle, coinType, account, change, address); + final pointer = TWHDWalletImpl.getDerivedKey( + _nativehandle, coinType, account, change, address); return PrivateKey._(pointer); } @@ -37,11 +44,13 @@ class HDWallet { } PrivateKey getKey(int coinType, String derivationPath) { - final pointer = TWHDWalletImpl.getKey(_nativehandle, coinType, derivationPath); + final pointer = + TWHDWalletImpl.getKey(_nativehandle, coinType, derivationPath); return PrivateKey._(pointer); } - PrivateKey getMaterKey(int curve) { + /// getMasterKey + PrivateKey getMasterKey(int curve) { final pointer = TWHDWalletImpl.getMasterKey(_nativehandle, curve); return PrivateKey._(pointer); } @@ -59,6 +68,7 @@ class HDWallet { } String getExtendedPublicKey(int purpose, int coinType, int twHdVersion) { - return TWHDWalletImpl.getExtendedPublicKey(_nativehandle, purpose, coinType, twHdVersion); + return TWHDWalletImpl.getExtendedPublicKey( + _nativehandle, purpose, coinType, twHdVersion); } }