Skip to content

Commit

Permalink
fix: add jsdoc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Dec 13, 2021
1 parent 66d543d commit 4cd969f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export type Status =
| 'NOT_RECEIVED'
| 'RECEIVED'
| 'PENDING'
| 'ACCEPTED_ON_L1'
| 'ACCEPTED_ON_L2'
| 'ACCEPTED_ON_L1'
| 'REJECTED';
export type TransactionStatus = 'TRANSACTION_RECEIVED';
export type Type = 'DEPLOY' | 'INVOKE_FUNCTION';
Expand Down
6 changes: 6 additions & 0 deletions src/utils/ellipticCurve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export function getStarkKey(keyPair: KeyPair): string {
return addHexPrefix(sanitizeBytes((keyPair as any).pub.getX().toString(16), 2));
}

/**
* Takes a public key and casts it into `elliptic` KeyPair format.
*
* @param publicKey - public key which should get casted to a KeyPair
* @returns keyPair with public key only, which can be used to verify signatures, but cant sign anything
*/
export function getKeyPairFromPublicKey(publicKey: BigNumberish): KeyPair {
const publicKeyBn = toBN(publicKey);
return ec.keyFromPublic(removeHexPrefix(toHex(publicKeyBn)), 'hex');
Expand Down

0 comments on commit 4cd969f

Please sign in to comment.