-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TRCL-3691 v4-client: Add signing function for push #233
Conversation
@@ -147,6 +147,12 @@ export async function connectWallet(mnemonic: string): Promise<string> { | |||
globalThis.wallet = await LocalWallet.fromMnemonic(mnemonic, BECH32_PREFIX); | |||
globalThis.nobleWallet = await LocalWallet.fromMnemonic(mnemonic, NOBLE_BECH32_PREFIX); | |||
|
|||
const { privateKey, publicKey } = deriveHDKeyFromMnemonic(mnemonic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are already setting the hdKey in deriveMnemomicFromEthereumSignature
, are we able to use it?
This way we shouldn't need to make deriveHDKeyFromMnemonic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deriveMnemomicFromEthereumSignature
is called during onboarding only, and client stores the mnemonic. This is why the current compliance flow doesn't work since deriveMnemomicFromEthereumSignature
is not called every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhh ok TIL
* | ||
* @returns Priv/pub keys | ||
*/ | ||
export const deriveHDKeyFromMnemonic = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe we can call this from exportMnemonicAndPrivateKey
* Add native function to sign push notification token registration payload * Bump version * Fix * Clean up * Clean up
Add native function to sign push notification token registration payload. Also add function to derive keys from mnemonic. This also fixes the function signCompliancePayload().