mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
Implement basic code splitting
This commit is contained in:
committed by
Justin Hernandez
parent
c269e66f10
commit
702e5096d5
18
app/src/utils/cryptoLoader.ts
Normal file
18
app/src/utils/cryptoLoader.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
export const loadCryptoUtils = async () => {
|
||||
const [elliptic, forge, ethers] = await Promise.all([
|
||||
import('elliptic'),
|
||||
import('node-forge'),
|
||||
import('ethers'),
|
||||
]);
|
||||
return { elliptic, forge, ethers };
|
||||
};
|
||||
|
||||
export const loadProvingUtils = async () => {
|
||||
return Promise.all([
|
||||
import('./proving/provingMachine'),
|
||||
import('./proving/attest'),
|
||||
import('./proving/validateDocument'),
|
||||
]);
|
||||
};
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
attributeToPosition_ID,
|
||||
calculateUserIdentifierHash,
|
||||
DEFAULT_MAJORITY,
|
||||
DocumentCategory,
|
||||
generateCircuitInputsDSC,
|
||||
generateCircuitInputsRegister,
|
||||
generateCircuitInputsVCandDisclose,
|
||||
@@ -15,6 +14,9 @@ import {
|
||||
hashEndpointWithScope,
|
||||
ID_CARD_ATTESTATION_ID,
|
||||
PASSPORT_ATTESTATION_ID,
|
||||
} from '@selfxyz/common';
|
||||
import type {
|
||||
DocumentCategory,
|
||||
PassportData,
|
||||
SelfApp,
|
||||
SelfAppDisclosureConfig,
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
import {
|
||||
DocumentCategory,
|
||||
EndpointType,
|
||||
getCircuitNameFromPassportData,
|
||||
getSolidityPackedUserContextData,
|
||||
PassportData,
|
||||
SelfApp,
|
||||
} from '@selfxyz/common';
|
||||
import type { DocumentCategory, EndpointType, PassportData, SelfApp } from '@selfxyz/common';
|
||||
import forge from 'node-forge';
|
||||
import socketIo, { Socket } from 'socket.io-client';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
|
||||
|
||||
import { WS_DB_RELAYER, WS_DB_RELAYER_STAGING } from '@selfxyz/common';
|
||||
import type { EndpointType } from '@selfxyz/common';
|
||||
import {
|
||||
initElliptic,
|
||||
WS_DB_RELAYER,
|
||||
WS_DB_RELAYER_STAGING,
|
||||
} from '@selfxyz/common';
|
||||
import { initElliptic } from '@selfxyz/common';
|
||||
import forge from 'node-forge';
|
||||
|
||||
const elliptic = initElliptic();
|
||||
|
||||
@@ -13,9 +13,8 @@ import {
|
||||
ID_CARD_ATTESTATION_ID,
|
||||
parseCertificateSimple,
|
||||
PASSPORT_ATTESTATION_ID,
|
||||
type PassportData,
|
||||
} from '@selfxyz/common';
|
||||
import { DocumentCategory } from '@selfxyz/common';
|
||||
import { DocumentCategory, PassportData } from '@selfxyz/common';
|
||||
import { poseidon2, poseidon5 } from 'poseidon-lite';
|
||||
|
||||
import { DocumentEvents } from '../../consts/analytics';
|
||||
|
||||
Reference in New Issue
Block a user