Skip to content

How to import private key of metamask to wallet-core? #1625

Answered by optout21
Hazhir007 asked this question in Q&A
Discussion options

You must be logged in to vote

'PrivateKey::isValid' has a one-parameter version, and a two-paramter version, and the first parameter is the key data, but it must be Data type, not string. Hint: use parse("") from HexCoding.
https://github.com/trustwallet/wallet-core/blob/master/src/PrivateKey.h#L33
Test:
https://github.com/trustwallet/wallet-core/blob/master/tests/PrivateKeyTests.cpp#L20
Test with create (TW):
https://github.com/trustwallet/wallet-core/blob/master/tests/interface/TWPrivateKeyTests.cpp#L21

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Hazhir007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1622 on September 06, 2021 08:02.