Skip to content

Commit 7b6442e

Browse files
authored
hotfix: signature validotr dep (#613)
1 parent 021922a commit 7b6442e

File tree

1 file changed

+1
-12
lines changed
  • infrastructure/signature-validator/src

1 file changed

+1
-12
lines changed

infrastructure/signature-validator/src/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
import axios from "axios";
22
import * as jose from "jose";
3-
4-
// Lazy initialization for base58btc to handle ESM module resolution
5-
let base58btcModule: { base58btc: { decode: (input: string) => Uint8Array } } | null = null;
6-
7-
async function getBase58btc() {
8-
if (!base58btcModule) {
9-
base58btcModule = await import("multiformats/bases/base58");
10-
}
11-
return base58btcModule.base58btc;
12-
}
3+
import { base58btc } from "multiformats/bases/base58";
134

145
/**
156
* Options for signature verification
@@ -68,7 +59,6 @@ async function decodeMultibasePublicKey(multibaseKey: string): Promise<Uint8Arra
6859

6960
// Try base58btc (standard multibase 'z' prefix)
7061
try {
71-
const base58btc = await getBase58btc();
7262
return base58btc.decode(encoded);
7363
} catch (error) {
7464
throw new Error(
@@ -87,7 +77,6 @@ async function decodeSignature(signature: string): Promise<Uint8Array> {
8777
// If it starts with 'z', it's multibase base58btc
8878
if (signature.startsWith("z")) {
8979
try {
90-
const base58btc = await getBase58btc();
9180
return base58btc.decode(signature.slice(1));
9281
} catch (error) {
9382
throw new Error(`Failed to decode multibase signature: ${error instanceof Error ? error.message : String(error)}`);

0 commit comments

Comments
 (0)