Skip to content

Commit 546ea34

Browse files
committed
fix: SDK wallet.ts - use globalThis and any type for isomorphic crypto
1 parent b1bd71c commit 546ea34

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sdk/src/wallet.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import { bytesToHex, hexToBytes } from './utils';
99

1010
// Placeholder for crypto operations
1111
// In production, use @noble/ed25519 or similar
12-
declare const window: { crypto: Crypto } | undefined;
13-
const crypto = typeof window !== 'undefined' ? window.crypto : (require('crypto').webcrypto as Crypto);
12+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
13+
const crypto: any = typeof globalThis !== 'undefined' && (globalThis as any).crypto
14+
? (globalThis as any).crypto
15+
: require('crypto').webcrypto;
1416

1517
/**
1618
* Key pair (public/private)

0 commit comments

Comments
 (0)