Created
July 1, 2019 01:04
-
-
Save fkfk/e45daa320a04ec5b909186af8fce2203 to your computer and use it in GitHub Desktop.
use monacoin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:bitcoin_flutter/bitcoin_flutter.dart'; | |
import 'package:bip32/bip32.dart' as bip32; | |
import 'package:bip39/bip39.dart' as bip39; | |
final MONACOIN = new NetworkType( | |
messagePrefix: '\x19Monacoin Signed Message:\n', | |
bech32: 'mona', | |
bip32: new Bip32Type( | |
public: 0x0488b21e, | |
private: 0x0488ade4 | |
), | |
pubKeyHash: 50, | |
scriptHash: 55, | |
wif: 178 | |
); | |
main () { | |
var mnemonic = "like like like like like like like like like like like like"; // your mnemonic phrase | |
var seed = bip39.mnemonicToSeed(mnemonic); | |
var masterWallet = new HDWallet.fromSeed(seed, network: MONACOIN); | |
var node = masterWallet.derivePath("m/44'/22'/0'"); | |
print(node.derive(0).derive(0).address); // => MPb8dEsv7TuEoXKNSmBAyQXgPnuYByxbb2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment