@reclaimprotocol/attestor-core 3.0.1
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/README.md +39 -0
- package/lib/avs/abis/avsDirectoryABI.d.ts +60 -0
- package/lib/avs/abis/avsDirectoryABI.js +344 -0
- package/lib/avs/abis/delegationABI.d.ts +126 -0
- package/lib/avs/abis/delegationABI.js +5 -0
- package/lib/avs/abis/registryABI.d.ts +136 -0
- package/lib/avs/abis/registryABI.js +729 -0
- package/lib/avs/client/create-claim-on-avs.d.ts +10 -0
- package/lib/avs/client/create-claim-on-avs.js +147 -0
- package/lib/avs/config.d.ts +7 -0
- package/lib/avs/config.js +24 -0
- package/lib/avs/contracts/ReclaimServiceManager.d.ts +697 -0
- package/lib/avs/contracts/ReclaimServiceManager.js +3 -0
- package/lib/avs/contracts/common.d.ts +21 -0
- package/lib/avs/contracts/common.js +3 -0
- package/lib/avs/contracts/factories/ReclaimServiceManager__factory.d.ts +888 -0
- package/lib/avs/contracts/factories/ReclaimServiceManager__factory.js +1174 -0
- package/lib/avs/contracts/factories/index.d.ts +1 -0
- package/lib/avs/contracts/factories/index.js +9 -0
- package/lib/avs/contracts/index.d.ts +3 -0
- package/lib/avs/contracts/index.js +30 -0
- package/lib/avs/tests/test.operator.d.ts +11 -0
- package/lib/avs/tests/test.operator.js +313 -0
- package/lib/avs/tests/utils.d.ts +2 -0
- package/lib/avs/tests/utils.js +50 -0
- package/lib/avs/types/index.d.ts +55 -0
- package/lib/avs/types/index.js +3 -0
- package/lib/avs/utils/contracts.d.ts +21 -0
- package/lib/avs/utils/contracts.js +38 -0
- package/lib/avs/utils/register.d.ts +27 -0
- package/lib/avs/utils/register.js +76 -0
- package/lib/avs/utils/tasks.d.ts +22 -0
- package/lib/avs/utils/tasks.js +45 -0
- package/lib/client/create-claim.d.ts +5 -0
- package/lib/client/create-claim.js +357 -0
- package/lib/client/index.d.ts +3 -0
- package/lib/client/index.js +20 -0
- package/lib/client/tunnels/make-rpc-tcp-tunnel.d.ts +16 -0
- package/lib/client/tunnels/make-rpc-tcp-tunnel.js +60 -0
- package/lib/client/tunnels/make-rpc-tls-tunnel.d.ts +25 -0
- package/lib/client/tunnels/make-rpc-tls-tunnel.js +135 -0
- package/lib/client/utils/attestor-pool.d.ts +6 -0
- package/lib/client/utils/attestor-pool.js +28 -0
- package/lib/client/utils/client-socket.d.ts +9 -0
- package/lib/client/utils/client-socket.js +77 -0
- package/lib/client/utils/message-handler.d.ts +4 -0
- package/lib/client/utils/message-handler.js +93 -0
- package/lib/config/index.d.ts +23 -0
- package/lib/config/index.js +35 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +39 -0
- package/lib/proto/api.d.ts +414 -0
- package/lib/proto/api.js +2756 -0
- package/lib/providers/http/index.d.ts +3 -0
- package/lib/providers/http/index.js +472 -0
- package/lib/providers/http/utils.d.ts +44 -0
- package/lib/providers/http/utils.js +302 -0
- package/lib/providers/index.d.ts +4 -0
- package/lib/providers/index.js +11 -0
- package/lib/scripts/check-avs-registration.d.ts +1 -0
- package/lib/scripts/check-avs-registration.js +28 -0
- package/lib/scripts/generate-provider-types.d.ts +5 -0
- package/lib/scripts/generate-provider-types.js +82 -0
- package/lib/scripts/generate-receipt.d.ts +9 -0
- package/lib/scripts/generate-receipt.js +93 -0
- package/lib/scripts/register-avs-operator.d.ts +1 -0
- package/lib/scripts/register-avs-operator.js +6 -0
- package/lib/scripts/start-server.d.ts +1 -0
- package/lib/scripts/start-server.js +6 -0
- package/lib/scripts/verify-root-ca.d.ts +1 -0
- package/lib/scripts/verify-root-ca.js +51 -0
- package/lib/server/create-server.d.ts +7 -0
- package/lib/server/create-server.js +85 -0
- package/lib/server/handlers/claimTunnel.d.ts +2 -0
- package/lib/server/handlers/claimTunnel.js +55 -0
- package/lib/server/handlers/completeClaimOnChain.d.ts +2 -0
- package/lib/server/handlers/completeClaimOnChain.js +28 -0
- package/lib/server/handlers/createClaimOnChain.d.ts +2 -0
- package/lib/server/handlers/createClaimOnChain.js +31 -0
- package/lib/server/handlers/createTunnel.d.ts +2 -0
- package/lib/server/handlers/createTunnel.js +65 -0
- package/lib/server/handlers/disconnectTunnel.d.ts +2 -0
- package/lib/server/handlers/disconnectTunnel.js +10 -0
- package/lib/server/handlers/index.d.ts +4 -0
- package/lib/server/handlers/index.js +18 -0
- package/lib/server/handlers/init.d.ts +2 -0
- package/lib/server/handlers/init.js +21 -0
- package/lib/server/index.d.ts +4 -0
- package/lib/server/index.js +21 -0
- package/lib/server/socket.d.ts +11 -0
- package/lib/server/socket.js +95 -0
- package/lib/server/tunnels/make-tcp-tunnel.d.ts +20 -0
- package/lib/server/tunnels/make-tcp-tunnel.js +182 -0
- package/lib/server/utils/apm.d.ts +11 -0
- package/lib/server/utils/apm.js +39 -0
- package/lib/server/utils/assert-valid-claim-request.d.ts +29 -0
- package/lib/server/utils/assert-valid-claim-request.js +189 -0
- package/lib/server/utils/config-env.d.ts +1 -0
- package/lib/server/utils/config-env.js +7 -0
- package/lib/server/utils/generics.d.ts +22 -0
- package/lib/server/utils/generics.js +59 -0
- package/lib/server/utils/iso.d.ts +1 -0
- package/lib/server/utils/iso.js +260 -0
- package/lib/server/utils/keep-alive.d.ts +7 -0
- package/lib/server/utils/keep-alive.js +42 -0
- package/lib/server/utils/process-handshake.d.ts +13 -0
- package/lib/server/utils/process-handshake.js +179 -0
- package/lib/server/utils/verify-server-certificates.d.ts +7 -0
- package/lib/server/utils/verify-server-certificates.js +102 -0
- package/lib/tests/describe-with-server.d.ts +21 -0
- package/lib/tests/describe-with-server.js +67 -0
- package/lib/tests/mock-provider-server.d.ts +13 -0
- package/lib/tests/mock-provider-server.js +65 -0
- package/lib/tests/mocks.d.ts +4 -0
- package/lib/tests/mocks.js +23 -0
- package/lib/tests/test.claim-creation.d.ts +1 -0
- package/lib/tests/test.claim-creation.js +187 -0
- package/lib/tests/test.http-parser.d.ts +1 -0
- package/lib/tests/test.http-parser.js +118 -0
- package/lib/tests/test.http-provider-utils.d.ts +1 -0
- package/lib/tests/test.http-provider-utils.js +1932 -0
- package/lib/tests/test.http-provider.d.ts +1 -0
- package/lib/tests/test.http-provider.js +43 -0
- package/lib/tests/test.rpc-communication.d.ts +1 -0
- package/lib/tests/test.rpc-communication.js +64 -0
- package/lib/tests/test.rpc-tunnel.d.ts +1 -0
- package/lib/tests/test.rpc-tunnel.js +168 -0
- package/lib/tests/test.signatures.d.ts +1 -0
- package/lib/tests/test.signatures.js +24 -0
- package/lib/tests/test.tcp-tunnel.d.ts +1 -0
- package/lib/tests/test.tcp-tunnel.js +64 -0
- package/lib/tests/test.zk.d.ts +1 -0
- package/lib/tests/test.zk.js +169 -0
- package/lib/tests/utils.d.ts +12 -0
- package/lib/tests/utils.js +49 -0
- package/lib/types/claims.d.ts +64 -0
- package/lib/types/claims.js +3 -0
- package/lib/types/client.d.ts +136 -0
- package/lib/types/client.js +3 -0
- package/lib/types/general.d.ts +39 -0
- package/lib/types/general.js +3 -0
- package/lib/types/handlers.d.ts +10 -0
- package/lib/types/handlers.js +3 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/index.js +26 -0
- package/lib/types/providers.d.ts +135 -0
- package/lib/types/providers.gen.d.ts +414 -0
- package/lib/types/providers.gen.js +14 -0
- package/lib/types/providers.js +3 -0
- package/lib/types/rpc.d.ts +35 -0
- package/lib/types/rpc.js +3 -0
- package/lib/types/signatures.d.ts +28 -0
- package/lib/types/signatures.js +3 -0
- package/lib/types/tunnel.d.ts +18 -0
- package/lib/types/tunnel.js +3 -0
- package/lib/types/zk.d.ts +16 -0
- package/lib/types/zk.js +3 -0
- package/lib/utils/benchmark.d.ts +1 -0
- package/lib/utils/benchmark.js +70 -0
- package/lib/utils/claims.d.ts +33 -0
- package/lib/utils/claims.js +112 -0
- package/lib/utils/env.d.ts +3 -0
- package/lib/utils/env.js +20 -0
- package/lib/utils/error.d.ts +27 -0
- package/lib/utils/error.js +43 -0
- package/lib/utils/generics.d.ts +112 -0
- package/lib/utils/generics.js +348 -0
- package/lib/utils/http-parser.d.ts +55 -0
- package/lib/utils/http-parser.js +249 -0
- package/lib/utils/index.d.ts +10 -0
- package/lib/utils/index.js +27 -0
- package/lib/utils/logger.d.ts +13 -0
- package/lib/utils/logger.js +100 -0
- package/lib/utils/prepare-packets.d.ts +16 -0
- package/lib/utils/prepare-packets.js +61 -0
- package/lib/utils/redactions.d.ts +41 -0
- package/lib/utils/redactions.js +111 -0
- package/lib/utils/retries.d.ts +12 -0
- package/lib/utils/retries.js +28 -0
- package/lib/utils/signatures/eth.d.ts +2 -0
- package/lib/utils/signatures/eth.js +33 -0
- package/lib/utils/signatures/index.d.ts +5 -0
- package/lib/utils/signatures/index.js +11 -0
- package/lib/utils/socket-base.d.ts +21 -0
- package/lib/utils/socket-base.js +89 -0
- package/lib/utils/tls.d.ts +2 -0
- package/lib/utils/tls.js +32 -0
- package/lib/utils/validation.d.ts +2 -0
- package/lib/utils/validation.js +46 -0
- package/lib/utils/ws.d.ts +12 -0
- package/lib/utils/ws.js +21 -0
- package/lib/utils/zk.d.ts +50 -0
- package/lib/utils/zk.js +282 -0
- package/lib/window-rpc/index.d.ts +3 -0
- package/lib/window-rpc/index.js +20 -0
- package/lib/window-rpc/setup-window-rpc.d.ts +5 -0
- package/lib/window-rpc/setup-window-rpc.js +239 -0
- package/lib/window-rpc/types.d.ts +184 -0
- package/lib/window-rpc/types.js +3 -0
- package/lib/window-rpc/utils.d.ts +13 -0
- package/lib/window-rpc/utils.js +76 -0
- package/lib/window-rpc/window-rpc-zk.d.ts +11 -0
- package/lib/window-rpc/window-rpc-zk.js +72 -0
- package/package.json +117 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "reclaim_attestor";
|
|
3
|
+
export declare enum TranscriptMessageSenderType {
|
|
4
|
+
TRANSCRIPT_MESSAGE_SENDER_TYPE_UNKNOWN = 0,
|
|
5
|
+
TRANSCRIPT_MESSAGE_SENDER_TYPE_CLIENT = 1,
|
|
6
|
+
TRANSCRIPT_MESSAGE_SENDER_TYPE_SERVER = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export declare function transcriptMessageSenderTypeFromJSON(object: any): TranscriptMessageSenderType;
|
|
10
|
+
export declare function transcriptMessageSenderTypeToJSON(object: TranscriptMessageSenderType): string;
|
|
11
|
+
export declare enum ServiceSignatureType {
|
|
12
|
+
SERVICE_SIGNATURE_TYPE_UNKNOWN = 0,
|
|
13
|
+
/**
|
|
14
|
+
* SERVICE_SIGNATURE_TYPE_ETH - ETH keys & signature
|
|
15
|
+
* keys: secp256k1
|
|
16
|
+
* signature: ethereum flavor of ECDSA (https://goethereumbook.org/signature-generate/)
|
|
17
|
+
*/
|
|
18
|
+
SERVICE_SIGNATURE_TYPE_ETH = 1,
|
|
19
|
+
UNRECOGNIZED = -1
|
|
20
|
+
}
|
|
21
|
+
export declare function serviceSignatureTypeFromJSON(object: any): ServiceSignatureType;
|
|
22
|
+
export declare function serviceSignatureTypeToJSON(object: ServiceSignatureType): string;
|
|
23
|
+
export declare enum AttestorVersion {
|
|
24
|
+
ATTESTOR_VERSION_UNKNOWN = 0,
|
|
25
|
+
ATTESTOR_VERSION_1_0_0 = 1,
|
|
26
|
+
ATTESTOR_VERSION_1_1_0 = 2,
|
|
27
|
+
ATTESTOR_VERSION_2_0_0 = 3,
|
|
28
|
+
UNRECOGNIZED = -1
|
|
29
|
+
}
|
|
30
|
+
export declare function attestorVersionFromJSON(object: any): AttestorVersion;
|
|
31
|
+
export declare function attestorVersionToJSON(object: AttestorVersion): string;
|
|
32
|
+
export declare enum ErrorCode {
|
|
33
|
+
/**
|
|
34
|
+
* ERROR_NO_ERROR - 0 should be treated as the absence of an error
|
|
35
|
+
* should be used when gracefully closing the connection
|
|
36
|
+
*/
|
|
37
|
+
ERROR_NO_ERROR = 0,
|
|
38
|
+
/**
|
|
39
|
+
* ERROR_INTERNAL - internal error in the attestor -- all "Error/TypeError"
|
|
40
|
+
* messages are mapped to this
|
|
41
|
+
*/
|
|
42
|
+
ERROR_INTERNAL = 1,
|
|
43
|
+
/** ERROR_BAD_REQUEST - bad request from the client */
|
|
44
|
+
ERROR_BAD_REQUEST = 2,
|
|
45
|
+
/** ERROR_NOT_FOUND - the item requested was not found */
|
|
46
|
+
ERROR_NOT_FOUND = 3,
|
|
47
|
+
/** ERROR_PROXY_ERROR - error in the proxy */
|
|
48
|
+
ERROR_PROXY_ERROR = 4,
|
|
49
|
+
/**
|
|
50
|
+
* ERROR_INVALID_CLAIM - claim creation failed -- i.e. the transcript
|
|
51
|
+
* did not result in a valid claim
|
|
52
|
+
*/
|
|
53
|
+
ERROR_INVALID_CLAIM = 5,
|
|
54
|
+
/** ERROR_NETWORK_ERROR - any network error */
|
|
55
|
+
ERROR_NETWORK_ERROR = 6,
|
|
56
|
+
/** ERROR_PAYMENT_REFUSED - attestor refused to pay the costs */
|
|
57
|
+
ERROR_PAYMENT_REFUSED = 7,
|
|
58
|
+
UNRECOGNIZED = -1
|
|
59
|
+
}
|
|
60
|
+
export declare function errorCodeFromJSON(object: any): ErrorCode;
|
|
61
|
+
export declare function errorCodeToJSON(object: ErrorCode): string;
|
|
62
|
+
export declare enum ZKProofEngine {
|
|
63
|
+
ZK_ENGINE_SNARKJS = 0,
|
|
64
|
+
ZK_ENGINE_GNARK = 1,
|
|
65
|
+
UNRECOGNIZED = -1
|
|
66
|
+
}
|
|
67
|
+
export declare function zKProofEngineFromJSON(object: any): ZKProofEngine;
|
|
68
|
+
export declare function zKProofEngineToJSON(object: ZKProofEngine): string;
|
|
69
|
+
export interface ClaimContext {
|
|
70
|
+
/**
|
|
71
|
+
* Extracted parameters from the TLS transcript
|
|
72
|
+
* by the provider. Any parameters provided by the
|
|
73
|
+
* user will be overwritten
|
|
74
|
+
*/
|
|
75
|
+
extractedParameters: {
|
|
76
|
+
[key: string]: string;
|
|
77
|
+
};
|
|
78
|
+
/** Provider hash. TODO: docs */
|
|
79
|
+
providerHash: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ClaimContext_ExtractedParametersEntry {
|
|
82
|
+
key: string;
|
|
83
|
+
value: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ProviderClaimData {
|
|
86
|
+
/**
|
|
87
|
+
* Name of the provider to generate the
|
|
88
|
+
* claim using.
|
|
89
|
+
* @example "http"
|
|
90
|
+
*/
|
|
91
|
+
provider: string;
|
|
92
|
+
/**
|
|
93
|
+
* Canonically JSON stringified parameters
|
|
94
|
+
* of the claim, as specified by the provider.
|
|
95
|
+
* @example '{"url":"https://example.com","method":"GET"}'
|
|
96
|
+
*/
|
|
97
|
+
parameters: string;
|
|
98
|
+
/**
|
|
99
|
+
* Owner of the claim. Must be the public key/address
|
|
100
|
+
* @example "0x1234..."
|
|
101
|
+
*/
|
|
102
|
+
owner: string;
|
|
103
|
+
/**
|
|
104
|
+
* Unix timestamp in seconds of the claim being made.
|
|
105
|
+
* Cannot be more than 10 minutes in the past or future
|
|
106
|
+
*/
|
|
107
|
+
timestampS: number;
|
|
108
|
+
/**
|
|
109
|
+
* Any additional data you want to store with the claim.
|
|
110
|
+
* Also expected to be a canonical JSON string.
|
|
111
|
+
*/
|
|
112
|
+
context: string;
|
|
113
|
+
/**
|
|
114
|
+
* identifier of the claim;
|
|
115
|
+
* Hash of (provider, parameters, context)
|
|
116
|
+
*/
|
|
117
|
+
identifier: string;
|
|
118
|
+
/** Legacy V1 Beacon epoch number */
|
|
119
|
+
epoch: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ProviderClaimInfo {
|
|
122
|
+
provider: string;
|
|
123
|
+
parameters: string;
|
|
124
|
+
context: string;
|
|
125
|
+
}
|
|
126
|
+
export interface ErrorData {
|
|
127
|
+
code: ErrorCode;
|
|
128
|
+
message: string;
|
|
129
|
+
data: string;
|
|
130
|
+
}
|
|
131
|
+
export interface CreateTunnelRequest {
|
|
132
|
+
/**
|
|
133
|
+
* Assign a unique ID to the client for this tunnel
|
|
134
|
+
* request. This ID will be used to identify the tunnel
|
|
135
|
+
* to later send messages or disconnect the tunnel.
|
|
136
|
+
*/
|
|
137
|
+
id: number;
|
|
138
|
+
host: string;
|
|
139
|
+
port: number;
|
|
140
|
+
/**
|
|
141
|
+
* Geo location from which the request will be made.
|
|
142
|
+
* Provide 2 letter ISO country code. Leave empty
|
|
143
|
+
* if you don't want to use geo location.
|
|
144
|
+
*
|
|
145
|
+
* Geo location is implemented using an https proxy
|
|
146
|
+
* eg. US, IN, GB, etc.
|
|
147
|
+
*/
|
|
148
|
+
geoLocation: string;
|
|
149
|
+
}
|
|
150
|
+
export interface DisconnectTunnelRequest {
|
|
151
|
+
id: number;
|
|
152
|
+
}
|
|
153
|
+
/** empty message */
|
|
154
|
+
export interface Empty {
|
|
155
|
+
}
|
|
156
|
+
export interface TunnelMessage {
|
|
157
|
+
/** ID of the tunnel where this message belongs */
|
|
158
|
+
tunnelId: number;
|
|
159
|
+
message: Uint8Array;
|
|
160
|
+
}
|
|
161
|
+
export interface TunnelDisconnectEvent {
|
|
162
|
+
tunnelId: number;
|
|
163
|
+
error: ErrorData | undefined;
|
|
164
|
+
}
|
|
165
|
+
export interface MessageReveal {
|
|
166
|
+
/**
|
|
167
|
+
* direct reveal of the block via the key & IV
|
|
168
|
+
* cipher (aes, chacha) for decryption
|
|
169
|
+
* selected based on `cipherSuite`
|
|
170
|
+
* determined by the server hello packet
|
|
171
|
+
*/
|
|
172
|
+
directReveal?: MessageReveal_MessageRevealDirect | undefined;
|
|
173
|
+
/** partially or fully reveal the block via a zk proof */
|
|
174
|
+
zkReveal?: MessageReveal_MessageRevealZk | undefined;
|
|
175
|
+
}
|
|
176
|
+
export interface MessageReveal_MessageRevealDirect {
|
|
177
|
+
/** key for the block */
|
|
178
|
+
key: Uint8Array;
|
|
179
|
+
/** IV for the block */
|
|
180
|
+
iv: Uint8Array;
|
|
181
|
+
/**
|
|
182
|
+
* used to generate IV in authenticated
|
|
183
|
+
* cipher suites
|
|
184
|
+
*/
|
|
185
|
+
recordNumber: number;
|
|
186
|
+
}
|
|
187
|
+
export interface MessageReveal_MessageRevealZk {
|
|
188
|
+
proofs: MessageReveal_ZKProof[];
|
|
189
|
+
}
|
|
190
|
+
export interface MessageReveal_ZKProof {
|
|
191
|
+
/** JSON encoded snarkJS proof */
|
|
192
|
+
proofJson: string;
|
|
193
|
+
/** the decrypted ciphertext as output by the ZK proof */
|
|
194
|
+
decryptedRedactedCiphertext: Uint8Array;
|
|
195
|
+
/** the plaintext that is fully or partially revealed */
|
|
196
|
+
redactedPlaintext: Uint8Array;
|
|
197
|
+
/**
|
|
198
|
+
* start of this specific block
|
|
199
|
+
* in the redactedPlaintext
|
|
200
|
+
*/
|
|
201
|
+
startIdx: number;
|
|
202
|
+
}
|
|
203
|
+
export interface ClaimRequestData {
|
|
204
|
+
provider: string;
|
|
205
|
+
parameters: string;
|
|
206
|
+
/**
|
|
207
|
+
* Owner of the claim. Must be the public key/address
|
|
208
|
+
* of the signatures
|
|
209
|
+
*/
|
|
210
|
+
owner: string;
|
|
211
|
+
/**
|
|
212
|
+
* Timestamp of the claim being made.
|
|
213
|
+
* Cannot be more than 10 minutes in the past
|
|
214
|
+
* or in the future
|
|
215
|
+
*/
|
|
216
|
+
timestampS: number;
|
|
217
|
+
context: string;
|
|
218
|
+
}
|
|
219
|
+
export interface ClaimTunnelRequest {
|
|
220
|
+
/**
|
|
221
|
+
* parameters supplied to establish the tunnel
|
|
222
|
+
* & connect to the end server
|
|
223
|
+
*/
|
|
224
|
+
request: CreateTunnelRequest | undefined;
|
|
225
|
+
/** data describing the claim you want to prove */
|
|
226
|
+
data: ClaimRequestData | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* messages from the client & server
|
|
229
|
+
* in the order they were sent/received
|
|
230
|
+
*
|
|
231
|
+
* Attach a proof (if any) to each message
|
|
232
|
+
* to reveal the contents of the message inside
|
|
233
|
+
*
|
|
234
|
+
* The revealed messages should support the proving
|
|
235
|
+
* of the claim as defined in the provider's implementation
|
|
236
|
+
*/
|
|
237
|
+
transcript: ClaimTunnelRequest_TranscriptMessage[];
|
|
238
|
+
signatures: ClaimTunnelRequest_Signatures | undefined;
|
|
239
|
+
/** type of ZK engine used. SnarkJS or Gnark */
|
|
240
|
+
zkEngine: ZKProofEngine;
|
|
241
|
+
/** server and client fixed IVs needed for ZK validation */
|
|
242
|
+
fixedServerIV: Uint8Array;
|
|
243
|
+
fixedClientIV: Uint8Array;
|
|
244
|
+
}
|
|
245
|
+
export interface ClaimTunnelRequest_Signatures {
|
|
246
|
+
/**
|
|
247
|
+
* signature of ClaimTunnelRequest
|
|
248
|
+
* with empty "signatures" field
|
|
249
|
+
*/
|
|
250
|
+
requestSignature: Uint8Array;
|
|
251
|
+
}
|
|
252
|
+
export interface ClaimTunnelRequest_TranscriptMessage {
|
|
253
|
+
/** client or server */
|
|
254
|
+
sender: TranscriptMessageSenderType;
|
|
255
|
+
/** packet data */
|
|
256
|
+
message: Uint8Array;
|
|
257
|
+
reveal: MessageReveal | undefined;
|
|
258
|
+
}
|
|
259
|
+
export interface ClaimTunnelResponse {
|
|
260
|
+
/** The original request that was made to claim the tunnel */
|
|
261
|
+
request: ClaimTunnelRequest | undefined;
|
|
262
|
+
claim?: ProviderClaimData | undefined;
|
|
263
|
+
error?: ErrorData | undefined;
|
|
264
|
+
signatures: ClaimTunnelResponse_Signatures | undefined;
|
|
265
|
+
}
|
|
266
|
+
export interface ClaimTunnelResponse_Signatures {
|
|
267
|
+
/** Address of the attestor that has signed the claim */
|
|
268
|
+
attestorAddress: string;
|
|
269
|
+
/**
|
|
270
|
+
* signature of `stringifyProviderClaimData(claim)`,
|
|
271
|
+
* if the claim was successful
|
|
272
|
+
*/
|
|
273
|
+
claimSignature: Uint8Array;
|
|
274
|
+
/**
|
|
275
|
+
* signature of the complete ClaimTunnelResponse
|
|
276
|
+
* structure with empty "signatures" field
|
|
277
|
+
*/
|
|
278
|
+
resultSignature: Uint8Array;
|
|
279
|
+
}
|
|
280
|
+
export interface RequestClaimOnAvsRequest {
|
|
281
|
+
/**
|
|
282
|
+
* Chain ID of the chain on which the claim is to be made
|
|
283
|
+
* @example 17000 (holesky)
|
|
284
|
+
*/
|
|
285
|
+
chainId: number;
|
|
286
|
+
/** Serialised JSON string of the ClaimRequest struct */
|
|
287
|
+
jsonCreateClaimRequest: string;
|
|
288
|
+
/** ETH signature of the `ClaimRequest` struct */
|
|
289
|
+
requestSignature: Uint8Array;
|
|
290
|
+
}
|
|
291
|
+
export interface RequestClaimOnAvsResponse {
|
|
292
|
+
txHash: string;
|
|
293
|
+
taskIndex: number;
|
|
294
|
+
jsonTask: string;
|
|
295
|
+
}
|
|
296
|
+
export interface CompleteClaimOnAvsRequest {
|
|
297
|
+
/**
|
|
298
|
+
* Chain ID of the chain on which the claim is to be made
|
|
299
|
+
* @example 17000 (holesky)
|
|
300
|
+
*/
|
|
301
|
+
chainId: number;
|
|
302
|
+
taskIndex: number;
|
|
303
|
+
completedTaskJson: string;
|
|
304
|
+
}
|
|
305
|
+
export interface CompleteClaimOnAvsResponse {
|
|
306
|
+
txHash: string;
|
|
307
|
+
taskCompletedObjectJson: string;
|
|
308
|
+
}
|
|
309
|
+
export interface InitRequest {
|
|
310
|
+
/** Attestor client version */
|
|
311
|
+
clientVersion: AttestorVersion;
|
|
312
|
+
/** Signature type used & expected by the user */
|
|
313
|
+
signatureType: ServiceSignatureType;
|
|
314
|
+
}
|
|
315
|
+
export interface RPCMessage {
|
|
316
|
+
/**
|
|
317
|
+
* Per connection unique RPC message ID. Either party sending a
|
|
318
|
+
* duplicate ID will do nothing except confuse the other party.
|
|
319
|
+
*
|
|
320
|
+
* For response messages, the ID should be the same as the request
|
|
321
|
+
* to which it is responding.
|
|
322
|
+
*/
|
|
323
|
+
id: number;
|
|
324
|
+
initRequest?: InitRequest | undefined;
|
|
325
|
+
/** Response to the init request. */
|
|
326
|
+
initResponse?: Empty | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* Data representing an error in the WebSocket connection.
|
|
329
|
+
* The party sending this message should close the connection
|
|
330
|
+
* immediately after sending this message.
|
|
331
|
+
*/
|
|
332
|
+
connectionTerminationAlert?: ErrorData | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Data representing an error in the attestor's
|
|
335
|
+
* request to the server. This should be sent in case
|
|
336
|
+
* there was an error in processing the request.
|
|
337
|
+
*/
|
|
338
|
+
requestError?: ErrorData | undefined;
|
|
339
|
+
/** Create a tunnel to the specified host & port. */
|
|
340
|
+
createTunnelRequest?: CreateTunnelRequest | undefined;
|
|
341
|
+
createTunnelResponse?: Empty | undefined;
|
|
342
|
+
/** Disconnect a tunnel. */
|
|
343
|
+
disconnectTunnelRequest?: DisconnectTunnelRequest | undefined;
|
|
344
|
+
disconnectTunnelResponse?: Empty | undefined;
|
|
345
|
+
/**
|
|
346
|
+
* Message to send through a tunnel. Client can send
|
|
347
|
+
* this message to forward data to the server.
|
|
348
|
+
*/
|
|
349
|
+
tunnelMessage?: TunnelMessage | undefined;
|
|
350
|
+
/**
|
|
351
|
+
* Event indicating that a tunnel has been disconnected.
|
|
352
|
+
* The client should not send any more messages through
|
|
353
|
+
* this tunnel.
|
|
354
|
+
*/
|
|
355
|
+
tunnelDisconnectEvent?: TunnelDisconnectEvent | undefined;
|
|
356
|
+
/**
|
|
357
|
+
* Using the transcript of a tunnel, make a claim.
|
|
358
|
+
* The tunnel must be disconnected before making a claim.
|
|
359
|
+
*/
|
|
360
|
+
claimTunnelRequest?: ClaimTunnelRequest | undefined;
|
|
361
|
+
claimTunnelResponse?: ClaimTunnelResponse | undefined;
|
|
362
|
+
/**
|
|
363
|
+
* Request the attestor to pay for the claim on the chain.
|
|
364
|
+
* The Attestor can choose to reject the request.
|
|
365
|
+
*/
|
|
366
|
+
createClaimOnChainRequest?: RequestClaimOnAvsRequest | undefined;
|
|
367
|
+
createClaimOnChainResponse?: RequestClaimOnAvsResponse | undefined;
|
|
368
|
+
/** Submit the work done for the claim on the chain. */
|
|
369
|
+
completeClaimOnChainRequest?: CompleteClaimOnAvsRequest | undefined;
|
|
370
|
+
completeClaimOnChainResponse?: CompleteClaimOnAvsResponse | undefined;
|
|
371
|
+
}
|
|
372
|
+
export interface RPCMessages {
|
|
373
|
+
messages: RPCMessage[];
|
|
374
|
+
}
|
|
375
|
+
export declare const ClaimContext: MessageFns<ClaimContext>;
|
|
376
|
+
export declare const ClaimContext_ExtractedParametersEntry: MessageFns<ClaimContext_ExtractedParametersEntry>;
|
|
377
|
+
export declare const ProviderClaimData: MessageFns<ProviderClaimData>;
|
|
378
|
+
export declare const ProviderClaimInfo: MessageFns<ProviderClaimInfo>;
|
|
379
|
+
export declare const ErrorData: MessageFns<ErrorData>;
|
|
380
|
+
export declare const CreateTunnelRequest: MessageFns<CreateTunnelRequest>;
|
|
381
|
+
export declare const DisconnectTunnelRequest: MessageFns<DisconnectTunnelRequest>;
|
|
382
|
+
export declare const Empty: MessageFns<Empty>;
|
|
383
|
+
export declare const TunnelMessage: MessageFns<TunnelMessage>;
|
|
384
|
+
export declare const TunnelDisconnectEvent: MessageFns<TunnelDisconnectEvent>;
|
|
385
|
+
export declare const MessageReveal: MessageFns<MessageReveal>;
|
|
386
|
+
export declare const MessageReveal_MessageRevealDirect: MessageFns<MessageReveal_MessageRevealDirect>;
|
|
387
|
+
export declare const MessageReveal_MessageRevealZk: MessageFns<MessageReveal_MessageRevealZk>;
|
|
388
|
+
export declare const MessageReveal_ZKProof: MessageFns<MessageReveal_ZKProof>;
|
|
389
|
+
export declare const ClaimRequestData: MessageFns<ClaimRequestData>;
|
|
390
|
+
export declare const ClaimTunnelRequest: MessageFns<ClaimTunnelRequest>;
|
|
391
|
+
export declare const ClaimTunnelRequest_Signatures: MessageFns<ClaimTunnelRequest_Signatures>;
|
|
392
|
+
export declare const ClaimTunnelRequest_TranscriptMessage: MessageFns<ClaimTunnelRequest_TranscriptMessage>;
|
|
393
|
+
export declare const ClaimTunnelResponse: MessageFns<ClaimTunnelResponse>;
|
|
394
|
+
export declare const ClaimTunnelResponse_Signatures: MessageFns<ClaimTunnelResponse_Signatures>;
|
|
395
|
+
export declare const RequestClaimOnAvsRequest: MessageFns<RequestClaimOnAvsRequest>;
|
|
396
|
+
export declare const RequestClaimOnAvsResponse: MessageFns<RequestClaimOnAvsResponse>;
|
|
397
|
+
export declare const CompleteClaimOnAvsRequest: MessageFns<CompleteClaimOnAvsRequest>;
|
|
398
|
+
export declare const CompleteClaimOnAvsResponse: MessageFns<CompleteClaimOnAvsResponse>;
|
|
399
|
+
export declare const InitRequest: MessageFns<InitRequest>;
|
|
400
|
+
export declare const RPCMessage: MessageFns<RPCMessage>;
|
|
401
|
+
export declare const RPCMessages: MessageFns<RPCMessages>;
|
|
402
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
403
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
404
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
405
|
+
} : Partial<T>;
|
|
406
|
+
export interface MessageFns<T> {
|
|
407
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
408
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
409
|
+
fromJSON(object: any): T;
|
|
410
|
+
toJSON(message: T): unknown;
|
|
411
|
+
create(base?: DeepPartial<T>): T;
|
|
412
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
413
|
+
}
|
|
414
|
+
export {};
|