Skip to content

Commit

Permalink
fix: pass Uint8Array to getPublicKey method
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsonevv committed Feb 22, 2024
1 parent bdaed65 commit c465557
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silly-queens-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@near-js/crypto": patch
---

Pass Uint8Array to getPublicKey method.
2 changes: 1 addition & 1 deletion packages/crypto/src/key_pair_ed25519.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class KeyPairEd25519 extends KeyPairBase {
*/
static fromRandom() {
const secretKey = randombytes(KeySize.SECRET_KEY);
const publicKey = ed25519.getPublicKey(secretKey);
const publicKey = ed25519.getPublicKey(new Uint8Array(secretKey));
const extendedSecretKey = new Uint8Array([...secretKey, ...publicKey]);
return new KeyPairEd25519(baseEncode(extendedSecretKey));
}
Expand Down

0 comments on commit c465557

Please sign in to comment.