@reclaimprotocol/attestor-core 5.0.1-beta.3 → 5.0.1-beta.5

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.
Files changed (38) hide show
  1. package/lib/browser/avs/client/create-claim-on-avs.js +5 -5
  2. package/lib/browser/avs/config.js +1 -1
  3. package/lib/browser/avs/utils/contracts.js +5 -5
  4. package/lib/browser/avs/utils/register.js +3 -3
  5. package/lib/browser/avs/utils/tasks.js +1 -1
  6. package/lib/browser/client/create-claim.js +9 -9
  7. package/lib/browser/client/tunnels/make-rpc-tcp-tunnel.js +1 -1
  8. package/lib/browser/client/tunnels/make-rpc-tls-tunnel.js +3 -3
  9. package/lib/browser/client/utils/attestor-pool.js +1 -1
  10. package/lib/browser/client/utils/client-socket.js +5 -5
  11. package/lib/browser/client/utils/message-handler.js +2 -2
  12. package/lib/browser/config/index.js +1 -1
  13. package/lib/browser/external-rpc/benchmark.js +3 -3
  14. package/lib/browser/external-rpc/handle-incoming-msg.js +9 -9
  15. package/lib/browser/external-rpc/jsc-polyfills/2.js +2 -2
  16. package/lib/browser/external-rpc/jsc-polyfills/index.js +2 -2
  17. package/lib/browser/external-rpc/jsc-polyfills/ws.js +1 -1
  18. package/lib/browser/external-rpc/setup-browser.js +4 -4
  19. package/lib/browser/external-rpc/setup-jsc.js +3 -3
  20. package/lib/browser/external-rpc/utils.js +4 -4
  21. package/lib/browser/external-rpc/zk.js +2 -2
  22. package/lib/browser/mechain/client/create-claim-on-mechain.js +2 -2
  23. package/lib/browser/providers/http/index.js +5 -5
  24. package/lib/browser/providers/http/utils.js +2 -2
  25. package/lib/browser/providers/index.js +1 -1
  26. package/lib/browser/utils/auth.js +6 -6
  27. package/lib/browser/utils/claims.js +3 -3
  28. package/lib/browser/utils/error.js +1 -1
  29. package/lib/browser/utils/generics.js +1 -1
  30. package/lib/browser/utils/http-parser.js +2 -2
  31. package/lib/browser/utils/logger.browser.js +1 -1
  32. package/lib/browser/utils/logger.js +1 -1
  33. package/lib/browser/utils/prepare-packets.js +2 -2
  34. package/lib/browser/utils/signatures/index.js +2 -2
  35. package/lib/browser/utils/socket-base.js +3 -3
  36. package/lib/browser/utils/tls.js +1 -1
  37. package/lib/browser/utils/zk.js +7 -7
  38. package/package.json +5 -17
@@ -1,9 +1,9 @@
1
1
  import { EventLog, hexlify, Wallet } from "ethers";
2
- import { CHAIN_CONFIGS, SELECTED_CHAIN_ID } from "../../../avs/config.js";
3
- import { initialiseContracts } from "../../../avs/utils/contracts.js";
4
- import { createNewClaimRequestOnChain, signClaimRequest } from "../../../avs/utils/tasks.js";
5
- import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "../../../client/index.js";
6
- import { AttestorError, canonicalStringify, getIdentifierFromClaimInfo, logger as LOGGER, unixTimestampSeconds } from "../../../utils/index.js";
2
+ import { CHAIN_CONFIGS, SELECTED_CHAIN_ID } from "../../avs/config.js";
3
+ import { initialiseContracts } from "../../avs/utils/contracts.js";
4
+ import { createNewClaimRequestOnChain, signClaimRequest } from "../../avs/utils/tasks.js";
5
+ import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "../../client/index.js";
6
+ import { AttestorError, canonicalStringify, getIdentifierFromClaimInfo, logger as LOGGER, unixTimestampSeconds } from "../../utils/index.js";
7
7
  const EMPTY_CLAIM_USER_ID = hexlify(new Uint8Array(32));
8
8
  async function createClaimOnAvs({
9
9
  onStep,
@@ -1,4 +1,4 @@
1
- import { getEnvVariable } from "../../utils/env.js";
1
+ import { getEnvVariable } from "../utils/env.js";
2
2
  const CHAIN_CONFIGS = {
3
3
  "31337": {
4
4
  rpcUrl: "http://localhost:8545",
@@ -1,9 +1,9 @@
1
1
  import { Contract, JsonRpcProvider, Wallet } from "ethers";
2
- import { avsDirectoryABI } from "../../../avs/abis/avsDirectoryABI.js";
3
- import { delegationABI } from "../../../avs/abis/delegationABI.js";
4
- import { registryABI } from "../../../avs/abis/registryABI.js";
5
- import { CHAIN_CONFIGS, PRIVATE_KEY, SELECTED_CHAIN_ID } from "../../../avs/config.js";
6
- import { ReclaimServiceManager__factory } from "../../../avs/contracts/index.js";
2
+ import { avsDirectoryABI } from "../../avs/abis/avsDirectoryABI.js";
3
+ import { delegationABI } from "../../avs/abis/delegationABI.js";
4
+ import { registryABI } from "../../avs/abis/registryABI.js";
5
+ import { CHAIN_CONFIGS, PRIVATE_KEY, SELECTED_CHAIN_ID } from "../../avs/config.js";
6
+ import { ReclaimServiceManager__factory } from "../../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 "../../../avs/config.js";
3
- import { getContracts } from "../../../avs/utils/contracts.js";
4
- import { logger as LOGGER } from "../../../utils/index.js";
2
+ import { RECLAIM_PUBLIC_URL, SELECTED_CHAIN_ID } from "../../avs/config.js";
3
+ import { getContracts } from "../../avs/utils/contracts.js";
4
+ import { logger as LOGGER } from "../../utils/index.js";
5
5
  async function registerOperator({
6
6
  logger = LOGGER,
7
7
  chainId = SELECTED_CHAIN_ID,
@@ -1,5 +1,5 @@
1
1
  import { EventLog, getBytes } from "ethers";
2
- import { getContracts } from "../../../avs/utils/contracts.js";
2
+ import { getContracts } from "../../avs/utils/contracts.js";
3
3
  async function createNewClaimRequestOnChain({
4
4
  request,
5
5
  payer,
@@ -1,9 +1,9 @@
1
1
  import { asciiToUint8Array } from "@reclaimprotocol/tls";
2
- import { makeRpcTlsTunnel } from "../../client/tunnels/make-rpc-tls-tunnel.js";
3
- import { getAttestorClientFromPool } from "../../client/utils/attestor-pool.js";
4
- import { DEFAULT_HTTPS_PORT, PROVIDER_CTX, TOPRF_DOMAIN_SEPARATOR } from "../../config/index.js";
5
- import { ClaimTunnelRequest } from "../../proto/api.js";
6
- import { providers } from "../../providers/index.js";
2
+ import { makeRpcTlsTunnel } from "../client/tunnels/make-rpc-tls-tunnel.js";
3
+ import { getAttestorClientFromPool } from "../client/utils/attestor-pool.js";
4
+ import { DEFAULT_HTTPS_PORT, PROVIDER_CTX, TOPRF_DOMAIN_SEPARATOR } from "../config/index.js";
5
+ import { ClaimTunnelRequest } from "../proto/api.js";
6
+ import { providers } from "../providers/index.js";
7
7
  import {
8
8
  AttestorError,
9
9
  binaryHashToStr,
@@ -20,10 +20,10 @@ import {
20
20
  redactSlices,
21
21
  uint8ArrayToStr,
22
22
  unixTimestampSeconds
23
- } from "../../utils/index.js";
24
- import { executeWithRetries } from "../../utils/retries.js";
25
- import { SIGNATURES } from "../../utils/signatures/index.js";
26
- import { getDefaultTlsOptions } from "../../utils/tls.js";
23
+ } from "../utils/index.js";
24
+ import { executeWithRetries } from "../utils/retries.js";
25
+ import { SIGNATURES } from "../utils/signatures/index.js";
26
+ import { getDefaultTlsOptions } from "../utils/tls.js";
27
27
  function createClaimOnAttestor({
28
28
  logger: _logger,
29
29
  maxRetries = 3,
@@ -1,4 +1,4 @@
1
- import { AttestorError } from "../../../utils/index.js";
1
+ import { AttestorError } from "../../utils/index.js";
2
2
  const makeRpcTcpTunnel = ({
3
3
  tunnelId,
4
4
  client,
@@ -1,7 +1,7 @@
1
1
  import { concatenateUint8Arrays, makeTLSClient } from "@reclaimprotocol/tls";
2
- import { makeRpcTcpTunnel } from "../../../client/tunnels/make-rpc-tcp-tunnel.js";
3
- import { DEFAULT_HTTPS_PORT } from "../../../config/index.js";
4
- import { generateRpcMessageId, generateTunnelId } from "../../../utils/index.js";
2
+ import { makeRpcTcpTunnel } from "../../client/tunnels/make-rpc-tcp-tunnel.js";
3
+ import { DEFAULT_HTTPS_PORT } from "../../config/index.js";
4
+ import { generateRpcMessageId, generateTunnelId } from "../../utils/index.js";
5
5
  const makeRpcTlsTunnel = async ({
6
6
  onMessage,
7
7
  onClose,
@@ -1,4 +1,4 @@
1
- import { AttestorClient } from "../../../client/utils/client-socket.js";
1
+ import { AttestorClient } from "../../client/utils/client-socket.js";
2
2
  const POOL = {};
3
3
  function getAttestorClientFromPool(url, getCreateOpts = () => ({})) {
4
4
  const key = url.toString();
@@ -1,9 +1,9 @@
1
1
  import { encodeBase64 } from "ethers";
2
- import { DEFAULT_METADATA, DEFAULT_RPC_TIMEOUT_MS } from "../../../config/index.js";
3
- import { RPCMessages } from "../../../proto/api.js";
4
- import { AttestorError, generateRpcMessageId, getRpcRequestType, logger as LOGGER, packRpcMessages } from "../../../utils/index.js";
5
- import { AttestorSocket } from "../../../utils/socket-base.js";
6
- import { makeWebSocket as defaultMakeWebSocket } from "../../../utils/ws.js";
2
+ import { DEFAULT_METADATA, DEFAULT_RPC_TIMEOUT_MS } from "../../config/index.js";
3
+ import { RPCMessages } from "../../proto/api.js";
4
+ import { AttestorError, generateRpcMessageId, getRpcRequestType, logger as LOGGER, packRpcMessages } from "../../utils/index.js";
5
+ import { AttestorSocket } from "../../utils/socket-base.js";
6
+ import { makeWebSocket as defaultMakeWebSocket } from "../../utils/ws.js";
7
7
  class AttestorClient extends AttestorSocket {
8
8
  waitForInitPromise;
9
9
  initResponse;
@@ -1,5 +1,5 @@
1
- import { RPCMessages } from "../../../proto/api.js";
2
- import { AttestorError, extractArrayBufferFromWsData, getRpcRequest, getRpcRequestType, getRpcResponseType } from "../../../utils/index.js";
1
+ import { RPCMessages } from "../../proto/api.js";
2
+ import { AttestorError, extractArrayBufferFromWsData, getRpcRequest, getRpcRequestType, getRpcResponseType } from "../../utils/index.js";
3
3
  async function wsMessageHandler(data) {
4
4
  const buff = await extractArrayBufferFromWsData(data);
5
5
  const { messages } = RPCMessages.decode(buff);
@@ -1,4 +1,4 @@
1
- import { AttestorVersion, ServiceSignatureType } from "../../proto/api.js";
1
+ import { AttestorVersion, ServiceSignatureType } from "../proto/api.js";
2
2
  const DEFAULT_ZK_CONCURRENCY = 10;
3
3
  const RECLAIM_USER_AGENT = "reclaim/0.0.1";
4
4
  const DEFAULT_HTTPS_PORT = 443;
@@ -3,9 +3,9 @@ import {
3
3
  encryptWrappedRecord,
4
4
  SUPPORTED_CIPHER_SUITE_MAP
5
5
  } from "@reclaimprotocol/tls";
6
- import { strToUint8Array } from "../../utils/generics.js";
7
- import { logger } from "../../utils/logger.js";
8
- import { makeZkProofGenerator } from "../../utils/zk.js";
6
+ import { strToUint8Array } from "../utils/generics.js";
7
+ import { logger } from "../utils/logger.js";
8
+ import { makeZkProofGenerator } from "../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 "../../avs/client/create-claim-on-avs.js";
3
- import { createClaimOnAttestor } from "../../client/index.js";
4
- import { benchmark } from "../../external-rpc/benchmark.js";
5
- import { generateRpcRequestId, getCurrentMemoryUsage, getWsApiUrlFromBaseUrl, RPC_MSG_BRIDGE, sendMessageToApp, waitForResponse } from "../../external-rpc/utils.js";
6
- import { ALL_ENC_ALGORITHMS, makeExternalRpcOprfOperator, makeExternalRpcZkOperator } from "../../external-rpc/zk.js";
7
- import { createClaimOnMechain } from "../../mechain/client/create-claim-on-mechain.js";
8
- import { extractHTMLElement, extractJSONValueIndex, generateRequstAndResponseFromTranscript } from "../../providers/http/utils.js";
9
- import { B64_JSON_REVIVER } from "../../utils/b64-json.js";
10
- import { AttestorError, getIdentifierFromClaimInfo, logger, makeLogger, uint8ArrayToStr } from "../../utils/index.js";
2
+ import { createClaimOnAvs } from "../avs/client/create-claim-on-avs.js";
3
+ import { createClaimOnAttestor } from "../client/index.js";
4
+ import { benchmark } from "../external-rpc/benchmark.js";
5
+ import { generateRpcRequestId, getCurrentMemoryUsage, getWsApiUrlFromBaseUrl, RPC_MSG_BRIDGE, sendMessageToApp, waitForResponse } from "../external-rpc/utils.js";
6
+ import { ALL_ENC_ALGORITHMS, makeExternalRpcOprfOperator, makeExternalRpcZkOperator } from "../external-rpc/zk.js";
7
+ import { createClaimOnMechain } from "../mechain/client/create-claim-on-mechain.js";
8
+ import { extractHTMLElement, extractJSONValueIndex, generateRequstAndResponseFromTranscript } from "../providers/http/utils.js";
9
+ import { B64_JSON_REVIVER } from "../utils/b64-json.js";
10
+ import { AttestorError, getIdentifierFromClaimInfo, logger, makeLogger, uint8ArrayToStr } from "../utils/index.js";
11
11
  async function handleIncomingMessage(data) {
12
12
  let id = "";
13
13
  try {
@@ -1,6 +1,6 @@
1
1
  import { URL as WHATWG_URL } from "whatwg-url";
2
- import { CloseEventPolyfill, ErrorEventPolyfill, EventPolyfill, MessageEventPolyfill } from "../../../external-rpc/jsc-polyfills/event.js";
3
- import { RPCWebSocket } from "../../../external-rpc/jsc-polyfills/ws.js";
2
+ import { CloseEventPolyfill, ErrorEventPolyfill, EventPolyfill, MessageEventPolyfill } from "../../external-rpc/jsc-polyfills/event.js";
3
+ import { RPCWebSocket } from "../../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 "../../../external-rpc/jsc-polyfills/1.js";
2
- import "../../../external-rpc/jsc-polyfills/2.js";
1
+ import "../../external-rpc/jsc-polyfills/1.js";
2
+ import "../../external-rpc/jsc-polyfills/2.js";
@@ -1,4 +1,4 @@
1
- import { RPC_MSG_BRIDGE, rpcRequest } from "../../../external-rpc/utils.js";
1
+ import { RPC_MSG_BRIDGE, rpcRequest } from "../../external-rpc/utils.js";
2
2
  class RPCWebSocket extends EventTarget {
3
3
  CONNECTING = 0;
4
4
  OPEN = 1;
@@ -1,8 +1,8 @@
1
1
  import { setCryptoImplementation } from "@reclaimprotocol/tls";
2
2
  import { webcryptoCrypto } from "@reclaimprotocol/tls/webcrypto";
3
- import { handleIncomingMessage } from "../../external-rpc/handle-incoming-msg.js";
4
- import { getWsApiUrlFromBaseUrl } from "../../external-rpc/utils.js";
5
- import { logger, makeLogger } from "../../utils/index.js";
3
+ import { handleIncomingMessage } from "../external-rpc/handle-incoming-msg.js";
4
+ import { getWsApiUrlFromBaseUrl } from "../external-rpc/utils.js";
5
+ import { logger, makeLogger } from "../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 "../../index.js";
30
+ export * from "../index.js";
31
31
  export {
32
32
  setupWindowRpc
33
33
  };
@@ -1,9 +1,9 @@
1
- import "../../external-rpc/jsc-polyfills/index.js";
1
+ import "../external-rpc/jsc-polyfills/index.js";
2
2
  1;
3
3
  import { setCryptoImplementation } from "@reclaimprotocol/tls";
4
4
  import { pureJsCrypto } from "@reclaimprotocol/tls/purejs-crypto";
5
- import * as AttestorRPCImport from "../../external-rpc/index.js";
6
- import { makeLogger } from "../../utils/logger.js";
5
+ import * as AttestorRPCImport from "../external-rpc/index.js";
6
+ import { makeLogger } from "../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 "../../config/index.js";
2
- import { EventBus } from "../../external-rpc/event-bus.js";
3
- import { B64_JSON_REPLACER } from "../../utils/b64-json.js";
4
- import { AttestorError } from "../../utils/error.js";
1
+ import { WS_PATHNAME } from "../config/index.js";
2
+ import { EventBus } from "../external-rpc/event-bus.js";
3
+ import { B64_JSON_REPLACER } from "../utils/b64-json.js";
4
+ import { AttestorError } from "../utils/error.js";
5
5
  const RPC_MSG_BRIDGE = new EventBus();
6
6
  async function getCurrentMemoryUsage() {
7
7
  if (!window.crossOriginIsolated) {
@@ -1,5 +1,5 @@
1
- import { rpcRequest } from "../../external-rpc/utils.js";
2
- import { logger, makeDefaultZkOperator } from "../../utils/index.js";
1
+ import { rpcRequest } from "../external-rpc/utils.js";
2
+ import { logger, makeDefaultZkOperator } from "../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 "../../../client/index.js";
2
- import { AttestorClient } from "../../../client/index.js";
1
+ import { createClaimOnAttestor as _createClaimOnAttestor, getAttestorClientFromPool } from "../../client/index.js";
2
+ import { AttestorClient } from "../../client/index.js";
3
3
  async function createClaimOnMechain({
4
4
  createClaimOnAttestor = _createClaimOnAttestor,
5
5
  onStep,
@@ -1,7 +1,7 @@
1
1
  import { areUint8ArraysEqual, concatenateUint8Arrays, uint8ArrayToBinaryStr } from "@reclaimprotocol/tls";
2
2
  import { encodeBase64 } from "ethers";
3
- import { DEFAULT_HTTPS_PORT, RECLAIM_USER_AGENT } from "../../../config/index.js";
4
- import { AttestorVersion } from "../../../proto/api.js";
3
+ import { DEFAULT_HTTPS_PORT, RECLAIM_USER_AGENT } from "../../config/index.js";
4
+ import { AttestorVersion } from "../../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 "../../../providers/http/utils.js";
15
- import { isValidProxySessionId } from "../../../server/utils/proxy-session.js";
14
+ } from "../../providers/http/utils.js";
15
+ import { isValidProxySessionId } from "../../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 "../../../utils/index.js";
23
+ } from "../../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,4 +1,4 @@
1
- import "../../../providers/http/patch-parse5-tree.js";
1
+ import "../../providers/http/patch-parse5-tree.js";
2
2
  import { concatenateUint8Arrays } from "@reclaimprotocol/tls";
3
3
  import {
4
4
  ArrayExpression,
@@ -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 "../../../utils/index.js";
16
+ import { getHttpRequestDataFromTranscript, isApplicationData, makeHttpResponseParser, REDACTION_CHAR_CODE } from "../../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);
@@ -1,4 +1,4 @@
1
- import http from "../../providers/http/index.js";
1
+ import http from "../providers/http/index.js";
2
2
  const providers = {
3
3
  http
4
4
  };
@@ -1,10 +1,10 @@
1
1
  import { getBytes } from "ethers";
2
- import { DEFAULT_AUTH_EXPIRY_S } from "../../config/index.js";
3
- import { AuthenticatedUserData } from "../../proto/api.js";
4
- import { getEnvVariable } from "../../utils/env.js";
5
- import { AttestorError } from "../../utils/error.js";
6
- import { unixTimestampSeconds } from "../../utils/generics.js";
7
- import { SelectedServiceSignature, SIGNATURES } from "../../utils/signatures/index.js";
2
+ import { DEFAULT_AUTH_EXPIRY_S } from "../config/index.js";
3
+ import { AuthenticatedUserData } from "../proto/api.js";
4
+ import { getEnvVariable } from "../utils/env.js";
5
+ import { AttestorError } from "../utils/error.js";
6
+ import { unixTimestampSeconds } from "../utils/generics.js";
7
+ import { SelectedServiceSignature, SIGNATURES } from "../utils/signatures/index.js";
8
8
  async function assertValidAuthRequest(request, signatureType) {
9
9
  const publicKey = getEnvVariable("AUTHENTICATION_PUBLIC_KEY");
10
10
  if (!request) {
@@ -1,8 +1,8 @@
1
1
  import canonicalize from "canonicalize";
2
2
  import { keccak256 } from "ethers";
3
- import { DEFAULT_METADATA } from "../../config/index.js";
4
- import { ClaimTunnelResponse } from "../../proto/api.js";
5
- import { SIGNATURES, strToUint8Array } from "../../utils/index.js";
3
+ import { DEFAULT_METADATA } from "../config/index.js";
4
+ import { ClaimTunnelResponse } from "../proto/api.js";
5
+ import { SIGNATURES, strToUint8Array } from "../utils/index.js";
6
6
  function createSignDataForClaim(data) {
7
7
  const lines = [
8
8
  getIdentifierFromClaimInfo(data),
@@ -1,4 +1,4 @@
1
- import { ErrorCode, ErrorData } from "../../proto/api.js";
1
+ import { ErrorCode, ErrorData } from "../proto/api.js";
2
2
  const PROTO_ERROR = ErrorData.fromJSON({});
3
3
  class AttestorError extends Error {
4
4
  name = "AttestorError";
@@ -9,7 +9,7 @@ import {
9
9
  uint8ArrayToDataView
10
10
  } from "@reclaimprotocol/tls";
11
11
  import { REDACTION_CHAR_CODE } from "@reclaimprotocol/zk-symmetric-crypto";
12
- import { RPCMessage, RPCMessages } from "../../proto/api.js";
12
+ import { RPCMessage, RPCMessages } from "../proto/api.js";
13
13
  const DEFAULT_REDACTION_DATA = new Uint8Array(4).fill(REDACTION_CHAR_CODE);
14
14
  function uint8ArrayToStr(arr) {
15
15
  return new TextDecoder().decode(arr);
@@ -1,6 +1,6 @@
1
1
  import { asciiToUint8Array, concatenateUint8Arrays } from "@reclaimprotocol/tls";
2
- import { findIndexInUint8Array, uint8ArrayToStr } from "../../utils/generics.js";
3
- import { REDACTION_CHAR_CODE } from "../../utils/redactions.js";
2
+ import { findIndexInUint8Array, uint8ArrayToStr } from "../utils/generics.js";
3
+ import { REDACTION_CHAR_CODE } from "../utils/redactions.js";
4
4
  const HTTP_HEADER_LINE_END = asciiToUint8Array("\r\n");
5
5
  function makeHttpResponseParser() {
6
6
  const res = {
@@ -1,4 +1,4 @@
1
- import { getEnvVariable } from "../../utils/env.js";
1
+ import { getEnvVariable } from "../utils/env.js";
2
2
  const PII_PROPERTIES = ["ownerPrivateKey", "secretParams"];
3
3
  const redactedText = "[REDACTED]";
4
4
  const envLevel = getEnvVariable("LOG_LEVEL");
@@ -1,4 +1,4 @@
1
- import { getEnvVariable } from "../../utils/env.js";
1
+ import { getEnvVariable } from "../utils/env.js";
2
2
  const PII_PROPERTIES = ["ownerPrivateKey", "secretParams"];
3
3
  const redactedText = "[REDACTED]";
4
4
  const envLevel = getEnvVariable("LOG_LEVEL");
@@ -1,8 +1,8 @@
1
1
  import { concatenateUint8Arrays, crypto } from "@reclaimprotocol/tls";
2
2
  import {
3
3
  TranscriptMessageSenderType
4
- } from "../../proto/api.js";
5
- import { makeZkProofGenerator } from "../../utils/zk.js";
4
+ } from "../proto/api.js";
5
+ import { makeZkProofGenerator } from "../utils/zk.js";
6
6
  async function preparePacketsForReveal(tlsTranscript, reveals, { onZkProgress, ...opts }) {
7
7
  const transcript = [];
8
8
  const proofGenerator = await makeZkProofGenerator(opts);
@@ -1,5 +1,5 @@
1
- import { ServiceSignatureType } from "../../../proto/api.js";
2
- import { ETH_SIGNATURE_PROVIDER } from "../../../utils/signatures/eth.js";
1
+ import { ServiceSignatureType } from "../../proto/api.js";
2
+ import { ETH_SIGNATURE_PROVIDER } from "../../utils/signatures/eth.js";
3
3
  const SIGNATURES = {
4
4
  [ServiceSignatureType.SERVICE_SIGNATURE_TYPE_ETH]: ETH_SIGNATURE_PROVIDER
5
5
  };
@@ -1,6 +1,6 @@
1
- import { wsMessageHandler } from "../../client/utils/message-handler.js";
2
- import { RPCMessages } from "../../proto/api.js";
3
- import { AttestorError, makeRpcEvent, packRpcMessages } from "../../utils/index.js";
1
+ import { wsMessageHandler } from "../client/utils/message-handler.js";
2
+ import { RPCMessages } from "../proto/api.js";
3
+ import { AttestorError, makeRpcEvent, packRpcMessages } from "../utils/index.js";
4
4
  class AttestorSocket {
5
5
  eventTarget = new EventTarget();
6
6
  socket;
@@ -1,5 +1,5 @@
1
1
  import { SUPPORTED_NAMED_CURVES } from "@reclaimprotocol/tls";
2
- import { detectEnvironment } from "../../utils/env.js";
2
+ import { detectEnvironment } from "../utils/env.js";
3
3
  const ZK_CIPHER_SUITES = [
4
4
  // chacha-20
5
5
  "TLS_CHACHA20_POLY1305_SHA256",
@@ -16,19 +16,19 @@ import {
16
16
  DEFAULT_REMOTE_FILE_FETCH_BASE_URL,
17
17
  DEFAULT_ZK_CONCURRENCY,
18
18
  TOPRF_DOMAIN_SEPARATOR
19
- } from "../../config/index.js";
20
- import { ZKProofEngine } from "../../proto/api.js";
21
- import { detectEnvironment, getEnvVariable } from "../../utils/env.js";
22
- import { AttestorError } from "../../utils/error.js";
19
+ } from "../config/index.js";
20
+ import { ZKProofEngine } from "../proto/api.js";
21
+ import { detectEnvironment, getEnvVariable } from "../utils/env.js";
22
+ import { AttestorError } from "../utils/error.js";
23
23
  import {
24
24
  getPureCiphertext,
25
25
  getRecordIV,
26
26
  getZkAlgorithmForCipherSuite,
27
27
  isTls13Suite,
28
28
  strToUint8Array
29
- } from "../../utils/generics.js";
30
- import { logger as LOGGER } from "../../utils/logger.js";
31
- import { binaryHashToStr, isFullyRedacted, isRedactionCongruent, REDACTION_CHAR_CODE } from "../../utils/redactions.js";
29
+ } from "../utils/generics.js";
30
+ import { logger as LOGGER } from "../utils/logger.js";
31
+ import { binaryHashToStr, isFullyRedacted, isRedactionCongruent, REDACTION_CHAR_CODE } from "../utils/redactions.js";
32
32
  const ZK_CONCURRENCY = +(getEnvVariable("ZK_CONCURRENCY") || DEFAULT_ZK_CONCURRENCY);
33
33
  async function makeZkProofGenerator({
34
34
  zkOperators,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/attestor-core",
3
- "version": "5.0.1-beta.3",
3
+ "version": "5.0.1-beta.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "imports": {
@@ -8,27 +8,15 @@
8
8
  },
9
9
  "exports": {
10
10
  ".": {
11
- "browser": {
12
- "types": "./lib/browser/index.d.ts",
13
- "default": "./lib/browser/index.js"
14
- },
15
- "node": {
16
- "types": "./lib/index.d.ts",
17
- "default": "./lib/index.js"
18
- },
19
11
  "types": "./lib/index.d.ts",
12
+ "browser": "./lib/browser/index.js",
13
+ "node": "./lib/index.js",
20
14
  "default": "./lib/index.js"
21
15
  },
22
16
  "./external-rpc": {
23
- "browser": {
24
- "types": "./lib/browser/external-rpc/index.d.ts",
25
- "default": "./lib/browser/external-rpc/index.js"
26
- },
27
- "node": {
28
- "types": "./lib/external-rpc/index.d.ts",
29
- "default": "./lib/external-rpc/index.js"
30
- },
31
17
  "types": "./lib/external-rpc/index.d.ts",
18
+ "browser": "./lib/browser/external-rpc/index.js",
19
+ "node": "./lib/external-rpc/index.js",
32
20
  "default": "./lib/external-rpc/index.js"
33
21
  }
34
22
  },