From c25bf102fee7239884a482f55e9d1f63cf042bfe Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 19 Apr 2023 05:10:26 -0400 Subject: [PATCH] refactor: switch to ed25519-keygen --- ...ro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch | 18 ------------------ package.json | 2 +- src/lib/seed.ts | 2 +- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 .yarn/patches/micro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch diff --git a/.yarn/patches/micro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch b/.yarn/patches/micro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch deleted file mode 100644 index 4b4a085..0000000 --- a/.yarn/patches/micro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/index.js b/index.js -index dc628dab1a201e6679a1716b3d51b56e4723b49d..9daeb44298586d51d7bb6e859a1dd696846e0078 100644 ---- a/index.js -+++ b/index.js -@@ -115,11 +115,11 @@ class HDKey { - }); - } - sign(message) { -- message = ensureBytes(message, 32); -+ message = ensureBytes(message); - return ed25519.sync.sign(message, this.privateKey); - } - verify(message, signature) { -- message = ensureBytes(message, 32); -+ message = ensureBytes(message); - signature = ensureBytes(signature, 64); - return ed25519.sync.verify(signature, message, this.publicKeyRaw); - } diff --git a/package.json b/package.json index 163e098..4402907 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "b4a": "^1.6.1", "compact-encoding": "^2.11.0", "dotenv": "^16.0.1", + "ed25519-keygen": "^0.4.1", "ethers": "^5.6.9", "eventemitter2": "^6.4.9", "fastify": "^4.10.2", @@ -33,7 +34,6 @@ "json-stable-stringify": "^1.0.1", "json-stringify-deterministic": "^1.0.7", "loady": "git+https://github.com/LumeWeb/loady.git", - "micro-ed25519-hdkey": "patch:micro-ed25519-hdkey@npm%3A0.1.2#~/.yarn/patches/micro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch", "msgpackr": "^1.6.1", "node-cache": "^5.1.2", "node-cron": "^3.0.1", diff --git a/src/lib/seed.ts b/src/lib/seed.ts index cb0be8b..1de0f7c 100644 --- a/src/lib/seed.ts +++ b/src/lib/seed.ts @@ -1,4 +1,4 @@ -import { HDKey } from "micro-ed25519-hdkey"; +import { HDKey } from "ed25519-keygen/hdkey"; import config from "../config"; import * as bip39 from "@scure/bip39"; import { wordlist } from "@scure/bip39/wordlists/english";