@nullclear/shared 0.0.0-stage → 1.1.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/LICENSE +21 -0
- package/README.md +8 -2
- package/dist/index.cjs +264 -0
- package/dist/index.d.cts +793 -0
- package/dist/index.d.mts +378 -0
- package/dist/index.d.ts +793 -0
- package/dist/index.js +216 -0
- package/dist/index.mjs +154 -0
- package/package.json +39 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
interface ChainConfig {
|
|
4
|
+
name: string;
|
|
5
|
+
chainId: number;
|
|
6
|
+
caip2: `eip155:${number}`;
|
|
7
|
+
erc8004Identity: `0x${string}`;
|
|
8
|
+
erc8004Reputation: `0x${string}`;
|
|
9
|
+
usdc: `0x${string}`;
|
|
10
|
+
usdcDomain: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
chainId: number;
|
|
14
|
+
verifyingContract: `0x${string}`;
|
|
15
|
+
};
|
|
16
|
+
rpcUrl: string;
|
|
17
|
+
blockExplorer: string;
|
|
18
|
+
}
|
|
19
|
+
declare const NULLCLEAR_TREASURY_ADDRESS: "0xB586eFcCa41dF27ad3873BEcA54da0c30bf04d5c";
|
|
20
|
+
declare const NULLCLEAR_ARBITER_ADDRESS: "0xfd74fF802EA0E735514C070AF04E0D6528deD145";
|
|
21
|
+
declare const BASE_MAINNET: ChainConfig;
|
|
22
|
+
declare const BASE_SEPOLIA: ChainConfig;
|
|
23
|
+
declare const SUPPORTED_CHAINS: Record<number, ChainConfig>;
|
|
24
|
+
declare const CAIP2_TO_CHAIN_ID: Record<string, number>;
|
|
25
|
+
declare function getChainConfig(chainIdOrCaip2: number | string): ChainConfig;
|
|
26
|
+
|
|
27
|
+
declare const ERC8004_IDENTITY_ABI: readonly [{
|
|
28
|
+
readonly name: "register";
|
|
29
|
+
readonly type: "function";
|
|
30
|
+
readonly stateMutability: "nonpayable";
|
|
31
|
+
readonly inputs: readonly [{
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly name: "agentURI";
|
|
34
|
+
}];
|
|
35
|
+
readonly outputs: readonly [{
|
|
36
|
+
readonly type: "uint256";
|
|
37
|
+
readonly name: "agentId";
|
|
38
|
+
}];
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "ownerOf";
|
|
41
|
+
readonly type: "function";
|
|
42
|
+
readonly stateMutability: "view";
|
|
43
|
+
readonly inputs: readonly [{
|
|
44
|
+
readonly type: "uint256";
|
|
45
|
+
readonly name: "tokenId";
|
|
46
|
+
}];
|
|
47
|
+
readonly outputs: readonly [{
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
}];
|
|
50
|
+
}, {
|
|
51
|
+
readonly name: "tokenURI";
|
|
52
|
+
readonly type: "function";
|
|
53
|
+
readonly stateMutability: "view";
|
|
54
|
+
readonly inputs: readonly [{
|
|
55
|
+
readonly type: "uint256";
|
|
56
|
+
readonly name: "tokenId";
|
|
57
|
+
}];
|
|
58
|
+
readonly outputs: readonly [{
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
}];
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "getAgentWallet";
|
|
63
|
+
readonly type: "function";
|
|
64
|
+
readonly stateMutability: "view";
|
|
65
|
+
readonly inputs: readonly [{
|
|
66
|
+
readonly type: "uint256";
|
|
67
|
+
readonly name: "agentId";
|
|
68
|
+
}];
|
|
69
|
+
readonly outputs: readonly [{
|
|
70
|
+
readonly type: "address";
|
|
71
|
+
}];
|
|
72
|
+
}, {
|
|
73
|
+
readonly name: "Registered";
|
|
74
|
+
readonly type: "event";
|
|
75
|
+
readonly inputs: readonly [{
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
readonly name: "agentId";
|
|
78
|
+
readonly indexed: true;
|
|
79
|
+
}, {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
readonly name: "agentURI";
|
|
82
|
+
}, {
|
|
83
|
+
readonly type: "address";
|
|
84
|
+
readonly name: "owner";
|
|
85
|
+
readonly indexed: true;
|
|
86
|
+
}];
|
|
87
|
+
}];
|
|
88
|
+
declare const ERC8004_REPUTATION_ABI: readonly [{
|
|
89
|
+
readonly name: "giveFeedback";
|
|
90
|
+
readonly type: "function";
|
|
91
|
+
readonly stateMutability: "nonpayable";
|
|
92
|
+
readonly inputs: readonly [{
|
|
93
|
+
readonly type: "uint256";
|
|
94
|
+
readonly name: "agentId";
|
|
95
|
+
}, {
|
|
96
|
+
readonly type: "int128";
|
|
97
|
+
readonly name: "value";
|
|
98
|
+
}, {
|
|
99
|
+
readonly type: "uint8";
|
|
100
|
+
readonly name: "valueDecimals";
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
readonly name: "tag1";
|
|
104
|
+
}, {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly name: "tag2";
|
|
107
|
+
}, {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly name: "endpoint";
|
|
110
|
+
}, {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
readonly name: "feedbackURI";
|
|
113
|
+
}, {
|
|
114
|
+
readonly type: "bytes32";
|
|
115
|
+
readonly name: "feedbackHash";
|
|
116
|
+
}];
|
|
117
|
+
readonly outputs: readonly [];
|
|
118
|
+
}, {
|
|
119
|
+
readonly name: "getSummary";
|
|
120
|
+
readonly type: "function";
|
|
121
|
+
readonly stateMutability: "view";
|
|
122
|
+
readonly inputs: readonly [{
|
|
123
|
+
readonly type: "uint256";
|
|
124
|
+
readonly name: "agentId";
|
|
125
|
+
}, {
|
|
126
|
+
readonly type: "address[]";
|
|
127
|
+
readonly name: "clientAddresses";
|
|
128
|
+
}, {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
readonly name: "tag1";
|
|
131
|
+
}, {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly name: "tag2";
|
|
134
|
+
}];
|
|
135
|
+
readonly outputs: readonly [{
|
|
136
|
+
readonly type: "uint64";
|
|
137
|
+
readonly name: "count";
|
|
138
|
+
}, {
|
|
139
|
+
readonly type: "int128";
|
|
140
|
+
readonly name: "summaryValue";
|
|
141
|
+
}, {
|
|
142
|
+
readonly type: "uint8";
|
|
143
|
+
readonly name: "summaryValueDecimals";
|
|
144
|
+
}];
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "readFeedback";
|
|
147
|
+
readonly type: "function";
|
|
148
|
+
readonly stateMutability: "view";
|
|
149
|
+
readonly inputs: readonly [{
|
|
150
|
+
readonly type: "uint256";
|
|
151
|
+
readonly name: "agentId";
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "address";
|
|
154
|
+
readonly name: "clientAddress";
|
|
155
|
+
}, {
|
|
156
|
+
readonly type: "uint64";
|
|
157
|
+
readonly name: "feedbackIndex";
|
|
158
|
+
}];
|
|
159
|
+
readonly outputs: readonly [{
|
|
160
|
+
readonly type: "int128";
|
|
161
|
+
readonly name: "value";
|
|
162
|
+
}, {
|
|
163
|
+
readonly type: "uint8";
|
|
164
|
+
readonly name: "valueDecimals";
|
|
165
|
+
}, {
|
|
166
|
+
readonly type: "string";
|
|
167
|
+
readonly name: "tag1";
|
|
168
|
+
}, {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
readonly name: "tag2";
|
|
171
|
+
}, {
|
|
172
|
+
readonly type: "bool";
|
|
173
|
+
readonly name: "isRevoked";
|
|
174
|
+
}];
|
|
175
|
+
}, {
|
|
176
|
+
readonly name: "NewFeedback";
|
|
177
|
+
readonly type: "event";
|
|
178
|
+
readonly inputs: readonly [{
|
|
179
|
+
readonly type: "uint256";
|
|
180
|
+
readonly name: "agentId";
|
|
181
|
+
readonly indexed: true;
|
|
182
|
+
}, {
|
|
183
|
+
readonly type: "address";
|
|
184
|
+
readonly name: "clientAddress";
|
|
185
|
+
readonly indexed: true;
|
|
186
|
+
}, {
|
|
187
|
+
readonly type: "uint64";
|
|
188
|
+
readonly name: "feedbackIndex";
|
|
189
|
+
}, {
|
|
190
|
+
readonly type: "int128";
|
|
191
|
+
readonly name: "value";
|
|
192
|
+
}, {
|
|
193
|
+
readonly type: "uint8";
|
|
194
|
+
readonly name: "valueDecimals";
|
|
195
|
+
}, {
|
|
196
|
+
readonly type: "string";
|
|
197
|
+
readonly name: "indexedTag1";
|
|
198
|
+
readonly indexed: true;
|
|
199
|
+
}, {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
readonly name: "tag1";
|
|
202
|
+
}, {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
readonly name: "tag2";
|
|
205
|
+
}, {
|
|
206
|
+
readonly type: "string";
|
|
207
|
+
readonly name: "endpoint";
|
|
208
|
+
}, {
|
|
209
|
+
readonly type: "string";
|
|
210
|
+
readonly name: "feedbackURI";
|
|
211
|
+
}, {
|
|
212
|
+
readonly type: "bytes32";
|
|
213
|
+
readonly name: "feedbackHash";
|
|
214
|
+
}];
|
|
215
|
+
}];
|
|
216
|
+
|
|
217
|
+
declare const EIP3009_ABI: readonly [{
|
|
218
|
+
readonly name: "transferWithAuthorization";
|
|
219
|
+
readonly type: "function";
|
|
220
|
+
readonly stateMutability: "nonpayable";
|
|
221
|
+
readonly inputs: readonly [{
|
|
222
|
+
readonly type: "address";
|
|
223
|
+
readonly name: "from";
|
|
224
|
+
}, {
|
|
225
|
+
readonly type: "address";
|
|
226
|
+
readonly name: "to";
|
|
227
|
+
}, {
|
|
228
|
+
readonly type: "uint256";
|
|
229
|
+
readonly name: "value";
|
|
230
|
+
}, {
|
|
231
|
+
readonly type: "uint256";
|
|
232
|
+
readonly name: "validAfter";
|
|
233
|
+
}, {
|
|
234
|
+
readonly type: "uint256";
|
|
235
|
+
readonly name: "validBefore";
|
|
236
|
+
}, {
|
|
237
|
+
readonly type: "bytes32";
|
|
238
|
+
readonly name: "nonce";
|
|
239
|
+
}, {
|
|
240
|
+
readonly type: "uint8";
|
|
241
|
+
readonly name: "v";
|
|
242
|
+
}, {
|
|
243
|
+
readonly type: "bytes32";
|
|
244
|
+
readonly name: "r";
|
|
245
|
+
}, {
|
|
246
|
+
readonly type: "bytes32";
|
|
247
|
+
readonly name: "s";
|
|
248
|
+
}];
|
|
249
|
+
readonly outputs: readonly [];
|
|
250
|
+
}];
|
|
251
|
+
interface X402PaymentOption {
|
|
252
|
+
scheme: "exact";
|
|
253
|
+
network: "eip155:8453" | "eip155:84532";
|
|
254
|
+
amount: string;
|
|
255
|
+
asset: `0x${string}`;
|
|
256
|
+
payTo: `0x${string}`;
|
|
257
|
+
maxTimeoutSeconds: number;
|
|
258
|
+
extra?: {
|
|
259
|
+
name?: string;
|
|
260
|
+
version?: string;
|
|
261
|
+
feePayer?: `0x${string}`;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
interface X402PaymentRequired {
|
|
265
|
+
x402Version: 2;
|
|
266
|
+
error?: string;
|
|
267
|
+
resource: {
|
|
268
|
+
url: string;
|
|
269
|
+
description?: string;
|
|
270
|
+
mimeType?: string;
|
|
271
|
+
};
|
|
272
|
+
accepts: X402PaymentOption[];
|
|
273
|
+
}
|
|
274
|
+
interface EIP3009Authorization {
|
|
275
|
+
from: `0x${string}`;
|
|
276
|
+
to: `0x${string}`;
|
|
277
|
+
value: string;
|
|
278
|
+
validAfter: string;
|
|
279
|
+
validBefore: string;
|
|
280
|
+
nonce: `0x${string}`;
|
|
281
|
+
}
|
|
282
|
+
interface X402PaymentSignaturePayload {
|
|
283
|
+
x402Version: 2;
|
|
284
|
+
resource?: {
|
|
285
|
+
url: string;
|
|
286
|
+
mimeType?: string;
|
|
287
|
+
};
|
|
288
|
+
accepted: X402PaymentOption;
|
|
289
|
+
payload: {
|
|
290
|
+
signature: `0x${string}`;
|
|
291
|
+
authorization: EIP3009Authorization;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
declare const EIP3009_TYPES: {
|
|
295
|
+
readonly TransferWithAuthorization: readonly [{
|
|
296
|
+
readonly name: "from";
|
|
297
|
+
readonly type: "address";
|
|
298
|
+
}, {
|
|
299
|
+
readonly name: "to";
|
|
300
|
+
readonly type: "address";
|
|
301
|
+
}, {
|
|
302
|
+
readonly name: "value";
|
|
303
|
+
readonly type: "uint256";
|
|
304
|
+
}, {
|
|
305
|
+
readonly name: "validAfter";
|
|
306
|
+
readonly type: "uint256";
|
|
307
|
+
}, {
|
|
308
|
+
readonly name: "validBefore";
|
|
309
|
+
readonly type: "uint256";
|
|
310
|
+
}, {
|
|
311
|
+
readonly name: "nonce";
|
|
312
|
+
readonly type: "bytes32";
|
|
313
|
+
}];
|
|
314
|
+
};
|
|
315
|
+
interface X402PaymentResponse {
|
|
316
|
+
success: boolean;
|
|
317
|
+
transaction?: `0x${string}`;
|
|
318
|
+
network: "eip155:8453" | "eip155:84532";
|
|
319
|
+
payer: `0x${string}`;
|
|
320
|
+
errorReason?: string;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Universal base64 encoder that works in Node.js, Cloudflare Workers, and Browser
|
|
324
|
+
*/
|
|
325
|
+
declare function encodeBase64Json(obj: unknown): string;
|
|
326
|
+
/**
|
|
327
|
+
* Universal base64 decoder that works in Node.js, Cloudflare Workers, and Browser
|
|
328
|
+
*/
|
|
329
|
+
declare function decodeBase64Json<T>(base64: string): T;
|
|
330
|
+
|
|
331
|
+
interface KYAMandate {
|
|
332
|
+
corporateEntity: string;
|
|
333
|
+
entityRegistrationNumber: string;
|
|
334
|
+
agentId: string;
|
|
335
|
+
agentWallet: `0x${string}`;
|
|
336
|
+
maxTxLimitUsd: number;
|
|
337
|
+
liabilityCoverageUsd: number;
|
|
338
|
+
validUntil: number;
|
|
339
|
+
jurisdiction: string;
|
|
340
|
+
}
|
|
341
|
+
declare const KYA_MANDATE_TYPES: {
|
|
342
|
+
readonly CorporateMandate: readonly [{
|
|
343
|
+
readonly name: "corporateEntity";
|
|
344
|
+
readonly type: "string";
|
|
345
|
+
}, {
|
|
346
|
+
readonly name: "entityRegistrationNumber";
|
|
347
|
+
readonly type: "string";
|
|
348
|
+
}, {
|
|
349
|
+
readonly name: "agentId";
|
|
350
|
+
readonly type: "string";
|
|
351
|
+
}, {
|
|
352
|
+
readonly name: "agentWallet";
|
|
353
|
+
readonly type: "address";
|
|
354
|
+
}, {
|
|
355
|
+
readonly name: "maxTxLimitUsd";
|
|
356
|
+
readonly type: "uint256";
|
|
357
|
+
}, {
|
|
358
|
+
readonly name: "liabilityCoverageUsd";
|
|
359
|
+
readonly type: "uint256";
|
|
360
|
+
}, {
|
|
361
|
+
readonly name: "validUntil";
|
|
362
|
+
readonly type: "uint256";
|
|
363
|
+
}, {
|
|
364
|
+
readonly name: "jurisdiction";
|
|
365
|
+
readonly type: "string";
|
|
366
|
+
}];
|
|
367
|
+
};
|
|
368
|
+
declare const KYA_DOMAIN: {
|
|
369
|
+
readonly name: "NullClear KYA Registry";
|
|
370
|
+
readonly version: "1";
|
|
371
|
+
readonly chainId: 8453;
|
|
372
|
+
};
|
|
373
|
+
interface ClearingAttestation {
|
|
374
|
+
clearingId: string;
|
|
375
|
+
buyer: `0x${string}`;
|
|
376
|
+
sellerAgentId: string;
|
|
377
|
+
amountAtomic: string;
|
|
378
|
+
feeAtomic: string;
|
|
379
|
+
responseHash: `0x${string}`;
|
|
380
|
+
timestamp: number;
|
|
381
|
+
cleared: boolean;
|
|
382
|
+
}
|
|
383
|
+
declare const ARBITER_ATTESTATION_TYPES: {
|
|
384
|
+
readonly ClearingAttestation: readonly [{
|
|
385
|
+
readonly name: "clearingId";
|
|
386
|
+
readonly type: "string";
|
|
387
|
+
}, {
|
|
388
|
+
readonly name: "buyer";
|
|
389
|
+
readonly type: "address";
|
|
390
|
+
}, {
|
|
391
|
+
readonly name: "sellerAgentId";
|
|
392
|
+
readonly type: "string";
|
|
393
|
+
}, {
|
|
394
|
+
readonly name: "amountAtomic";
|
|
395
|
+
readonly type: "uint256";
|
|
396
|
+
}, {
|
|
397
|
+
readonly name: "feeAtomic";
|
|
398
|
+
readonly type: "uint256";
|
|
399
|
+
}, {
|
|
400
|
+
readonly name: "responseHash";
|
|
401
|
+
readonly type: "bytes32";
|
|
402
|
+
}, {
|
|
403
|
+
readonly name: "timestamp";
|
|
404
|
+
readonly type: "uint256";
|
|
405
|
+
}, {
|
|
406
|
+
readonly name: "cleared";
|
|
407
|
+
readonly type: "bool";
|
|
408
|
+
}];
|
|
409
|
+
};
|
|
410
|
+
declare const ARBITER_DOMAIN: {
|
|
411
|
+
readonly name: "NullClear Arbiter";
|
|
412
|
+
readonly version: "1";
|
|
413
|
+
readonly chainId: 8453;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Deterministic Value Invariant Rule for deep field-level verification
|
|
418
|
+
*/
|
|
419
|
+
declare const InvariantRuleSchema: z.ZodObject<{
|
|
420
|
+
path: z.ZodString;
|
|
421
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
422
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
423
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
424
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
425
|
+
eq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
426
|
+
neq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
427
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
428
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
429
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
430
|
+
notContains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
431
|
+
maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
|
|
432
|
+
}, "strip", z.ZodTypeAny, {
|
|
433
|
+
path: string;
|
|
434
|
+
gt?: number | undefined;
|
|
435
|
+
gte?: number | undefined;
|
|
436
|
+
lt?: number | undefined;
|
|
437
|
+
lte?: number | undefined;
|
|
438
|
+
eq?: string | number | boolean | undefined;
|
|
439
|
+
neq?: string | number | boolean | undefined;
|
|
440
|
+
minLength?: number | undefined;
|
|
441
|
+
maxLength?: number | undefined;
|
|
442
|
+
pattern?: string | undefined;
|
|
443
|
+
notContains?: string[] | undefined;
|
|
444
|
+
maxStalenessSeconds?: number | undefined;
|
|
445
|
+
}, {
|
|
446
|
+
path: string;
|
|
447
|
+
gt?: number | undefined;
|
|
448
|
+
gte?: number | undefined;
|
|
449
|
+
lt?: number | undefined;
|
|
450
|
+
lte?: number | undefined;
|
|
451
|
+
eq?: string | number | boolean | undefined;
|
|
452
|
+
neq?: string | number | boolean | undefined;
|
|
453
|
+
minLength?: number | undefined;
|
|
454
|
+
maxLength?: number | undefined;
|
|
455
|
+
pattern?: string | undefined;
|
|
456
|
+
notContains?: string[] | undefined;
|
|
457
|
+
maxStalenessSeconds?: number | undefined;
|
|
458
|
+
}>;
|
|
459
|
+
type InvariantRule = z.infer<typeof InvariantRuleSchema>;
|
|
460
|
+
/**
|
|
461
|
+
* Validation Configuration contract
|
|
462
|
+
*/
|
|
463
|
+
declare const ValidationConfigSchema: z.ZodObject<{
|
|
464
|
+
expectedStatus: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
465
|
+
jsonSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
466
|
+
requiredFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
467
|
+
sha256Match: z.ZodOptional<z.ZodString>;
|
|
468
|
+
rejectRefusals: z.ZodOptional<z.ZodBoolean>;
|
|
469
|
+
invariants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
470
|
+
path: z.ZodString;
|
|
471
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
472
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
473
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
474
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
475
|
+
eq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
476
|
+
neq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
477
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
478
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
480
|
+
notContains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
481
|
+
maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
|
|
482
|
+
}, "strip", z.ZodTypeAny, {
|
|
483
|
+
path: string;
|
|
484
|
+
gt?: number | undefined;
|
|
485
|
+
gte?: number | undefined;
|
|
486
|
+
lt?: number | undefined;
|
|
487
|
+
lte?: number | undefined;
|
|
488
|
+
eq?: string | number | boolean | undefined;
|
|
489
|
+
neq?: string | number | boolean | undefined;
|
|
490
|
+
minLength?: number | undefined;
|
|
491
|
+
maxLength?: number | undefined;
|
|
492
|
+
pattern?: string | undefined;
|
|
493
|
+
notContains?: string[] | undefined;
|
|
494
|
+
maxStalenessSeconds?: number | undefined;
|
|
495
|
+
}, {
|
|
496
|
+
path: string;
|
|
497
|
+
gt?: number | undefined;
|
|
498
|
+
gte?: number | undefined;
|
|
499
|
+
lt?: number | undefined;
|
|
500
|
+
lte?: number | undefined;
|
|
501
|
+
eq?: string | number | boolean | undefined;
|
|
502
|
+
neq?: string | number | boolean | undefined;
|
|
503
|
+
minLength?: number | undefined;
|
|
504
|
+
maxLength?: number | undefined;
|
|
505
|
+
pattern?: string | undefined;
|
|
506
|
+
notContains?: string[] | undefined;
|
|
507
|
+
maxStalenessSeconds?: number | undefined;
|
|
508
|
+
}>, "many">>;
|
|
509
|
+
}, "strip", z.ZodTypeAny, {
|
|
510
|
+
expectedStatus?: number[] | undefined;
|
|
511
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
|
512
|
+
requiredFields?: string[] | undefined;
|
|
513
|
+
sha256Match?: string | undefined;
|
|
514
|
+
rejectRefusals?: boolean | undefined;
|
|
515
|
+
invariants?: {
|
|
516
|
+
path: string;
|
|
517
|
+
gt?: number | undefined;
|
|
518
|
+
gte?: number | undefined;
|
|
519
|
+
lt?: number | undefined;
|
|
520
|
+
lte?: number | undefined;
|
|
521
|
+
eq?: string | number | boolean | undefined;
|
|
522
|
+
neq?: string | number | boolean | undefined;
|
|
523
|
+
minLength?: number | undefined;
|
|
524
|
+
maxLength?: number | undefined;
|
|
525
|
+
pattern?: string | undefined;
|
|
526
|
+
notContains?: string[] | undefined;
|
|
527
|
+
maxStalenessSeconds?: number | undefined;
|
|
528
|
+
}[] | undefined;
|
|
529
|
+
}, {
|
|
530
|
+
expectedStatus?: number[] | undefined;
|
|
531
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
|
532
|
+
requiredFields?: string[] | undefined;
|
|
533
|
+
sha256Match?: string | undefined;
|
|
534
|
+
rejectRefusals?: boolean | undefined;
|
|
535
|
+
invariants?: {
|
|
536
|
+
path: string;
|
|
537
|
+
gt?: number | undefined;
|
|
538
|
+
gte?: number | undefined;
|
|
539
|
+
lt?: number | undefined;
|
|
540
|
+
lte?: number | undefined;
|
|
541
|
+
eq?: string | number | boolean | undefined;
|
|
542
|
+
neq?: string | number | boolean | undefined;
|
|
543
|
+
minLength?: number | undefined;
|
|
544
|
+
maxLength?: number | undefined;
|
|
545
|
+
pattern?: string | undefined;
|
|
546
|
+
notContains?: string[] | undefined;
|
|
547
|
+
maxStalenessSeconds?: number | undefined;
|
|
548
|
+
}[] | undefined;
|
|
549
|
+
}>;
|
|
550
|
+
type ValidationConfig = z.infer<typeof ValidationConfigSchema>;
|
|
551
|
+
/**
|
|
552
|
+
* Fallback Candidate Target for autonomous multi-seller failover
|
|
553
|
+
*/
|
|
554
|
+
declare const FallbackTargetSchema: z.ZodObject<{
|
|
555
|
+
targetUrl: z.ZodString;
|
|
556
|
+
sellerAgentId: z.ZodOptional<z.ZodString>;
|
|
557
|
+
paymentSignatureHeader: z.ZodString;
|
|
558
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
559
|
+
}, "strip", z.ZodTypeAny, {
|
|
560
|
+
targetUrl: string;
|
|
561
|
+
paymentSignatureHeader: string;
|
|
562
|
+
sellerAgentId?: string | undefined;
|
|
563
|
+
headers?: Record<string, string> | undefined;
|
|
564
|
+
}, {
|
|
565
|
+
targetUrl: string;
|
|
566
|
+
paymentSignatureHeader: string;
|
|
567
|
+
sellerAgentId?: string | undefined;
|
|
568
|
+
headers?: Record<string, string> | undefined;
|
|
569
|
+
}>;
|
|
570
|
+
type FallbackTarget = z.infer<typeof FallbackTargetSchema>;
|
|
571
|
+
/**
|
|
572
|
+
* Outbound Spend Policy Firewall
|
|
573
|
+
*/
|
|
574
|
+
declare const SpendPolicySchema: z.ZodObject<{
|
|
575
|
+
maxPerCallAtomic: z.ZodOptional<z.ZodString>;
|
|
576
|
+
maxDailyWalletAtomic: z.ZodOptional<z.ZodString>;
|
|
577
|
+
}, "strip", z.ZodTypeAny, {
|
|
578
|
+
maxPerCallAtomic?: string | undefined;
|
|
579
|
+
maxDailyWalletAtomic?: string | undefined;
|
|
580
|
+
}, {
|
|
581
|
+
maxPerCallAtomic?: string | undefined;
|
|
582
|
+
maxDailyWalletAtomic?: string | undefined;
|
|
583
|
+
}>;
|
|
584
|
+
type SpendPolicy = z.infer<typeof SpendPolicySchema>;
|
|
585
|
+
/**
|
|
586
|
+
* Full POST /v1/clear Request Schema
|
|
587
|
+
*/
|
|
588
|
+
declare const ClearRequestSchema: z.ZodObject<{
|
|
589
|
+
targetUrl: z.ZodString;
|
|
590
|
+
method: z.ZodDefault<z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "DELETE"]>>>;
|
|
591
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
592
|
+
body: z.ZodOptional<z.ZodUnknown>;
|
|
593
|
+
paymentSignatureHeader: z.ZodString;
|
|
594
|
+
sellerAgentId: z.ZodOptional<z.ZodString>;
|
|
595
|
+
minTrustScore: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
596
|
+
twoPhaseRelease: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
597
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
598
|
+
expectedStatus: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
599
|
+
jsonSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
600
|
+
requiredFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
601
|
+
sha256Match: z.ZodOptional<z.ZodString>;
|
|
602
|
+
rejectRefusals: z.ZodOptional<z.ZodBoolean>;
|
|
603
|
+
invariants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
604
|
+
path: z.ZodString;
|
|
605
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
606
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
607
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
608
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
609
|
+
eq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
610
|
+
neq: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
611
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
612
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
613
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
614
|
+
notContains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
615
|
+
maxStalenessSeconds: z.ZodOptional<z.ZodNumber>;
|
|
616
|
+
}, "strip", z.ZodTypeAny, {
|
|
617
|
+
path: string;
|
|
618
|
+
gt?: number | undefined;
|
|
619
|
+
gte?: number | undefined;
|
|
620
|
+
lt?: number | undefined;
|
|
621
|
+
lte?: number | undefined;
|
|
622
|
+
eq?: string | number | boolean | undefined;
|
|
623
|
+
neq?: string | number | boolean | undefined;
|
|
624
|
+
minLength?: number | undefined;
|
|
625
|
+
maxLength?: number | undefined;
|
|
626
|
+
pattern?: string | undefined;
|
|
627
|
+
notContains?: string[] | undefined;
|
|
628
|
+
maxStalenessSeconds?: number | undefined;
|
|
629
|
+
}, {
|
|
630
|
+
path: string;
|
|
631
|
+
gt?: number | undefined;
|
|
632
|
+
gte?: number | undefined;
|
|
633
|
+
lt?: number | undefined;
|
|
634
|
+
lte?: number | undefined;
|
|
635
|
+
eq?: string | number | boolean | undefined;
|
|
636
|
+
neq?: string | number | boolean | undefined;
|
|
637
|
+
minLength?: number | undefined;
|
|
638
|
+
maxLength?: number | undefined;
|
|
639
|
+
pattern?: string | undefined;
|
|
640
|
+
notContains?: string[] | undefined;
|
|
641
|
+
maxStalenessSeconds?: number | undefined;
|
|
642
|
+
}>, "many">>;
|
|
643
|
+
}, "strip", z.ZodTypeAny, {
|
|
644
|
+
expectedStatus?: number[] | undefined;
|
|
645
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
|
646
|
+
requiredFields?: string[] | undefined;
|
|
647
|
+
sha256Match?: string | undefined;
|
|
648
|
+
rejectRefusals?: boolean | undefined;
|
|
649
|
+
invariants?: {
|
|
650
|
+
path: string;
|
|
651
|
+
gt?: number | undefined;
|
|
652
|
+
gte?: number | undefined;
|
|
653
|
+
lt?: number | undefined;
|
|
654
|
+
lte?: number | undefined;
|
|
655
|
+
eq?: string | number | boolean | undefined;
|
|
656
|
+
neq?: string | number | boolean | undefined;
|
|
657
|
+
minLength?: number | undefined;
|
|
658
|
+
maxLength?: number | undefined;
|
|
659
|
+
pattern?: string | undefined;
|
|
660
|
+
notContains?: string[] | undefined;
|
|
661
|
+
maxStalenessSeconds?: number | undefined;
|
|
662
|
+
}[] | undefined;
|
|
663
|
+
}, {
|
|
664
|
+
expectedStatus?: number[] | undefined;
|
|
665
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
|
666
|
+
requiredFields?: string[] | undefined;
|
|
667
|
+
sha256Match?: string | undefined;
|
|
668
|
+
rejectRefusals?: boolean | undefined;
|
|
669
|
+
invariants?: {
|
|
670
|
+
path: string;
|
|
671
|
+
gt?: number | undefined;
|
|
672
|
+
gte?: number | undefined;
|
|
673
|
+
lt?: number | undefined;
|
|
674
|
+
lte?: number | undefined;
|
|
675
|
+
eq?: string | number | boolean | undefined;
|
|
676
|
+
neq?: string | number | boolean | undefined;
|
|
677
|
+
minLength?: number | undefined;
|
|
678
|
+
maxLength?: number | undefined;
|
|
679
|
+
pattern?: string | undefined;
|
|
680
|
+
notContains?: string[] | undefined;
|
|
681
|
+
maxStalenessSeconds?: number | undefined;
|
|
682
|
+
}[] | undefined;
|
|
683
|
+
}>>;
|
|
684
|
+
fallbacks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
685
|
+
targetUrl: z.ZodString;
|
|
686
|
+
sellerAgentId: z.ZodOptional<z.ZodString>;
|
|
687
|
+
paymentSignatureHeader: z.ZodString;
|
|
688
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
689
|
+
}, "strip", z.ZodTypeAny, {
|
|
690
|
+
targetUrl: string;
|
|
691
|
+
paymentSignatureHeader: string;
|
|
692
|
+
sellerAgentId?: string | undefined;
|
|
693
|
+
headers?: Record<string, string> | undefined;
|
|
694
|
+
}, {
|
|
695
|
+
targetUrl: string;
|
|
696
|
+
paymentSignatureHeader: string;
|
|
697
|
+
sellerAgentId?: string | undefined;
|
|
698
|
+
headers?: Record<string, string> | undefined;
|
|
699
|
+
}>, "many">>;
|
|
700
|
+
spendPolicy: z.ZodOptional<z.ZodObject<{
|
|
701
|
+
maxPerCallAtomic: z.ZodOptional<z.ZodString>;
|
|
702
|
+
maxDailyWalletAtomic: z.ZodOptional<z.ZodString>;
|
|
703
|
+
}, "strip", z.ZodTypeAny, {
|
|
704
|
+
maxPerCallAtomic?: string | undefined;
|
|
705
|
+
maxDailyWalletAtomic?: string | undefined;
|
|
706
|
+
}, {
|
|
707
|
+
maxPerCallAtomic?: string | undefined;
|
|
708
|
+
maxDailyWalletAtomic?: string | undefined;
|
|
709
|
+
}>>;
|
|
710
|
+
}, "strip", z.ZodTypeAny, {
|
|
711
|
+
targetUrl: string;
|
|
712
|
+
paymentSignatureHeader: string;
|
|
713
|
+
method: "GET" | "POST" | "PUT" | "DELETE";
|
|
714
|
+
minTrustScore: number;
|
|
715
|
+
twoPhaseRelease: boolean;
|
|
716
|
+
sellerAgentId?: string | undefined;
|
|
717
|
+
validation?: {
|
|
718
|
+
expectedStatus?: number[] | undefined;
|
|
719
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
|
720
|
+
requiredFields?: string[] | undefined;
|
|
721
|
+
sha256Match?: string | undefined;
|
|
722
|
+
rejectRefusals?: boolean | undefined;
|
|
723
|
+
invariants?: {
|
|
724
|
+
path: string;
|
|
725
|
+
gt?: number | undefined;
|
|
726
|
+
gte?: number | undefined;
|
|
727
|
+
lt?: number | undefined;
|
|
728
|
+
lte?: number | undefined;
|
|
729
|
+
eq?: string | number | boolean | undefined;
|
|
730
|
+
neq?: string | number | boolean | undefined;
|
|
731
|
+
minLength?: number | undefined;
|
|
732
|
+
maxLength?: number | undefined;
|
|
733
|
+
pattern?: string | undefined;
|
|
734
|
+
notContains?: string[] | undefined;
|
|
735
|
+
maxStalenessSeconds?: number | undefined;
|
|
736
|
+
}[] | undefined;
|
|
737
|
+
} | undefined;
|
|
738
|
+
headers?: Record<string, string> | undefined;
|
|
739
|
+
body?: unknown;
|
|
740
|
+
fallbacks?: {
|
|
741
|
+
targetUrl: string;
|
|
742
|
+
paymentSignatureHeader: string;
|
|
743
|
+
sellerAgentId?: string | undefined;
|
|
744
|
+
headers?: Record<string, string> | undefined;
|
|
745
|
+
}[] | undefined;
|
|
746
|
+
spendPolicy?: {
|
|
747
|
+
maxPerCallAtomic?: string | undefined;
|
|
748
|
+
maxDailyWalletAtomic?: string | undefined;
|
|
749
|
+
} | undefined;
|
|
750
|
+
}, {
|
|
751
|
+
targetUrl: string;
|
|
752
|
+
paymentSignatureHeader: string;
|
|
753
|
+
sellerAgentId?: string | undefined;
|
|
754
|
+
validation?: {
|
|
755
|
+
expectedStatus?: number[] | undefined;
|
|
756
|
+
jsonSchema?: Record<string, unknown> | undefined;
|
|
757
|
+
requiredFields?: string[] | undefined;
|
|
758
|
+
sha256Match?: string | undefined;
|
|
759
|
+
rejectRefusals?: boolean | undefined;
|
|
760
|
+
invariants?: {
|
|
761
|
+
path: string;
|
|
762
|
+
gt?: number | undefined;
|
|
763
|
+
gte?: number | undefined;
|
|
764
|
+
lt?: number | undefined;
|
|
765
|
+
lte?: number | undefined;
|
|
766
|
+
eq?: string | number | boolean | undefined;
|
|
767
|
+
neq?: string | number | boolean | undefined;
|
|
768
|
+
minLength?: number | undefined;
|
|
769
|
+
maxLength?: number | undefined;
|
|
770
|
+
pattern?: string | undefined;
|
|
771
|
+
notContains?: string[] | undefined;
|
|
772
|
+
maxStalenessSeconds?: number | undefined;
|
|
773
|
+
}[] | undefined;
|
|
774
|
+
} | undefined;
|
|
775
|
+
headers?: Record<string, string> | undefined;
|
|
776
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | undefined;
|
|
777
|
+
body?: unknown;
|
|
778
|
+
minTrustScore?: number | undefined;
|
|
779
|
+
twoPhaseRelease?: boolean | undefined;
|
|
780
|
+
fallbacks?: {
|
|
781
|
+
targetUrl: string;
|
|
782
|
+
paymentSignatureHeader: string;
|
|
783
|
+
sellerAgentId?: string | undefined;
|
|
784
|
+
headers?: Record<string, string> | undefined;
|
|
785
|
+
}[] | undefined;
|
|
786
|
+
spendPolicy?: {
|
|
787
|
+
maxPerCallAtomic?: string | undefined;
|
|
788
|
+
maxDailyWalletAtomic?: string | undefined;
|
|
789
|
+
} | undefined;
|
|
790
|
+
}>;
|
|
791
|
+
type ClearRequestPayload = z.infer<typeof ClearRequestSchema>;
|
|
792
|
+
|
|
793
|
+
export { ARBITER_ATTESTATION_TYPES, ARBITER_DOMAIN, BASE_MAINNET, BASE_SEPOLIA, CAIP2_TO_CHAIN_ID, type ChainConfig, type ClearRequestPayload, ClearRequestSchema, type ClearingAttestation, type EIP3009Authorization, EIP3009_ABI, EIP3009_TYPES, ERC8004_IDENTITY_ABI, ERC8004_REPUTATION_ABI, type FallbackTarget, FallbackTargetSchema, type InvariantRule, InvariantRuleSchema, type KYAMandate, KYA_DOMAIN, KYA_MANDATE_TYPES, NULLCLEAR_ARBITER_ADDRESS, NULLCLEAR_TREASURY_ADDRESS, SUPPORTED_CHAINS, type SpendPolicy, SpendPolicySchema, type ValidationConfig, ValidationConfigSchema, type X402PaymentOption, type X402PaymentRequired, type X402PaymentResponse, type X402PaymentSignaturePayload, decodeBase64Json, encodeBase64Json, getChainConfig };
|