From 3a7d25c3a2f2305b5efa0a127779851225a1f5ce Mon Sep 17 00:00:00 2001 From: Merul Dhiman Date: Fri, 12 Dec 2025 17:54:35 +0530 Subject: [PATCH] hotfix: signature validotr dep --- infrastructure/signature-validator/src/index.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/infrastructure/signature-validator/src/index.ts b/infrastructure/signature-validator/src/index.ts index c8970229..633c4414 100644 --- a/infrastructure/signature-validator/src/index.ts +++ b/infrastructure/signature-validator/src/index.ts @@ -1,15 +1,6 @@ import axios from "axios"; import * as jose from "jose"; - -// Lazy initialization for base58btc to handle ESM module resolution -let base58btcModule: { base58btc: { decode: (input: string) => Uint8Array } } | null = null; - -async function getBase58btc() { - if (!base58btcModule) { - base58btcModule = await import("multiformats/bases/base58"); - } - return base58btcModule.base58btc; -} +import { base58btc } from "multiformats/bases/base58"; /** * Options for signature verification @@ -68,7 +59,6 @@ async function decodeMultibasePublicKey(multibaseKey: string): Promise { // If it starts with 'z', it's multibase base58btc if (signature.startsWith("z")) { try { - const base58btc = await getBase58btc(); return base58btc.decode(signature.slice(1)); } catch (error) { throw new Error(`Failed to decode multibase signature: ${error instanceof Error ? error.message : String(error)}`);