diff --git a/package.json b/package.json index f636f387..cfe25c15 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,6 @@ "async-mutex": "^0.4.1", "elliptic": "^6.5.4", "ethers": "^5.7.2", - "js-sha3": "0.9.3", "long": "^5.2.3" }, "devDependencies": { diff --git a/rollup.config.bench.js b/rollup.config.bench.js index b6642db1..3b465dea 100644 --- a/rollup.config.bench.js +++ b/rollup.config.bench.js @@ -12,7 +12,6 @@ const external = [ 'crypto', 'elliptic', 'ethers', - 'js-sha3', 'long', ] diff --git a/rollup.config.js b/rollup.config.js index ba4454f3..268438aa 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -16,7 +16,6 @@ const external = [ 'crypto', 'elliptic', 'ethers', - 'js-sha3', 'long', ] diff --git a/src/authn/LocalAuthenticator.ts b/src/authn/LocalAuthenticator.ts index 8180b570..425b7538 100644 --- a/src/authn/LocalAuthenticator.ts +++ b/src/authn/LocalAuthenticator.ts @@ -1,11 +1,9 @@ -import sha3 from 'js-sha3' import { authn, signature, publicKey } from '@xmtp/proto' import AuthData from './AuthData' import { PrivateKey } from '../crypto' import { hexToBytes } from '../crypto/utils' import Token from './Token' - -const { keccak256 } = sha3 +import { keccak256 } from 'viem' export default class LocalAuthenticator { private identityKey: PrivateKey diff --git a/test/authn/Authn.test.ts b/test/authn/Authn.test.ts index ecf342dc..0e0170fd 100644 --- a/test/authn/Authn.test.ts +++ b/test/authn/Authn.test.ts @@ -1,4 +1,3 @@ -import sha3 from 'js-sha3' import Long from 'long' import { PrivateKey, PrivateKeyBundleV1, Signature } from '../../src/crypto' import Authenticator from '../../src/authn/LocalAuthenticator' @@ -7,8 +6,7 @@ import { hexToBytes } from '../../src/crypto/utils' import { newWallet, sleep } from '../helpers' import { Wallet } from 'ethers' import AuthCache from '../../src/authn/AuthCache' - -const { keccak256 } = sha3 +import { keccak256 } from 'viem' describe('authn', () => { let authenticator: Authenticator diff --git a/yarn.lock b/yarn.lock index 8454e638..0bffe4bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2571,7 +2571,6 @@ __metadata: ethers: "npm:^5.7.2" happy-dom: "npm:^13.6.2" husky: "npm:^7.0.4" - js-sha3: "npm:0.9.3" long: "npm:^5.2.3" prettier: "npm:^3.2.5" prettier-plugin-packagejson: "npm:^2.4.12" @@ -6289,13 +6288,6 @@ __metadata: languageName: node linkType: hard -"js-sha3@npm:0.9.3": - version: 0.9.3 - resolution: "js-sha3@npm:0.9.3" - checksum: 10/8daacb93b18609a0dc081f2f6199b80a96df36f9975b4b9c7476ae92822e07100b9e1969fc76f4b58e703cd6175f0de7656a99cbb2335cfb554c66f988fbead5 - languageName: node - linkType: hard - "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0"