We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
getKeyPairFromPublicKey
1 parent fc1e086 commit 66d543dCopy full SHA for 66d543d
src/utils/ellipticCurve.ts
@@ -53,6 +53,11 @@ export function getStarkKey(keyPair: KeyPair): string {
53
return addHexPrefix(sanitizeBytes((keyPair as any).pub.getX().toString(16), 2));
54
}
55
56
+export function getKeyPairFromPublicKey(publicKey: BigNumberish): KeyPair {
57
+ const publicKeyBn = toBN(publicKey);
58
+ return ec.keyFromPublic(removeHexPrefix(toHex(publicKeyBn)), 'hex');
59
+}
60
+
61
/*
62
Signs a message using the provided key.
63
key should be an KeyPair with a valid private key.
0 commit comments