From cce3d4365bfc80b22a856b7ca9f5add973191d3b Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Wed, 24 May 2023 06:46:44 +0100 Subject: [PATCH 01/16] wip: world bridge --- idkit/package.json | 2 + idkit/pnpm-lock.yaml | 20 +++++ .../IDKitWidget/States/WorldIDState.tsx | 79 ++++++++--------- idkit/src/lib/hashing.ts | 7 ++ idkit/src/services/wld-bridge.ts | 86 +++++++++++++++++++ 5 files changed, 152 insertions(+), 42 deletions(-) create mode 100644 idkit/src/services/wld-bridge.ts diff --git a/idkit/package.json b/idkit/package.json index aa458a56..e0049dc9 100644 --- a/idkit/package.json +++ b/idkit/package.json @@ -62,6 +62,7 @@ "country-telephone-data": "^0.6.3", "framer-motion": "^7.6.7", "js-sha3": "^0.8.0", + "libsodium-wrappers": "^0.7.11", "phone": "^3.1.37", "posthog-js-lite": "2.0.0", "qr-code-styling-new": "^1.6.1", @@ -80,6 +81,7 @@ "@testing-library/react": "^14.0.0", "@types/country-telephone-data": "^0.6.1", "@types/jest": "^29.5.0", + "@types/libsodium-wrappers": "^0.7.10", "@types/node": "18.11.9", "@types/qrcode": "^1.5.0", "@types/react": "18.0.25", diff --git a/idkit/pnpm-lock.yaml b/idkit/pnpm-lock.yaml index b21ab5b3..0041f826 100644 --- a/idkit/pnpm-lock.yaml +++ b/idkit/pnpm-lock.yaml @@ -46,6 +46,9 @@ dependencies: js-sha3: specifier: ^0.8.0 version: 0.8.0 + libsodium-wrappers: + specifier: ^0.7.11 + version: 0.7.11 phone: specifier: ^3.1.37 version: 3.1.37 @@ -96,6 +99,9 @@ devDependencies: '@types/jest': specifier: ^29.5.0 version: 29.5.0 + '@types/libsodium-wrappers': + specifier: ^0.7.10 + version: 0.7.10 '@types/node': specifier: 18.11.9 version: 18.11.9 @@ -1656,6 +1662,10 @@ packages: resolution: {integrity: sha512-1YXyYH83h6We1djyoUEqTlVyQtCfJAFXELSKW2ZRtjHD4hQ82CC4lvrv5D0l0FLcKBaiPbXyi3MpMsI9ZRgKsw==} dev: true + /@types/libsodium-wrappers@0.7.10: + resolution: {integrity: sha512-BqI9B92u+cM3ccp8mpHf+HzJ8fBlRwdmyd6+fz3p99m3V6ifT5O3zmOMi612PGkpeFeG/G6loxUnzlDNhfjPSA==} + dev: true + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -5695,6 +5705,16 @@ packages: type-check: 0.4.0 dev: true + /libsodium-wrappers@0.7.11: + resolution: {integrity: sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==} + dependencies: + libsodium: 0.7.11 + dev: false + + /libsodium@0.7.11: + resolution: {integrity: sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A==} + dev: false + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} diff --git a/idkit/src/components/IDKitWidget/States/WorldIDState.tsx b/idkit/src/components/IDKitWidget/States/WorldIDState.tsx index ec784a50..c4acd2fb 100644 --- a/idkit/src/components/IDKitWidget/States/WorldIDState.tsx +++ b/idkit/src/components/IDKitWidget/States/WorldIDState.tsx @@ -7,6 +7,7 @@ import { shallow } from 'zustand/shallow' import { useEffect, useState } from 'react' import type { IDKitStore } from '@/store/idkit' import AboutWorldID from '@/components/AboutWorldID' +import { useWorldBridge } from '@/services/wld-bridge' import useAppConnection from '@/services/walletconnect' import LoadingIcon from '@/components/Icons/LoadingIcon' import WorldcoinIcon from '@/components/Icons/WorldcoinIcon' @@ -47,31 +48,24 @@ const WorldIDState = () => { setErrorState, } = useIDKitStore(getOptions, shallow) - const { result, qrData, verificationState, reset, errorCode } = useAppConnection( - app_id, - action, - signal, - credential_types, - action_description, - walletConnectProjectId - ) + const { connector } = useWorldBridge(app_id, action, signal, credential_types, action_description) - useEffect(() => reset, [reset]) + // useEffect(() => reset, [reset]) - useEffect(() => { - if (verificationState === VerificationState.Failed) { - setStage(IDKITStage.ERROR) - setErrorState({ code: errorCode ?? AppErrorCodes.GenericError }) - } + // useEffect(() => { + // if (verificationState === VerificationState.Failed) { + // setStage(IDKITStage.ERROR) + // setErrorState({ code: errorCode ?? AppErrorCodes.GenericError }) + // } - if (result) { - if (!isExperimental) return handleVerify(result) + // if (result) { + // if (!isExperimental) return handleVerify(result) - const { nullifier_hash, credential_type, ...proof_payload } = result + // const { nullifier_hash, credential_type, ...proof_payload } = result - handleVerify({ proof_payload, nullifier_hash, credential_type }) - } - }, [result, reset, handleVerify, verificationState, setStage, errorCode, setErrorState, isExperimental]) + // handleVerify({ proof_payload, nullifier_hash, credential_type }) + // } + // }, [result, reset, handleVerify, verificationState, setStage, errorCode, setErrorState, isExperimental]) return (
@@ -79,8 +73,7 @@ const WorldIDState = () => {
-

- {/* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing */} + {/*

{verificationState === VerificationState.AwaitingVerification ? __('Confirm in World App') : __('Continue with Worldcoin')} @@ -89,35 +82,37 @@ const WorldIDState = () => {

Please confirm the request in your app to continue.

- )} + )} */}
- {verificationState === VerificationState.AwaitingVerification ? ( + {/* {verificationState === VerificationState.AwaitingVerification ? (
- ) : ( - + ) : ( */} + {connector && ( + )} + {/* )} {(media == 'desktop' || !showQR) && (verificationState === VerificationState.AwaitingConnection || verificationState === VerificationState.LoadingWidget) && } - {hasPhone && verificationState == VerificationState.AwaitingConnection && ( -
-
-
-

or

-
-
-
- -
+ {hasPhone && verificationState == VerificationState.AwaitingConnection && ( */} +
+
+
+

or

+
- )} +
+ +
+
+ {/* )} */}
) } diff --git a/idkit/src/lib/hashing.ts b/idkit/src/lib/hashing.ts index ee5a578a..ab1abaa3 100644 --- a/idkit/src/lib/hashing.ts +++ b/idkit/src/lib/hashing.ts @@ -2,6 +2,7 @@ import sha3 from 'js-sha3' import type { AbiEncodedValue } from '@/types' import { pack } from '@ethersproject/solidity' import type { IDKitConfig } from '@/types/config' +import type { KeyPair } from 'libsodium-wrappers' import type { BytesLike } from '@ethersproject/bytes' import { arrayify, concat, hexlify, isBytesLike } from '@ethersproject/bytes' @@ -110,3 +111,9 @@ export const encodeAction = (action: IDKitConfig['action']): string => { return action.types.map((type, index) => `${type}(${action.values[index]})`).join(',') } + +export const encodeKey = (key: KeyPair): string => { + return `0x${Array.from(key.publicKey) + .map(b => b.toString(16).padStart(2, '0')) + .join('')}` +} diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts new file mode 100644 index 00000000..0cc957c1 --- /dev/null +++ b/idkit/src/services/wld-bridge.ts @@ -0,0 +1,86 @@ +import { create } from 'zustand' +import { useEffect, useRef } from 'react' +import libsodium from 'libsodium-wrappers' +import type { IDKitConfig } from '@/types/config' +import { encodeAction, encodeKey, generateSignal } from '@/lib/hashing' + +type WorldBridgeStore = { + connector: string | null + key: libsodium.KeyPair | null + + getConnectorURI: ( + app_id: IDKitConfig['app_id'], + action: IDKitConfig['action'], + signal?: IDKitConfig['signal'], + credential_types?: IDKitConfig['credential_types'], + action_description?: IDKitConfig['action_description'] + ) => string + createClient: ( + app_id: IDKitConfig['app_id'], + action: IDKitConfig['action'], + signal?: IDKitConfig['signal'], + credential_types?: IDKitConfig['credential_types'], + action_description?: IDKitConfig['action_description'] + ) => Promise +} + +const useWorldBridgeStore = create((set, get) => ({ + key: null, + connector: null, + + createClient: async ( + app_id: IDKitConfig['app_id'], + action: IDKitConfig['action'], + signal?: IDKitConfig['signal'], + credential_types?: IDKitConfig['credential_types'], + action_description?: IDKitConfig['action_description'] + ) => { + await libsodium.ready + + set({ key: libsodium.crypto_box_keypair() }) + set({ connector: get().getConnectorURI(app_id, action, signal, credential_types, action_description) }) + }, + + getConnectorURI: ( + app_id: IDKitConfig['app_id'], + action: IDKitConfig['action'], + signal?: IDKitConfig['signal'], + credential_types?: IDKitConfig['credential_types'], + action_description?: IDKitConfig['action_description'] + ) => { + const key = get().key + if (!key) throw new Error('No keypair found. Please call `createClient` first.') + + const params = new URLSearchParams({ + app_id, + key: encodeKey(key), + action: encodeAction(action), + }) + + if (signal) params.set('signal', generateSignal(signal).digest) + if (action_description) params.set('action_description', action_description) + if (credential_types) params.set('credential_types', credential_types.join(',')) + + return `https://id.worldcoin.org/verify?${params.toString()}` + }, +})) + +export const useWorldBridge = ( + app_id: IDKitConfig['app_id'], + action: IDKitConfig['action'], + signal?: IDKitConfig['signal'], + credential_types?: IDKitConfig['credential_types'], + action_description?: IDKitConfig['action_description'] +) => { + const { connector, createClient } = useWorldBridgeStore() + const ref_credential_types = useRef(credential_types) + + useEffect(() => { + if (!app_id) return + if (!connector) { + void createClient(app_id, action, signal, ref_credential_types.current, action_description) + } + }, [app_id, action, signal, action_description, createClient, ref_credential_types, connector]) + + return { connector } +} From b3e0ba971fcc63c09e0c1bdb18e8ab8ea935c37a Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Wed, 24 May 2023 07:08:30 +0100 Subject: [PATCH 02/16] wip --- .../IDKitWidget/States/WorldID/QRState.tsx | 11 +-- .../IDKitWidget/States/WorldIDState.tsx | 94 +++++++++---------- idkit/src/lib/hashing.ts | 4 +- idkit/src/services/wld-bridge.ts | 87 +++++++++++++---- idkit/src/store/idkit.ts | 8 +- idkit/src/types/bridge.ts | 22 +++++ idkit/src/types/config.ts | 2 +- 7 files changed, 147 insertions(+), 81 deletions(-) create mode 100644 idkit/src/types/bridge.ts diff --git a/idkit/src/components/IDKitWidget/States/WorldID/QRState.tsx b/idkit/src/components/IDKitWidget/States/WorldID/QRState.tsx index b8599fda..763fb29d 100644 --- a/idkit/src/components/IDKitWidget/States/WorldID/QRState.tsx +++ b/idkit/src/components/IDKitWidget/States/WorldID/QRState.tsx @@ -10,10 +10,7 @@ import LoadingIcon from '@/components/Icons/LoadingIcon' import WorldcoinIcon from '@/components/Icons/WorldcoinIcon' type Props = { - qrData: { - default: string - mobile: string - } | null + qrData: string | null showQR: boolean setShowQR: (show: boolean | ((state: boolean) => boolean)) => void } @@ -23,7 +20,7 @@ const QRState: FC = ({ qrData, showQR, setShowQR }) => { const [copiedLink, setCopiedLink] = useState(false) const copyLink = useCallback(() => { - copy(qrData?.default ?? '') + copy(qrData ?? '') setCopiedLink(true) setTimeout(() => setCopiedLink(false), 2000) @@ -59,7 +56,7 @@ const QRState: FC = ({ qrData, showQR, setShowQR }) => { {qrData ? ( // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
- +
) : (
@@ -72,11 +69,11 @@ const QRState: FC = ({ qrData, showQR, setShowQR }) => { )}
({ @@ -19,6 +18,7 @@ const getOptions = (store: IDKitStore) => ({ app_id: store.app_id, action: store.action, setStage: store.setStage, + bridgeUrl: store.bridgeUrl, handleVerify: store.handleVerify, setErrorState: store.setErrorState, showAbout: store.methods.length == 1, @@ -26,7 +26,6 @@ const getOptions = (store: IDKitStore) => ({ isExperimental: store.methods.length > 0, hasPhone: store.methods.includes('phone'), action_description: store.action_description, - walletConnectProjectId: store.walletConnectProjectId, usePhone: () => store.setStage(IDKITStage.ENTER_PHONE), }) @@ -41,6 +40,7 @@ const WorldIDState = () => { usePhone, handleVerify, isExperimental, + bridgeUrl, action_description, credential_types, hasPhone, @@ -48,24 +48,31 @@ const WorldIDState = () => { setErrorState, } = useIDKitStore(getOptions, shallow) - const { connector } = useWorldBridge(app_id, action, signal, credential_types, action_description) + const { connectorURI, reset, errorCode, result, verificationState } = useWorldBridge( + app_id, + action, + signal, + bridgeUrl, + credential_types, + action_description + ) - // useEffect(() => reset, [reset]) + useEffect(() => reset, [reset]) - // useEffect(() => { - // if (verificationState === VerificationState.Failed) { - // setStage(IDKITStage.ERROR) - // setErrorState({ code: errorCode ?? AppErrorCodes.GenericError }) - // } + useEffect(() => { + if (verificationState === VerificationState.Failed) { + setStage(IDKITStage.ERROR) + setErrorState({ code: errorCode ?? AppErrorCodes.GenericError }) + } - // if (result) { - // if (!isExperimental) return handleVerify(result) + if (result) { + if (!isExperimental) return handleVerify(result) - // const { nullifier_hash, credential_type, ...proof_payload } = result + const { nullifier_hash, credential_type, ...proof_payload } = result - // handleVerify({ proof_payload, nullifier_hash, credential_type }) - // } - // }, [result, reset, handleVerify, verificationState, setStage, errorCode, setErrorState, isExperimental]) + handleVerify({ proof_payload, nullifier_hash, credential_type }) + } + }, [result, reset, handleVerify, verificationState, setStage, errorCode, setErrorState, isExperimental]) return (
@@ -73,46 +80,35 @@ const WorldIDState = () => {
- {/*

- {verificationState === VerificationState.AwaitingVerification - ? __('Confirm in World App') - : __('Continue with Worldcoin')} +

+ {__('Continue with Worldcoin')}

- {verificationState === VerificationState.AwaitingVerification && ( -

- Please confirm the request in your app to continue. -

- )} */}
- {/* {verificationState === VerificationState.AwaitingVerification ? ( + {verificationState === VerificationState.PreparingClient ? (
- ) : ( */} - {connector && ( - + ) : ( + )} - {/* )} - {(media == 'desktop' || !showQR) && - (verificationState === VerificationState.AwaitingConnection || - verificationState === VerificationState.LoadingWidget) && } - {hasPhone && verificationState == VerificationState.AwaitingConnection && ( */} -
-
-
-

or

-
+ {(media == 'desktop' || !showQR) && } + {hasPhone && ( +
+
+
+

or

+
+
+
+ +
-
- -
-
- {/* )} */} + )}
) } diff --git a/idkit/src/lib/hashing.ts b/idkit/src/lib/hashing.ts index ab1abaa3..99da8695 100644 --- a/idkit/src/lib/hashing.ts +++ b/idkit/src/lib/hashing.ts @@ -112,8 +112,8 @@ export const encodeAction = (action: IDKitConfig['action']): string => { return action.types.map((type, index) => `${type}(${action.values[index]})`).join(',') } -export const encodeKey = (key: KeyPair): string => { - return `0x${Array.from(key.publicKey) +export const encodeKey = (key: Uint8Array): string => { + return `0x${Array.from(key) .map(b => b.toString(16).padStart(2, '0')) .join('')}` } diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index 0cc957c1..d794d4ee 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -1,12 +1,21 @@ import { create } from 'zustand' +import type { ISuccessResult } from '..' import { useEffect, useRef } from 'react' import libsodium from 'libsodium-wrappers' import type { IDKitConfig } from '@/types/config' +import { VerificationState } from '@/types/bridge' +import type { AppErrorCodes } from '@/types/bridge' import { encodeAction, encodeKey, generateSignal } from '@/lib/hashing' +const DEFAULT_BRIDGE_URL = 'https://bridge.worldcoin.org/' + type WorldBridgeStore = { - connector: string | null + bridgeUrl: string + connectorURI: string | null + result: ISuccessResult | null key: libsodium.KeyPair | null + errorCode: AppErrorCodes | null + verificationState: VerificationState getConnectorURI: ( app_id: IDKitConfig['app_id'], @@ -15,30 +24,45 @@ type WorldBridgeStore = { credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] ) => string + createClient: ( app_id: IDKitConfig['app_id'], action: IDKitConfig['action'], signal?: IDKitConfig['signal'], + bridgeUrl?: IDKitConfig['bridgeUrl'], credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] ) => Promise + + pollForUpdates: () => Promise + + reset: () => void } const useWorldBridgeStore = create((set, get) => ({ key: null, - connector: null, + result: null, + errorCode: null, + connectorURI: null, + bridgeUrl: DEFAULT_BRIDGE_URL, + verificationState: VerificationState.PreparingClient, createClient: async ( app_id: IDKitConfig['app_id'], action: IDKitConfig['action'], signal?: IDKitConfig['signal'], + bridgeUrl?: IDKitConfig['bridgeUrl'], credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] ) => { await libsodium.ready - set({ key: libsodium.crypto_box_keypair() }) - set({ connector: get().getConnectorURI(app_id, action, signal, credential_types, action_description) }) + set({ + key: libsodium.crypto_box_keypair(), + bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, + verificationState: VerificationState.PollingForUpdates, + }) + set({ connectorURI: get().getConnectorURI(app_id, action, signal, credential_types, action_description) }) }, getConnectorURI: ( @@ -51,36 +75,63 @@ const useWorldBridgeStore = create((set, get) => ({ const key = get().key if (!key) throw new Error('No keypair found. Please call `createClient` first.') - const params = new URLSearchParams({ - app_id, - key: encodeKey(key), - action: encodeAction(action), - }) - - if (signal) params.set('signal', generateSignal(signal).digest) - if (action_description) params.set('action_description', action_description) + const params = new URLSearchParams({ app_id, action: encodeAction(action), key: encodeKey(key.publicKey) }) if (credential_types) params.set('credential_types', credential_types.join(',')) + if (action_description) params.set('action_description', action_description) + if (signal) params.set('signal', generateSignal(signal).digest) return `https://id.worldcoin.org/verify?${params.toString()}` }, + + pollForUpdates: async () => { + const key = get().key + if (!key) throw new Error('No keypair found. Please call `createClient` first.') + + const response = await fetch(`${get().bridgeUrl}/${encodeKey(libsodium.crypto_generichash(32, key.publicKey))}`) + + if (response.ok) return + + // ... + }, + + reset: () => { + set({ key: null, connectorURI: null }) + }, })) +type UseAppBridgeResponse = { + reset: () => void + connectorURI: string | null + result: ISuccessResult | null + errorCode: AppErrorCodes | null + verificationState: VerificationState +} + export const useWorldBridge = ( app_id: IDKitConfig['app_id'], action: IDKitConfig['action'], signal?: IDKitConfig['signal'], + bridgeUrl?: IDKitConfig['bridgeUrl'], credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] -) => { - const { connector, createClient } = useWorldBridgeStore() +): UseAppBridgeResponse => { + const { reset, result, connectorURI, createClient, pollForUpdates, verificationState, errorCode } = + useWorldBridgeStore() const ref_credential_types = useRef(credential_types) useEffect(() => { if (!app_id) return - if (!connector) { - void createClient(app_id, action, signal, ref_credential_types.current, action_description) + if (!connectorURI) { + void createClient(app_id, action, signal, bridgeUrl, ref_credential_types.current, action_description) } - }, [app_id, action, signal, action_description, createClient, ref_credential_types, connector]) + }, [app_id, action, signal, action_description, createClient, ref_credential_types, bridgeUrl, connectorURI]) + + useEffect(() => { + if (!connectorURI || result) return + + const interval = setInterval(() => void pollForUpdates(), 5000) + return () => clearInterval(interval) + }, [connectorURI, pollForUpdates, result]) - return { connector } + return { connectorURI, reset, result, verificationState, errorCode } } diff --git a/idkit/src/store/idkit.ts b/idkit/src/store/idkit.ts index fb24aa69..d22ddcb8 100644 --- a/idkit/src/store/idkit.ts +++ b/idkit/src/store/idkit.ts @@ -11,8 +11,8 @@ export type IDKitStore = { app_id: IDKitConfig['app_id'] action: IDKitConfig['action'] signal: IDKitConfig['signal'] + bridgeUrl?: IDKitConfig['bridgeUrl'] action_description?: IDKitConfig['action_description'] - walletConnectProjectId?: IDKitConfig['walletConnectProjectId'] credential_types?: IDKitConfig['credential_types'] phoneNumber: string // EXPERIMENTAL @@ -63,7 +63,7 @@ const useIDKitStore = create()((set, get) => ({ phoneNumber: '', // EXPERIMENTAL methods: [], action_description: '', - walletConnectProjectId: '', + bridgeUrl: '', credential_types: [], open: false, @@ -143,7 +143,7 @@ const useIDKitStore = create()((set, get) => ({ credential_types, action_description, experimental_methods, - walletConnectProjectId, + bridgeUrl, autoClose, theme, }: Config, @@ -161,7 +161,7 @@ const useIDKitStore = create()((set, get) => ({ action, app_id, autoClose, - walletConnectProjectId, + bridgeUrl, credential_types: sanitized_credential_types, action_description, methods: experimental_methods ?? store.methods, diff --git a/idkit/src/types/bridge.ts b/idkit/src/types/bridge.ts new file mode 100644 index 00000000..fde1547a --- /dev/null +++ b/idkit/src/types/bridge.ts @@ -0,0 +1,22 @@ +export enum AppErrorCodes { + ConnectionFailed = 'connection_failed', + VerificationRejected = 'verification_rejected', + MaxVerificationsReached = 'max_verifications_reached', + AlreadySigned = 'already_signed', // NOTE: Deprecated, handled for backwards compatibility + CredentialUnavailable = 'credential_unavailable', + MalformedRequest = 'malformed_request', + InvalidNetwork = 'invalid_network', + InclusionProofFailed = 'inclusion_proof_failed', + InclusionProofPending = 'inclusion_proof_pending', + UnexpectedResponse = 'unexpected_response', // NOTE: when the World app returns an unexpected response + FailedByHostApp = 'failed_by_host_app', // NOTE: Host app failed/rejected verification (does not come from World App / simulator) + GenericError = 'generic_error', + InvalidPhoneOTP = 'invalid_phone_otp', // NOTE: Experimental, only for phone verification +} + +export enum VerificationState { + PreparingClient = 'loading_widget', + PollingForUpdates = 'awaiting_connection', + Confirmed = 'confirmed', + Failed = 'failed', +} diff --git a/idkit/src/types/config.ts b/idkit/src/types/config.ts index a7a3ecbb..ab269551 100644 --- a/idkit/src/types/config.ts +++ b/idkit/src/types/config.ts @@ -16,7 +16,7 @@ export type IDKitConfig = { signal?: AbiEncodedValue | string /** Identifier for the action the user is performing. Should be left blank for [Sign in with Worldcoin](https://docs.worldcoin.org/id/sign-in). */ action?: AbiEncodedValue | string - walletConnectProjectId?: string + bridgeUrl?: string /** An array of credential types to allow for verification. Will accept any combination of "orb" & "phone". Defaults to orb. TypeScript apps can use the `CredentialType` enum. */ credential_types?: CredentialType[] // Accepted credentials for verification by the host app } From 5bafc102f7a664a648efe367c73dc8a88e8f2eb5 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 5 Jun 2023 03:05:26 +0100 Subject: [PATCH 03/16] switch to AES --- idkit/package.json | 2 -- idkit/pnpm-lock.yaml | 26 +++------------ idkit/src/lib/crypto.ts | 15 +++++++++ idkit/src/lib/hashing.ts | 9 ++--- idkit/src/services/wld-bridge.ts | 56 +++++++++++++++----------------- 5 files changed, 50 insertions(+), 58 deletions(-) create mode 100644 idkit/src/lib/crypto.ts diff --git a/idkit/package.json b/idkit/package.json index e0049dc9..aa458a56 100644 --- a/idkit/package.json +++ b/idkit/package.json @@ -62,7 +62,6 @@ "country-telephone-data": "^0.6.3", "framer-motion": "^7.6.7", "js-sha3": "^0.8.0", - "libsodium-wrappers": "^0.7.11", "phone": "^3.1.37", "posthog-js-lite": "2.0.0", "qr-code-styling-new": "^1.6.1", @@ -81,7 +80,6 @@ "@testing-library/react": "^14.0.0", "@types/country-telephone-data": "^0.6.1", "@types/jest": "^29.5.0", - "@types/libsodium-wrappers": "^0.7.10", "@types/node": "18.11.9", "@types/qrcode": "^1.5.0", "@types/react": "18.0.25", diff --git a/idkit/pnpm-lock.yaml b/idkit/pnpm-lock.yaml index 0041f826..377a5406 100644 --- a/idkit/pnpm-lock.yaml +++ b/idkit/pnpm-lock.yaml @@ -1,4 +1,8 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: '@ethersproject/bytes': @@ -46,9 +50,6 @@ dependencies: js-sha3: specifier: ^0.8.0 version: 0.8.0 - libsodium-wrappers: - specifier: ^0.7.11 - version: 0.7.11 phone: specifier: ^3.1.37 version: 3.1.37 @@ -99,9 +100,6 @@ devDependencies: '@types/jest': specifier: ^29.5.0 version: 29.5.0 - '@types/libsodium-wrappers': - specifier: ^0.7.10 - version: 0.7.10 '@types/node': specifier: 18.11.9 version: 18.11.9 @@ -1662,10 +1660,6 @@ packages: resolution: {integrity: sha512-1YXyYH83h6We1djyoUEqTlVyQtCfJAFXELSKW2ZRtjHD4hQ82CC4lvrv5D0l0FLcKBaiPbXyi3MpMsI9ZRgKsw==} dev: true - /@types/libsodium-wrappers@0.7.10: - resolution: {integrity: sha512-BqI9B92u+cM3ccp8mpHf+HzJ8fBlRwdmyd6+fz3p99m3V6ifT5O3zmOMi612PGkpeFeG/G6loxUnzlDNhfjPSA==} - dev: true - /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -5705,16 +5699,6 @@ packages: type-check: 0.4.0 dev: true - /libsodium-wrappers@0.7.11: - resolution: {integrity: sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==} - dependencies: - libsodium: 0.7.11 - dev: false - - /libsodium@0.7.11: - resolution: {integrity: sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A==} - dev: false - /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} diff --git a/idkit/src/lib/crypto.ts b/idkit/src/lib/crypto.ts new file mode 100644 index 00000000..1c5b9c43 --- /dev/null +++ b/idkit/src/lib/crypto.ts @@ -0,0 +1,15 @@ +import { encodeKey } from './hashing' + +export const generateKey = (): Promise => { + return window.crypto.subtle.generateKey({ name: 'AES-GCM', length: 256 }, true, ['encrypt', 'decrypt']) +} + +export const exportKey = async (key: CryptoKey): Promise<`0x${string}`> => { + return encodeKey(await window.crypto.subtle.exportKey('raw', key)) +} + +export const hashKey = async (key: CryptoKey): Promise<`0x${string}`> => { + const rawKey = await window.crypto.subtle.exportKey('raw', key) + + return encodeKey(await window.crypto.subtle.digest('SHA-256', rawKey)) +} diff --git a/idkit/src/lib/hashing.ts b/idkit/src/lib/hashing.ts index 99da8695..e3037119 100644 --- a/idkit/src/lib/hashing.ts +++ b/idkit/src/lib/hashing.ts @@ -2,13 +2,12 @@ import sha3 from 'js-sha3' import type { AbiEncodedValue } from '@/types' import { pack } from '@ethersproject/solidity' import type { IDKitConfig } from '@/types/config' -import type { KeyPair } from 'libsodium-wrappers' import type { BytesLike } from '@ethersproject/bytes' import { arrayify, concat, hexlify, isBytesLike } from '@ethersproject/bytes' export interface HashFunctionOutput { hash: BigInt - digest: string + digest: `0x${string}` } /** @@ -112,8 +111,6 @@ export const encodeAction = (action: IDKitConfig['action']): string => { return action.types.map((type, index) => `${type}(${action.values[index]})`).join(',') } -export const encodeKey = (key: Uint8Array): string => { - return `0x${Array.from(key) - .map(b => b.toString(16).padStart(2, '0')) - .join('')}` +export const encodeKey = (key: ArrayBuffer): `0x${string}` => { + return `0x${[...new Uint8Array(key)].map(b => b.toString(16).padStart(2, '0')).join('')}` } diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index d794d4ee..69b1013a 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -1,29 +1,23 @@ import { create } from 'zustand' import type { ISuccessResult } from '..' import { useEffect, useRef } from 'react' -import libsodium from 'libsodium-wrappers' import type { IDKitConfig } from '@/types/config' import { VerificationState } from '@/types/bridge' import type { AppErrorCodes } from '@/types/bridge' +import { exportKey, generateKey, hashKey } from '@/lib/crypto' import { encodeAction, encodeKey, generateSignal } from '@/lib/hashing' const DEFAULT_BRIDGE_URL = 'https://bridge.worldcoin.org/' type WorldBridgeStore = { bridgeUrl: string + key: CryptoKey | null connectorURI: string | null result: ISuccessResult | null - key: libsodium.KeyPair | null errorCode: AppErrorCodes | null verificationState: VerificationState - getConnectorURI: ( - app_id: IDKitConfig['app_id'], - action: IDKitConfig['action'], - signal?: IDKitConfig['signal'], - credential_types?: IDKitConfig['credential_types'], - action_description?: IDKitConfig['action_description'] - ) => string + getConnectorURI: () => Promise createClient: ( app_id: IDKitConfig['app_id'], @@ -55,47 +49,51 @@ const useWorldBridgeStore = create((set, get) => ({ credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] ) => { - await libsodium.ready + const key = await generateKey() + + // const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/${await hashKey(key)}`, { + // method: 'PUT', + // headers: { 'Content-Type': 'application/json' }, + // body: JSON.stringify({ + // app_id, + // credential_types, + // action_description, + // action: encodeAction(action), + // signal: generateSignal(signal).digest, + // }), + // }) + + // if (!res.ok) { + // set({ verificationState: VerificationState.Failed }) + // throw new Error('Failed to create client') + // } set({ - key: libsodium.crypto_box_keypair(), + key, bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, verificationState: VerificationState.PollingForUpdates, + connectorURI: `https://id.worldcoin.org/verify?key=${await exportKey(key)}`, }) - set({ connectorURI: get().getConnectorURI(app_id, action, signal, credential_types, action_description) }) }, - getConnectorURI: ( - app_id: IDKitConfig['app_id'], - action: IDKitConfig['action'], - signal?: IDKitConfig['signal'], - credential_types?: IDKitConfig['credential_types'], - action_description?: IDKitConfig['action_description'] - ) => { + getConnectorURI: async () => { const key = get().key if (!key) throw new Error('No keypair found. Please call `createClient` first.') - const params = new URLSearchParams({ app_id, action: encodeAction(action), key: encodeKey(key.publicKey) }) - if (credential_types) params.set('credential_types', credential_types.join(',')) - if (action_description) params.set('action_description', action_description) - if (signal) params.set('signal', generateSignal(signal).digest) - - return `https://id.worldcoin.org/verify?${params.toString()}` + return `https://id.worldcoin.org/verify?key=${encodeKey(await window.crypto.subtle.exportKey('raw', key))}` }, pollForUpdates: async () => { const key = get().key if (!key) throw new Error('No keypair found. Please call `createClient` first.') - const response = await fetch(`${get().bridgeUrl}/${encodeKey(libsodium.crypto_generichash(32, key.publicKey))}`) - - if (response.ok) return + const response = await fetch(`${get().bridgeUrl}/${hashKey(key)}`) // ... }, reset: () => { - set({ key: null, connectorURI: null }) + set({ key: null, connectorURI: null, verificationState: VerificationState.PreparingClient }) }, })) From 5870ade781693ff77c1ab031c42d7eb5c4b8a68b Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Fri, 18 Aug 2023 17:26:03 +0200 Subject: [PATCH 04/16] wip --- idkit/src/lib/crypto.ts | 12 +++-- idkit/src/services/wld-bridge.ts | 86 ++++++++++++++++++++------------ 2 files changed, 62 insertions(+), 36 deletions(-) diff --git a/idkit/src/lib/crypto.ts b/idkit/src/lib/crypto.ts index 1c5b9c43..4c8aaab5 100644 --- a/idkit/src/lib/crypto.ts +++ b/idkit/src/lib/crypto.ts @@ -8,8 +8,14 @@ export const exportKey = async (key: CryptoKey): Promise<`0x${string}`> => { return encodeKey(await window.crypto.subtle.exportKey('raw', key)) } -export const hashKey = async (key: CryptoKey): Promise<`0x${string}`> => { - const rawKey = await window.crypto.subtle.exportKey('raw', key) +export const getRequestId = async (key: CryptoKey): Promise<`0x${string}`> => { + return encodeKey(await window.crypto.subtle.sign('HMAC', key, Buffer.from('world-id-v1'))) +} + +export const encryptRequest = async (key: CryptoKey, request: string): Promise<`0x${string}`> => { + return encodeKey(await window.crypto.subtle.encrypt({ name: 'RSA-OAEP' }, key, Buffer.from(request))) +} - return encodeKey(await window.crypto.subtle.digest('SHA-256', rawKey)) +export const decryptResponse = async (key: CryptoKey, response: ArrayBuffer): Promise => { + return encodeKey(await window.crypto.subtle.decrypt({ name: 'RSA-OAEP' }, key, response)) } diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index 69b1013a..ee18df86 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -4,21 +4,20 @@ import { useEffect, useRef } from 'react' import type { IDKitConfig } from '@/types/config' import { VerificationState } from '@/types/bridge' import type { AppErrorCodes } from '@/types/bridge' -import { exportKey, generateKey, hashKey } from '@/lib/crypto' -import { encodeAction, encodeKey, generateSignal } from '@/lib/hashing' +import { encodeAction, generateSignal } from '@/lib/hashing' +import { decryptResponse, encryptRequest, exportKey, generateKey, getRequestId } from '@/lib/crypto' -const DEFAULT_BRIDGE_URL = 'https://bridge.worldcoin.org/' +const DEFAULT_BRIDGE_URL = 'https://bridge.id.worldcoin.org/' type WorldBridgeStore = { bridgeUrl: string key: CryptoKey | null connectorURI: string | null result: ISuccessResult | null + requestId: `0x${string}` | null errorCode: AppErrorCodes | null verificationState: VerificationState - getConnectorURI: () => Promise - createClient: ( app_id: IDKitConfig['app_id'], action: IDKitConfig['action'], @@ -37,6 +36,7 @@ const useWorldBridgeStore = create((set, get) => ({ key: null, result: null, errorCode: null, + requestId: null, connectorURI: null, bridgeUrl: DEFAULT_BRIDGE_URL, verificationState: VerificationState.PreparingClient, @@ -50,50 +50,69 @@ const useWorldBridgeStore = create((set, get) => ({ action_description?: IDKitConfig['action_description'] ) => { const key = await generateKey() + const requestId = await getRequestId(key) + + const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/octet-stream', + }, + body: await encryptRequest( + key, + JSON.stringify({ + app_id, + credential_types, + action_description, + action: encodeAction(action), + signal: generateSignal(signal).digest, + }) + ), + }) - // const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/${await hashKey(key)}`, { - // method: 'PUT', - // headers: { 'Content-Type': 'application/json' }, - // body: JSON.stringify({ - // app_id, - // credential_types, - // action_description, - // action: encodeAction(action), - // signal: generateSignal(signal).digest, - // }), - // }) - - // if (!res.ok) { - // set({ verificationState: VerificationState.Failed }) - // throw new Error('Failed to create client') - // } + if (!res.ok) { + set({ verificationState: VerificationState.Failed }) + throw new Error('Failed to create client') + } set({ key, + requestId, bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, verificationState: VerificationState.PollingForUpdates, - connectorURI: `https://id.worldcoin.org/verify?key=${await exportKey(key)}`, + connectorURI: `https://id.worldcoin.org/verify?t=wld&key=${await exportKey(key)}${ + bridgeUrl ? `&bridge=${encodeURIComponent(bridgeUrl)}` : '' + }`, }) }, - getConnectorURI: async () => { + pollForUpdates: async () => { const key = get().key if (!key) throw new Error('No keypair found. Please call `createClient` first.') - return `https://id.worldcoin.org/verify?key=${encodeKey(await window.crypto.subtle.exportKey('raw', key))}` - }, + const res = await fetch(`${get().bridgeUrl}/response/${get().requestId}`) - pollForUpdates: async () => { - const key = get().key - if (!key) throw new Error('No keypair found. Please call `createClient` first.') + if (res.status == 500) { + return set({ verificationState: VerificationState.Failed }) + } + + if (!res.ok) return - const response = await fetch(`${get().bridgeUrl}/${hashKey(key)}`) + const result = JSON.parse(await decryptResponse(key, await res.arrayBuffer())) as + | ISuccessResult + | { error: AppErrorCodes } - // ... + if ('error' in result) { + return set({ + errorCode: result.error, + verificationState: VerificationState.Failed, + }) + } + + set({ result, verificationState: VerificationState.Confirmed, key: null, connectorURI: null, requestId: null }) }, reset: () => { - set({ key: null, connectorURI: null, verificationState: VerificationState.PreparingClient }) + set({ requestId: null, key: null, connectorURI: null, verificationState: VerificationState.PreparingClient }) }, })) @@ -125,11 +144,12 @@ export const useWorldBridge = ( }, [app_id, action, signal, action_description, createClient, ref_credential_types, bridgeUrl, connectorURI]) useEffect(() => { - if (!connectorURI || result) return + if (!connectorURI || result || errorCode) return const interval = setInterval(() => void pollForUpdates(), 5000) + return () => clearInterval(interval) - }, [connectorURI, pollForUpdates, result]) + }, [connectorURI, pollForUpdates, errorCode, result]) return { connectorURI, reset, result, verificationState, errorCode } } From a9b9d2b19e26905230db94f0892b46361daea7dc Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Sat, 26 Aug 2023 02:41:30 +0100 Subject: [PATCH 05/16] use RSA-OAEP and JWKs --- idkit/src/lib/crypto.ts | 25 +++++++++++++++++-------- idkit/src/services/wld-bridge.ts | 18 +++++++++--------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/idkit/src/lib/crypto.ts b/idkit/src/lib/crypto.ts index 4c8aaab5..ca5b6bef 100644 --- a/idkit/src/lib/crypto.ts +++ b/idkit/src/lib/crypto.ts @@ -1,21 +1,30 @@ import { encodeKey } from './hashing' -export const generateKey = (): Promise => { - return window.crypto.subtle.generateKey({ name: 'AES-GCM', length: 256 }, true, ['encrypt', 'decrypt']) +const encoder = new TextEncoder() +const decoder = new TextDecoder() + +export const generateKey = (): Promise => { + return window.crypto.subtle.generateKey( + { name: 'RSA-OAEP', modulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: 'SHA-256' }, + true, + ['encrypt', 'decrypt'] + ) } -export const exportKey = async (key: CryptoKey): Promise<`0x${string}`> => { - return encodeKey(await window.crypto.subtle.exportKey('raw', key)) +export const exportKey = async (key: CryptoKey): Promise => { + const jwk = await window.crypto.subtle.exportKey('jwk', key) + + return Buffer.from(JSON.stringify(jwk)).toString('base64') } export const getRequestId = async (key: CryptoKey): Promise<`0x${string}`> => { - return encodeKey(await window.crypto.subtle.sign('HMAC', key, Buffer.from('world-id-v1'))) + return encodeKey(await window.crypto.subtle.encrypt({ name: 'RSA-OAEP' }, key, encoder.encode('world-id-v1'))) } -export const encryptRequest = async (key: CryptoKey, request: string): Promise<`0x${string}`> => { - return encodeKey(await window.crypto.subtle.encrypt({ name: 'RSA-OAEP' }, key, Buffer.from(request))) +export const encryptRequest = async (key: CryptoKey, request: string): Promise => { + return window.crypto.subtle.encrypt({ name: 'RSA-OAEP' }, key, encoder.encode(request)) } export const decryptResponse = async (key: CryptoKey, response: ArrayBuffer): Promise => { - return encodeKey(await window.crypto.subtle.decrypt({ name: 'RSA-OAEP' }, key, response)) + return decoder.decode(await window.crypto.subtle.decrypt({ name: 'RSA-OAEP' }, key, response)) } diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index ee18df86..adda4113 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -11,7 +11,7 @@ const DEFAULT_BRIDGE_URL = 'https://bridge.id.worldcoin.org/' type WorldBridgeStore = { bridgeUrl: string - key: CryptoKey | null + key: CryptoKeyPair | null connectorURI: string | null result: ISuccessResult | null requestId: `0x${string}` | null @@ -50,7 +50,7 @@ const useWorldBridgeStore = create((set, get) => ({ action_description?: IDKitConfig['action_description'] ) => { const key = await generateKey() - const requestId = await getRequestId(key) + const requestId = await getRequestId(key.publicKey) const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`, { method: 'PUT', @@ -58,7 +58,7 @@ const useWorldBridgeStore = create((set, get) => ({ 'Content-Type': 'application/octet-stream', }, body: await encryptRequest( - key, + key.publicKey, JSON.stringify({ app_id, credential_types, @@ -79,8 +79,8 @@ const useWorldBridgeStore = create((set, get) => ({ requestId, bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, verificationState: VerificationState.PollingForUpdates, - connectorURI: `https://id.worldcoin.org/verify?t=wld&key=${await exportKey(key)}${ - bridgeUrl ? `&bridge=${encodeURIComponent(bridgeUrl)}` : '' + connectorURI: `https://worldcoin.org/verify?t=wld&k=${await exportKey(key.privateKey)}${ + bridgeUrl ? `&b=${encodeURIComponent(bridgeUrl)}` : '' }`, }) }, @@ -97,13 +97,13 @@ const useWorldBridgeStore = create((set, get) => ({ if (!res.ok) return - const result = JSON.parse(await decryptResponse(key, await res.arrayBuffer())) as + const result = JSON.parse(await decryptResponse(key.privateKey, await res.arrayBuffer())) as | ISuccessResult - | { error: AppErrorCodes } + | { error_code: AppErrorCodes } - if ('error' in result) { + if ('error_code' in result) { return set({ - errorCode: result.error, + errorCode: result.error_code, verificationState: VerificationState.Failed, }) } From 0e0d19bfde6e03e65f7007af1778e8d22ae9f47c Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 18 Sep 2023 01:50:33 +0200 Subject: [PATCH 06/16] switch to AES --- idkit/src/lib/crypto.ts | 37 +++++++++++++--------- idkit/src/lib/utils.ts | 22 +++++++++++++ idkit/src/services/wld-bridge.ts | 53 ++++++++++++++++++++------------ 3 files changed, 78 insertions(+), 34 deletions(-) diff --git a/idkit/src/lib/crypto.ts b/idkit/src/lib/crypto.ts index ca5b6bef..0763fe6c 100644 --- a/idkit/src/lib/crypto.ts +++ b/idkit/src/lib/crypto.ts @@ -1,30 +1,37 @@ import { encodeKey } from './hashing' +import { buffer_decode, buffer_encode } from './utils' const encoder = new TextEncoder() const decoder = new TextDecoder() -export const generateKey = (): Promise => { - return window.crypto.subtle.generateKey( - { name: 'RSA-OAEP', modulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), hash: 'SHA-256' }, - true, - ['encrypt', 'decrypt'] - ) +export const generateKey = async (): Promise<{ key: CryptoKey; iv: Uint8Array }> => { + return { + iv: window.crypto.getRandomValues(new Uint8Array(12)), + key: await window.crypto.subtle.generateKey({ name: 'AES-GCM', length: 256 }, true, ['encrypt', 'decrypt']), + } } export const exportKey = async (key: CryptoKey): Promise => { - const jwk = await window.crypto.subtle.exportKey('jwk', key) - - return Buffer.from(JSON.stringify(jwk)).toString('base64') + return buffer_encode(await window.crypto.subtle.exportKey('raw', key)) } -export const getRequestId = async (key: CryptoKey): Promise<`0x${string}`> => { - return encodeKey(await window.crypto.subtle.encrypt({ name: 'RSA-OAEP' }, key, encoder.encode('world-id-v1'))) +export const getRequestId = async (key: CryptoKey, iv: Uint8Array): Promise<`0x${string}`> => { + return encodeKey(await window.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, encoder.encode('world-id-v1'))) } -export const encryptRequest = async (key: CryptoKey, request: string): Promise => { - return window.crypto.subtle.encrypt({ name: 'RSA-OAEP' }, key, encoder.encode(request)) +export const encryptRequest = async ( + key: CryptoKey, + iv: Uint8Array, + request: string +): Promise<{ payload: string; encrypted_iv: string }> => { + return { + payload: buffer_encode( + await window.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, encoder.encode(request)) + ), + encrypted_iv: buffer_encode(await window.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, iv)), + } } -export const decryptResponse = async (key: CryptoKey, response: ArrayBuffer): Promise => { - return decoder.decode(await window.crypto.subtle.decrypt({ name: 'RSA-OAEP' }, key, response)) +export const decryptResponse = async (key: CryptoKey, iv: Uint8Array, payload: string): Promise => { + return decoder.decode(await window.crypto.subtle.decrypt({ name: 'AES-GCM', iv }, key, buffer_decode(payload))) } diff --git a/idkit/src/lib/utils.ts b/idkit/src/lib/utils.ts index 20d832a7..4494e9ae 100644 --- a/idkit/src/lib/utils.ts +++ b/idkit/src/lib/utils.ts @@ -5,3 +5,25 @@ export const classNames = (...classes: unknown[]): string => { export const randomNumber = (min: number, max: number): number => { return Math.floor(Math.random() * (max - min + 1) + min) } + +export const buffer_encode = (buffer: ArrayBuffer): string => { + let encoded = '' + + const bytes = new Uint8Array(buffer) + for (let i = 0; i < bytes.byteLength; i++) { + encoded += String.fromCharCode(bytes[i]) + } + + return Buffer.from(encoded).toString('base64') +} + +export const buffer_decode = (encoded: string): ArrayBuffer => { + const byteCharacters = Buffer.from(encoded, 'base64').toString('utf-8') + + const byteNumbers = new Array(byteCharacters.length) + for (let i = 0; i < byteCharacters.length; i++) { + byteNumbers[i] = byteCharacters.charCodeAt(i) + } + + return new Uint8Array(byteNumbers) +} diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index adda4113..f3d026c4 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -11,7 +11,8 @@ const DEFAULT_BRIDGE_URL = 'https://bridge.id.worldcoin.org/' type WorldBridgeStore = { bridgeUrl: string - key: CryptoKeyPair | null + iv: Uint8Array | null + key: CryptoKey | null connectorURI: string | null result: ISuccessResult | null requestId: `0x${string}` | null @@ -33,6 +34,7 @@ type WorldBridgeStore = { } const useWorldBridgeStore = create((set, get) => ({ + iv: null, key: null, result: null, errorCode: null, @@ -49,25 +51,32 @@ const useWorldBridgeStore = create((set, get) => ({ credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] ) => { - const key = await generateKey() - const requestId = await getRequestId(key.publicKey) - + console.log('generating key') + const { key, iv } = await generateKey() + console.log('generated key') + console.log('getting request id') + const requestId = await getRequestId(key, iv) + console.log('got request id') + + console.log('posting to bridge', `${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`) const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`, { method: 'PUT', - headers: { - 'Content-Type': 'application/octet-stream', - }, - body: await encryptRequest( - key.publicKey, - JSON.stringify({ - app_id, - credential_types, - action_description, - action: encodeAction(action), - signal: generateSignal(signal).digest, - }) + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify( + await encryptRequest( + key, + iv, + JSON.stringify({ + app_id, + credential_types, + action_description, + action: encodeAction(action), + signal: generateSignal(signal).digest, + }) + ) ), }) + console.log('posted to bridge', res.status, res) if (!res.ok) { set({ verificationState: VerificationState.Failed }) @@ -79,7 +88,7 @@ const useWorldBridgeStore = create((set, get) => ({ requestId, bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, verificationState: VerificationState.PollingForUpdates, - connectorURI: `https://worldcoin.org/verify?t=wld&k=${await exportKey(key.privateKey)}${ + connectorURI: `https://worldcoin.org/verify?t=wld&k=${encodeURIComponent(await exportKey(key))}${ bridgeUrl ? `&b=${encodeURIComponent(bridgeUrl)}` : '' }`, }) @@ -97,7 +106,7 @@ const useWorldBridgeStore = create((set, get) => ({ if (!res.ok) return - const result = JSON.parse(await decryptResponse(key.privateKey, await res.arrayBuffer())) as + const result = JSON.parse(await decryptResponse(key, get().iv!, await res.text())) as | ISuccessResult | { error_code: AppErrorCodes } @@ -112,7 +121,13 @@ const useWorldBridgeStore = create((set, get) => ({ }, reset: () => { - set({ requestId: null, key: null, connectorURI: null, verificationState: VerificationState.PreparingClient }) + set({ + iv: null, + key: null, + requestId: null, + connectorURI: null, + verificationState: VerificationState.PreparingClient, + }) }, })) From b5d784cb0b05c8da987d7bde7a2cc6bdb86d2341 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Tue, 19 Sep 2023 18:31:32 +0200 Subject: [PATCH 07/16] switch to UUIDs for requests --- idkit/src/lib/crypto.ts | 9 ++------- idkit/src/lib/hashing.ts | 4 ---- idkit/src/services/wld-bridge.ts | 19 +++++++------------ 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/idkit/src/lib/crypto.ts b/idkit/src/lib/crypto.ts index 0763fe6c..002a1823 100644 --- a/idkit/src/lib/crypto.ts +++ b/idkit/src/lib/crypto.ts @@ -1,4 +1,3 @@ -import { encodeKey } from './hashing' import { buffer_decode, buffer_encode } from './utils' const encoder = new TextEncoder() @@ -15,20 +14,16 @@ export const exportKey = async (key: CryptoKey): Promise => { return buffer_encode(await window.crypto.subtle.exportKey('raw', key)) } -export const getRequestId = async (key: CryptoKey, iv: Uint8Array): Promise<`0x${string}`> => { - return encodeKey(await window.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, encoder.encode('world-id-v1'))) -} - export const encryptRequest = async ( key: CryptoKey, iv: Uint8Array, request: string -): Promise<{ payload: string; encrypted_iv: string }> => { +): Promise<{ payload: string; iv: string }> => { return { + iv: buffer_encode(iv), payload: buffer_encode( await window.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, encoder.encode(request)) ), - encrypted_iv: buffer_encode(await window.crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, iv)), } } diff --git a/idkit/src/lib/hashing.ts b/idkit/src/lib/hashing.ts index e3037119..94088f8e 100644 --- a/idkit/src/lib/hashing.ts +++ b/idkit/src/lib/hashing.ts @@ -110,7 +110,3 @@ export const encodeAction = (action: IDKitConfig['action']): string => { return action.types.map((type, index) => `${type}(${action.values[index]})`).join(',') } - -export const encodeKey = (key: ArrayBuffer): `0x${string}` => { - return `0x${[...new Uint8Array(key)].map(b => b.toString(16).padStart(2, '0')).join('')}` -} diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index f3d026c4..7ff36d6e 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -5,7 +5,7 @@ import type { IDKitConfig } from '@/types/config' import { VerificationState } from '@/types/bridge' import type { AppErrorCodes } from '@/types/bridge' import { encodeAction, generateSignal } from '@/lib/hashing' -import { decryptResponse, encryptRequest, exportKey, generateKey, getRequestId } from '@/lib/crypto' +import { decryptResponse, encryptRequest, exportKey, generateKey } from '@/lib/crypto' const DEFAULT_BRIDGE_URL = 'https://bridge.id.worldcoin.org/' @@ -13,9 +13,9 @@ type WorldBridgeStore = { bridgeUrl: string iv: Uint8Array | null key: CryptoKey | null + requestId: string | null connectorURI: string | null result: ISuccessResult | null - requestId: `0x${string}` | null errorCode: AppErrorCodes | null verificationState: VerificationState @@ -51,14 +51,9 @@ const useWorldBridgeStore = create((set, get) => ({ credential_types?: IDKitConfig['credential_types'], action_description?: IDKitConfig['action_description'] ) => { - console.log('generating key') const { key, iv } = await generateKey() - console.log('generated key') - console.log('getting request id') - const requestId = await getRequestId(key, iv) - console.log('got request id') + const requestId = window.crypto.randomUUID() - console.log('posting to bridge', `${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`) const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`, { method: 'PUT', headers: { 'Content-Type': 'application/json' }, @@ -76,7 +71,6 @@ const useWorldBridgeStore = create((set, get) => ({ ) ), }) - console.log('posted to bridge', res.status, res) if (!res.ok) { set({ verificationState: VerificationState.Failed }) @@ -84,13 +78,14 @@ const useWorldBridgeStore = create((set, get) => ({ } set({ + iv, key, requestId, bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, verificationState: VerificationState.PollingForUpdates, - connectorURI: `https://worldcoin.org/verify?t=wld&k=${encodeURIComponent(await exportKey(key))}${ - bridgeUrl ? `&b=${encodeURIComponent(bridgeUrl)}` : '' - }`, + connectorURI: `https://worldcoin.org/verify?t=wld&i=${requestId}&k=${encodeURIComponent( + await exportKey(key) + )}${bridgeUrl ? `&b=${encodeURIComponent(bridgeUrl)}` : ''}`, }) }, From cf8114ea0e6bd9b3c153ba816928aa9057587419 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Thu, 5 Oct 2023 20:29:53 +0200 Subject: [PATCH 08/16] simplify encoding/decoding fn --- idkit/src/lib/utils.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/idkit/src/lib/utils.ts b/idkit/src/lib/utils.ts index 4494e9ae..659616c1 100644 --- a/idkit/src/lib/utils.ts +++ b/idkit/src/lib/utils.ts @@ -7,23 +7,9 @@ export const randomNumber = (min: number, max: number): number => { } export const buffer_encode = (buffer: ArrayBuffer): string => { - let encoded = '' - - const bytes = new Uint8Array(buffer) - for (let i = 0; i < bytes.byteLength; i++) { - encoded += String.fromCharCode(bytes[i]) - } - - return Buffer.from(encoded).toString('base64') + return Buffer.from(buffer).toString('base64') } export const buffer_decode = (encoded: string): ArrayBuffer => { - const byteCharacters = Buffer.from(encoded, 'base64').toString('utf-8') - - const byteNumbers = new Array(byteCharacters.length) - for (let i = 0; i < byteCharacters.length; i++) { - byteNumbers[i] = byteCharacters.charCodeAt(i) - } - - return new Uint8Array(byteNumbers) + return Buffer.from(encoded, 'base64') } From 2594d969db5d9820b247f35635e42ce26b8dd06a Mon Sep 17 00:00:00 2001 From: 0xPenryn Date: Thu, 5 Oct 2023 16:06:55 -0500 Subject: [PATCH 09/16] fix: don't reuse iv --- idkit/src/lib/crypto.ts | 4 ++-- idkit/src/services/wld-bridge.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/idkit/src/lib/crypto.ts b/idkit/src/lib/crypto.ts index 002a1823..6fc5b705 100644 --- a/idkit/src/lib/crypto.ts +++ b/idkit/src/lib/crypto.ts @@ -16,7 +16,7 @@ export const exportKey = async (key: CryptoKey): Promise => { export const encryptRequest = async ( key: CryptoKey, - iv: Uint8Array, + iv: ArrayBuffer, request: string ): Promise<{ payload: string; iv: string }> => { return { @@ -27,6 +27,6 @@ export const encryptRequest = async ( } } -export const decryptResponse = async (key: CryptoKey, iv: Uint8Array, payload: string): Promise => { +export const decryptResponse = async (key: CryptoKey, iv: ArrayBuffer, payload: string): Promise => { return decoder.decode(await window.crypto.subtle.decrypt({ name: 'AES-GCM', iv }, key, buffer_decode(payload))) } diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index 7ff36d6e..1459ce79 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -1,6 +1,7 @@ import { create } from 'zustand' import type { ISuccessResult } from '..' import { useEffect, useRef } from 'react' +import { buffer_decode } from '@/lib/utils' import type { IDKitConfig } from '@/types/config' import { VerificationState } from '@/types/bridge' import type { AppErrorCodes } from '@/types/bridge' @@ -101,7 +102,9 @@ const useWorldBridgeStore = create((set, get) => ({ if (!res.ok) return - const result = JSON.parse(await decryptResponse(key, get().iv!, await res.text())) as + const { iv, payload } = JSON.parse(await res.text()) as { iv: string; payload: string } + + const result = JSON.parse(await decryptResponse(key, buffer_decode(iv), payload)) as | ISuccessResult | { error_code: AppErrorCodes } @@ -113,6 +116,12 @@ const useWorldBridgeStore = create((set, get) => ({ } set({ result, verificationState: VerificationState.Confirmed, key: null, connectorURI: null, requestId: null }) + result, + verificationState: VerificationState.Confirmed, + key: null, + connectorURI: null, + requestId: null, + }) }, reset: () => { @@ -156,7 +165,7 @@ export const useWorldBridge = ( useEffect(() => { if (!connectorURI || result || errorCode) return - const interval = setInterval(() => void pollForUpdates(), 5000) + const interval = setInterval(() => void pollForUpdates(), 500) return () => clearInterval(interval) }, [connectorURI, pollForUpdates, errorCode, result]) From 80e9f39fd94628041d58028f22e65d9c6e45d0a5 Mon Sep 17 00:00:00 2001 From: 0xPenryn Date: Thu, 5 Oct 2023 16:28:04 -0500 Subject: [PATCH 10/16] fix: one line got left out of the last commit --- idkit/src/services/wld-bridge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index 1459ce79..d2ef81dd 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -115,7 +115,7 @@ const useWorldBridgeStore = create((set, get) => ({ }) } - set({ result, verificationState: VerificationState.Confirmed, key: null, connectorURI: null, requestId: null }) + set({ result, verificationState: VerificationState.Confirmed, key: null, From 8eb83e0f9693a107d82c71bab910be2019387750 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Fri, 6 Oct 2023 16:32:30 +0200 Subject: [PATCH 11/16] cs --- idkit/src/services/wld-bridge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index d2ef81dd..066caf0a 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -102,7 +102,7 @@ const useWorldBridgeStore = create((set, get) => ({ if (!res.ok) return - const { iv, payload } = JSON.parse(await res.text()) as { iv: string; payload: string } + const { iv, payload } = (await res.json()) as { iv: string; payload: string } const result = JSON.parse(await decryptResponse(key, buffer_decode(iv), payload)) as | ISuccessResult From b76fe505c9145bdf0663601fdb63772eba693ef8 Mon Sep 17 00:00:00 2001 From: Paolo <149602456+pdtfh@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:23:06 -0800 Subject: [PATCH 12/16] improvements --- idkit/src/services/walletconnect.ts | 280 ---------------------------- idkit/src/services/wld-bridge.ts | 5 +- idkit/src/types/bridge.ts | 2 - 3 files changed, 3 insertions(+), 284 deletions(-) delete mode 100644 idkit/src/services/walletconnect.ts diff --git a/idkit/src/services/walletconnect.ts b/idkit/src/services/walletconnect.ts deleted file mode 100644 index c1bd92c5..00000000 --- a/idkit/src/services/walletconnect.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { __ } from '@/lang' -import { create } from 'zustand' -import { buildQRData } from '@/lib/qr' -import { CredentialType } from '@/types' -import { useEffect, useRef } from 'react' -import { randomNumber } from '@/lib/utils' -import { WC_PROJECT_ID } from '@/lib/consts' -import Client from '@walletconnect/sign-client' -import type { IDKitConfig } from '@/types/config' -import { getSdkError } from '@walletconnect/utils' -import { AppErrorCodes, VerificationState } from '@/types/app' -import type { ExpectedErrorResponse, ISuccessResult } from '@/types' -import { encodeAction, generateExternalNullifier, generateSignal, validateABILikeEncoding } from '@/lib/hashing' - -type WalletConnectStore = { - connected: boolean - uri: string - topic: string - result: ISuccessResult | null - errorCode: AppErrorCodes | null - verificationState: VerificationState - config: IDKitConfig | null - qrData: { - default: string - mobile: string - } | null - client: Client | null - - resetConnection: () => void - onConnectionEstablished: (client: Client) => void - setUri: (uri: string) => void - createClient: ( - app_id: IDKitConfig['app_id'], - action: IDKitConfig['action'], - signal: IDKitConfig['signal'], - credential_types?: IDKitConfig['credential_types'], - action_description?: IDKitConfig['action_description'], - walletConnectProjectId?: IDKitConfig['walletConnectProjectId'] - ) => Promise - connectClient: (client: Client) => Promise -} - -const namespaces = { - eip155: { - methods: ['world_id_v1'], - chains: ['eip155:1'], // Chain ID used does not matter, since we only perform custom JSON RPC messages (World ID verification) - events: ['accountsChanged'], - }, -} - -const useWalletConnectStore = create()((set, get) => ({ - qrData: null, - config: null, - result: null, - connected: false, - uri: '', - topic: '', - errorCode: null, - verificationState: VerificationState.LoadingWidget, - client: null, - - createClient: async ( - app_id: IDKitConfig['app_id'], - action: IDKitConfig['action'], - signal?: IDKitConfig['signal'], - credential_types?: IDKitConfig['credential_types'], - action_description?: IDKitConfig['action_description'], - walletConnectProjectId = WC_PROJECT_ID - ) => { - if (credential_types && !credential_types.length) { - console.warn( - __('Cannot set empty `:param`. Defaulting to only Orb credential.', { param: 'credential_types' }) - ) - } - - set({ - config: { - app_id, - action, - signal, - action_description, - walletConnectProjectId, - credential_types: credential_types?.length ? credential_types : [CredentialType.Orb], - }, - }) - - try { - const client = await Client.init({ - projectId: walletConnectProjectId, - metadata: { - name: 'IDKit', - description: __('Verify with World ID'), - url: 'https://worldcoin.org', - icons: ['https://worldcoin.org/icons/logo-small.svg'], - }, - }) - set({ client: client }) - - return get().connectClient(client) - } catch (error) { - console.error(error) - } - }, - - connectClient: async (client: Client) => { - try { - const { uri, approval } = await client.connect({ requiredNamespaces: namespaces }) - - if (uri) { - get().setUri(uri) - const session = await approval() - - if (typeof session !== 'undefined') { - set({ topic: session.topic }) - return get().onConnectionEstablished(client) - } - } - } catch (error) { - set({ errorCode: AppErrorCodes.ConnectionFailed }) - console.error(__('Unable to establish a connection with the World app.'), error) - } - }, - - setUri: (uri: string) => { - if (!uri) return - - set({ - uri: uri, - verificationState: VerificationState.AwaitingConnection, - qrData: { - default: buildQRData(uri), - mobile: buildQRData(uri, window.location.href), - }, - }) - }, - - // eslint-disable-next-line @typescript-eslint/no-misused-promises - onConnectionEstablished: async (client: Client) => { - set({ verificationState: VerificationState.AwaitingVerification }) - - await client - .request({ - topic: get().topic, - chainId: 'eip155:1', - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - request: buildVerificationRequest(get().config!), - }) - .then(result => { - if (!ensureVerificationResponse(result)) { - return set({ errorCode: AppErrorCodes.UnexpectedResponse }) - } - - set({ result, verificationState: VerificationState.Confirmed }) - }) - .catch((error: unknown) => { - let errorCode = AppErrorCodes.GenericError - - const errorMessage = (error as ExpectedErrorResponse).message - if (errorMessage && Object.values(AppErrorCodes).includes(errorMessage as AppErrorCodes)) { - errorCode = errorMessage as AppErrorCodes - } - - console.warn(__('Error receiving proof: :errorCode', { errorCode })) - console.warn(__('Raw error response'), error) - - set({ errorCode, verificationState: VerificationState.Failed }) - }) - .finally(() => void client.disconnect({ topic: get().topic, reason: getSdkError('USER_DISCONNECTED') })) - .catch((error: string) => { - console.error(__(`Unable to disconnect: :error`, { error })) - }) - }, - - resetConnection: () => { - set({ - result: null, - config: null, - qrData: null, - errorCode: null, - connected: false, - client: null, - verificationState: VerificationState.LoadingWidget, - }) - }, -})) - -const buildVerificationRequest = (config: IDKitConfig) => ({ - jsonrpc: '2.0', - method: 'world_id_v1', - id: randomNumber(100000, 9999999), - params: [ - { - app_id: config.app_id, - action: encodeAction(config.action), - credential_types: config.credential_types, - signal: generateSignal(config.signal).digest, - action_description: config.action_description, - external_nullifier: generateExternalNullifier(config.app_id, config.action).digest, - }, - ], -}) - -const ensureVerificationResponse = (result: unknown): result is ISuccessResult => { - if (!result || typeof result !== 'object') return false - const proof = 'proof' in result ? (result as Record).proof : undefined - const merkle_root = 'merkle_root' in result ? (result as Record).merkle_root : undefined - const nullifier_hash = 'nullifier_hash' in result ? (result as Record).nullifier_hash : undefined - const credential_type = 'credential_type' in result ? (result as Record).credential_type : undefined - - if (!credential_type) return false - for (const attr of [merkle_root, nullifier_hash, proof]) { - if (!attr || !validateABILikeEncoding(attr)) return false - } - - return true -} - -type UseAppConnectionResponse = { - reset: () => void - result: ISuccessResult | null - errorCode: AppErrorCodes | null - verificationState: VerificationState - qrData: { - default: string - mobile: string - } | null -} - -const getStore = (store: WalletConnectStore) => ({ - qrData: store.qrData, - result: store.result, - errorCode: store.errorCode, - reset: store.resetConnection, - client: store.client, - createClient: store.createClient, - connectClient: store.connectClient, - verificationState: store.verificationState, -}) - -const useAppConnection = ( - app_id: IDKitConfig['app_id'], - action: IDKitConfig['action'], - signal?: IDKitConfig['signal'], - credential_types?: IDKitConfig['credential_types'], - action_description?: IDKitConfig['action_description'], - walletConnectProjectId?: IDKitConfig['walletConnectProjectId'] -): UseAppConnectionResponse => { - const { result, verificationState, errorCode, qrData, client, createClient, reset } = - useWalletConnectStore(getStore) - - const ref_credential_types = useRef(credential_types) - - useEffect(() => { - if (!app_id) return - if (!client) { - void createClient( - app_id, - action, - signal, - ref_credential_types.current, - action_description, - walletConnectProjectId - ) - } - }, [ - app_id, - action, - signal, - walletConnectProjectId, - action_description, - client, - createClient, - verificationState, - ref_credential_types, - ]) - - return { result, reset, verificationState, errorCode, qrData } -} - -export default useAppConnection diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index 066caf0a..33efeb78 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -5,10 +5,10 @@ import { buffer_decode } from '@/lib/utils' import type { IDKitConfig } from '@/types/config' import { VerificationState } from '@/types/bridge' import type { AppErrorCodes } from '@/types/bridge' -import { encodeAction, generateSignal } from '@/lib/hashing' import { decryptResponse, encryptRequest, exportKey, generateKey } from '@/lib/crypto' +import { encodeAction, generateExternalNullifier, generateSignal } from '@/lib/hashing' -const DEFAULT_BRIDGE_URL = 'https://bridge.id.worldcoin.org/' +const DEFAULT_BRIDGE_URL = 'https://bridge.worldcoin.org' type WorldBridgeStore = { bridgeUrl: string @@ -67,6 +67,7 @@ const useWorldBridgeStore = create((set, get) => ({ credential_types, action_description, action: encodeAction(action), + external_nullifier: generateExternalNullifier(app_id, action).digest, signal: generateSignal(signal).digest, }) ) diff --git a/idkit/src/types/bridge.ts b/idkit/src/types/bridge.ts index fde1547a..a7181719 100644 --- a/idkit/src/types/bridge.ts +++ b/idkit/src/types/bridge.ts @@ -2,7 +2,6 @@ export enum AppErrorCodes { ConnectionFailed = 'connection_failed', VerificationRejected = 'verification_rejected', MaxVerificationsReached = 'max_verifications_reached', - AlreadySigned = 'already_signed', // NOTE: Deprecated, handled for backwards compatibility CredentialUnavailable = 'credential_unavailable', MalformedRequest = 'malformed_request', InvalidNetwork = 'invalid_network', @@ -11,7 +10,6 @@ export enum AppErrorCodes { UnexpectedResponse = 'unexpected_response', // NOTE: when the World app returns an unexpected response FailedByHostApp = 'failed_by_host_app', // NOTE: Host app failed/rejected verification (does not come from World App / simulator) GenericError = 'generic_error', - InvalidPhoneOTP = 'invalid_phone_otp', // NOTE: Experimental, only for phone verification } export enum VerificationState { From 9b7892de9faaf26607edb289b94b0ce489bdfab3 Mon Sep 17 00:00:00 2001 From: Paolo <149602456+pdtfh@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:36:41 -0800 Subject: [PATCH 13/16] remove more WalletConnect deps --- example-nextjs/pages/index.tsx | 1 - example-react/src/App.tsx | 1 - idkit/package.json | 3 - idkit/pnpm-lock.yaml | 934 ++---------------- .../IDKitWidget/States/WorldIDState.tsx | 1 - idkit/src/components/SignInWithWorldID.tsx | 2 +- idkit/src/lib/consts.ts | 1 - idkit/src/types/index.ts | 6 - idkit/src/vanilla.tsx | 6 - 9 files changed, 56 insertions(+), 899 deletions(-) delete mode 100644 idkit/src/lib/consts.ts diff --git a/example-nextjs/pages/index.tsx b/example-nextjs/pages/index.tsx index de93094c..ae791473 100644 --- a/example-nextjs/pages/index.tsx +++ b/example-nextjs/pages/index.tsx @@ -24,7 +24,6 @@ export default function Home() { onSuccess={onSuccess} handleVerify={handleProof} app_id="get_this_from_the_dev_portal" - // walletConnectProjectId="get_this_from_walletconnect_portal" > {({ open }) => } diff --git a/example-react/src/App.tsx b/example-react/src/App.tsx index 76dcbab5..376fc039 100644 --- a/example-react/src/App.tsx +++ b/example-react/src/App.tsx @@ -38,7 +38,6 @@ function App() { handleVerify={handleProof} app_id={app_id} credential_types={credential_types} - // walletConnectProjectId="get_this_from_walletconnect_portal" > {({ open }) => } diff --git a/idkit/package.json b/idkit/package.json index e4616d30..bf0efd03 100644 --- a/idkit/package.json +++ b/idkit/package.json @@ -55,9 +55,6 @@ "@radix-ui/react-toast": "^1.1.3", "@stitches/react": "^1.2.8", "@tailwindcss/forms": "^0.5.3", - "@walletconnect/sign-client": "^2.2.0", - "@walletconnect/types": "^2.2.0", - "@walletconnect/utils": "^2.2.1", "copy-to-clipboard": "^3.3.3", "country-telephone-data": "^0.6.3", "framer-motion": "^7.6.7", diff --git a/idkit/pnpm-lock.yaml b/idkit/pnpm-lock.yaml index 93ca7019..ee5fa305 100644 --- a/idkit/pnpm-lock.yaml +++ b/idkit/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -29,15 +29,6 @@ dependencies: '@tailwindcss/forms': specifier: ^0.5.3 version: 0.5.3(tailwindcss@3.2.4) - '@walletconnect/sign-client': - specifier: ^2.2.0 - version: 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/types': - specifier: ^2.2.0 - version: 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/utils': - specifier: ^2.2.1 - version: 2.2.1(@types/node@18.11.9)(typescript@4.9.3) copy-to-clipboard: specifier: ^3.3.3 version: 3.3.3 @@ -259,7 +250,7 @@ packages: '@babel/traverse': 7.21.4 '@babel/types': 7.21.4 convert-source-map: 1.9.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.0 @@ -574,7 +565,7 @@ packages: '@babel/helper-split-export-declaration': 7.18.6 '@babel/parser': 7.21.4 '@babel/types': 7.21.4 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -602,13 +593,6 @@ packages: minimist: 1.2.8 dev: true - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: false - /@emotion/is-prop-valid@0.8.8: resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} requiresBuild: true @@ -619,6 +603,7 @@ packages: /@emotion/memoize@0.7.4: resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} + requiresBuild: true dev: false optional: true @@ -635,7 +620,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 espree: 9.5.1 globals: 13.20.0 ignore: 5.2.4 @@ -726,7 +711,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -1018,11 +1003,6 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/resolve-uri@3.1.1: - resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} - engines: {node: '>=6.0.0'} - dev: false - /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} @@ -1034,6 +1014,7 @@ packages: /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true /@jridgewell/trace-mapping@0.3.18: resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} @@ -1042,13 +1023,6 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: false - /@mdn/browser-compat-data@3.3.14: resolution: {integrity: sha512-n2RC9d6XatVbWFdHLimzzUJxJ1KY8LdjqrW6YvGPiRmsHkhOUx74/Ct10x5Yo7bC/Jvqx7cDEW8IMPv/+vwEzA==} dev: true @@ -1373,122 +1347,6 @@ packages: '@sinonjs/commons': 2.0.0 dev: true - /@stablelib/aead@1.0.1: - resolution: {integrity: sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==} - dev: false - - /@stablelib/binary@1.0.1: - resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} - dependencies: - '@stablelib/int': 1.0.1 - dev: false - - /@stablelib/bytes@1.0.1: - resolution: {integrity: sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==} - dev: false - - /@stablelib/chacha20poly1305@1.0.1: - resolution: {integrity: sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==} - dependencies: - '@stablelib/aead': 1.0.1 - '@stablelib/binary': 1.0.1 - '@stablelib/chacha': 1.0.1 - '@stablelib/constant-time': 1.0.1 - '@stablelib/poly1305': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/chacha@1.0.1: - resolution: {integrity: sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==} - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/constant-time@1.0.1: - resolution: {integrity: sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==} - dev: false - - /@stablelib/ed25519@1.0.3: - resolution: {integrity: sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==} - dependencies: - '@stablelib/random': 1.0.2 - '@stablelib/sha512': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/hash@1.0.1: - resolution: {integrity: sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==} - dev: false - - /@stablelib/hkdf@1.0.1: - resolution: {integrity: sha512-SBEHYE16ZXlHuaW5RcGk533YlBj4grMeg5TooN80W3NpcHRtLZLLXvKyX0qcRFxf+BGDobJLnwkvgEwHIDBR6g==} - dependencies: - '@stablelib/hash': 1.0.1 - '@stablelib/hmac': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/hmac@1.0.1: - resolution: {integrity: sha512-V2APD9NSnhVpV/QMYgCVMIYKiYG6LSqw1S65wxVoirhU/51ACio6D4yDVSwMzuTJXWZoVHbDdINioBwKy5kVmA==} - dependencies: - '@stablelib/constant-time': 1.0.1 - '@stablelib/hash': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/int@1.0.1: - resolution: {integrity: sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==} - dev: false - - /@stablelib/keyagreement@1.0.1: - resolution: {integrity: sha512-VKL6xBwgJnI6l1jKrBAfn265cspaWBPAPEc62VBQrWHLqVgNRE09gQ/AnOEyKUWrrqfD+xSQ3u42gJjLDdMDQg==} - dependencies: - '@stablelib/bytes': 1.0.1 - dev: false - - /@stablelib/poly1305@1.0.1: - resolution: {integrity: sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==} - dependencies: - '@stablelib/constant-time': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/random@1.0.2: - resolution: {integrity: sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==} - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/sha256@1.0.1: - resolution: {integrity: sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==} - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/hash': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/sha512@1.0.1: - resolution: {integrity: sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==} - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/hash': 1.0.1 - '@stablelib/wipe': 1.0.1 - dev: false - - /@stablelib/wipe@1.0.1: - resolution: {integrity: sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==} - dev: false - - /@stablelib/x25519@1.0.3: - resolution: {integrity: sha512-KnTbKmUhPhHavzobclVJQG5kuivH+qDLpe84iRqX3CLrKp881cF160JvXJ+hjn1aMyCwYOKeIZefIH/P5cJoRw==} - dependencies: - '@stablelib/keyagreement': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/wipe': 1.0.1 - dev: false - /@stitches/react@1.2.8(react@18.2.0): resolution: {integrity: sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA==} peerDependencies: @@ -1554,22 +1412,6 @@ packages: engines: {node: '>= 10'} dev: true - /@tsconfig/node10@1.0.9: - resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} - dev: false - - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - dev: false - - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - dev: false - - /@tsconfig/node16@1.0.3: - resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} - dev: false - /@types/aria-query@5.0.1: resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==} dev: true @@ -1666,6 +1508,7 @@ packages: /@types/node@18.11.9: resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} + dev: true /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -1762,7 +1605,7 @@ packages: '@typescript-eslint/scope-manager': 5.20.0 '@typescript-eslint/type-utils': 5.20.0(eslint@8.29.0)(typescript@4.9.3) '@typescript-eslint/utils': 5.20.0(eslint@8.29.0)(typescript@4.9.3) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 eslint: 8.29.0 functional-red-black-tree: 1.0.1 ignore: 5.2.4 @@ -1787,7 +1630,7 @@ packages: '@typescript-eslint/scope-manager': 5.20.0 '@typescript-eslint/types': 5.20.0 '@typescript-eslint/typescript-estree': 5.20.0(typescript@4.9.3) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 eslint: 8.29.0 typescript: 4.9.3 transitivePeerDependencies: @@ -1813,7 +1656,7 @@ packages: optional: true dependencies: '@typescript-eslint/utils': 5.20.0(eslint@8.29.0)(typescript@4.9.3) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 eslint: 8.29.0 tsutils: 3.21.0(typescript@4.9.3) typescript: 4.9.3 @@ -1837,7 +1680,7 @@ packages: dependencies: '@typescript-eslint/types': 5.20.0 '@typescript-eslint/visitor-keys': 5.20.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.4.0 @@ -1873,281 +1716,6 @@ packages: eslint-visitor-keys: 3.4.0 dev: true - /@walletconnect/core@2.2.0(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-oucu/Ro1bYL9DQIRqB4Y5HUfOFRhl/sOMyQ3SVLtq9J6jrFs5uePiw13dvhz7+p1BzWVWV5Jw2+elmJllNiB/A==} - dependencies: - '@walletconnect/heartbeat': 1.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/jsonrpc-provider': 1.0.12 - '@walletconnect/jsonrpc-utils': 1.0.7 - '@walletconnect/jsonrpc-ws-connection': 1.0.11 - '@walletconnect/keyvaluestorage': 1.0.2 - '@walletconnect/logger': 2.0.1 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/utils': 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - events: 3.3.0 - lodash.isequal: 4.5.0 - pino: 7.11.0 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - bufferutil - - lokijs - - typescript - - utf-8-validate - dev: false - - /@walletconnect/environment@1.0.1: - resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} - dependencies: - tslib: 1.14.1 - dev: false - - /@walletconnect/events@1.0.1: - resolution: {integrity: sha512-NPTqaoi0oPBVNuLv7qPaJazmGHs5JGyO8eEAk5VGKmJzDR7AHzD4k6ilox5kxk1iwiOnFopBOOMLs86Oa76HpQ==} - dependencies: - keyvaluestorage-interface: 1.0.0 - tslib: 1.14.1 - dev: false - - /@walletconnect/heartbeat@1.2.0(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-0vbzTa/ARrpmMmOD+bQMxPvFYKtOLQZObgZakrYr0aODiMOO71CmPVNV2eAqXnw9rMmcP+z91OybLeIFlwTjjA==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/time': 1.0.2 - chai: 4.3.7 - mocha: 10.2.0 - ts-node: 10.9.1(@types/node@18.11.9)(typescript@4.9.3) - tslib: 1.14.1 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - typescript - dev: false - - /@walletconnect/jsonrpc-provider@1.0.12: - resolution: {integrity: sha512-6uI2y5281gloZSzICOjk+CVC7CVu0MhtMt2Yzpj05lPb0pzm/bK2oZ2ibxwLerPrqpNt/5bIFVRmoOgPw1mHAQ==} - dependencies: - '@walletconnect/jsonrpc-utils': 1.0.7 - '@walletconnect/safe-json': 1.0.2 - tslib: 1.14.1 - dev: false - - /@walletconnect/jsonrpc-types@1.0.2: - resolution: {integrity: sha512-CZe8tjJX73OWdHjrBHy7HtAapJ2tT0Q3TYhPBhRxi3643lwPIQWC9En45ldY14TZwgSewkbZ0FtGBZK0G7Bbyg==} - dependencies: - keyvaluestorage-interface: 1.0.0 - tslib: 1.14.1 - dev: false - - /@walletconnect/jsonrpc-utils@1.0.7: - resolution: {integrity: sha512-zJziApzUF/Il4VcwabnaU+0yo1QI4eUkYX99zmCVTHJvZOf2l0zjADf/OpKqWyeNFC3Io56Z/8uJHVtcNVvyFA==} - dependencies: - '@walletconnect/environment': 1.0.1 - '@walletconnect/jsonrpc-types': 1.0.2 - tslib: 1.14.1 - dev: false - - /@walletconnect/jsonrpc-ws-connection@1.0.11: - resolution: {integrity: sha512-TiFJ6saasKXD+PwGkm5ZGSw0837nc6EeFmurSPgIT/NofnOV4Tv7CVJqGQN0rQYoJUSYu21cwHNYaFkzNpUN+w==} - dependencies: - '@walletconnect/jsonrpc-utils': 1.0.7 - '@walletconnect/safe-json': 1.0.2 - events: 3.3.0 - tslib: 1.14.1 - ws: 7.5.9 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false - - /@walletconnect/keyvaluestorage@1.0.2: - resolution: {integrity: sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ==} - peerDependencies: - '@react-native-async-storage/async-storage': 1.x - lokijs: 1.x - peerDependenciesMeta: - '@react-native-async-storage/async-storage': - optional: true - lokijs: - optional: true - dependencies: - safe-json-utils: 1.1.1 - tslib: 1.14.1 - dev: false - - /@walletconnect/logger@2.0.1: - resolution: {integrity: sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ==} - dependencies: - pino: 7.11.0 - tslib: 1.14.1 - dev: false - - /@walletconnect/relay-api@1.0.9: - resolution: {integrity: sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg==} - dependencies: - '@walletconnect/jsonrpc-types': 1.0.2 - tslib: 1.14.1 - dev: false - - /@walletconnect/relay-auth@1.0.4: - resolution: {integrity: sha512-kKJcS6+WxYq5kshpPaxGHdwf5y98ZwbfuS4EE/NkQzqrDFm5Cj+dP8LofzWvjrrLkZq7Afy7WrQMXdLy8Sx7HQ==} - dependencies: - '@stablelib/ed25519': 1.0.3 - '@stablelib/random': 1.0.2 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - tslib: 1.14.1 - uint8arrays: 3.1.0 - dev: false - - /@walletconnect/safe-json@1.0.2: - resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} - dependencies: - tslib: 1.14.1 - dev: false - - /@walletconnect/sign-client@2.2.0(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-7oEYp/t/uuR85/meMqJvaJBxVY/R9CR6xJOxL4sobOioL2Dy58m1HkxpODqxSpdZvJ1sCm6x7zYlqOWYbY1kdA==} - dependencies: - '@walletconnect/core': 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/jsonrpc-provider': 1.0.12 - '@walletconnect/jsonrpc-utils': 1.0.7 - '@walletconnect/logger': 2.0.1 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/utils': 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - events: 3.3.0 - pino: 7.11.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - bufferutil - - lokijs - - typescript - - utf-8-validate - dev: false - - /@walletconnect/time@1.0.2: - resolution: {integrity: sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==} - dependencies: - tslib: 1.14.1 - dev: false - - /@walletconnect/types@2.2.0(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-mxxXcHTtRaa3FiLWWEYEOA3wyGzOc9Fdv2Objms/COcPAropAY/8A0kceqCDB0si1UFOl6KpEzvm5WHJpJi9tQ==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/jsonrpc-types': 1.0.2 - '@walletconnect/keyvaluestorage': 1.0.2 - '@walletconnect/logger': 2.0.1 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - lokijs - - typescript - dev: false - - /@walletconnect/types@2.2.1(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-97Ko6u6jC/B/7ymI2ddc+Hdn4x47Pkv0Y7IYHU0RD/J9878S5pJ2nQjDfWhvfDp1GWKgzHVDy6VHwaxDiLtkSw==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/jsonrpc-types': 1.0.2 - '@walletconnect/keyvaluestorage': 1.0.2 - '@walletconnect/logger': 2.0.1 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - lokijs - - typescript - dev: false - - /@walletconnect/utils@2.2.0(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-nQqJHK3KMOKXSn277QhEVGQF5+LuP2PRZDDipl63Qz0ixz2okSpK7SGl1cfDm3728DVW1RxMi2qhmIiQwAU2tg==} - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.7 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.2.0(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 7.1.1 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - lokijs - - typescript - dev: false - - /@walletconnect/utils@2.2.1(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-DkjYcWMMBGznlyuenJkt1Z+IcPchhVbnYwMeQIZCu7gSbL9nUBsyzixfcWat5lapsBeGJDquhV63dU8pbkdhfg==} - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.7 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.2.1(@types/node@18.11.9)(typescript@4.9.3) - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 7.1.1 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - lokijs - - typescript - dev: false - - /@walletconnect/window-getters@1.0.1: - resolution: {integrity: sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==} - dependencies: - tslib: 1.14.1 - dev: false - - /@walletconnect/window-metadata@1.0.1: - resolution: {integrity: sha512-9koTqyGrM2cqFRW517BPY/iEtUDx2r1+Pwwu5m7sJ7ka79wi3EyqhqcICk/yDmv6jAS1rjKgTKXlEhanYjijcA==} - dependencies: - '@walletconnect/window-getters': 1.0.1 - tslib: 1.14.1 - dev: false - /@xobotyi/scrollbar-width@1.9.5: resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==} dev: false @@ -2185,6 +1753,7 @@ packages: /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} + dev: true /acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} @@ -2195,12 +1764,13 @@ packages: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true + dev: true /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -2214,11 +1784,6 @@ packages: uri-js: 4.4.1 dev: true - /ansi-colors@4.1.1: - resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} - engines: {node: '>=6'} - dev: false - /ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} @@ -2264,10 +1829,6 @@ packages: normalize-path: 3.0.0 picomatch: 2.3.1 - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - dev: false - /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -2279,6 +1840,7 @@ packages: /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true /aria-hidden@1.2.3: resolution: {integrity: sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==} @@ -2379,10 +1941,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /assertion-error@1.1.0: - resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} - dev: false - /assign-symbols@1.0.0: resolution: {integrity: sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==} engines: {node: '>=0.10.0'} @@ -2408,11 +1966,6 @@ packages: hasBin: true dev: true - /atomic-sleep@1.0.0: - resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} - engines: {node: '>=8.0.0'} - dev: false - /autoprefixer@10.4.13(postcss@8.4.19): resolution: {integrity: sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==} engines: {node: ^10 || ^12 || >=14} @@ -2572,6 +2125,7 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true /base@0.11.2: resolution: {integrity: sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==} @@ -2599,11 +2153,13 @@ packages: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + dev: true /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 + dev: true /braces@2.3.2: resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==} @@ -2629,10 +2185,6 @@ packages: dependencies: fill-range: 7.0.1 - /browser-stdout@1.3.1: - resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - dev: false - /browserslist@4.21.5: resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -2702,6 +2254,7 @@ packages: /camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + dev: true /camelcase@7.0.1: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} @@ -2719,19 +2272,6 @@ packages: rsvp: 4.8.5 dev: true - /chai@4.3.7: - resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} - engines: {node: '>=4'} - dependencies: - assertion-error: 1.1.0 - check-error: 1.0.2 - deep-eql: 4.1.3 - get-func-name: 2.0.0 - loupe: 2.3.6 - pathval: 1.1.1 - type-detect: 4.0.8 - dev: false - /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -2755,16 +2295,13 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + dev: true /char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} dev: true - /check-error@1.0.2: - resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} - dev: false - /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -2814,14 +2351,6 @@ packages: wrap-ansi: 6.2.0 dev: false - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: false - /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2885,6 +2414,7 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true /construct-style-sheets-polyfill@3.1.0: resolution: {integrity: sha512-HBLKP0chz8BAY6rBdzda11c3wAZeCZ+kIG4weVC2NM3AXzxx09nhe8t0SQNdloAvg5GLuHwq/0SPOOSPvtCcKw==} @@ -2934,10 +2464,6 @@ packages: resolution: {integrity: sha512-3tQLA0vec+NDVlcaHhXGqILq/oQRsv4fRi4EedCfJqUuJUjQGdcSPM8r2IJIT2kZ5yWbiOCkXMgy7YTo8FNS2w==} dev: false - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - dev: false - /cross-spawn@6.0.5: resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} engines: {node: '>=4.8'} @@ -3034,7 +2560,7 @@ packages: ms: 2.1.3 dev: true - /debug@4.3.4(supports-color@8.1.1): + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -3044,7 +2570,7 @@ packages: optional: true dependencies: ms: 2.1.2 - supports-color: 8.1.1 + dev: true /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} @@ -3058,11 +2584,6 @@ packages: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} - /decamelize@4.0.0: - resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} - engines: {node: '>=10'} - dev: false - /decamelize@6.0.0: resolution: {integrity: sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -3075,18 +2596,12 @@ packages: /decode-uri-component@0.2.2: resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} engines: {node: '>=0.10'} + dev: true /dedent@0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true - /deep-eql@4.1.3: - resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} - engines: {node: '>=6'} - dependencies: - type-detect: 4.0.8 - dev: false - /deep-equal@2.2.0: resolution: {integrity: sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==} dependencies: @@ -3161,10 +2676,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - /detect-browser@5.3.0: - resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} - dev: false - /detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} @@ -3191,16 +2702,6 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - dev: false - - /diff@5.0.0: - resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} - engines: {node: '>=0.3.1'} - dev: false - /dijkstrajs@1.0.2: resolution: {integrity: sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg==} dev: false @@ -3240,15 +2741,6 @@ packages: webidl-conversions: 7.0.0 dev: true - /duplexify@4.1.2: - resolution: {integrity: sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==} - dependencies: - end-of-stream: 1.4.4 - inherits: 2.0.4 - readable-stream: 3.6.2 - stream-shift: 1.0.1 - dev: false - /electron-to-chromium@1.4.357: resolution: {integrity: sha512-UTkCbNTAcGXABmEnQrGcW4m3cG6fcyBfD4KDF0iyEAlbrGZiY9dmslyDAGOD1Kr5biN2F743Y30aRCOtau35Vw==} dev: true @@ -3273,6 +2765,7 @@ packages: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: once: 1.4.0 + dev: true /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} @@ -3627,6 +3120,7 @@ packages: /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} + dev: true /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} @@ -3641,6 +3135,7 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + dev: true /escodegen@2.0.0: resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==} @@ -3882,7 +3377,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 @@ -3962,11 +3457,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /events@3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - dev: false - /exec-sh@0.3.6: resolution: {integrity: sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==} dev: true @@ -4090,11 +3580,6 @@ packages: resolution: {integrity: sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g==} dev: false - /fast-redact@3.1.2: - resolution: {integrity: sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw==} - engines: {node: '>=6'} - dev: false - /fast-shallow-equal@1.0.0: resolution: {integrity: sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw==} dev: false @@ -4137,11 +3622,6 @@ packages: dependencies: to-regex-range: 5.0.1 - /filter-obj@1.1.0: - resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} - engines: {node: '>=0.10.0'} - dev: false - /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -4155,6 +3635,7 @@ packages: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 + dev: true /find-up@6.3.0: resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} @@ -4172,11 +3653,6 @@ packages: rimraf: 3.0.2 dev: true - /flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} - hasBin: true - dev: false - /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true @@ -4238,6 +3714,7 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} @@ -4282,10 +3759,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - /get-func-name@2.0.0: - resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} - dev: false - /get-intrinsic@1.2.0: resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} dependencies: @@ -4341,17 +3814,6 @@ packages: dependencies: is-glob: 4.0.3 - /glob@7.2.0: - resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: false - /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -4436,6 +3898,7 @@ packages: /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + dev: true /has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} @@ -4504,11 +3967,6 @@ packages: minimalistic-assert: 1.0.1 dev: false - /he@1.2.0: - resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} - hasBin: true - dev: false - /hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} dev: false @@ -4548,7 +4006,7 @@ packages: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -4558,7 +4016,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 transitivePeerDependencies: - supports-color dev: true @@ -4642,6 +4100,7 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 + dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -4856,11 +4315,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /is-plain-obj@2.1.0: - resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} - engines: {node: '>=8'} - dev: false - /is-plain-object@2.0.4: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} @@ -4929,11 +4383,6 @@ packages: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} dev: true - /is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - dev: false - /is-weakmap@2.0.1: resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} dev: true @@ -5018,7 +4467,7 @@ packages: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4 istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: @@ -5550,6 +4999,7 @@ packages: hasBin: true dependencies: argparse: 2.0.1 + dev: true /jsdom@20.0.3: resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} @@ -5635,10 +5085,6 @@ packages: object.assign: 4.1.4 dev: true - /keyvaluestorage-interface@1.0.0: - resolution: {integrity: sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==} - dev: false - /kind-of@3.2.2: resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} engines: {node: '>=0.10.0'} @@ -5733,6 +5179,7 @@ packages: engines: {node: '>=10'} dependencies: p-locate: 5.0.0 + dev: true /locate-path@7.2.0: resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} @@ -5749,10 +5196,6 @@ packages: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} dev: true - /lodash.isequal@4.5.0: - resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} - dev: false - /lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} dev: true @@ -5765,26 +5208,12 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - dev: false - /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true dependencies: js-tokens: 4.0.0 - /loupe@2.3.6: - resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} - dependencies: - get-func-name: 2.0.0 - dev: false - /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: @@ -5815,10 +5244,6 @@ packages: semver: 6.3.0 dev: true - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: false - /makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} dependencies: @@ -5945,13 +5370,7 @@ packages: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 - - /minimatch@5.0.1: - resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: false + dev: true /minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} @@ -5980,47 +5399,17 @@ packages: is-extendable: 1.0.1 dev: true - /mocha@10.2.0: - resolution: {integrity: sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==} - engines: {node: '>= 14.0.0'} - hasBin: true - dependencies: - ansi-colors: 4.1.1 - browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.4(supports-color@8.1.1) - diff: 5.0.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 7.2.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.0.1 - ms: 2.1.3 - nanoid: 3.3.3 - serialize-javascript: 6.0.0 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.2.1 - yargs: 16.2.0 - yargs-parser: 20.2.4 - yargs-unparser: 2.0.0 - dev: false - /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - /multiformats@9.9.0: - resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} - dev: false + dev: true /mylas@2.1.13: resolution: {integrity: sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg==} @@ -6045,12 +5434,6 @@ packages: stylis: 4.1.3 dev: false - /nanoid@3.3.3: - resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: false - /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -6262,14 +5645,11 @@ packages: es-abstract: 1.21.2 dev: true - /on-exit-leak-free@0.2.0: - resolution: {integrity: sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==} - dev: false - /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 + dev: true /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} @@ -6327,6 +5707,7 @@ packages: engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 + dev: true /p-limit@4.0.0: resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} @@ -6346,6 +5727,7 @@ packages: engines: {node: '>=10'} dependencies: p-limit: 3.1.0 + dev: true /p-locate@6.0.0: resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} @@ -6406,6 +5788,7 @@ packages: /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + dev: true /path-key@2.0.1: resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} @@ -6432,10 +5815,6 @@ packages: engines: {node: '>=8'} dev: true - /pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} - dev: false - /phone@3.1.37: resolution: {integrity: sha512-DV7+e8TkH1SHITfzayRVa4X6hRzIOX/Ptr7S2NhoetbeaZ6Sw330UO2gtyP8+TWj+KpoCfRJn2d6cFUO2jH5jw==} engines: {node: '>=12'} @@ -6463,34 +5842,6 @@ packages: engines: {node: '>=4'} dev: true - /pino-abstract-transport@0.5.0: - resolution: {integrity: sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==} - dependencies: - duplexify: 4.1.2 - split2: 4.2.0 - dev: false - - /pino-std-serializers@4.0.0: - resolution: {integrity: sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==} - dev: false - - /pino@7.11.0: - resolution: {integrity: sha512-dMACeu63HtRLmCG8VKdy4cShCPKaYDR4youZqoSWLxl5Gu99HUw8bw75thbPv9Nip+H+QYX8o3ZJbTdVZZ2TVg==} - hasBin: true - dependencies: - atomic-sleep: 1.0.0 - fast-redact: 3.1.2 - on-exit-leak-free: 0.2.0 - pino-abstract-transport: 0.5.0 - pino-std-serializers: 4.0.0 - process-warning: 1.0.0 - quick-format-unescaped: 4.0.4 - real-require: 0.1.0 - safe-stable-stringify: 2.4.3 - sonic-boom: 2.8.0 - thread-stream: 0.15.2 - dev: false - /pirates@4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} engines: {node: '>= 6'} @@ -6700,10 +6051,6 @@ packages: react-is: 18.2.0 dev: true - /process-warning@1.0.0: - resolution: {integrity: sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==} - dev: false - /prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -6760,16 +6107,6 @@ packages: yargs: 15.4.1 dev: false - /query-string@7.1.1: - resolution: {integrity: sha512-MplouLRDHBZSG9z7fpuAAcI7aAYjDLhtsiVZsevsfaHWDS2IDdORKbSd1kWUA+V4zyva/HZoSfpwnYMMQDhb0w==} - engines: {node: '>=6'} - dependencies: - decode-uri-component: 0.2.2 - filter-obj: 1.1.0 - split-on-first: 1.1.0 - strict-uri-encode: 2.0.0 - dev: false - /querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} dev: true @@ -6781,10 +6118,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - /quick-format-unescaped@4.0.4: - resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} - dev: false - /quick-lru@5.1.1: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} @@ -6794,12 +6127,6 @@ packages: engines: {node: '>=12'} dev: true - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: false - /react-countdown@2.3.4(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-AvtZOnxBYLAVDjvVoXQ9I3asZEnCHIIr1uqKdIayhaTJQTKtZvmLgK/620HjO5TP5Jce9cJCw9t1JQL/TA8gJg==} peerDependencies: @@ -6991,26 +6318,12 @@ packages: type-fest: 2.19.0 dev: true - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: false - /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 - /real-require@0.1.0: - resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} - engines: {node: '>= 12.13.0'} - dev: false - /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -7158,14 +6471,6 @@ packages: dependencies: queue-microtask: 1.2.3 - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: false - - /safe-json-utils@1.1.1: - resolution: {integrity: sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ==} - dev: false - /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: @@ -7180,11 +6485,6 @@ packages: ret: 0.1.15 dev: true - /safe-stable-stringify@2.4.3: - resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} - engines: {node: '>=10'} - dev: false - /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true @@ -7261,12 +6561,6 @@ packages: lru-cache: 6.0.0 dev: true - /serialize-javascript@6.0.0: - resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} - dependencies: - randombytes: 2.1.0 - dev: false - /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: false @@ -7367,12 +6661,6 @@ packages: - supports-color dev: true - /sonic-boom@2.8.0: - resolution: {integrity: sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==} - dependencies: - atomic-sleep: 1.0.0 - dev: false - /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -7441,11 +6729,6 @@ packages: resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} dev: true - /split-on-first@1.1.0: - resolution: {integrity: sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==} - engines: {node: '>=6'} - dev: false - /split-string@3.1.0: resolution: {integrity: sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==} engines: {node: '>=0.10.0'} @@ -7453,11 +6736,6 @@ packages: extend-shallow: 3.0.2 dev: true - /split2@4.2.0: - resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} - engines: {node: '>= 10.x'} - dev: false - /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true @@ -7509,15 +6787,6 @@ packages: internal-slot: 1.0.5 dev: true - /stream-shift@1.0.1: - resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==} - dev: false - - /strict-uri-encode@2.0.0: - resolution: {integrity: sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==} - engines: {node: '>=4'} - dev: false - /string-hash@1.1.3: resolution: {integrity: sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==} dev: true @@ -7585,12 +6854,6 @@ packages: es-abstract: 1.21.2 dev: true - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - dependencies: - safe-buffer: 5.2.1 - dev: false - /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -7634,6 +6897,7 @@ packages: /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + dev: true /style-value-types@5.1.2: resolution: {integrity: sha512-Vs9fNreYF9j6W2VvuDTP7kepALi7sk0xtk2Tu8Yxi9UoajJdEVpNpCov0HsLTqXvNGKX+Uv09pkozVITi1jf3Q==} @@ -7658,12 +6922,14 @@ packages: engines: {node: '>=8'} dependencies: has-flag: 4.0.0 + dev: true /supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} dependencies: has-flag: 4.0.0 + dev: true /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} @@ -7719,12 +6985,6 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /thread-stream@0.15.2: - resolution: {integrity: sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==} - dependencies: - real-require: 0.1.0 - dev: false - /throttle-debounce@2.3.0: resolution: {integrity: sha512-H7oLPV0P7+jgvrk+6mwwwBDmxTaxnu9HMXmloNLXwnNO0ZxZ31Orah2n8lU1eMPvsaowP2CX+USCgyovXfdOFQ==} engines: {node: '>=8'} @@ -7800,37 +7060,6 @@ packages: resolution: {integrity: sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==} dev: false - /ts-node@10.9.1(@types/node@18.11.9)(typescript@4.9.3): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.3 - '@types/node': 18.11.9 - acorn: 8.8.2 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 4.9.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: false - /tsc-alias@1.7.1: resolution: {integrity: sha512-P4+0i+OB0hX17Ca+U6EJ4WZZ+OSupqW32VJ34N7g7+Ch+bwSx1AqYOvDdIVYEKymBh3dfG0t1qxbxPlBbtB1lQ==} hasBin: true @@ -7854,6 +7083,7 @@ packages: /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true /tslib@2.3.1: resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} @@ -7909,6 +7139,7 @@ packages: /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + dev: true /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} @@ -7948,12 +7179,7 @@ packages: resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} engines: {node: '>=4.2.0'} hasBin: true - - /uint8arrays@3.1.0: - resolution: {integrity: sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==} - dependencies: - multiformats: 9.9.0 - dev: false + dev: true /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -8063,10 +7289,6 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: false - /v8-to-istanbul@9.1.0: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} @@ -8176,10 +7398,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /workerpool@6.2.1: - resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} - dev: false - /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -8196,9 +7414,11 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true /write-file-atomic@3.0.3: resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} @@ -8217,19 +7437,6 @@ packages: signal-exit: 3.0.7 dev: true - /ws@7.5.9: - resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} - engines: {node: '>=8.3.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false - /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'} @@ -8263,6 +7470,7 @@ packages: /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + dev: true /yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -8284,26 +7492,11 @@ packages: decamelize: 1.2.0 dev: false - /yargs-parser@20.2.4: - resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} - engines: {node: '>=10'} - dev: false - /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} dev: true - /yargs-unparser@2.0.0: - resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} - engines: {node: '>=10'} - dependencies: - camelcase: 6.3.0 - decamelize: 4.0.0 - flat: 5.0.2 - is-plain-obj: 2.1.0 - dev: false - /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} @@ -8321,19 +7514,6 @@ packages: yargs-parser: 18.1.3 dev: false - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.4 - dev: false - /yargs@17.7.1: resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} engines: {node: '>=12'} @@ -8347,14 +7527,10 @@ packages: yargs-parser: 21.1.1 dev: true - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: false - /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + dev: true /yocto-queue@1.0.0: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} diff --git a/idkit/src/components/IDKitWidget/States/WorldIDState.tsx b/idkit/src/components/IDKitWidget/States/WorldIDState.tsx index 01758aa7..7c443118 100644 --- a/idkit/src/components/IDKitWidget/States/WorldIDState.tsx +++ b/idkit/src/components/IDKitWidget/States/WorldIDState.tsx @@ -44,7 +44,6 @@ const WorldIDState = () => { action_description, credential_types, hasPhone, - walletConnectProjectId, setErrorState, } = useIDKitStore(getOptions, shallow) diff --git a/idkit/src/components/SignInWithWorldID.tsx b/idkit/src/components/SignInWithWorldID.tsx index 0835fa92..654f8ef7 100644 --- a/idkit/src/components/SignInWithWorldID.tsx +++ b/idkit/src/components/SignInWithWorldID.tsx @@ -8,7 +8,7 @@ import SignInButton from './SignInButton' import type { IDKitConfig, WidgetConfig } from '@/types/config' type Props = Omit & - Pick & { + Pick & { nonce?: string onSuccess: (jwt: string) => void children?: ({ open }: { open: () => void }) => JSX.Element diff --git a/idkit/src/lib/consts.ts b/idkit/src/lib/consts.ts deleted file mode 100644 index 717516de..00000000 --- a/idkit/src/lib/consts.ts +++ /dev/null @@ -1 +0,0 @@ -export const WC_PROJECT_ID = 'c3e6053f10efbb423808783ee874cf6a' // Default WalletConnect project ID for IDKit diff --git a/idkit/src/types/index.ts b/idkit/src/types/index.ts index 3020929c..ee222f13 100644 --- a/idkit/src/types/index.ts +++ b/idkit/src/types/index.ts @@ -37,12 +37,6 @@ export interface ISuccessResult { export type CallbackFn = (result: T) => Promise | void -// Error response received from World app through WalletConnect -export interface ExpectedErrorResponse { - message: string - stack: string -} - export interface IErrorState { code: AppErrorCodes message?: string diff --git a/idkit/src/vanilla.tsx b/idkit/src/vanilla.tsx index 7532a0f0..f5fc1205 100644 --- a/idkit/src/vanilla.tsx +++ b/idkit/src/vanilla.tsx @@ -17,12 +17,6 @@ let isInitialized = false export const init = (config: Config): void => { if (isInitialized) throw new Error(__('IDKit is already initialized')) if (!config.app_id) throw new Error(__('You must provide your App ID & Action')) - if (!config.walletConnectProjectId) { - console.warn( - __('WalletConnect project ID not detected. Using default, but this is not advisable for production usage!') - ) - console.warn(__('Get your own project ID at :url', { url: 'https://cloud.walletconnect.com/' })) - } const startApp = () => { try { From 8e43f83ccf979c97d3eb695a59f6c95636b499c3 Mon Sep 17 00:00:00 2001 From: Paolo <149602456+pdtfh@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:37:48 -0800 Subject: [PATCH 14/16] Update pnpm-lock.yaml --- idkit/pnpm-lock.yaml | 187 +++++++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 87 deletions(-) diff --git a/idkit/pnpm-lock.yaml b/idkit/pnpm-lock.yaml index ee5fa305..b5074b56 100644 --- a/idkit/pnpm-lock.yaml +++ b/idkit/pnpm-lock.yaml @@ -5,12 +5,6 @@ settings: excludeLinksFromLockfile: false dependencies: - '@ethersproject/bytes': - specifier: ^5.7.0 - version: 5.7.0 - '@ethersproject/solidity': - specifier: ^5.7.0 - version: 5.7.0 '@fontsource/rubik': specifier: ^4.5.11 version: 4.5.11 @@ -38,9 +32,6 @@ dependencies: framer-motion: specifier: ^7.6.7 version: 7.6.7(react-dom@18.2.0)(react@18.2.0) - js-sha3: - specifier: ^0.8.0 - version: 0.8.0 phone: specifier: ^3.1.37 version: 3.1.37 @@ -65,6 +56,9 @@ dependencies: react-shadow: specifier: ^19.0.3 version: 19.0.3(prop-types@15.8.1)(react-dom@18.2.0)(react@18.2.0) + viem: + specifier: ^0.3.37 + version: 0.3.50(typescript@4.9.3) zustand: specifier: ^4.3.3 version: 4.3.3(react@18.2.0) @@ -215,6 +209,10 @@ packages: resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==} dev: true + /@adraffy/ens-normalize@1.9.0: + resolution: {integrity: sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ==} + dev: false + /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} @@ -632,64 +630,6 @@ packages: - supports-color dev: true - /@ethersproject/bignumber@5.7.0: - resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - bn.js: 5.2.1 - dev: false - - /@ethersproject/bytes@5.7.0: - resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} - dependencies: - '@ethersproject/logger': 5.7.0 - dev: false - - /@ethersproject/constants@5.7.0: - resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - dev: false - - /@ethersproject/keccak256@5.7.0: - resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} - dependencies: - '@ethersproject/bytes': 5.7.0 - js-sha3: 0.8.0 - dev: false - - /@ethersproject/logger@5.7.0: - resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} - dev: false - - /@ethersproject/sha2@5.7.0: - resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - hash.js: 1.1.7 - dev: false - - /@ethersproject/solidity@5.7.0: - resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/strings': 5.7.0 - dev: false - - /@ethersproject/strings@5.7.0: - resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - dev: false - /@fontsource/rubik@4.5.11: resolution: {integrity: sha512-m0/4GKOqJjF9cB4wuLgDhRdRVt35WzqI5n7SgddRjRD+yzsO0eEq/ak0ezgfbR3+f91ydDCek1+RuOVB8dNYwg==} dev: false @@ -1078,6 +1018,16 @@ packages: tslib: 2.4.0 dev: false + /@noble/curves@1.0.0: + resolution: {integrity: sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==} + dependencies: + '@noble/hashes': 1.3.0 + dev: false + + /@noble/hashes@1.3.0: + resolution: {integrity: sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==} + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1331,6 +1281,25 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false + /@scure/base@1.1.3: + resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} + dev: false + + /@scure/bip32@1.3.0: + resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==} + dependencies: + '@noble/curves': 1.0.0 + '@noble/hashes': 1.3.0 + '@scure/base': 1.1.3 + dev: false + + /@scure/bip39@1.2.0: + resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==} + dependencies: + '@noble/hashes': 1.3.0 + '@scure/base': 1.1.3 + dev: false + /@sinclair/typebox@0.25.24: resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} dev: true @@ -1716,6 +1685,17 @@ packages: eslint-visitor-keys: 3.4.0 dev: true + /@wagmi/chains@1.0.0(typescript@4.9.3): + resolution: {integrity: sha512-eNbqRWyHbivcMNq5tbXJks4NaOzVLHnNQauHPeE/EDT9AlpqzcrMc+v2T1/2Iw8zN4zgqB86NCsxeJHJs7+xng==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 4.9.3 + dev: false + /@xobotyi/scrollbar-width@1.9.5: resolution: {integrity: sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ==} dev: false @@ -1724,6 +1704,18 @@ packages: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} dev: true + /abitype@0.8.7(typescript@4.9.3): + resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + dependencies: + typescript: 4.9.3 + dev: false + /acorn-globals@7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: @@ -2144,10 +2136,6 @@ packages: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - /bn.js@5.2.1: - resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} - dev: false - /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -3960,13 +3948,6 @@ packages: dependencies: function-bind: 1.1.1 - /hash.js@1.1.7: - resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} - dependencies: - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - dev: false - /hey-listen@1.0.8: resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} dev: false @@ -4104,6 +4085,7 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true /inline-style-prefixer@6.0.4: resolution: {integrity: sha512-FwXmZC2zbeeS7NzGjJ6pAiqRhXR0ugUShSNb6GApMl6da0/XGc4MOJsoWAywia52EEWbXNSy0pzkwz/+Y+swSg==} @@ -4436,6 +4418,14 @@ packages: engines: {node: '>=0.10.0'} dev: true + /isomorphic-ws@5.0.0(ws@8.12.0): + resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + peerDependencies: + ws: '*' + dependencies: + ws: 8.12.0 + dev: false + /istanbul-lib-coverage@3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} engines: {node: '>=8'} @@ -4979,10 +4969,6 @@ packages: resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} dev: true - /js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: false - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -5362,10 +5348,6 @@ packages: hasBin: true dev: false - /minimalistic-assert@1.0.1: - resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} - dev: false - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -7179,7 +7161,6 @@ packages: resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} engines: {node: '>=4.2.0'} hasBin: true - dev: true /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -7305,6 +7286,25 @@ packages: spdx-expression-parse: 3.0.1 dev: true + /viem@0.3.50(typescript@4.9.3): + resolution: {integrity: sha512-s+LxCYZTR9F/qPk1/n1YDVAX9vSeVz7GraqBZWGrDuenCJxo9ArCoIceJ6ksI0WwSeNzcZ0VVbD/kWRzTxkipw==} + dependencies: + '@adraffy/ens-normalize': 1.9.0 + '@noble/curves': 1.0.0 + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + '@wagmi/chains': 1.0.0(typescript@4.9.3) + abitype: 0.8.7(typescript@4.9.3) + isomorphic-ws: 5.0.0(ws@8.12.0) + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + dev: false + /w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} @@ -7437,6 +7437,19 @@ packages: signal-exit: 3.0.7 dev: true + /ws@8.12.0: + resolution: {integrity: sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'} From 9aedadb7e4773881baed248f4d380ccda1cde705 Mon Sep 17 00:00:00 2001 From: Paolo <149602456+pdtfh@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:42:36 -0800 Subject: [PATCH 15/16] fix ts --- idkit/jest.config.ts | 3 +- idkit/package.json | 3 +- idkit/pnpm-lock.yaml | 144 ++++++++++++++++++++++++++++++++----------- idkit/src/index.ts | 2 - 4 files changed, 112 insertions(+), 40 deletions(-) diff --git a/idkit/jest.config.ts b/idkit/jest.config.ts index 56c57eca..bf34a37b 100644 --- a/idkit/jest.config.ts +++ b/idkit/jest.config.ts @@ -3,9 +3,8 @@ * https://jestjs.io/docs/configuration */ -import type { PackageJson } from 'type-fest' import * as packageJson from './package.json' -const { version }: Pick = packageJson +const { version } = packageJson export default { // Automatically clear mock calls, instances, contexts and results before every test diff --git a/idkit/package.json b/idkit/package.json index a4b0cade..59476634 100644 --- a/idkit/package.json +++ b/idkit/package.json @@ -64,7 +64,7 @@ "react-country-flag": "^3.1.0", "react-frame-component": "^5.2.3", "react-shadow": "^19.0.3", - "viem": "^0.3.37", + "viem": "^0.3.50", "zustand": "^4.3.3" }, "devDependencies": { @@ -111,6 +111,7 @@ "react-dom": "18.2.0", "rimraf": "^3.0.2", "tailwindcss": "^3.2.4", + "ts-node": "^10.9.1", "tsc-alias": "^1.7.1", "twin.macro": "^3.1.0", "typescript": "4.9.3" diff --git a/idkit/pnpm-lock.yaml b/idkit/pnpm-lock.yaml index b5074b56..ff5fabdb 100644 --- a/idkit/pnpm-lock.yaml +++ b/idkit/pnpm-lock.yaml @@ -57,7 +57,7 @@ dependencies: specifier: ^19.0.3 version: 19.0.3(prop-types@15.8.1)(react-dom@18.2.0)(react@18.2.0) viem: - specifier: ^0.3.37 + specifier: ^0.3.50 version: 0.3.50(typescript@4.9.3) zustand: specifier: ^4.3.3 @@ -159,10 +159,10 @@ devDependencies: version: 4.6.0(eslint@8.29.0) eslint-plugin-tailwindcss: specifier: ^3.7.1 - version: 3.7.1 + version: 3.7.1(ts-node@10.9.1) jest: specifier: ^29.5.0 - version: 29.5.0(@types/node@18.11.9) + version: 29.5.0(@types/node@18.11.9)(ts-node@10.9.1) jest-environment-jsdom: specifier: ^29.5.0 version: 29.5.0 @@ -192,7 +192,10 @@ devDependencies: version: 3.0.2 tailwindcss: specifier: ^3.2.4 - version: 3.2.4(postcss@8.4.19) + version: 3.2.4(postcss@8.4.19)(ts-node@10.9.1) + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@types/node@18.11.9)(typescript@4.9.3) tsc-alias: specifier: ^1.7.1 version: 1.7.1 @@ -591,6 +594,12 @@ packages: minimist: 1.2.8 dev: true + /@cspotcode/source-map-support@0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + /@emotion/is-prop-valid@0.8.8: resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} requiresBuild: true @@ -694,7 +703,7 @@ packages: slash: 3.0.0 dev: true - /@jest/core@29.5.0: + /@jest/core@29.5.0(ts-node@10.9.1): resolution: {integrity: sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -715,7 +724,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.5.0 - jest-config: 29.5.0(@types/node@18.11.9) + jest-config: 29.5.0(@types/node@18.11.9)(ts-node@10.9.1) jest-haste-map: 29.5.0 jest-message-util: 29.5.0 jest-regex-util: 29.4.3 @@ -941,7 +950,6 @@ packages: /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} - dev: true /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} @@ -954,7 +962,6 @@ packages: /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - dev: true /@jridgewell/trace-mapping@0.3.18: resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} @@ -963,6 +970,12 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@jridgewell/trace-mapping@0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.15 + /@mdn/browser-compat-data@3.3.14: resolution: {integrity: sha512-n2RC9d6XatVbWFdHLimzzUJxJ1KY8LdjqrW6YvGPiRmsHkhOUx74/Ct10x5Yo7bC/Jvqx7cDEW8IMPv/+vwEzA==} dev: true @@ -1330,7 +1343,7 @@ packages: tailwindcss: '>=3.0.0 || >= 3.0.0-alpha.1' dependencies: mini-svg-data-uri: 1.4.4 - tailwindcss: 3.2.4(postcss@8.4.19) + tailwindcss: 3.2.4(postcss@8.4.19)(ts-node@10.9.1) dev: false /@testing-library/dom@9.2.0: @@ -1381,6 +1394,18 @@ packages: engines: {node: '>= 10'} dev: true + /@tsconfig/node10@1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + + /@tsconfig/node12@1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + /@tsconfig/node14@1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + /@tsconfig/node16@1.0.4: + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + /@types/aria-query@5.0.1: resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==} dev: true @@ -1477,7 +1502,6 @@ packages: /@types/node@18.11.9: resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} - dev: true /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} @@ -1745,7 +1769,6 @@ packages: /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - dev: true /acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} @@ -1756,7 +1779,6 @@ packages: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} @@ -1821,6 +1843,9 @@ packages: normalize-path: 3.0.0 picomatch: 2.3.1 + /arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -1966,7 +1991,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.5 - caniuse-lite: 1.0.30001477 + caniuse-lite: 1.0.30001561 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -2178,7 +2203,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001477 + caniuse-lite: 1.0.30001561 electron-to-chromium: 1.4.357 node-releases: 2.0.10 update-browserslist-db: 1.0.10(browserslist@4.21.5) @@ -2249,8 +2274,8 @@ packages: engines: {node: '>=14.16'} dev: true - /caniuse-lite@1.0.30001477: - resolution: {integrity: sha512-lZim4iUHhGcy5p+Ri/G7m84hJwncj+Kz7S5aD4hoQfslKZJgt0tHc/hafVbqHC5bbhHb+mrW2JOUHkI5KH7toQ==} + /caniuse-lite@1.0.30001561: + resolution: {integrity: sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==} dev: true /capture-exit@2.0.0: @@ -2302,7 +2327,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 /ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} @@ -2452,6 +2477,9 @@ packages: resolution: {integrity: sha512-3tQLA0vec+NDVlcaHhXGqILq/oQRsv4fRi4EedCfJqUuJUjQGdcSPM8r2IJIT2kZ5yWbiOCkXMgy7YTo8FNS2w==} dev: false + /create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + /cross-spawn@6.0.5: resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} engines: {node: '>=4.8'} @@ -2690,6 +2718,10 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true + /diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + /dijkstrajs@1.0.2: resolution: {integrity: sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg==} dev: false @@ -3195,7 +3227,7 @@ packages: '@mdn/browser-compat-data': 5.2.49 ast-metadata-inferer: 0.7.0 browserslist: 4.21.5 - caniuse-lite: 1.0.30001477 + caniuse-lite: 1.0.30001561 core-js: 3.30.0 eslint: 8.29.0 find-up: 5.0.0 @@ -3306,13 +3338,13 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /eslint-plugin-tailwindcss@3.7.1: + /eslint-plugin-tailwindcss@3.7.1(ts-node@10.9.1): resolution: {integrity: sha512-MCPpVp5VvNYuRz1JYN9sN0r/cgAt3SfIlKbvYjVij+T/8r0z4U8nPY/c07vm+dLYb7mBv9N9LLIR4l9pLHSJaQ==} engines: {node: '>=12.13.0'} dependencies: fast-glob: 3.2.12 postcss: 8.4.19 - tailwindcss: 3.2.4(postcss@8.4.19) + tailwindcss: 3.2.4(postcss@8.4.19)(ts-node@10.9.1) transitivePeerDependencies: - ts-node dev: true @@ -3704,8 +3736,8 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -4508,7 +4540,7 @@ packages: - supports-color dev: true - /jest-cli@29.5.0(@types/node@18.11.9): + /jest-cli@29.5.0(@types/node@18.11.9)(ts-node@10.9.1): resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4518,14 +4550,14 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.5.0 + '@jest/core': 29.5.0(ts-node@10.9.1) '@jest/test-result': 29.5.0 '@jest/types': 29.5.0 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.5.0(@types/node@18.11.9) + jest-config: 29.5.0(@types/node@18.11.9)(ts-node@10.9.1) jest-util: 29.5.0 jest-validate: 29.5.0 prompts: 2.4.2 @@ -4536,7 +4568,7 @@ packages: - ts-node dev: true - /jest-config@29.5.0(@types/node@18.11.9): + /jest-config@29.5.0(@types/node@18.11.9)(ts-node@10.9.1): resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -4571,6 +4603,7 @@ packages: pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 + ts-node: 10.9.1(@types/node@18.11.9)(typescript@4.9.3) transitivePeerDependencies: - supports-color dev: true @@ -4661,7 +4694,7 @@ packages: sane: 4.1.0 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 transitivePeerDependencies: - supports-color dev: true @@ -4682,7 +4715,7 @@ packages: micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /jest-leak-detector@29.5.0: @@ -4941,7 +4974,7 @@ packages: supports-color: 8.1.1 dev: true - /jest@29.5.0(@types/node@18.11.9): + /jest@29.5.0(@types/node@18.11.9)(ts-node@10.9.1): resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4951,10 +4984,10 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.5.0 + '@jest/core': 29.5.0(ts-node@10.9.1) '@jest/types': 29.5.0 import-local: 3.1.0 - jest-cli: 29.5.0(@types/node@18.11.9) + jest-cli: 29.5.0(@types/node@18.11.9)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' - supports-color @@ -5230,6 +5263,9 @@ packages: semver: 6.3.0 dev: true + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + /makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} dependencies: @@ -5881,7 +5917,7 @@ packages: camelcase-css: 2.0.1 postcss: 8.4.19 - /postcss-load-config@3.1.4(postcss@8.4.19): + /postcss-load-config@3.1.4(postcss@8.4.19)(ts-node@10.9.1): resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} peerDependencies: @@ -5895,6 +5931,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.19 + ts-node: 10.9.1(@types/node@18.11.9)(typescript@4.9.3) yaml: 1.10.2 /postcss-modules-extract-imports@3.0.0(postcss@8.4.19): @@ -6921,7 +6958,7 @@ packages: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true - /tailwindcss@3.2.4(postcss@8.4.19): + /tailwindcss@3.2.4(postcss@8.4.19)(ts-node@10.9.1): resolution: {integrity: sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==} engines: {node: '>=12.13.0'} hasBin: true @@ -6945,7 +6982,7 @@ packages: postcss: 8.4.19 postcss-import: 14.1.0(postcss@8.4.19) postcss-js: 4.0.1(postcss@8.4.19) - postcss-load-config: 3.1.4(postcss@8.4.19) + postcss-load-config: 3.1.4(postcss@8.4.19)(ts-node@10.9.1) postcss-nested: 6.0.0(postcss@8.4.19) postcss-selector-parser: 6.0.11 postcss-value-parser: 4.2.0 @@ -7042,6 +7079,36 @@ packages: resolution: {integrity: sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==} dev: false + /ts-node@10.9.1(@types/node@18.11.9)(typescript@4.9.3): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 18.11.9 + acorn: 8.8.2 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + /tsc-alias@1.7.1: resolution: {integrity: sha512-P4+0i+OB0hX17Ca+U6EJ4WZZ+OSupqW32VJ34N7g7+Ch+bwSx1AqYOvDdIVYEKymBh3dfG0t1qxbxPlBbtB1lQ==} hasBin: true @@ -7101,7 +7168,7 @@ packages: lodash.get: 4.4.2 lodash.merge: 4.6.2 postcss-selector-parser: 6.0.11 - tailwindcss: 3.2.4(postcss@8.4.19) + tailwindcss: 3.2.4(postcss@8.4.19)(ts-node@10.9.1) dev: true /type-check@0.3.2: @@ -7270,6 +7337,9 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + /v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + /v8-to-istanbul@9.1.0: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} @@ -7540,6 +7610,10 @@ packages: yargs-parser: 21.1.1 dev: true + /yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} diff --git a/idkit/src/index.ts b/idkit/src/index.ts index ea8b2561..8cec1792 100644 --- a/idkit/src/index.ts +++ b/idkit/src/index.ts @@ -5,7 +5,6 @@ import type { ISuccessResult } from '@/types' import { solidityEncode } from './lib/hashing' import IDKitWidget from '@/components/IDKitWidget' import SignInButton from './components/SignInButton' -import useAppConnection from '@/services/walletconnect' import type { WidgetProps, Config } from '@/types/config' import { VerificationState, AppErrorCodes } from './types/app' import SignInWithWorldID from './components/SignInWithWorldID' @@ -17,7 +16,6 @@ const internal = { validateABILikeEncoding, generateExternalNullifier, QRCode, - useAppConnection, VerificationState, AppErrorCodes, } From bd208e7ce725b39a03a57a883be179240ae9d749 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Tue, 14 Nov 2023 20:49:19 -0800 Subject: [PATCH 16/16] bridge updates --- idkit/src/services/wld-bridge.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/idkit/src/services/wld-bridge.ts b/idkit/src/services/wld-bridge.ts index 33efeb78..e7d0dc35 100644 --- a/idkit/src/services/wld-bridge.ts +++ b/idkit/src/services/wld-bridge.ts @@ -53,10 +53,9 @@ const useWorldBridgeStore = create((set, get) => ({ action_description?: IDKitConfig['action_description'] ) => { const { key, iv } = await generateKey() - const requestId = window.crypto.randomUUID() - const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request/${requestId}`, { - method: 'PUT', + const res = await fetch(`${bridgeUrl ?? DEFAULT_BRIDGE_URL}/request`, { + method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify( await encryptRequest( @@ -79,13 +78,15 @@ const useWorldBridgeStore = create((set, get) => ({ throw new Error('Failed to create client') } + const { request_id } = await res.json() + set({ iv, key, - requestId, + requestId: request_id, bridgeUrl: bridgeUrl ?? DEFAULT_BRIDGE_URL, verificationState: VerificationState.PollingForUpdates, - connectorURI: `https://worldcoin.org/verify?t=wld&i=${requestId}&k=${encodeURIComponent( + connectorURI: `https://worldcoin.org/verify?t=wld&i=${request_id}&k=${encodeURIComponent( await exportKey(key) )}${bridgeUrl ? `&b=${encodeURIComponent(bridgeUrl)}` : ''}`, })