weishirongzhen / flutter_trust_wallet_core

MIT License
88 stars 33 forks source link

How to create HDWallet by using privateKey? #31

Closed remboshelby closed 2 years ago

remboshelby commented 2 years ago

Hello. Your plugging is very useful. Thank you for it. Now Im trying create HDWallet from privateKey using method createWithData. As I understood this method provides creation wallet using entropy. Can you help me how to use this method with privateKey? or it is not impossible?

weishirongzhen commented 2 years ago

wallet core source code alreay point it out.

` /// Creates an HDWallet from entropy (corresponding to a mnemonic). /// Null is returned on invalid input. Returned object needs to be deleted.

TW_EXPORT_STATIC_METHOD struct TWHDWallet _Nullable TWHDWalletCreateWithEntropy(TWData _Nonnull entropy, TWString *_Nonnull passphrase); `

entropy corresponding to a mnemonic, privateKey is not able to create "hdwallet".

remboshelby commented 2 years ago

Okey. Thank you for response.