Skip to content

Commit

Permalink
Import tweetnacl via default export to support common js (#59)
Browse files Browse the repository at this point in the history
* import tweetnacl via default export to support commonJS

* import tweetnacl via default export to support commonJS
  • Loading branch information
0xmaayan authored Jan 19, 2023
1 parent d4e298f commit d711f43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-falcons-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aptos-labs/wallet-adapter-core": patch
---

Import tweetnacl package via default export to support commonJS
4 changes: 2 additions & 2 deletions packages/wallet-adapter-core/src/WalletCore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HexString, Types } from "aptos";
import EventEmitter from "eventemitter3";
import { sign } from "tweetnacl";
import nacl from "tweetnacl";
import { Buffer } from "buffer";

import { WalletReadyState } from "./constants";
Expand Down Expand Up @@ -374,7 +374,7 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
);
// support for when address doesnt have hex prefix (0x)
const signature = new HexString(response.signature);
verified = sign.detached.verify(
verified = nacl.sign.detached.verify(
Buffer.from(response.fullMessage),
Buffer.from(signature.noPrefix(), "hex"),
Buffer.from(currentAccountPublicKey.noPrefix(), "hex")
Expand Down

0 comments on commit d711f43

Please sign in to comment.