@reclaimprotocol/attestor-core 4.0.3 → 5.0.1-beta.10
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/LICENSE +660 -660
- package/README.md +1 -2
- package/lib/avs/abis/avsDirectoryABI.js +341 -342
- package/lib/avs/abis/delegationABI.js +4 -5
- package/lib/avs/abis/registryABI.js +722 -723
- package/lib/avs/client/create-claim-on-avs.d.ts +5 -5
- package/lib/avs/client/create-claim-on-avs.js +160 -139
- package/lib/avs/config.d.ts +1 -1
- package/lib/avs/config.js +25 -23
- package/lib/avs/contracts/ReclaimServiceManager.d.ts +436 -532
- package/lib/avs/contracts/ReclaimServiceManager.js +0 -3
- package/lib/avs/contracts/common.d.ts +40 -11
- package/lib/avs/contracts/common.js +0 -3
- package/lib/avs/contracts/factories/ReclaimServiceManager__factory.d.ts +13 -11
- package/lib/avs/contracts/factories/ReclaimServiceManager__factory.js +1157 -1148
- package/lib/avs/contracts/factories/index.d.ts +1 -1
- package/lib/avs/contracts/factories/index.js +4 -9
- package/lib/avs/contracts/index.d.ts +3 -3
- package/lib/avs/contracts/index.js +6 -40
- package/lib/avs/types/index.d.ts +6 -6
- package/lib/avs/types/index.js +0 -3
- package/lib/avs/utils/contracts.d.ts +14 -14
- package/lib/avs/utils/contracts.js +50 -35
- package/lib/avs/utils/register.d.ts +3 -3
- package/lib/avs/utils/register.js +71 -79
- package/lib/avs/utils/tasks.d.ts +4 -4
- package/lib/avs/utils/tasks.js +44 -41
- package/lib/browser/avs/abis/avsDirectoryABI.d.ts +60 -0
- package/lib/browser/avs/abis/avsDirectoryABI.js +343 -0
- package/lib/browser/avs/abis/delegationABI.d.ts +126 -0
- package/lib/browser/avs/abis/delegationABI.js +4 -0
- package/lib/browser/avs/abis/registryABI.d.ts +136 -0
- package/lib/browser/avs/abis/registryABI.js +728 -0
- package/lib/browser/avs/client/create-claim-on-avs.d.ts +12 -0
- package/lib/browser/avs/client/create-claim-on-avs.js +168 -0
- package/lib/browser/avs/config.d.ts +7 -0
- package/lib/browser/avs/config.js +26 -0
- package/lib/browser/avs/contracts/ReclaimServiceManager.d.ts +601 -0
- package/lib/browser/avs/contracts/ReclaimServiceManager.js +0 -0
- package/lib/browser/avs/contracts/common.d.ts +50 -0
- package/lib/browser/avs/contracts/common.js +0 -0
- package/lib/browser/avs/contracts/factories/ReclaimServiceManager__factory.d.ts +890 -0
- package/lib/browser/avs/contracts/factories/ReclaimServiceManager__factory.js +1183 -0
- package/lib/browser/avs/contracts/factories/index.d.ts +1 -0
- package/lib/browser/avs/contracts/factories/index.js +4 -0
- package/lib/browser/avs/contracts/index.d.ts +3 -0
- package/lib/browser/avs/contracts/index.js +6 -0
- package/lib/browser/avs/types/index.d.ts +55 -0
- package/lib/browser/avs/types/index.js +0 -0
- package/lib/browser/avs/utils/contracts.d.ts +21 -0
- package/lib/browser/avs/utils/contracts.js +53 -0
- package/lib/browser/avs/utils/register.d.ts +27 -0
- package/lib/browser/avs/utils/register.js +74 -0
- package/lib/browser/avs/utils/tasks.d.ts +22 -0
- package/lib/browser/avs/utils/tasks.js +48 -0
- package/lib/browser/client/create-claim.d.ts +5 -0
- package/lib/browser/client/create-claim.js +461 -0
- package/lib/browser/client/index.d.ts +3 -0
- package/lib/browser/client/index.js +3 -0
- package/lib/browser/client/tunnels/make-rpc-tcp-tunnel.d.ts +16 -0
- package/lib/browser/client/tunnels/make-rpc-tcp-tunnel.js +53 -0
- package/lib/browser/client/tunnels/make-rpc-tls-tunnel.d.ts +26 -0
- package/lib/browser/client/tunnels/make-rpc-tls-tunnel.js +127 -0
- package/lib/browser/client/utils/attestor-pool.d.ts +8 -0
- package/lib/browser/client/utils/attestor-pool.js +24 -0
- package/lib/browser/client/utils/client-socket.d.ts +11 -0
- package/lib/browser/client/utils/client-socket.js +120 -0
- package/lib/browser/client/utils/message-handler.d.ts +4 -0
- package/lib/browser/client/utils/message-handler.js +97 -0
- package/lib/browser/config/index.d.ts +31 -0
- package/lib/browser/config/index.js +62 -0
- package/lib/browser/external-rpc/benchmark.d.ts +1 -0
- package/lib/browser/external-rpc/benchmark.js +82 -0
- package/lib/browser/external-rpc/event-bus.d.ts +7 -0
- package/lib/browser/external-rpc/event-bus.js +17 -0
- package/lib/browser/external-rpc/global.d.js +0 -0
- package/lib/browser/external-rpc/handle-incoming-msg.d.ts +2 -0
- package/lib/browser/external-rpc/handle-incoming-msg.js +241 -0
- package/lib/browser/external-rpc/index.d.ts +3 -0
- package/lib/browser/external-rpc/index.js +3 -0
- package/lib/browser/external-rpc/jsc-polyfills/1.d.ts +14 -0
- package/lib/browser/external-rpc/jsc-polyfills/1.js +80 -0
- package/lib/browser/external-rpc/jsc-polyfills/2.js +15 -0
- package/lib/browser/external-rpc/jsc-polyfills/event.d.ts +10 -0
- package/lib/browser/external-rpc/jsc-polyfills/event.js +19 -0
- package/lib/browser/external-rpc/jsc-polyfills/index.d.ts +2 -0
- package/lib/browser/external-rpc/jsc-polyfills/index.js +2 -0
- package/lib/browser/external-rpc/jsc-polyfills/ws.d.ts +21 -0
- package/lib/browser/external-rpc/jsc-polyfills/ws.js +83 -0
- package/lib/browser/external-rpc/setup-browser.d.ts +6 -0
- package/lib/browser/external-rpc/setup-browser.js +33 -0
- package/lib/browser/external-rpc/setup-jsc.d.ts +24 -0
- package/lib/browser/external-rpc/setup-jsc.js +22 -0
- package/lib/{window-rpc → browser/external-rpc}/types.d.ts +56 -35
- package/lib/browser/external-rpc/types.js +0 -0
- package/lib/browser/external-rpc/utils.d.ts +20 -0
- package/lib/browser/external-rpc/utils.js +100 -0
- package/lib/browser/external-rpc/zk.d.ts +14 -0
- package/lib/browser/external-rpc/zk.js +58 -0
- package/lib/browser/index.browser.js +13 -0
- package/lib/browser/index.d.ts +9 -0
- package/lib/browser/index.js +13 -0
- package/lib/browser/mechain/abis/governanceABI.d.ts +50 -0
- package/lib/browser/mechain/abis/governanceABI.js +461 -0
- package/lib/browser/mechain/abis/taskABI.d.ts +157 -0
- package/lib/browser/mechain/abis/taskABI.js +512 -0
- package/lib/browser/mechain/client/create-claim-on-mechain.d.ts +10 -0
- package/lib/browser/mechain/client/create-claim-on-mechain.js +33 -0
- package/lib/browser/mechain/client/index.d.ts +1 -0
- package/lib/browser/mechain/client/index.js +1 -0
- package/lib/browser/mechain/constants/index.d.ts +3 -0
- package/lib/browser/mechain/constants/index.js +8 -0
- package/lib/browser/mechain/index.d.ts +2 -0
- package/lib/browser/mechain/index.js +2 -0
- package/lib/browser/mechain/types/index.d.ts +23 -0
- package/lib/browser/mechain/types/index.js +0 -0
- package/lib/browser/proto/api.d.ts +651 -0
- package/lib/browser/proto/api.js +4250 -0
- package/lib/browser/proto/tee-bundle.d.ts +156 -0
- package/lib/browser/proto/tee-bundle.js +1296 -0
- package/lib/browser/providers/http/index.d.ts +18 -0
- package/lib/browser/providers/http/index.js +640 -0
- package/lib/browser/providers/http/patch-parse5-tree.d.ts +6 -0
- package/lib/browser/providers/http/patch-parse5-tree.js +34 -0
- package/lib/browser/providers/http/utils.d.ts +77 -0
- package/lib/browser/providers/http/utils.js +283 -0
- package/lib/browser/providers/index.d.ts +4 -0
- package/lib/browser/providers/index.js +7 -0
- package/lib/browser/scripts/fallbacks/crypto.js +4 -0
- package/lib/browser/scripts/fallbacks/empty.js +4 -0
- package/lib/browser/scripts/fallbacks/gnark.js +15 -0
- package/lib/browser/scripts/fallbacks/re2.js +7 -0
- package/lib/browser/scripts/fallbacks/snarkjs.js +10 -0
- package/lib/browser/scripts/fallbacks/stwo.js +159 -0
- package/lib/browser/types/bgp.d.ts +11 -0
- package/lib/browser/types/bgp.js +0 -0
- package/lib/browser/types/claims.d.ts +70 -0
- package/lib/browser/types/claims.js +0 -0
- package/lib/browser/types/client.d.ts +163 -0
- package/lib/browser/types/client.js +0 -0
- package/lib/browser/types/general.d.ts +77 -0
- package/lib/browser/types/general.js +0 -0
- package/lib/browser/types/handlers.d.ts +10 -0
- package/lib/browser/types/handlers.js +0 -0
- package/lib/browser/types/index.d.ts +10 -0
- package/lib/browser/types/index.js +10 -0
- package/lib/browser/types/providers.d.ts +161 -0
- package/lib/browser/types/providers.gen.d.ts +443 -0
- package/lib/browser/types/providers.gen.js +16 -0
- package/lib/browser/types/providers.js +0 -0
- package/lib/browser/types/rpc.d.ts +35 -0
- package/lib/browser/types/rpc.js +0 -0
- package/lib/browser/types/signatures.d.ts +28 -0
- package/lib/browser/types/signatures.js +0 -0
- package/lib/browser/types/tunnel.d.ts +18 -0
- package/lib/browser/types/tunnel.js +0 -0
- package/lib/browser/types/zk.d.ts +38 -0
- package/lib/browser/types/zk.js +0 -0
- package/lib/browser/utils/auth.d.ts +8 -0
- package/lib/browser/utils/auth.js +71 -0
- package/lib/browser/utils/b64-json.d.ts +2 -0
- package/lib/browser/utils/b64-json.js +17 -0
- package/lib/browser/utils/claims.d.ts +33 -0
- package/lib/browser/utils/claims.js +89 -0
- package/lib/browser/utils/env.d.ts +3 -0
- package/lib/browser/utils/env.js +19 -0
- package/lib/browser/utils/error.d.ts +26 -0
- package/lib/browser/utils/error.js +54 -0
- package/lib/browser/utils/generics.d.ts +119 -0
- package/lib/browser/utils/generics.js +272 -0
- package/lib/browser/utils/http-parser.d.ts +59 -0
- package/lib/browser/utils/http-parser.js +201 -0
- package/lib/browser/utils/index.browser.js +13 -0
- package/lib/browser/utils/index.d.ts +13 -0
- package/lib/browser/utils/index.js +13 -0
- package/lib/browser/utils/logger.browser.js +88 -0
- package/lib/browser/utils/logger.d.ts +14 -0
- package/lib/browser/utils/logger.js +88 -0
- package/lib/browser/utils/prepare-packets.d.ts +16 -0
- package/lib/browser/utils/prepare-packets.js +69 -0
- package/lib/browser/utils/redactions.d.ts +73 -0
- package/lib/browser/utils/redactions.js +135 -0
- package/lib/browser/utils/retries.d.ts +12 -0
- package/lib/browser/utils/retries.js +26 -0
- package/lib/browser/utils/signatures/eth.d.ts +2 -0
- package/lib/browser/utils/signatures/eth.js +31 -0
- package/lib/browser/utils/signatures/index.d.ts +5 -0
- package/lib/browser/utils/signatures/index.js +12 -0
- package/lib/browser/utils/socket-base.d.ts +23 -0
- package/lib/browser/utils/socket-base.js +96 -0
- package/lib/browser/utils/tls-imports.d.ts +21 -0
- package/lib/browser/utils/tls-imports.js +71 -0
- package/lib/browser/utils/tls.d.ts +2 -0
- package/lib/browser/utils/tls.js +58 -0
- package/lib/browser/utils/ws.d.ts +7 -0
- package/lib/browser/utils/ws.js +22 -0
- package/lib/browser/utils/zk.d.ts +71 -0
- package/lib/browser/utils/zk.js +625 -0
- package/lib/client/create-claim.d.ts +2 -2
- package/lib/client/create-claim.js +437 -400
- package/lib/client/index.d.ts +3 -3
- package/lib/client/index.js +3 -20
- package/lib/client/tunnels/make-rpc-tcp-tunnel.d.ts +2 -2
- package/lib/client/tunnels/make-rpc-tcp-tunnel.js +49 -56
- package/lib/client/tunnels/make-rpc-tls-tunnel.d.ts +4 -3
- package/lib/client/tunnels/make-rpc-tls-tunnel.js +123 -131
- package/lib/client/utils/attestor-pool.d.ts +3 -1
- package/lib/client/utils/attestor-pool.js +21 -25
- package/lib/client/utils/client-socket.d.ts +4 -4
- package/lib/client/utils/client-socket.js +114 -94
- package/lib/client/utils/message-handler.d.ts +2 -2
- package/lib/client/utils/message-handler.js +89 -86
- package/lib/config/index.d.ts +6 -3
- package/lib/config/index.js +60 -37
- package/lib/external-rpc/benchmark.d.ts +1 -0
- package/lib/external-rpc/benchmark.js +82 -0
- package/lib/external-rpc/event-bus.d.ts +7 -0
- package/lib/external-rpc/event-bus.js +17 -0
- package/lib/external-rpc/global.d.js +0 -0
- package/lib/external-rpc/handle-incoming-msg.d.ts +2 -0
- package/lib/external-rpc/handle-incoming-msg.js +241 -0
- package/lib/external-rpc/index.d.ts +3 -0
- package/lib/external-rpc/index.js +3 -0
- package/lib/external-rpc/jsc-polyfills/1.d.ts +14 -0
- package/lib/external-rpc/jsc-polyfills/1.js +80 -0
- package/lib/external-rpc/jsc-polyfills/2.js +15 -0
- package/lib/external-rpc/jsc-polyfills/event.d.ts +10 -0
- package/lib/external-rpc/jsc-polyfills/event.js +19 -0
- package/lib/external-rpc/jsc-polyfills/index.d.ts +2 -0
- package/lib/external-rpc/jsc-polyfills/index.js +2 -0
- package/lib/external-rpc/jsc-polyfills/ws.d.ts +21 -0
- package/lib/external-rpc/jsc-polyfills/ws.js +83 -0
- package/lib/external-rpc/setup-browser.d.ts +6 -0
- package/lib/external-rpc/setup-browser.js +33 -0
- package/lib/external-rpc/setup-jsc.d.ts +24 -0
- package/lib/external-rpc/setup-jsc.js +22 -0
- package/lib/external-rpc/types.d.ts +213 -0
- package/lib/external-rpc/types.js +0 -0
- package/lib/external-rpc/utils.d.ts +20 -0
- package/lib/external-rpc/utils.js +100 -0
- package/lib/external-rpc/zk.d.ts +14 -0
- package/lib/external-rpc/zk.js +58 -0
- package/lib/index.browser.d.ts +9 -0
- package/lib/index.d.ts +8 -9
- package/lib/index.js +12 -49
- package/lib/mechain/abis/governanceABI.js +460 -461
- package/lib/mechain/abis/taskABI.js +505 -506
- package/lib/mechain/client/create-claim-on-mechain.d.ts +3 -3
- package/lib/mechain/client/create-claim-on-mechain.js +31 -30
- package/lib/mechain/client/index.d.ts +1 -1
- package/lib/mechain/client/index.js +1 -18
- package/lib/mechain/constants/index.js +8 -7
- package/lib/mechain/index.d.ts +2 -2
- package/lib/mechain/index.js +2 -19
- package/lib/mechain/types/index.d.ts +2 -2
- package/lib/mechain/types/index.js +0 -3
- package/lib/proto/api.d.ts +182 -39
- package/lib/proto/api.js +4105 -3555
- package/lib/proto/tee-bundle.d.ts +156 -0
- package/lib/proto/tee-bundle.js +1296 -0
- package/lib/providers/http/index.d.ts +16 -1
- package/lib/providers/http/index.js +603 -576
- package/lib/providers/http/patch-parse5-tree.d.ts +6 -0
- package/lib/providers/http/patch-parse5-tree.js +34 -0
- package/lib/providers/http/utils.d.ts +7 -4
- package/lib/providers/http/utils.js +240 -317
- package/lib/providers/index.d.ts +1 -1
- package/lib/providers/index.js +5 -9
- package/lib/scripts/check-avs-registration.d.ts +1 -1
- package/lib/scripts/check-avs-registration.js +24 -25
- package/lib/scripts/fallbacks/crypto.d.ts +1 -0
- package/lib/scripts/fallbacks/crypto.js +4 -0
- package/lib/scripts/fallbacks/empty.d.ts +3 -0
- package/lib/scripts/fallbacks/empty.js +4 -0
- package/lib/scripts/fallbacks/gnark.d.ts +7 -0
- package/lib/scripts/fallbacks/gnark.js +15 -0
- package/lib/scripts/fallbacks/re2.d.ts +1 -0
- package/lib/scripts/fallbacks/re2.js +7 -0
- package/lib/scripts/fallbacks/snarkjs.d.ts +1 -0
- package/lib/scripts/fallbacks/snarkjs.js +10 -0
- package/lib/scripts/fallbacks/stwo.d.ts +6 -0
- package/lib/scripts/generate-provider-types.js +92 -73
- package/lib/scripts/generate-receipt.d.ts +2 -2
- package/lib/scripts/generate-receipt.js +94 -83
- package/lib/scripts/generate-toprf-keys.js +17 -16
- package/lib/scripts/jsc-cli-rpc.d.ts +1 -0
- package/lib/scripts/jsc-cli-rpc.js +35 -0
- package/lib/scripts/register-avs-operator.d.ts +1 -1
- package/lib/scripts/register-avs-operator.js +3 -7
- package/lib/scripts/start-server.d.ts +1 -1
- package/lib/scripts/start-server.js +9 -11
- package/lib/scripts/update-avs-metadata.d.ts +1 -1
- package/lib/scripts/update-avs-metadata.js +17 -19
- package/lib/scripts/utils.js +8 -9
- package/lib/scripts/whitelist-operator.d.ts +1 -1
- package/lib/scripts/whitelist-operator.js +13 -15
- package/lib/server/create-server.d.ts +3 -2
- package/lib/server/create-server.js +98 -85
- package/lib/server/handlers/claimTeeBundle.d.ts +6 -0
- package/lib/server/handlers/claimTeeBundle.js +232 -0
- package/lib/server/handlers/claimTunnel.d.ts +1 -1
- package/lib/server/handlers/claimTunnel.js +75 -73
- package/lib/server/handlers/completeClaimOnChain.d.ts +1 -1
- package/lib/server/handlers/completeClaimOnChain.js +27 -26
- package/lib/server/handlers/createClaimOnChain.d.ts +1 -1
- package/lib/server/handlers/createClaimOnChain.js +30 -29
- package/lib/server/handlers/createTaskOnMechain.d.ts +1 -1
- package/lib/server/handlers/createTaskOnMechain.js +54 -49
- package/lib/server/handlers/createTunnel.d.ts +1 -1
- package/lib/server/handlers/createTunnel.js +91 -94
- package/lib/server/handlers/disconnectTunnel.d.ts +1 -1
- package/lib/server/handlers/disconnectTunnel.js +6 -8
- package/lib/server/handlers/fetchCertificateBytes.d.ts +2 -0
- package/lib/server/handlers/fetchCertificateBytes.js +57 -0
- package/lib/server/handlers/index.d.ts +1 -1
- package/lib/server/handlers/index.js +24 -21
- package/lib/server/handlers/init.d.ts +1 -1
- package/lib/server/handlers/init.js +31 -34
- package/lib/server/handlers/toprf.d.ts +1 -1
- package/lib/server/handlers/toprf.js +17 -19
- package/lib/server/index.d.ts +4 -4
- package/lib/server/index.js +4 -21
- package/lib/server/socket.d.ts +7 -7
- package/lib/server/socket.js +104 -106
- package/lib/server/tunnels/make-tcp-tunnel.d.ts +5 -3
- package/lib/server/tunnels/make-tcp-tunnel.js +189 -162
- package/lib/server/utils/apm.d.ts +1 -1
- package/lib/server/utils/apm.js +26 -40
- package/lib/server/utils/assert-valid-claim-request.d.ts +6 -5
- package/lib/server/utils/assert-valid-claim-request.js +339 -185
- package/lib/server/utils/config-env.js +4 -7
- package/lib/server/utils/dns.js +18 -16
- package/lib/server/utils/gcp-attestation.d.ts +17 -0
- package/lib/server/utils/gcp-attestation.js +237 -0
- package/lib/server/utils/generics.d.ts +3 -3
- package/lib/server/utils/generics.js +37 -51
- package/lib/server/utils/iso.js +255 -256
- package/lib/server/utils/keep-alive.d.ts +2 -2
- package/lib/server/utils/keep-alive.js +36 -40
- package/lib/server/utils/nitro-attestation.d.ts +33 -0
- package/lib/server/utils/nitro-attestation.js +249 -0
- package/lib/server/utils/oprf-raw.d.ts +21 -0
- package/lib/server/utils/oprf-raw.js +61 -0
- package/lib/server/utils/process-handshake.d.ts +3 -3
- package/lib/server/utils/process-handshake.js +217 -175
- package/lib/server/utils/proxy-session.d.ts +1 -0
- package/lib/server/utils/proxy-session.js +4 -0
- package/lib/server/utils/tee-oprf-mpc-verification.d.ts +16 -0
- package/lib/server/utils/tee-oprf-mpc-verification.js +86 -0
- package/lib/server/utils/tee-oprf-verification.d.ts +24 -0
- package/lib/server/utils/tee-oprf-verification.js +151 -0
- package/lib/server/utils/tee-transcript-reconstruction.d.ts +24 -0
- package/lib/server/utils/tee-transcript-reconstruction.js +140 -0
- package/lib/server/utils/tee-verification.d.ts +28 -0
- package/lib/server/utils/tee-verification.js +358 -0
- package/lib/{utils → server/utils}/validation.d.ts +1 -1
- package/lib/server/utils/validation.js +45 -0
- package/lib/types/bgp.js +0 -3
- package/lib/types/claims.d.ts +7 -10
- package/lib/types/claims.js +0 -3
- package/lib/types/client.d.ts +5 -5
- package/lib/types/client.js +0 -3
- package/lib/types/general.d.ts +30 -4
- package/lib/types/general.js +0 -3
- package/lib/types/handlers.d.ts +3 -3
- package/lib/types/handlers.js +0 -3
- package/lib/types/index.d.ts +10 -10
- package/lib/types/index.js +10 -27
- package/lib/types/providers.d.ts +15 -4
- package/lib/types/providers.gen.d.ts +15 -1
- package/lib/types/providers.gen.js +15 -13
- package/lib/types/providers.js +0 -3
- package/lib/types/rpc.d.ts +2 -2
- package/lib/types/rpc.js +0 -3
- package/lib/types/signatures.js +0 -3
- package/lib/types/tunnel.d.ts +2 -2
- package/lib/types/tunnel.js +0 -3
- package/lib/types/zk.d.ts +17 -2
- package/lib/types/zk.js +0 -3
- package/lib/utils/auth.d.ts +2 -1
- package/lib/utils/auth.js +66 -59
- package/lib/utils/b64-json.js +13 -19
- package/lib/utils/bgp-listener.d.ts +1 -1
- package/lib/utils/bgp-listener.js +111 -114
- package/lib/utils/claims.d.ts +3 -3
- package/lib/utils/claims.js +78 -101
- package/lib/utils/env.js +15 -16
- package/lib/utils/error.d.ts +6 -7
- package/lib/utils/error.js +50 -39
- package/lib/utils/generics.d.ts +20 -13
- package/lib/utils/generics.js +221 -297
- package/lib/utils/http-parser.d.ts +1 -1
- package/lib/utils/http-parser.js +186 -237
- package/lib/utils/index.browser.d.ts +13 -0
- package/lib/utils/index.d.ts +14 -12
- package/lib/utils/index.js +14 -29
- package/lib/utils/logger.browser.d.ts +14 -0
- package/lib/utils/logger.d.ts +1 -1
- package/lib/utils/logger.js +69 -87
- package/lib/utils/prepare-packets.d.ts +3 -3
- package/lib/utils/prepare-packets.js +66 -58
- package/lib/utils/redactions.d.ts +20 -1
- package/lib/utils/redactions.js +116 -129
- package/lib/utils/retries.d.ts +1 -1
- package/lib/utils/retries.js +24 -26
- package/lib/utils/signatures/eth.d.ts +1 -1
- package/lib/utils/signatures/eth.js +28 -30
- package/lib/utils/signatures/index.d.ts +3 -3
- package/lib/utils/signatures/index.js +11 -10
- package/lib/utils/socket-base.d.ts +6 -5
- package/lib/utils/socket-base.js +89 -88
- package/lib/utils/tls-imports.d.ts +21 -0
- package/lib/utils/tls-imports.js +71 -0
- package/lib/utils/tls.d.ts +1 -1
- package/lib/utils/tls.js +54 -28
- package/lib/utils/ws.d.ts +1 -6
- package/lib/utils/ws.js +17 -33
- package/lib/utils/zk.d.ts +28 -12
- package/lib/utils/zk.js +587 -406
- package/package.json +79 -60
- package/lib/avs/tests/test.operator.d.ts +0 -11
- package/lib/avs/tests/test.operator.js +0 -313
- package/lib/avs/tests/utils.d.ts +0 -2
- package/lib/avs/tests/utils.js +0 -50
- package/lib/scripts/verify-root-ca.d.ts +0 -1
- package/lib/scripts/verify-root-ca.js +0 -51
- package/lib/tests/describe-with-server.d.ts +0 -20
- package/lib/tests/describe-with-server.js +0 -64
- package/lib/tests/mock-provider-server.d.ts +0 -13
- package/lib/tests/mock-provider-server.js +0 -65
- package/lib/tests/mocks.d.ts +0 -4
- package/lib/tests/mocks.js +0 -23
- package/lib/tests/test.auth.js +0 -75
- package/lib/tests/test.bgp-listener.js +0 -169
- package/lib/tests/test.claim-creation.js +0 -280
- package/lib/tests/test.http-parser.d.ts +0 -1
- package/lib/tests/test.http-parser.js +0 -120
- package/lib/tests/test.http-provider-utils.js +0 -2416
- package/lib/tests/test.http-provider.js +0 -114
- package/lib/tests/test.rpc-communication.d.ts +0 -1
- package/lib/tests/test.rpc-communication.js +0 -64
- package/lib/tests/test.rpc-tunnel.d.ts +0 -1
- package/lib/tests/test.rpc-tunnel.js +0 -172
- package/lib/tests/test.signatures.d.ts +0 -1
- package/lib/tests/test.signatures.js +0 -24
- package/lib/tests/test.tcp-tunnel.d.ts +0 -1
- package/lib/tests/test.tcp-tunnel.js +0 -64
- package/lib/tests/test.zk.d.ts +0 -1
- package/lib/tests/test.zk.js +0 -337
- package/lib/tests/utils.d.ts +0 -18
- package/lib/tests/utils.js +0 -64
- package/lib/utils/atomic-operations.d.ts +0 -24
- package/lib/utils/atomic-operations.js +0 -65
- package/lib/utils/benchmark.d.ts +0 -1
- package/lib/utils/benchmark.js +0 -70
- package/lib/utils/connection-state-machine.d.ts +0 -43
- package/lib/utils/connection-state-machine.js +0 -129
- package/lib/utils/resource-monitor.d.ts +0 -61
- package/lib/utils/resource-monitor.js +0 -107
- package/lib/utils/validation.js +0 -46
- package/lib/window-rpc/index.d.ts +0 -3
- package/lib/window-rpc/index.js +0 -20
- package/lib/window-rpc/setup-window-rpc.d.ts +0 -5
- package/lib/window-rpc/setup-window-rpc.js +0 -291
- package/lib/window-rpc/types.js +0 -3
- package/lib/window-rpc/utils.d.ts +0 -14
- package/lib/window-rpc/utils.js +0 -102
- package/lib/window-rpc/window-rpc-zk.d.ts +0 -15
- package/lib/window-rpc/window-rpc-zk.js +0 -85
- /package/lib/{tests/test.auth.d.ts → browser/external-rpc/jsc-polyfills/2.d.ts} +0 -0
- /package/lib/{tests/test.bgp-listener.d.ts → external-rpc/jsc-polyfills/2.d.ts} +0 -0
- /package/lib/{tests/test.claim-creation.d.ts → scripts/build-browser.d.ts} +0 -0
- /package/lib/{tests/test.http-provider-utils.d.ts → scripts/build-jsc.d.ts} +0 -0
- /package/lib/{tests/test.http-provider.d.ts → scripts/build-lib.d.ts} +0 -0
package/lib/utils/claims.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClaimTunnelResponse } from '
|
|
2
|
-
import { ClaimID, ClaimInfo, CompleteClaimData, ProviderParams } from '
|
|
1
|
+
import { ClaimTunnelResponse } from '#src/proto/api.ts';
|
|
2
|
+
import type { ClaimID, ClaimInfo, CompleteClaimData, ProviderParams } from '#src/types/index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Creates the standard string to sign for a claim.
|
|
5
5
|
* This data is what the attestor will sign when it successfully
|
|
@@ -16,7 +16,7 @@ export declare function createSignDataForClaim(data: CompleteClaimData): string;
|
|
|
16
16
|
* The successful run of this function means that the claim
|
|
17
17
|
* is valid, and the attestor that signed the claim is valid.
|
|
18
18
|
*/
|
|
19
|
-
export declare function assertValidClaimSignatures({ signatures, ...res }: Partial<ClaimTunnelResponse>, metadata?: import("
|
|
19
|
+
export declare function assertValidClaimSignatures({ signatures, ...res }: Partial<ClaimTunnelResponse>, metadata?: import("#src/proto/api.ts").InitRequest): Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
* Generates a unique identifier for given claim info
|
|
22
22
|
* @param info
|
package/lib/utils/claims.js
CHANGED
|
@@ -1,112 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
exports.createSignDataForClaim = createSignDataForClaim;
|
|
7
|
-
exports.assertValidClaimSignatures = assertValidClaimSignatures;
|
|
8
|
-
exports.getIdentifierFromClaimInfo = getIdentifierFromClaimInfo;
|
|
9
|
-
exports.canonicalStringify = canonicalStringify;
|
|
10
|
-
exports.hashProviderParams = hashProviderParams;
|
|
11
|
-
const tls_1 = require("@reclaimprotocol/tls");
|
|
12
|
-
const canonicalize_1 = __importDefault(require("canonicalize"));
|
|
13
|
-
const ethers_1 = require("ethers");
|
|
14
|
-
const config_1 = require("../config");
|
|
15
|
-
const api_1 = require("../proto/api");
|
|
16
|
-
const signatures_1 = require("../utils/signatures");
|
|
17
|
-
/**
|
|
18
|
-
* Creates the standard string to sign for a claim.
|
|
19
|
-
* This data is what the attestor will sign when it successfully
|
|
20
|
-
* verifies a claim.
|
|
21
|
-
*/
|
|
1
|
+
import canonicalize from "canonicalize";
|
|
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";
|
|
22
6
|
function createSignDataForClaim(data) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
data.epoch.toString(),
|
|
33
|
-
];
|
|
34
|
-
return lines.join('\n');
|
|
7
|
+
const lines = [
|
|
8
|
+
getIdentifierFromClaimInfo(data),
|
|
9
|
+
// we lowercase the owner to ensure that the
|
|
10
|
+
// ETH addresses always serialize the same way
|
|
11
|
+
data.owner.toLowerCase(),
|
|
12
|
+
data.timestampS.toString(),
|
|
13
|
+
data.epoch.toString()
|
|
14
|
+
];
|
|
15
|
+
return lines.join("\n");
|
|
35
16
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
const verified = await verify(resBytes, resultSignature, attestorAddress);
|
|
55
|
-
if (!verified) {
|
|
56
|
-
throw new Error('Invalid result signature');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// claim wasn't generated -- i.e. the transcript
|
|
60
|
-
// did not contain the necessary data
|
|
61
|
-
if (!res.claim) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const signData = createSignDataForClaim(res.claim);
|
|
65
|
-
const verifiedClaim = await verify((0, tls_1.strToUint8Array)(signData), claimSignature, attestorAddress);
|
|
66
|
-
if (!verifiedClaim) {
|
|
67
|
-
throw new Error('Invalid claim signature');
|
|
17
|
+
async function assertValidClaimSignatures({
|
|
18
|
+
signatures,
|
|
19
|
+
...res
|
|
20
|
+
}, metadata = DEFAULT_METADATA) {
|
|
21
|
+
if (!signatures) {
|
|
22
|
+
throw new Error("No signatures provided");
|
|
23
|
+
}
|
|
24
|
+
const {
|
|
25
|
+
resultSignature,
|
|
26
|
+
claimSignature,
|
|
27
|
+
attestorAddress
|
|
28
|
+
} = signatures;
|
|
29
|
+
const { verify } = SIGNATURES[metadata.signatureType];
|
|
30
|
+
if (signatures?.resultSignature) {
|
|
31
|
+
const resBytes = ClaimTunnelResponse.encode(ClaimTunnelResponse.create(res)).finish();
|
|
32
|
+
const verified = await verify(resBytes, resultSignature, attestorAddress);
|
|
33
|
+
if (!verified) {
|
|
34
|
+
throw new Error("Invalid result signature");
|
|
68
35
|
}
|
|
36
|
+
}
|
|
37
|
+
if (!res.claim) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const signData = createSignDataForClaim(res.claim);
|
|
41
|
+
const verifiedClaim = await verify(
|
|
42
|
+
strToUint8Array(signData),
|
|
43
|
+
claimSignature,
|
|
44
|
+
attestorAddress
|
|
45
|
+
);
|
|
46
|
+
if (!verifiedClaim) {
|
|
47
|
+
throw new Error("Invalid claim signature");
|
|
48
|
+
}
|
|
69
49
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Generates a unique identifier for given claim info
|
|
72
|
-
* @param info
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
50
|
function getIdentifierFromClaimInfo(info) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
catch (e) {
|
|
84
|
-
throw new Error('unable to parse non-empty context. Must be JSON');
|
|
85
|
-
}
|
|
51
|
+
if (info.context?.length > 0) {
|
|
52
|
+
try {
|
|
53
|
+
const ctx = JSON.parse(info.context);
|
|
54
|
+
info.context = canonicalStringify(ctx);
|
|
55
|
+
} catch {
|
|
56
|
+
throw new Error("unable to parse non-empty context. Must be JSON");
|
|
86
57
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
58
|
+
}
|
|
59
|
+
const str = `${info.provider}
|
|
60
|
+
${info.parameters}
|
|
61
|
+
${info.context || ""}`;
|
|
62
|
+
return keccak256(strToUint8Array(str)).toLowerCase();
|
|
90
63
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Canonically stringifies an object, so that the same object will always
|
|
93
|
-
* produce the same string despite the order of keys
|
|
94
|
-
*/
|
|
95
64
|
function canonicalStringify(params) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
65
|
+
if (!params) {
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
return canonicalize(params) || "";
|
|
100
69
|
}
|
|
101
70
|
function hashProviderParams(params) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
71
|
+
const filteredParams = {
|
|
72
|
+
url: params.url,
|
|
73
|
+
method: params.method,
|
|
74
|
+
body: params.body,
|
|
75
|
+
responseMatches: params.responseMatches,
|
|
76
|
+
responseRedactions: params.responseRedactions
|
|
77
|
+
};
|
|
78
|
+
const serializedParams = canonicalStringify(filteredParams);
|
|
79
|
+
return keccak256(
|
|
80
|
+
strToUint8Array(serializedParams)
|
|
81
|
+
).toLowerCase();
|
|
111
82
|
}
|
|
112
|
-
|
|
83
|
+
export {
|
|
84
|
+
assertValidClaimSignatures,
|
|
85
|
+
canonicalStringify,
|
|
86
|
+
createSignDataForClaim,
|
|
87
|
+
getIdentifierFromClaimInfo,
|
|
88
|
+
hashProviderParams
|
|
89
|
+
};
|
package/lib/utils/env.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.detectEnvironment = detectEnvironment;
|
|
4
|
-
exports.getEnvVariable = getEnvVariable;
|
|
5
1
|
function detectEnvironment() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
3
|
+
return "react-native";
|
|
4
|
+
}
|
|
5
|
+
if (typeof window !== "undefined") {
|
|
6
|
+
return "browser";
|
|
7
|
+
}
|
|
8
|
+
return "node";
|
|
13
9
|
}
|
|
14
10
|
function getEnvVariable(name) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
if (typeof process === "undefined") {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
return process?.env[name];
|
|
19
15
|
}
|
|
20
|
-
|
|
16
|
+
export {
|
|
17
|
+
detectEnvironment,
|
|
18
|
+
getEnvVariable
|
|
19
|
+
};
|
package/lib/utils/error.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { ErrorCode, ErrorData } from '
|
|
1
|
+
import { ErrorCode, ErrorData } from '#src/proto/api.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Represents an error that can be thrown by the Attestor Core
|
|
4
4
|
* or server. Provides a code, and optional data
|
|
5
5
|
* to pass along with the error.
|
|
6
6
|
*/
|
|
7
7
|
export declare class AttestorError extends Error {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
data
|
|
8
|
+
readonly name = "AttestorError";
|
|
9
|
+
readonly code: keyof typeof ErrorCode;
|
|
10
|
+
readonly data: {
|
|
11
11
|
[_: string]: any;
|
|
12
12
|
} | undefined;
|
|
13
|
-
readonly name = "AttestorError";
|
|
14
13
|
constructor(code: keyof typeof ErrorCode, message: string, data?: {
|
|
15
14
|
[_: string]: any;
|
|
16
|
-
}
|
|
15
|
+
});
|
|
17
16
|
/**
|
|
18
17
|
* Encodes the error as a ErrorData
|
|
19
18
|
* protobuf message
|
|
20
19
|
*/
|
|
21
20
|
toProto(): ErrorData;
|
|
22
21
|
static fromProto(data?: ErrorData): AttestorError;
|
|
23
|
-
static fromError(err: Error): AttestorError;
|
|
22
|
+
static fromError(err: Error, code?: keyof typeof ErrorCode): AttestorError;
|
|
24
23
|
static badRequest(message: string, data?: {
|
|
25
24
|
[_: string]: any;
|
|
26
25
|
}): AttestorError;
|
package/lib/utils/error.js
CHANGED
|
@@ -1,43 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AttestorError = void 0;
|
|
4
|
-
const api_1 = require("../proto/api");
|
|
5
|
-
/**
|
|
6
|
-
* Represents an error that can be thrown by the Attestor Core
|
|
7
|
-
* or server. Provides a code, and optional data
|
|
8
|
-
* to pass along with the error.
|
|
9
|
-
*/
|
|
1
|
+
import { ErrorCode, ErrorData } from "../proto/api.js";
|
|
2
|
+
const PROTO_ERROR = ErrorData.fromJSON({});
|
|
10
3
|
class AttestorError extends Error {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
name = "AttestorError";
|
|
5
|
+
code;
|
|
6
|
+
data;
|
|
7
|
+
constructor(code, message, data) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.data = data;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Encodes the error as a ErrorData
|
|
14
|
+
* protobuf message
|
|
15
|
+
*/
|
|
16
|
+
toProto() {
|
|
17
|
+
return ErrorData.create({
|
|
18
|
+
code: ErrorCode[this.code],
|
|
19
|
+
message: this.message,
|
|
20
|
+
data: JSON.stringify(this.data)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
static fromProto(data = PROTO_ERROR) {
|
|
24
|
+
return new AttestorError(
|
|
25
|
+
typeof data.code === "number" ? getKeyForValue(ErrorCode, data.code) || "UNRECOGNIZED" : data.code,
|
|
26
|
+
data.message,
|
|
27
|
+
data.data ? JSON.parse(data.data) : void 0
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
static fromError(err, code = "ERROR_INTERNAL") {
|
|
31
|
+
if (err instanceof AttestorError) {
|
|
32
|
+
return err;
|
|
17
33
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
static fromError(err) {
|
|
33
|
-
if (err instanceof AttestorError) {
|
|
34
|
-
return err;
|
|
35
|
-
}
|
|
36
|
-
return new AttestorError('ERROR_INTERNAL', err.message);
|
|
37
|
-
}
|
|
38
|
-
static badRequest(message, data) {
|
|
39
|
-
return new AttestorError('ERROR_BAD_REQUEST', message, data);
|
|
34
|
+
return new AttestorError(code, err.message);
|
|
35
|
+
}
|
|
36
|
+
static badRequest(message, data) {
|
|
37
|
+
return new AttestorError(
|
|
38
|
+
"ERROR_BAD_REQUEST",
|
|
39
|
+
message,
|
|
40
|
+
data
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function getKeyForValue(obj, value) {
|
|
45
|
+
for (const key in obj) {
|
|
46
|
+
if (obj[key] === value) {
|
|
47
|
+
return key;
|
|
40
48
|
}
|
|
49
|
+
}
|
|
50
|
+
return void 0;
|
|
41
51
|
}
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
export {
|
|
53
|
+
AttestorError
|
|
54
|
+
};
|
package/lib/utils/generics.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { CipherSuite, TLSProtocolVersion } from '@reclaimprotocol/tls';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { CipherSuite, TLSProtocolVersion } from '@reclaimprotocol/tls';
|
|
2
|
+
import { uint8ArrayToBinaryStr } from '#src/utils/tls-imports.ts';
|
|
3
|
+
import { RPCMessage, RPCMessages } from '#src/proto/api.ts';
|
|
4
|
+
import type { CompleteTLSPacket, IDecryptedTranscript, IDecryptedTranscriptMessage, ProviderField, RPCEvent, RPCEventMap, RPCEventType, RPCType, Transcript } from '#src/types/index.ts';
|
|
5
|
+
export { uint8ArrayToBinaryStr };
|
|
6
|
+
/**
|
|
7
|
+
* Decodes a Uint8Array to a UTF-8 string.
|
|
8
|
+
*/
|
|
4
9
|
export declare function uint8ArrayToStr(arr: Uint8Array): string;
|
|
10
|
+
/**
|
|
11
|
+
* Encodes a UTF-8 string to a Uint8Array.
|
|
12
|
+
*/
|
|
13
|
+
export declare function strToUint8Array(str: string): Uint8Array;
|
|
5
14
|
export declare function getTranscriptString(receipt: IDecryptedTranscript): string;
|
|
6
15
|
export declare const unixTimestampSeconds: () => number;
|
|
7
16
|
/**
|
|
8
17
|
* Find index of needle in haystack
|
|
9
18
|
*/
|
|
10
19
|
export declare function findIndexInUint8Array(haystack: Uint8Array, needle: Uint8Array): number;
|
|
11
|
-
/**
|
|
12
|
-
* convert a Uint8Array to a binary encoded str
|
|
13
|
-
* from: https://github.com/feross/buffer/blob/795bbb5bda1b39f1370ebd784bea6107b087e3a7/index.js#L1063
|
|
14
|
-
* @param buf
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export declare function uint8ArrayToBinaryStr(buf: Uint8Array): string;
|
|
18
|
-
export declare function gunzipSync(buf: Uint8Array): Uint8Array;
|
|
19
20
|
/**
|
|
20
21
|
* Fetch the ZK algorithm for the specified cipher suite
|
|
21
22
|
*/
|
|
@@ -100,8 +101,8 @@ export declare function extractHandshakeFromTranscript({ transcript, tlsVersion
|
|
|
100
101
|
tlsVersion: TLSProtocolVersion;
|
|
101
102
|
}): HandshakeTranscript<Uint8Array<ArrayBufferLike>>;
|
|
102
103
|
export declare function decryptDirect(directReveal: any, cipherSuite: CipherSuite, recordHeader: Uint8Array, serverTlsVersion: TLSProtocolVersion, content: Uint8Array): Promise<{
|
|
103
|
-
plaintext: Uint8Array
|
|
104
|
-
iv: Uint8Array
|
|
104
|
+
plaintext: Uint8Array<ArrayBufferLike>;
|
|
105
|
+
iv: Uint8Array<ArrayBufferLike>;
|
|
105
106
|
}>;
|
|
106
107
|
export declare function packRpcMessages(...msgs: Partial<RPCMessage>[]): RPCMessages;
|
|
107
108
|
/**
|
|
@@ -110,3 +111,9 @@ export declare function packRpcMessages(...msgs: Partial<RPCMessage>[]): RPCMess
|
|
|
110
111
|
* Required to correctly JSON.stringify the struct.
|
|
111
112
|
*/
|
|
112
113
|
export declare function ethersStructToPlainObject<T>(struct: T): T;
|
|
114
|
+
export declare function isTls13Suite(suite: CipherSuite): suite is "TLS_CHACHA20_POLY1305_SHA256" | "TLS_AES_256_GCM_SHA384" | "TLS_AES_128_GCM_SHA256";
|
|
115
|
+
/**
|
|
116
|
+
* Validates a proxy session ID format.
|
|
117
|
+
* Must be 8-14 lowercase alphanumeric characters.
|
|
118
|
+
*/
|
|
119
|
+
export declare function isValidProxySessionId(sessionId: string): boolean;
|