diff --git a/src/lib/privateRepo.ts b/src/lib/privateRepo.ts index 206a550..b9705de 100644 --- a/src/lib/privateRepo.ts +++ b/src/lib/privateRepo.ts @@ -2,10 +2,18 @@ import crypto from 'crypto'; import type { PrivateState } from '../types'; import { getActivePublicKey } from './arweaveHelper'; import { getWallet, initArweave } from './common'; -import { isCryptoKey } from 'util/types'; const arweave = initArweave(); +function isCryptoKey(obj: any) { + try { + // @ts-ignore + return obj instanceof CryptoKey; + } catch (e) { + return obj instanceof crypto.webcrypto.CryptoKey; + } +} + async function deriveAddress(publicKey: string) { const pubKeyBuf = arweave.utils.b64UrlToBuffer(publicKey); const sha512DigestBuf = await crypto.subtle.digest('SHA-512', pubKeyBuf);