File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
infrastructure/signature-validator/src Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change 11import axios from "axios" ;
22import * 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 ) } ` ) ;
You can’t perform that action at this time.
0 commit comments