From 75c9779f81552c817c9c31b7bbcdee071f2f5156 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 25 Nov 2024 12:52:39 -0800 Subject: [PATCH] Fix tools sign function. --- src/lib/tools.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/tools.ts b/src/lib/tools.ts index bc76205..153539b 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -86,10 +86,11 @@ export async function hash (data: string | string[], encoding?: 'hex'): Promise< * @returns {Promise} Hexadecimal-formatted signature */ export async function sign (key: string, ...input: string[]): Promise { + const account = await Account.fromPrivateKey(key) const data = await hash(input) const signature = Ed25519.sign( hex.toBytes(data), - hex.toBytes(key)) + hex.toBytes(`${account.privateKey}${account.publicKey}`)) return bytes.toHex(signature.subarray(0, 64)) } -- 2.34.1