symbol / symbol-hd-wallets

Hierarchical-deterministic wallets library for Symbol
BSD 2-Clause "Simplified" License
11 stars 16 forks source link

Signing with a hyper-deterministic wallet #4

Closed kahwooi closed 5 years ago

kahwooi commented 5 years ago

How do you implement sign transaction. Are you using nem2-sdk library to sign the transaction?

evias commented 5 years ago

Yes. You must use the ExtendedKey.getPrivateKey('hex') method and you can initiate an Account on the sdk with that 👍

const mnemo = MnemonicPassPhrase.createRandom();
const bip32Node = ExtendedKey.createFromSeed(mnemo.toSeed('password-here'));
const defaultWallet = bip32Node.derivePath("m/44'/43'/0'/0'/0'");
const account = Account.createFromPrivateKey(defaultWallet.getPrivateKey('hex'), NetworkType.MIJIN_TEST);