@reclaimprotocol/attestor-core 5.0.1-beta.12 → 5.0.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/avs/client/create-claim-on-avs.js +5 -5
- package/lib/avs/config.js +1 -1
- package/lib/avs/utils/contracts.js +5 -5
- package/lib/avs/utils/register.js +3 -3
- package/lib/avs/utils/tasks.js +1 -1
- package/lib/client/create-claim.js +10 -10
- package/lib/client/tunnels/make-rpc-tcp-tunnel.js +1 -1
- package/lib/client/tunnels/make-rpc-tls-tunnel.d.ts +1 -1
- package/lib/client/tunnels/make-rpc-tls-tunnel.js +4 -4
- package/lib/client/utils/attestor-pool.js +1 -1
- package/lib/client/utils/client-socket.js +5 -5
- package/lib/client/utils/message-handler.js +2 -2
- package/lib/config/index.js +1 -1
- package/lib/external-rpc/benchmark.js +4 -4
- package/lib/external-rpc/handle-incoming-msg.js +9 -9
- package/lib/external-rpc/jsc-polyfills/1.js +1 -1
- package/lib/external-rpc/jsc-polyfills/2.js +2 -2
- package/lib/external-rpc/jsc-polyfills/index.js +2 -2
- package/lib/external-rpc/jsc-polyfills/ws.js +1 -1
- package/lib/external-rpc/setup-browser.js +5 -5
- package/lib/external-rpc/setup-jsc.js +4 -4
- package/lib/external-rpc/utils.js +4 -4
- package/lib/external-rpc/zk.js +2 -2
- package/lib/mechain/client/create-claim-on-mechain.js +2 -2
- package/lib/providers/http/index.js +6 -6
- package/lib/providers/http/utils.js +3 -3
- package/lib/providers/index.js +1 -1
- package/lib/scripts/build-browser.js +38 -0
- package/lib/scripts/build-jsc.js +47 -0
- package/lib/scripts/build-lib.js +47 -0
- package/lib/scripts/check-avs-registration.js +1 -1
- package/lib/scripts/generate-provider-types.js +1 -1
- package/lib/scripts/generate-receipt.js +6 -6
- package/lib/scripts/generate-toprf-keys.js +1 -1
- package/lib/scripts/jsc-cli-rpc.js +3 -3
- package/lib/scripts/register-avs-operator.js +1 -1
- package/lib/scripts/start-server.js +3 -3
- package/lib/scripts/update-avs-metadata.js +2 -2
- package/lib/scripts/whitelist-operator.js +2 -2
- package/lib/server/create-server.js +9 -9
- package/lib/server/handlers/claimTeeBundle.js +11 -11
- package/lib/server/handlers/claimTunnel.js +6 -6
- package/lib/server/handlers/completeClaimOnChain.js +3 -3
- package/lib/server/handlers/createClaimOnChain.js +4 -4
- package/lib/server/handlers/createTaskOnMechain.js +4 -4
- package/lib/server/handlers/createTunnel.js +4 -4
- package/lib/server/handlers/fetchCertificateBytes.js +2 -2
- package/lib/server/handlers/index.js +10 -10
- package/lib/server/handlers/init.js +5 -5
- package/lib/server/handlers/toprf.js +2 -2
- package/lib/server/socket.js +7 -7
- package/lib/server/tunnels/make-tcp-tunnel.js +6 -6
- package/lib/server/utils/apm.js +2 -2
- package/lib/server/utils/assert-valid-claim-request.js +8 -8
- package/lib/server/utils/config-env.js +1 -1
- package/lib/server/utils/dns.js +1 -1
- package/lib/server/utils/generics.js +4 -4
- package/lib/server/utils/keep-alive.js +1 -1
- package/lib/server/utils/oprf-raw.js +3 -3
- package/lib/server/utils/process-handshake.js +2 -2
- package/lib/server/utils/proxy-session.d.ts +1 -1
- package/lib/server/utils/proxy-session.js +3 -1
- package/lib/server/utils/tee-oprf-mpc-verification.js +1 -1
- package/lib/server/utils/tee-oprf-verification.js +2 -2
- package/lib/server/utils/tee-transcript-reconstruction.js +3 -3
- package/lib/server/utils/tee-verification.js +6 -6
- package/lib/server/utils/validation.js +2 -2
- package/lib/types/general.d.ts +0 -1
- package/lib/utils/auth.js +6 -6
- package/lib/utils/bgp-listener.js +2 -2
- package/lib/utils/claims.js +3 -3
- package/lib/utils/error.js +1 -1
- package/lib/utils/generics.d.ts +1 -6
- package/lib/utils/generics.js +2 -6
- package/lib/utils/http-parser.js +3 -3
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/prepare-packets.js +3 -3
- package/lib/utils/redactions.js +1 -1
- package/lib/utils/signatures/index.js +2 -2
- package/lib/utils/socket-base.js +3 -3
- package/lib/utils/tls.js +2 -2
- package/lib/utils/zk.js +8 -8
- package/package.json +3 -9
- package/lib/browser/avs/abis/avsDirectoryABI.d.ts +0 -60
- package/lib/browser/avs/abis/avsDirectoryABI.js +0 -343
- package/lib/browser/avs/abis/delegationABI.d.ts +0 -126
- package/lib/browser/avs/abis/delegationABI.js +0 -4
- package/lib/browser/avs/abis/registryABI.d.ts +0 -136
- package/lib/browser/avs/abis/registryABI.js +0 -728
- package/lib/browser/avs/client/create-claim-on-avs.d.ts +0 -12
- package/lib/browser/avs/client/create-claim-on-avs.js +0 -168
- package/lib/browser/avs/config.d.ts +0 -7
- package/lib/browser/avs/config.js +0 -26
- package/lib/browser/avs/contracts/ReclaimServiceManager.d.ts +0 -601
- package/lib/browser/avs/contracts/ReclaimServiceManager.js +0 -0
- package/lib/browser/avs/contracts/common.d.ts +0 -50
- package/lib/browser/avs/contracts/common.js +0 -0
- package/lib/browser/avs/contracts/factories/ReclaimServiceManager__factory.d.ts +0 -890
- package/lib/browser/avs/contracts/factories/ReclaimServiceManager__factory.js +0 -1183
- package/lib/browser/avs/contracts/factories/index.d.ts +0 -1
- package/lib/browser/avs/contracts/factories/index.js +0 -4
- package/lib/browser/avs/contracts/index.d.ts +0 -3
- package/lib/browser/avs/contracts/index.js +0 -6
- package/lib/browser/avs/types/index.d.ts +0 -55
- package/lib/browser/avs/types/index.js +0 -0
- package/lib/browser/avs/utils/contracts.d.ts +0 -21
- package/lib/browser/avs/utils/contracts.js +0 -53
- package/lib/browser/avs/utils/register.d.ts +0 -27
- package/lib/browser/avs/utils/register.js +0 -74
- package/lib/browser/avs/utils/tasks.d.ts +0 -22
- package/lib/browser/avs/utils/tasks.js +0 -48
- package/lib/browser/client/create-claim.d.ts +0 -5
- package/lib/browser/client/create-claim.js +0 -461
- package/lib/browser/client/index.d.ts +0 -3
- package/lib/browser/client/index.js +0 -3
- package/lib/browser/client/tunnels/make-rpc-tcp-tunnel.d.ts +0 -16
- package/lib/browser/client/tunnels/make-rpc-tcp-tunnel.js +0 -53
- package/lib/browser/client/tunnels/make-rpc-tls-tunnel.d.ts +0 -26
- package/lib/browser/client/tunnels/make-rpc-tls-tunnel.js +0 -127
- package/lib/browser/client/utils/attestor-pool.d.ts +0 -8
- package/lib/browser/client/utils/attestor-pool.js +0 -24
- package/lib/browser/client/utils/client-socket.d.ts +0 -11
- package/lib/browser/client/utils/client-socket.js +0 -120
- package/lib/browser/client/utils/message-handler.d.ts +0 -4
- package/lib/browser/client/utils/message-handler.js +0 -97
- package/lib/browser/config/index.d.ts +0 -31
- package/lib/browser/config/index.js +0 -62
- package/lib/browser/external-rpc/benchmark.d.ts +0 -1
- package/lib/browser/external-rpc/benchmark.js +0 -82
- package/lib/browser/external-rpc/event-bus.d.ts +0 -7
- package/lib/browser/external-rpc/event-bus.js +0 -17
- package/lib/browser/external-rpc/global.d.js +0 -0
- package/lib/browser/external-rpc/handle-incoming-msg.d.ts +0 -2
- package/lib/browser/external-rpc/handle-incoming-msg.js +0 -241
- package/lib/browser/external-rpc/index.d.ts +0 -3
- package/lib/browser/external-rpc/index.js +0 -3
- package/lib/browser/external-rpc/jsc-polyfills/1.d.ts +0 -14
- package/lib/browser/external-rpc/jsc-polyfills/1.js +0 -80
- package/lib/browser/external-rpc/jsc-polyfills/2.d.ts +0 -1
- package/lib/browser/external-rpc/jsc-polyfills/2.js +0 -15
- package/lib/browser/external-rpc/jsc-polyfills/event.d.ts +0 -10
- package/lib/browser/external-rpc/jsc-polyfills/event.js +0 -19
- package/lib/browser/external-rpc/jsc-polyfills/index.d.ts +0 -2
- package/lib/browser/external-rpc/jsc-polyfills/index.js +0 -2
- package/lib/browser/external-rpc/jsc-polyfills/ws.d.ts +0 -21
- package/lib/browser/external-rpc/jsc-polyfills/ws.js +0 -83
- package/lib/browser/external-rpc/setup-browser.d.ts +0 -6
- package/lib/browser/external-rpc/setup-browser.js +0 -33
- package/lib/browser/external-rpc/setup-jsc.d.ts +0 -24
- package/lib/browser/external-rpc/setup-jsc.js +0 -22
- package/lib/browser/external-rpc/types.d.ts +0 -213
- package/lib/browser/external-rpc/types.js +0 -0
- package/lib/browser/external-rpc/utils.d.ts +0 -20
- package/lib/browser/external-rpc/utils.js +0 -100
- package/lib/browser/external-rpc/zk.d.ts +0 -14
- package/lib/browser/external-rpc/zk.js +0 -58
- package/lib/browser/index.browser.js +0 -13
- package/lib/browser/index.d.ts +0 -9
- package/lib/browser/index.js +0 -13
- package/lib/browser/mechain/abis/governanceABI.d.ts +0 -50
- package/lib/browser/mechain/abis/governanceABI.js +0 -461
- package/lib/browser/mechain/abis/taskABI.d.ts +0 -157
- package/lib/browser/mechain/abis/taskABI.js +0 -512
- package/lib/browser/mechain/client/create-claim-on-mechain.d.ts +0 -10
- package/lib/browser/mechain/client/create-claim-on-mechain.js +0 -33
- package/lib/browser/mechain/client/index.d.ts +0 -1
- package/lib/browser/mechain/client/index.js +0 -1
- package/lib/browser/mechain/constants/index.d.ts +0 -3
- package/lib/browser/mechain/constants/index.js +0 -8
- package/lib/browser/mechain/index.d.ts +0 -2
- package/lib/browser/mechain/index.js +0 -2
- package/lib/browser/mechain/types/index.d.ts +0 -23
- package/lib/browser/mechain/types/index.js +0 -0
- package/lib/browser/proto/api.d.ts +0 -651
- package/lib/browser/proto/api.js +0 -4250
- package/lib/browser/proto/tee-bundle.d.ts +0 -156
- package/lib/browser/proto/tee-bundle.js +0 -1296
- package/lib/browser/providers/http/index.d.ts +0 -18
- package/lib/browser/providers/http/index.js +0 -640
- package/lib/browser/providers/http/patch-parse5-tree.d.ts +0 -6
- package/lib/browser/providers/http/patch-parse5-tree.js +0 -34
- package/lib/browser/providers/http/utils.d.ts +0 -77
- package/lib/browser/providers/http/utils.js +0 -283
- package/lib/browser/providers/index.d.ts +0 -4
- package/lib/browser/providers/index.js +0 -7
- package/lib/browser/scripts/fallbacks/crypto.js +0 -4
- package/lib/browser/scripts/fallbacks/empty.js +0 -4
- package/lib/browser/scripts/fallbacks/gnark.js +0 -15
- package/lib/browser/scripts/fallbacks/re2.js +0 -7
- package/lib/browser/scripts/fallbacks/snarkjs.js +0 -10
- package/lib/browser/scripts/fallbacks/zk-file-fetch.js +0 -50
- package/lib/browser/types/bgp.d.ts +0 -11
- package/lib/browser/types/bgp.js +0 -0
- package/lib/browser/types/claims.d.ts +0 -70
- package/lib/browser/types/claims.js +0 -0
- package/lib/browser/types/client.d.ts +0 -163
- package/lib/browser/types/client.js +0 -0
- package/lib/browser/types/general.d.ts +0 -77
- package/lib/browser/types/general.js +0 -0
- package/lib/browser/types/handlers.d.ts +0 -10
- package/lib/browser/types/handlers.js +0 -0
- package/lib/browser/types/index.d.ts +0 -10
- package/lib/browser/types/index.js +0 -10
- package/lib/browser/types/providers.d.ts +0 -161
- package/lib/browser/types/providers.gen.d.ts +0 -443
- package/lib/browser/types/providers.gen.js +0 -16
- package/lib/browser/types/providers.js +0 -0
- package/lib/browser/types/rpc.d.ts +0 -35
- package/lib/browser/types/rpc.js +0 -0
- package/lib/browser/types/signatures.d.ts +0 -28
- package/lib/browser/types/signatures.js +0 -0
- package/lib/browser/types/tunnel.d.ts +0 -18
- package/lib/browser/types/tunnel.js +0 -0
- package/lib/browser/types/zk.d.ts +0 -38
- package/lib/browser/types/zk.js +0 -0
- package/lib/browser/utils/auth.d.ts +0 -8
- package/lib/browser/utils/auth.js +0 -71
- package/lib/browser/utils/b64-json.d.ts +0 -2
- package/lib/browser/utils/b64-json.js +0 -17
- package/lib/browser/utils/claims.d.ts +0 -33
- package/lib/browser/utils/claims.js +0 -89
- package/lib/browser/utils/env.d.ts +0 -3
- package/lib/browser/utils/env.js +0 -19
- package/lib/browser/utils/error.d.ts +0 -26
- package/lib/browser/utils/error.js +0 -54
- package/lib/browser/utils/generics.d.ts +0 -119
- package/lib/browser/utils/generics.js +0 -272
- package/lib/browser/utils/http-parser.d.ts +0 -59
- package/lib/browser/utils/http-parser.js +0 -201
- package/lib/browser/utils/index.browser.js +0 -13
- package/lib/browser/utils/index.d.ts +0 -13
- package/lib/browser/utils/index.js +0 -13
- package/lib/browser/utils/logger.browser.js +0 -88
- package/lib/browser/utils/logger.d.ts +0 -14
- package/lib/browser/utils/logger.js +0 -88
- package/lib/browser/utils/prepare-packets.d.ts +0 -16
- package/lib/browser/utils/prepare-packets.js +0 -69
- package/lib/browser/utils/redactions.d.ts +0 -73
- package/lib/browser/utils/redactions.js +0 -135
- package/lib/browser/utils/retries.d.ts +0 -12
- package/lib/browser/utils/retries.js +0 -26
- package/lib/browser/utils/signatures/eth.d.ts +0 -2
- package/lib/browser/utils/signatures/eth.js +0 -31
- package/lib/browser/utils/signatures/index.d.ts +0 -5
- package/lib/browser/utils/signatures/index.js +0 -12
- package/lib/browser/utils/socket-base.d.ts +0 -23
- package/lib/browser/utils/socket-base.js +0 -96
- package/lib/browser/utils/tls-imports.d.ts +0 -21
- package/lib/browser/utils/tls-imports.js +0 -71
- package/lib/browser/utils/tls.d.ts +0 -2
- package/lib/browser/utils/tls.js +0 -58
- package/lib/browser/utils/ws.d.ts +0 -7
- package/lib/browser/utils/ws.js +0 -22
- package/lib/browser/utils/zk.d.ts +0 -71
- package/lib/browser/utils/zk.js +0 -626
- package/lib/external-rpc/global.d.js +0 -0
- package/lib/index.browser.d.ts +0 -9
- package/lib/scripts/fallbacks/gnark.d.ts +0 -7
- package/lib/scripts/fallbacks/gnark.js +0 -15
- package/lib/scripts/fallbacks/zk-file-fetch.d.ts +0 -24
- package/lib/scripts/fallbacks/zk-file-fetch.js +0 -50
- package/lib/utils/index.browser.d.ts +0 -13
- package/lib/utils/logger.browser.d.ts +0 -14
- package/lib/utils/tls-imports.d.ts +0 -21
- package/lib/utils/tls-imports.js +0 -71
- /package/lib/{browser/scripts → scripts}/fallbacks/stwo.js +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EventLog, hexlify, Wallet } from "ethers";
|
|
2
|
-
import { CHAIN_CONFIGS, SELECTED_CHAIN_ID } from "
|
|
3
|
-
import { initialiseContracts } from "
|
|
4
|
-
import { createNewClaimRequestOnChain, signClaimRequest } from "
|
|
5
|
-
import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "
|
|
6
|
-
import { AttestorError, canonicalStringify, getIdentifierFromClaimInfo, logger as LOGGER, unixTimestampSeconds } from "
|
|
2
|
+
import { CHAIN_CONFIGS, SELECTED_CHAIN_ID } from "#src/avs/config.js";
|
|
3
|
+
import { initialiseContracts } from "#src/avs/utils/contracts.js";
|
|
4
|
+
import { createNewClaimRequestOnChain, signClaimRequest } from "#src/avs/utils/tasks.js";
|
|
5
|
+
import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "#src/client/index.js";
|
|
6
|
+
import { AttestorError, canonicalStringify, getIdentifierFromClaimInfo, logger as LOGGER, unixTimestampSeconds } from "#src/utils/index.js";
|
|
7
7
|
const EMPTY_CLAIM_USER_ID = hexlify(new Uint8Array(32));
|
|
8
8
|
async function createClaimOnAvs({
|
|
9
9
|
onStep,
|
package/lib/avs/config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Contract, JsonRpcProvider, Wallet } from "ethers";
|
|
2
|
-
import { avsDirectoryABI } from "
|
|
3
|
-
import { delegationABI } from "
|
|
4
|
-
import { registryABI } from "
|
|
5
|
-
import { CHAIN_CONFIGS, PRIVATE_KEY, SELECTED_CHAIN_ID } from "
|
|
6
|
-
import { ReclaimServiceManager__factory } from "
|
|
2
|
+
import { avsDirectoryABI } from "#src/avs/abis/avsDirectoryABI.js";
|
|
3
|
+
import { delegationABI } from "#src/avs/abis/delegationABI.js";
|
|
4
|
+
import { registryABI } from "#src/avs/abis/registryABI.js";
|
|
5
|
+
import { CHAIN_CONFIGS, PRIVATE_KEY, SELECTED_CHAIN_ID } from "#src/avs/config.js";
|
|
6
|
+
import { ReclaimServiceManager__factory } from "#src/avs/contracts/index.js";
|
|
7
7
|
const configs = {};
|
|
8
8
|
function getContracts(chainId = SELECTED_CHAIN_ID) {
|
|
9
9
|
const config = CHAIN_CONFIGS[chainId];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hexlify, randomBytes, SigningKey } from "ethers";
|
|
2
|
-
import { RECLAIM_PUBLIC_URL, SELECTED_CHAIN_ID } from "
|
|
3
|
-
import { getContracts } from "
|
|
4
|
-
import { logger as LOGGER } from "
|
|
2
|
+
import { RECLAIM_PUBLIC_URL, SELECTED_CHAIN_ID } from "#src/avs/config.js";
|
|
3
|
+
import { getContracts } from "#src/avs/utils/contracts.js";
|
|
4
|
+
import { logger as LOGGER } from "#src/utils/index.js";
|
|
5
5
|
async function registerOperator({
|
|
6
6
|
logger = LOGGER,
|
|
7
7
|
chainId = SELECTED_CHAIN_ID,
|
package/lib/avs/utils/tasks.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { asciiToUint8Array } from "@reclaimprotocol/tls";
|
|
2
|
+
import { makeRpcTlsTunnel } from "#src/client/tunnels/make-rpc-tls-tunnel.js";
|
|
3
|
+
import { getAttestorClientFromPool } from "#src/client/utils/attestor-pool.js";
|
|
4
|
+
import { DEFAULT_HTTPS_PORT, PROVIDER_CTX, TOPRF_DOMAIN_SEPARATOR } from "#src/config/index.js";
|
|
5
|
+
import { ClaimTunnelRequest } from "#src/proto/api.js";
|
|
6
|
+
import { providers } from "#src/providers/index.js";
|
|
6
7
|
import {
|
|
7
|
-
asciiToUint8Array,
|
|
8
8
|
AttestorError,
|
|
9
9
|
binaryHashToStr,
|
|
10
10
|
canonicalStringify,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
redactSlices,
|
|
21
21
|
uint8ArrayToStr,
|
|
22
22
|
unixTimestampSeconds
|
|
23
|
-
} from "
|
|
24
|
-
import { executeWithRetries } from "
|
|
25
|
-
import { SIGNATURES } from "
|
|
26
|
-
import { getDefaultTlsOptions } from "
|
|
23
|
+
} from "#src/utils/index.js";
|
|
24
|
+
import { executeWithRetries } from "#src/utils/retries.js";
|
|
25
|
+
import { SIGNATURES } from "#src/utils/signatures/index.js";
|
|
26
|
+
import { getDefaultTlsOptions } from "#src/utils/tls.js";
|
|
27
27
|
function createClaimOnAttestor({
|
|
28
28
|
logger: _logger,
|
|
29
29
|
maxRetries = 3,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TLSConnectionOptions } from '@reclaimprotocol/tls';
|
|
2
|
-
import { makeTLSClient } from '
|
|
2
|
+
import { makeTLSClient } from '@reclaimprotocol/tls';
|
|
3
3
|
import type { CreateTunnelRequest, RPCMessage } from '#src/proto/api.ts';
|
|
4
4
|
import type { CompleteTLSPacket, IAttestorClient, Logger, MakeTunnelFn, Transcript } from '#src/types/index.ts';
|
|
5
5
|
type ExtraTLSOptions = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { concatenateUint8Arrays, makeTLSClient } from "
|
|
2
|
-
import { makeRpcTcpTunnel } from "
|
|
3
|
-
import { DEFAULT_HTTPS_PORT } from "
|
|
4
|
-
import { generateRpcMessageId, generateTunnelId } from "
|
|
1
|
+
import { concatenateUint8Arrays, makeTLSClient } from "@reclaimprotocol/tls";
|
|
2
|
+
import { makeRpcTcpTunnel } from "#src/client/tunnels/make-rpc-tcp-tunnel.js";
|
|
3
|
+
import { DEFAULT_HTTPS_PORT } from "#src/config/index.js";
|
|
4
|
+
import { generateRpcMessageId, generateTunnelId } from "#src/utils/index.js";
|
|
5
5
|
const makeRpcTlsTunnel = async ({
|
|
6
6
|
onMessage,
|
|
7
7
|
onClose,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { encodeBase64 } from "ethers";
|
|
2
|
-
import { DEFAULT_METADATA, DEFAULT_RPC_TIMEOUT_MS } from "
|
|
3
|
-
import { RPCMessages } from "
|
|
4
|
-
import { AttestorError, generateRpcMessageId, getRpcRequestType, logger as LOGGER, packRpcMessages } from "
|
|
5
|
-
import { AttestorSocket } from "
|
|
6
|
-
import { makeWebSocket as defaultMakeWebSocket } from "
|
|
2
|
+
import { DEFAULT_METADATA, DEFAULT_RPC_TIMEOUT_MS } from "#src/config/index.js";
|
|
3
|
+
import { RPCMessages } from "#src/proto/api.js";
|
|
4
|
+
import { AttestorError, generateRpcMessageId, getRpcRequestType, logger as LOGGER, packRpcMessages } from "#src/utils/index.js";
|
|
5
|
+
import { AttestorSocket } from "#src/utils/socket-base.js";
|
|
6
|
+
import { makeWebSocket as defaultMakeWebSocket } from "#src/utils/ws.js";
|
|
7
7
|
class AttestorClient extends AttestorSocket {
|
|
8
8
|
waitForInitPromise;
|
|
9
9
|
initResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RPCMessages } from "
|
|
2
|
-
import { AttestorError, extractArrayBufferFromWsData, getRpcRequest, getRpcRequestType, getRpcResponseType } from "
|
|
1
|
+
import { RPCMessages } from "#src/proto/api.js";
|
|
2
|
+
import { AttestorError, extractArrayBufferFromWsData, getRpcRequest, getRpcRequestType, getRpcResponseType } from "#src/utils/index.js";
|
|
3
3
|
async function wsMessageHandler(data) {
|
|
4
4
|
const buff = await extractArrayBufferFromWsData(data);
|
|
5
5
|
const { messages } = RPCMessages.decode(buff);
|
package/lib/config/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
crypto,
|
|
3
3
|
encryptWrappedRecord,
|
|
4
4
|
SUPPORTED_CIPHER_SUITE_MAP
|
|
5
|
-
} from "
|
|
6
|
-
import { strToUint8Array } from "
|
|
7
|
-
import { logger } from "
|
|
8
|
-
import { makeZkProofGenerator } from "
|
|
5
|
+
} from "@reclaimprotocol/tls";
|
|
6
|
+
import { strToUint8Array } from "#src/utils/generics.js";
|
|
7
|
+
import { logger } from "#src/utils/logger.js";
|
|
8
|
+
import { makeZkProofGenerator } from "#src/utils/zk.js";
|
|
9
9
|
const ZK_CIPHER_SUITES = [
|
|
10
10
|
"TLS_CHACHA20_POLY1305_SHA256",
|
|
11
11
|
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { hexlify } from "ethers";
|
|
2
|
-
import { createClaimOnAvs } from "
|
|
3
|
-
import { createClaimOnAttestor } from "
|
|
4
|
-
import { benchmark } from "
|
|
5
|
-
import { generateRpcRequestId, getCurrentMemoryUsage, getWsApiUrlFromBaseUrl, RPC_MSG_BRIDGE, sendMessageToApp, waitForResponse } from "
|
|
6
|
-
import { ALL_ENC_ALGORITHMS, makeExternalRpcOprfOperator, makeExternalRpcZkOperator } from "
|
|
7
|
-
import { createClaimOnMechain } from "
|
|
8
|
-
import { extractHTMLElement, extractJSONValueIndex, generateRequstAndResponseFromTranscript } from "
|
|
9
|
-
import { B64_JSON_REVIVER } from "
|
|
10
|
-
import { AttestorError, getIdentifierFromClaimInfo, logger, makeLogger, uint8ArrayToStr } from "
|
|
2
|
+
import { createClaimOnAvs } from "#src/avs/client/create-claim-on-avs.js";
|
|
3
|
+
import { createClaimOnAttestor } from "#src/client/index.js";
|
|
4
|
+
import { benchmark } from "#src/external-rpc/benchmark.js";
|
|
5
|
+
import { generateRpcRequestId, getCurrentMemoryUsage, getWsApiUrlFromBaseUrl, RPC_MSG_BRIDGE, sendMessageToApp, waitForResponse } from "#src/external-rpc/utils.js";
|
|
6
|
+
import { ALL_ENC_ALGORITHMS, makeExternalRpcOprfOperator, makeExternalRpcZkOperator } from "#src/external-rpc/zk.js";
|
|
7
|
+
import { createClaimOnMechain } from "#src/mechain/client/create-claim-on-mechain.js";
|
|
8
|
+
import { extractHTMLElement, extractJSONValueIndex, generateRequstAndResponseFromTranscript } from "#src/providers/http/utils.js";
|
|
9
|
+
import { B64_JSON_REVIVER } from "#src/utils/b64-json.js";
|
|
10
|
+
import { AttestorError, getIdentifierFromClaimInfo, logger, makeLogger, uint8ArrayToStr } from "#src/utils/index.js";
|
|
11
11
|
async function handleIncomingMessage(data) {
|
|
12
12
|
let id = "";
|
|
13
13
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TextDecoder, TextEncoder } from "@kayahr/text-encoding";
|
|
2
|
-
import { crypto, uint8ArrayToBinaryStr } from "
|
|
2
|
+
import { crypto, uint8ArrayToBinaryStr } from "@reclaimprotocol/tls";
|
|
3
3
|
import { fromByteArray, toByteArray } from "base64-js";
|
|
4
4
|
import { EventTarget } from "event-target-shim";
|
|
5
5
|
if (typeof global === "undefined") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URL as WHATWG_URL } from "whatwg-url";
|
|
2
|
-
import { CloseEventPolyfill, ErrorEventPolyfill, EventPolyfill, MessageEventPolyfill } from "
|
|
3
|
-
import { RPCWebSocket } from "
|
|
2
|
+
import { CloseEventPolyfill, ErrorEventPolyfill, EventPolyfill, MessageEventPolyfill } from "#src/external-rpc/jsc-polyfills/event.js";
|
|
3
|
+
import { RPCWebSocket } from "#src/external-rpc/jsc-polyfills/ws.js";
|
|
4
4
|
if (typeof globalThis.URL === "undefined") {
|
|
5
5
|
globalThis.URL = WHATWG_URL;
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
1
|
+
import "#src/external-rpc/jsc-polyfills/1.js";
|
|
2
|
+
import "#src/external-rpc/jsc-polyfills/2.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { setCryptoImplementation } from "@reclaimprotocol/tls";
|
|
1
2
|
import { webcryptoCrypto } from "@reclaimprotocol/tls/webcrypto";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { logger, makeLogger } from "../utils/index.js";
|
|
3
|
+
import { handleIncomingMessage } from "#src/external-rpc/handle-incoming-msg.js";
|
|
4
|
+
import { getWsApiUrlFromBaseUrl } from "#src/external-rpc/utils.js";
|
|
5
|
+
import { logger, makeLogger } from "#src/utils/index.js";
|
|
6
6
|
makeLogger(true);
|
|
7
7
|
setCryptoImplementation(webcryptoCrypto);
|
|
8
8
|
function setupWindowRpc(baseUrl, channel = "attestor-core") {
|
|
@@ -27,7 +27,7 @@ function setupWindowRpc(baseUrl, channel = "attestor-core") {
|
|
|
27
27
|
}
|
|
28
28
|
logger.info({ defaultUrl: getWsApiUrlFromBaseUrl() }, "window RPC setup");
|
|
29
29
|
}
|
|
30
|
-
export * from "
|
|
30
|
+
export * from "#src/index.js";
|
|
31
31
|
export {
|
|
32
32
|
setupWindowRpc
|
|
33
33
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "#src/external-rpc/jsc-polyfills/index.js";
|
|
2
2
|
1;
|
|
3
|
+
import { setCryptoImplementation } from "@reclaimprotocol/tls";
|
|
3
4
|
import { pureJsCrypto } from "@reclaimprotocol/tls/purejs-crypto";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { makeLogger } from "../utils/logger.js";
|
|
5
|
+
import * as AttestorRPCImport from "#src/external-rpc/index.js";
|
|
6
|
+
import { makeLogger } from "#src/utils/logger.js";
|
|
7
7
|
setCryptoImplementation(pureJsCrypto);
|
|
8
8
|
makeLogger(true);
|
|
9
9
|
function setupJsRpc(baseUrl, channel = "attestor-core") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WS_PATHNAME } from "
|
|
2
|
-
import { EventBus } from "
|
|
3
|
-
import { B64_JSON_REPLACER } from "
|
|
4
|
-
import { AttestorError } from "
|
|
1
|
+
import { WS_PATHNAME } from "#src/config/index.js";
|
|
2
|
+
import { EventBus } from "#src/external-rpc/event-bus.js";
|
|
3
|
+
import { B64_JSON_REPLACER } from "#src/utils/b64-json.js";
|
|
4
|
+
import { AttestorError } from "#src/utils/error.js";
|
|
5
5
|
const RPC_MSG_BRIDGE = new EventBus();
|
|
6
6
|
async function getCurrentMemoryUsage() {
|
|
7
7
|
if (!window.crossOriginIsolated) {
|
package/lib/external-rpc/zk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { rpcRequest } from "
|
|
2
|
-
import { logger, makeDefaultZkOperator } from "
|
|
1
|
+
import { rpcRequest } from "#src/external-rpc/utils.js";
|
|
2
|
+
import { logger, makeDefaultZkOperator } from "#src/utils/index.js";
|
|
3
3
|
const ALL_ENC_ALGORITHMS = [
|
|
4
4
|
"aes-256-ctr",
|
|
5
5
|
"aes-128-ctr",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "
|
|
2
|
-
import { AttestorClient } from "
|
|
1
|
+
import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "#src/client/index.js";
|
|
2
|
+
import { AttestorClient } from "#src/client/index.js";
|
|
3
3
|
async function createClaimOnMechain({
|
|
4
4
|
createClaimOnAttestor = _createClaimOnAttestor,
|
|
5
5
|
onStep,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { areUint8ArraysEqual, concatenateUint8Arrays, uint8ArrayToBinaryStr } from "
|
|
1
|
+
import { areUint8ArraysEqual, concatenateUint8Arrays, uint8ArrayToBinaryStr } from "@reclaimprotocol/tls";
|
|
2
2
|
import { encodeBase64 } from "ethers";
|
|
3
|
-
import { DEFAULT_HTTPS_PORT, RECLAIM_USER_AGENT } from "
|
|
4
|
-
import { AttestorVersion } from "
|
|
3
|
+
import { DEFAULT_HTTPS_PORT, RECLAIM_USER_AGENT } from "#src/config/index.js";
|
|
4
|
+
import { AttestorVersion } from "#src/proto/api.js";
|
|
5
5
|
import {
|
|
6
6
|
buildHeaders,
|
|
7
7
|
convertResponsePosToAbsolutePos,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
makeRegex,
|
|
12
12
|
matchRedactedStrings,
|
|
13
13
|
parseHttpResponse
|
|
14
|
-
} from "
|
|
15
|
-
import { isValidProxySessionId } from "
|
|
14
|
+
} from "#src/providers/http/utils.js";
|
|
15
|
+
import { isValidProxySessionId } from "#src/server/utils/proxy-session.js";
|
|
16
16
|
import {
|
|
17
17
|
findIndexInUint8Array,
|
|
18
18
|
getHttpRequestDataFromTranscript,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
REDACTION_CHAR_CODE,
|
|
21
21
|
strToUint8Array,
|
|
22
22
|
uint8ArrayToStr
|
|
23
|
-
} from "
|
|
23
|
+
} from "#src/utils/index.js";
|
|
24
24
|
const OK_HTTP_HEADER = "HTTP/1.1 200";
|
|
25
25
|
const dateHeaderRegex = "[dD]ate: ((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:[0-3][0-9]) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:[0-9]{4}) (?:[01][0-9]|2[0-3])(?::[0-5][0-9]){2} GMT)";
|
|
26
26
|
const dateDiff = 1e3 * 60 * 10;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { concatenateUint8Arrays } from "
|
|
1
|
+
import "#src/providers/http/patch-parse5-tree.js";
|
|
2
|
+
import { concatenateUint8Arrays } from "@reclaimprotocol/tls";
|
|
3
3
|
import {
|
|
4
4
|
ArrayExpression,
|
|
5
5
|
ExpressionStatement,
|
|
@@ -13,7 +13,7 @@ import { parse } from "parse5";
|
|
|
13
13
|
import { adapter as htmlAdapter } from "parse5-htmlparser2-tree-adapter";
|
|
14
14
|
import RE2 from "re2";
|
|
15
15
|
import xpath from "xpath";
|
|
16
|
-
import { getHttpRequestDataFromTranscript, isApplicationData, makeHttpResponseParser, REDACTION_CHAR_CODE } from "
|
|
16
|
+
import { getHttpRequestDataFromTranscript, isApplicationData, makeHttpResponseParser, REDACTION_CHAR_CODE } from "#src/utils/index.js";
|
|
17
17
|
function extractHTMLElement(html, xpathExpression, contentsOnly) {
|
|
18
18
|
const { start, end } = extractHTMLElementIndex(html, xpathExpression, contentsOnly);
|
|
19
19
|
return html.slice(start, end);
|
package/lib/providers/index.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as esbuild from "esbuild";
|
|
2
|
+
const rslt = await esbuild.build({
|
|
3
|
+
entryPoints: ["src/external-rpc/setup-browser.js"],
|
|
4
|
+
bundle: true,
|
|
5
|
+
minify: true,
|
|
6
|
+
outfile: "browser/resources/attestor-browser.min.mjs",
|
|
7
|
+
platform: "browser",
|
|
8
|
+
format: "esm",
|
|
9
|
+
tsconfig: "tsconfig.build.json",
|
|
10
|
+
legalComments: "none",
|
|
11
|
+
metafile: true,
|
|
12
|
+
// Enable metafile generation
|
|
13
|
+
treeShaking: true,
|
|
14
|
+
alias: {
|
|
15
|
+
"crypto": "#src/scripts/fallbacks/crypto.js",
|
|
16
|
+
"koffi": "#src/scripts/fallbacks/empty.js",
|
|
17
|
+
"ip-cidr": "#src/scripts/fallbacks/empty.js",
|
|
18
|
+
"snarkjs": "#src/scripts/fallbacks/snarkjs.js",
|
|
19
|
+
"re2": "#src/scripts/fallbacks/re2.js",
|
|
20
|
+
"@reclaimprotocol/zk-symmetric-crypto/stwo": "#src/scripts/fallbacks/stwo.js"
|
|
21
|
+
},
|
|
22
|
+
external: [
|
|
23
|
+
"dotenv",
|
|
24
|
+
"elastic-apm-node",
|
|
25
|
+
"https-proxy-agent",
|
|
26
|
+
"ip-cidr",
|
|
27
|
+
"serve-static",
|
|
28
|
+
"re2",
|
|
29
|
+
"snarkjs",
|
|
30
|
+
"ws",
|
|
31
|
+
"fs/promises",
|
|
32
|
+
"path"
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
if (process.argv.includes("--analyze")) {
|
|
36
|
+
const analysis = await esbuild.analyzeMetafile(rslt.metafile);
|
|
37
|
+
console.log(analysis);
|
|
38
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as esbuild from "esbuild";
|
|
2
|
+
const isCliBuild = process.argv.includes("--cli");
|
|
3
|
+
if (isCliBuild) {
|
|
4
|
+
console.log("Building for CLI...");
|
|
5
|
+
}
|
|
6
|
+
const rslt = await esbuild.build({
|
|
7
|
+
bundle: true,
|
|
8
|
+
...isCliBuild ? {
|
|
9
|
+
entryPoints: ["src/scripts/jsc-cli-rpc.js"],
|
|
10
|
+
outfile: "out/jsc-cli-rpc.mjs",
|
|
11
|
+
format: "esm"
|
|
12
|
+
} : {
|
|
13
|
+
minify: true,
|
|
14
|
+
entryPoints: ["src/external-rpc/setup-jsc.js"],
|
|
15
|
+
outfile: "browser/resources/attestor-jsc.min.mjs",
|
|
16
|
+
format: "iife"
|
|
17
|
+
},
|
|
18
|
+
tsconfig: "tsconfig.build.json",
|
|
19
|
+
legalComments: "none",
|
|
20
|
+
metafile: true,
|
|
21
|
+
// Enable metafile generation
|
|
22
|
+
treeShaking: true,
|
|
23
|
+
alias: {
|
|
24
|
+
"crypto": "#src/scripts/fallbacks/crypto.js",
|
|
25
|
+
"koffi": "#src/scripts/fallbacks/empty.js",
|
|
26
|
+
"ip-cidr": "#src/scripts/fallbacks/empty.js",
|
|
27
|
+
"snarkjs": "#src/scripts/fallbacks/empty.js",
|
|
28
|
+
"re2": "#src/scripts/fallbacks/re2.js",
|
|
29
|
+
"@reclaimprotocol/zk-symmetric-crypto/stwo": "#src/scripts/fallbacks/stwo.js"
|
|
30
|
+
},
|
|
31
|
+
external: [
|
|
32
|
+
"dotenv",
|
|
33
|
+
"elastic-apm-node",
|
|
34
|
+
"https-proxy-agent",
|
|
35
|
+
"ip-cidr",
|
|
36
|
+
"serve-static",
|
|
37
|
+
"re2",
|
|
38
|
+
"snarkjs",
|
|
39
|
+
"ws",
|
|
40
|
+
"fs/promises",
|
|
41
|
+
"path"
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
if (process.argv.includes("--analyze")) {
|
|
45
|
+
const analysis = await esbuild.analyzeMetafile(rslt.metafile);
|
|
46
|
+
console.log(analysis);
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as esbuild from "esbuild";
|
|
2
|
+
import { readdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
async function* glob(dir) {
|
|
5
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
6
|
+
for (const entry of entries) {
|
|
7
|
+
const path = join(dir, entry.name);
|
|
8
|
+
if (entry.isDirectory()) {
|
|
9
|
+
yield* glob(path);
|
|
10
|
+
} else if (entry.name.endsWith(".js") && !entry.name.endsWith(".d.js")) {
|
|
11
|
+
yield path;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const files = [];
|
|
16
|
+
for await (const file of glob("src")) {
|
|
17
|
+
if (!file.includes("/tests/") && !file.includes(".test.js") && !file.includes("/test.js")) {
|
|
18
|
+
files.push(file);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
await esbuild.build({
|
|
22
|
+
entryPoints: files,
|
|
23
|
+
outdir: "lib",
|
|
24
|
+
format: "esm",
|
|
25
|
+
platform: "node",
|
|
26
|
+
target: "es2022",
|
|
27
|
+
outbase: "src",
|
|
28
|
+
bundle: false
|
|
29
|
+
});
|
|
30
|
+
async function fixImports(dir) {
|
|
31
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
const path = join(dir, entry.name);
|
|
34
|
+
if (entry.isDirectory()) {
|
|
35
|
+
await fixImports(path);
|
|
36
|
+
} else if (entry.name.endsWith(".js")) {
|
|
37
|
+
const content = await readFile(path, "utf-8");
|
|
38
|
+
let fixed = content.replace(/^import\s+['"].*\.d\.ts['"];?\s*\n?/gm, "");
|
|
39
|
+
fixed = fixed.replace(/\.ts(['"])/g, ".js$1");
|
|
40
|
+
if (fixed !== content) {
|
|
41
|
+
await writeFile(path, fixed);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
await fixImports("lib");
|
|
47
|
+
console.log(`Built ${files.length} files to lib/`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "src/server/utils/config-env";
|
|
2
|
-
import { getContracts } from "
|
|
2
|
+
import { getContracts } from "#src/avs/utils/contracts.js";
|
|
3
3
|
async function main() {
|
|
4
4
|
const { wallet, contract } = getContracts();
|
|
5
5
|
const meta = await contract.taskCreationMetadata();
|
|
@@ -2,7 +2,7 @@ import { readdir, readFile, writeFile } from "fs/promises";
|
|
|
2
2
|
import { compile } from "json-schema-to-typescript";
|
|
3
3
|
import { parse } from "yaml";
|
|
4
4
|
const PROVIDER_SCHEMAS_PATH = "./provider-schemas";
|
|
5
|
-
const GEN_TS_FILENAME = "./src/types/providers.gen.
|
|
5
|
+
const GEN_TS_FILENAME = "./src/types/providers.gen.js";
|
|
6
6
|
const BinaryDataType = "BinaryData";
|
|
7
7
|
async function main() {
|
|
8
8
|
const folders = await findAllProviderFolders();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "#src/server/utils/config-env.js";
|
|
2
2
|
import { setCryptoImplementation } from "@reclaimprotocol/tls";
|
|
3
3
|
import { webcryptoCrypto } from "@reclaimprotocol/tls/webcrypto";
|
|
4
4
|
import { readFile } from "fs/promises";
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
logger,
|
|
11
11
|
providers,
|
|
12
12
|
WS_PATHNAME
|
|
13
|
-
} from "
|
|
14
|
-
import { getCliArgument } from "
|
|
15
|
-
import { createServer, decryptTranscript } from "
|
|
16
|
-
import { assertValidateProviderParams } from "
|
|
17
|
-
import { getEnvVariable } from "
|
|
13
|
+
} from "#src/index.js";
|
|
14
|
+
import { getCliArgument } from "#src/scripts/utils.js";
|
|
15
|
+
import { createServer, decryptTranscript } from "#src/server/index.js";
|
|
16
|
+
import { assertValidateProviderParams } from "#src/server/utils/validation.js";
|
|
17
|
+
import { getEnvVariable } from "#src/utils/env.js";
|
|
18
18
|
setCryptoImplementation(webcryptoCrypto);
|
|
19
19
|
const DEFAULT_ATTESTOR_HOST_PORT = "wss://eu.attestor.reclaimprotocol.org/ws";
|
|
20
20
|
const PRIVATE_KEY_HEX = getEnvVariable("PRIVATE_KEY_HEX") || "0x0123788edad59d7c013cdc85e4372f350f828e2cec62d9a2de4560e69aec7f89";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "#src/external-rpc/jsc-polyfills/index.js";
|
|
2
2
|
import { setCryptoImplementation } from "@reclaimprotocol/tls";
|
|
3
3
|
import { pureJsCrypto } from "@reclaimprotocol/tls/purejs-crypto";
|
|
4
|
-
import { handleIncomingMessage } from "
|
|
5
|
-
import { B64_JSON_REVIVER } from "
|
|
4
|
+
import { handleIncomingMessage } from "#src/external-rpc/index.js";
|
|
5
|
+
import { B64_JSON_REVIVER } from "#src/utils/b64-json.js";
|
|
6
6
|
function readIncomingMsg() {
|
|
7
7
|
const cmd2 = readline();
|
|
8
8
|
return JSON.parse(cmd2, B64_JSON_REVIVER);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import "#src/server/utils/config-env.js";
|
|
2
2
|
import { setCryptoImplementation } from "@reclaimprotocol/tls";
|
|
3
3
|
import { webcryptoCrypto } from "@reclaimprotocol/tls/webcrypto";
|
|
4
|
-
import { getApm } from "
|
|
4
|
+
import { getApm } from "#src/server/utils/apm.js";
|
|
5
5
|
getApm();
|
|
6
6
|
setCryptoImplementation(webcryptoCrypto);
|
|
7
7
|
async function main() {
|
|
8
|
-
const { createServer } = await import("
|
|
8
|
+
const { createServer } = await import("#src/server/index.js");
|
|
9
9
|
return createServer();
|
|
10
10
|
}
|
|
11
11
|
main();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "src/server/utils/config-env";
|
|
2
|
-
import { getContracts } from "
|
|
3
|
-
import { getCliArgument } from "
|
|
2
|
+
import { getContracts } from "#src/avs/utils/contracts.js";
|
|
3
|
+
import { getCliArgument } from "#src/scripts/utils.js";
|
|
4
4
|
async function main() {
|
|
5
5
|
const { contract } = getContracts();
|
|
6
6
|
const minSignaturesPerTask = getCliArgument("minSignaturesPerTask");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "src/server/utils/config-env";
|
|
2
|
-
import { getContracts } from "
|
|
3
|
-
import { getCliArgument } from "
|
|
2
|
+
import { getContracts } from "#src/avs/utils/contracts.js";
|
|
3
|
+
import { getCliArgument } from "#src/scripts/utils.js";
|
|
4
4
|
async function main() {
|
|
5
5
|
const { contract } = getContracts();
|
|
6
6
|
const address = getCliArgument("address");
|