Skip to content

Commit

Permalink
fix: remove noble package and add js-sha3
Browse files Browse the repository at this point in the history
  • Loading branch information
jccguimaraes committed Dec 26, 2024
1 parent c861401 commit 21823ff
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libs/ledgerjs/packages/hw-app-aptos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"dependencies": {
"@ledgerhq/errors": "workspace:^",
"@ledgerhq/hw-transport": "workspace:^",
"@noble/hashes": "1.5.0",
"bip32-path": "^0.4.2"
"bip32-path": "^0.4.2",
"js-sha3": "0.9.3"
},
"devDependencies": {
"@ledgerhq/hw-transport-mocker": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions libs/ledgerjs/packages/hw-app-aptos/src/Aptos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
********************************************************************************/

import BIPPath from "bip32-path";
import { sha3_256 as sha3Hash } from "@noble/hashes/sha3";
import { sha3_256 as sha3Hash } from "js-sha3";
import Transport from "@ledgerhq/hw-transport";
import { StatusCodes } from "@ledgerhq/errors";

Expand Down Expand Up @@ -207,7 +207,7 @@ export default class Aptos {
const hash = sha3Hash.create();
hash.update(pubKey);
hash.update("\x00");
return Buffer.from(hash.digest());
return Buffer.from(hash.hex());
}

private throwOnFailure(reply: Buffer): void {
Expand Down
161 changes: 155 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 21823ff

Please sign in to comment.