opentool 0.6.4 → 0.7.0

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.
@@ -1,1693 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const PAYMENT_SCHEMA_VERSION: 1;
4
- declare const paymentSchemaVersionSchema: z.ZodLiteral<1>;
5
- type PaymentSchemaVersion = z.infer<typeof paymentSchemaVersionSchema>;
6
- declare const decimalStringSchema: z.ZodString;
7
- declare const currencySchema: z.ZodObject<{
8
- code: z.ZodEffects<z.ZodString, string, string>;
9
- symbol: z.ZodOptional<z.ZodString>;
10
- decimals: z.ZodOptional<z.ZodNumber>;
11
- kind: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fiat", "crypto"]>>>;
12
- description: z.ZodOptional<z.ZodString>;
13
- }, "strip", z.ZodTypeAny, {
14
- code: string;
15
- symbol?: string | undefined;
16
- decimals?: number | undefined;
17
- kind?: "fiat" | "crypto" | undefined;
18
- description?: string | undefined;
19
- }, {
20
- code: string;
21
- symbol?: string | undefined;
22
- decimals?: number | undefined;
23
- kind?: "fiat" | "crypto" | undefined;
24
- description?: string | undefined;
25
- }>;
26
- type Currency = z.infer<typeof currencySchema>;
27
- declare const paymentAmountSchema: z.ZodObject<{
28
- value: z.ZodString;
29
- currency: z.ZodObject<{
30
- code: z.ZodEffects<z.ZodString, string, string>;
31
- symbol: z.ZodOptional<z.ZodString>;
32
- decimals: z.ZodOptional<z.ZodNumber>;
33
- kind: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fiat", "crypto"]>>>;
34
- description: z.ZodOptional<z.ZodString>;
35
- }, "strip", z.ZodTypeAny, {
36
- code: string;
37
- symbol?: string | undefined;
38
- decimals?: number | undefined;
39
- kind?: "fiat" | "crypto" | undefined;
40
- description?: string | undefined;
41
- }, {
42
- code: string;
43
- symbol?: string | undefined;
44
- decimals?: number | undefined;
45
- kind?: "fiat" | "crypto" | undefined;
46
- description?: string | undefined;
47
- }>;
48
- display: z.ZodOptional<z.ZodString>;
49
- }, "strip", z.ZodTypeAny, {
50
- value: string;
51
- currency: {
52
- code: string;
53
- symbol?: string | undefined;
54
- decimals?: number | undefined;
55
- kind?: "fiat" | "crypto" | undefined;
56
- description?: string | undefined;
57
- };
58
- display?: string | undefined;
59
- }, {
60
- value: string;
61
- currency: {
62
- code: string;
63
- symbol?: string | undefined;
64
- decimals?: number | undefined;
65
- kind?: "fiat" | "crypto" | undefined;
66
- description?: string | undefined;
67
- };
68
- display?: string | undefined;
69
- }>;
70
- type PaymentAmount = z.infer<typeof paymentAmountSchema>;
71
- declare const cryptoAssetSchema: z.ZodObject<{
72
- symbol: z.ZodString;
73
- network: z.ZodOptional<z.ZodString>;
74
- chainId: z.ZodOptional<z.ZodNumber>;
75
- address: z.ZodOptional<z.ZodString>;
76
- decimals: z.ZodOptional<z.ZodNumber>;
77
- standard: z.ZodOptional<z.ZodDefault<z.ZodEnum<["erc20", "spl", "custom"]>>>;
78
- description: z.ZodOptional<z.ZodString>;
79
- }, "strip", z.ZodTypeAny, {
80
- symbol: string;
81
- decimals?: number | undefined;
82
- description?: string | undefined;
83
- network?: string | undefined;
84
- chainId?: number | undefined;
85
- address?: string | undefined;
86
- standard?: "custom" | "erc20" | "spl" | undefined;
87
- }, {
88
- symbol: string;
89
- decimals?: number | undefined;
90
- description?: string | undefined;
91
- network?: string | undefined;
92
- chainId?: number | undefined;
93
- address?: string | undefined;
94
- standard?: "custom" | "erc20" | "spl" | undefined;
95
- }>;
96
- type CryptoAsset = z.infer<typeof cryptoAssetSchema>;
97
- declare const facilitatorConfigSchema: z.ZodObject<{
98
- url: z.ZodString;
99
- vendor: z.ZodOptional<z.ZodString>;
100
- verifyPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
101
- settlePath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
102
- apiKey: z.ZodOptional<z.ZodString>;
103
- apiKeyEnv: z.ZodOptional<z.ZodString>;
104
- apiKeyHeader: z.ZodOptional<z.ZodDefault<z.ZodString>>;
105
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
106
- timeoutMs: z.ZodOptional<z.ZodNumber>;
107
- }, "strip", z.ZodTypeAny, {
108
- url: string;
109
- vendor?: string | undefined;
110
- verifyPath?: string | undefined;
111
- settlePath?: string | undefined;
112
- apiKey?: string | undefined;
113
- apiKeyEnv?: string | undefined;
114
- apiKeyHeader?: string | undefined;
115
- headers?: Record<string, string> | undefined;
116
- timeoutMs?: number | undefined;
117
- }, {
118
- url: string;
119
- vendor?: string | undefined;
120
- verifyPath?: string | undefined;
121
- settlePath?: string | undefined;
122
- apiKey?: string | undefined;
123
- apiKeyEnv?: string | undefined;
124
- apiKeyHeader?: string | undefined;
125
- headers?: Record<string, string> | undefined;
126
- timeoutMs?: number | undefined;
127
- }>;
128
- type FacilitatorConfig = z.infer<typeof facilitatorConfigSchema>;
129
- declare const settlementTermsSchema: z.ZodObject<{
130
- windowSeconds: z.ZodOptional<z.ZodNumber>;
131
- targetConfirmations: z.ZodOptional<z.ZodNumber>;
132
- finalityDescription: z.ZodOptional<z.ZodString>;
133
- slaDescription: z.ZodOptional<z.ZodString>;
134
- }, "strip", z.ZodTypeAny, {
135
- windowSeconds?: number | undefined;
136
- targetConfirmations?: number | undefined;
137
- finalityDescription?: string | undefined;
138
- slaDescription?: string | undefined;
139
- }, {
140
- windowSeconds?: number | undefined;
141
- targetConfirmations?: number | undefined;
142
- finalityDescription?: string | undefined;
143
- slaDescription?: string | undefined;
144
- }>;
145
- type SettlementTerms = z.infer<typeof settlementTermsSchema>;
146
- declare const paymentFieldSchema: z.ZodObject<{
147
- key: z.ZodString;
148
- label: z.ZodString;
149
- required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
150
- description: z.ZodOptional<z.ZodString>;
151
- example: z.ZodOptional<z.ZodString>;
152
- }, "strip", z.ZodTypeAny, {
153
- key: string;
154
- label: string;
155
- description?: string | undefined;
156
- required?: boolean | undefined;
157
- example?: string | undefined;
158
- }, {
159
- key: string;
160
- label: string;
161
- description?: string | undefined;
162
- required?: boolean | undefined;
163
- example?: string | undefined;
164
- }>;
165
- type PaymentField = z.infer<typeof paymentFieldSchema>;
166
- declare const x402ProofSchema: z.ZodObject<{
167
- mode: z.ZodLiteral<"x402">;
168
- scheme: z.ZodString;
169
- network: z.ZodString;
170
- version: z.ZodOptional<z.ZodNumber>;
171
- facilitator: z.ZodOptional<z.ZodObject<{
172
- url: z.ZodString;
173
- vendor: z.ZodOptional<z.ZodString>;
174
- verifyPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
175
- settlePath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
176
- apiKey: z.ZodOptional<z.ZodString>;
177
- apiKeyEnv: z.ZodOptional<z.ZodString>;
178
- apiKeyHeader: z.ZodOptional<z.ZodDefault<z.ZodString>>;
179
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
180
- timeoutMs: z.ZodOptional<z.ZodNumber>;
181
- }, "strip", z.ZodTypeAny, {
182
- url: string;
183
- vendor?: string | undefined;
184
- verifyPath?: string | undefined;
185
- settlePath?: string | undefined;
186
- apiKey?: string | undefined;
187
- apiKeyEnv?: string | undefined;
188
- apiKeyHeader?: string | undefined;
189
- headers?: Record<string, string> | undefined;
190
- timeoutMs?: number | undefined;
191
- }, {
192
- url: string;
193
- vendor?: string | undefined;
194
- verifyPath?: string | undefined;
195
- settlePath?: string | undefined;
196
- apiKey?: string | undefined;
197
- apiKeyEnv?: string | undefined;
198
- apiKeyHeader?: string | undefined;
199
- headers?: Record<string, string> | undefined;
200
- timeoutMs?: number | undefined;
201
- }>>;
202
- verifier: z.ZodOptional<z.ZodString>;
203
- }, "strip", z.ZodTypeAny, {
204
- network: string;
205
- mode: "x402";
206
- scheme: string;
207
- version?: number | undefined;
208
- facilitator?: {
209
- url: string;
210
- vendor?: string | undefined;
211
- verifyPath?: string | undefined;
212
- settlePath?: string | undefined;
213
- apiKey?: string | undefined;
214
- apiKeyEnv?: string | undefined;
215
- apiKeyHeader?: string | undefined;
216
- headers?: Record<string, string> | undefined;
217
- timeoutMs?: number | undefined;
218
- } | undefined;
219
- verifier?: string | undefined;
220
- }, {
221
- network: string;
222
- mode: "x402";
223
- scheme: string;
224
- version?: number | undefined;
225
- facilitator?: {
226
- url: string;
227
- vendor?: string | undefined;
228
- verifyPath?: string | undefined;
229
- settlePath?: string | undefined;
230
- apiKey?: string | undefined;
231
- apiKeyEnv?: string | undefined;
232
- apiKeyHeader?: string | undefined;
233
- headers?: Record<string, string> | undefined;
234
- timeoutMs?: number | undefined;
235
- } | undefined;
236
- verifier?: string | undefined;
237
- }>;
238
- type X402ProofConfig = z.infer<typeof x402ProofSchema>;
239
- declare const directProofSchema: z.ZodObject<{
240
- mode: z.ZodLiteral<"direct">;
241
- proofTypes: z.ZodArray<z.ZodString, "atleastone">;
242
- verifier: z.ZodOptional<z.ZodString>;
243
- instructions: z.ZodOptional<z.ZodString>;
244
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
245
- key: z.ZodString;
246
- label: z.ZodString;
247
- required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
248
- description: z.ZodOptional<z.ZodString>;
249
- example: z.ZodOptional<z.ZodString>;
250
- }, "strip", z.ZodTypeAny, {
251
- key: string;
252
- label: string;
253
- description?: string | undefined;
254
- required?: boolean | undefined;
255
- example?: string | undefined;
256
- }, {
257
- key: string;
258
- label: string;
259
- description?: string | undefined;
260
- required?: boolean | undefined;
261
- example?: string | undefined;
262
- }>, "many">>;
263
- allowsManualReview: z.ZodOptional<z.ZodBoolean>;
264
- }, "strip", z.ZodTypeAny, {
265
- mode: "direct";
266
- proofTypes: [string, ...string[]];
267
- verifier?: string | undefined;
268
- instructions?: string | undefined;
269
- fields?: {
270
- key: string;
271
- label: string;
272
- description?: string | undefined;
273
- required?: boolean | undefined;
274
- example?: string | undefined;
275
- }[] | undefined;
276
- allowsManualReview?: boolean | undefined;
277
- }, {
278
- mode: "direct";
279
- proofTypes: [string, ...string[]];
280
- verifier?: string | undefined;
281
- instructions?: string | undefined;
282
- fields?: {
283
- key: string;
284
- label: string;
285
- description?: string | undefined;
286
- required?: boolean | undefined;
287
- example?: string | undefined;
288
- }[] | undefined;
289
- allowsManualReview?: boolean | undefined;
290
- }>;
291
- type DirectProofConfig = z.infer<typeof directProofSchema>;
292
- declare const paymentProofSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
293
- mode: z.ZodLiteral<"x402">;
294
- scheme: z.ZodString;
295
- network: z.ZodString;
296
- version: z.ZodOptional<z.ZodNumber>;
297
- facilitator: z.ZodOptional<z.ZodObject<{
298
- url: z.ZodString;
299
- vendor: z.ZodOptional<z.ZodString>;
300
- verifyPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
301
- settlePath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
302
- apiKey: z.ZodOptional<z.ZodString>;
303
- apiKeyEnv: z.ZodOptional<z.ZodString>;
304
- apiKeyHeader: z.ZodOptional<z.ZodDefault<z.ZodString>>;
305
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
306
- timeoutMs: z.ZodOptional<z.ZodNumber>;
307
- }, "strip", z.ZodTypeAny, {
308
- url: string;
309
- vendor?: string | undefined;
310
- verifyPath?: string | undefined;
311
- settlePath?: string | undefined;
312
- apiKey?: string | undefined;
313
- apiKeyEnv?: string | undefined;
314
- apiKeyHeader?: string | undefined;
315
- headers?: Record<string, string> | undefined;
316
- timeoutMs?: number | undefined;
317
- }, {
318
- url: string;
319
- vendor?: string | undefined;
320
- verifyPath?: string | undefined;
321
- settlePath?: string | undefined;
322
- apiKey?: string | undefined;
323
- apiKeyEnv?: string | undefined;
324
- apiKeyHeader?: string | undefined;
325
- headers?: Record<string, string> | undefined;
326
- timeoutMs?: number | undefined;
327
- }>>;
328
- verifier: z.ZodOptional<z.ZodString>;
329
- }, "strip", z.ZodTypeAny, {
330
- network: string;
331
- mode: "x402";
332
- scheme: string;
333
- version?: number | undefined;
334
- facilitator?: {
335
- url: string;
336
- vendor?: string | undefined;
337
- verifyPath?: string | undefined;
338
- settlePath?: string | undefined;
339
- apiKey?: string | undefined;
340
- apiKeyEnv?: string | undefined;
341
- apiKeyHeader?: string | undefined;
342
- headers?: Record<string, string> | undefined;
343
- timeoutMs?: number | undefined;
344
- } | undefined;
345
- verifier?: string | undefined;
346
- }, {
347
- network: string;
348
- mode: "x402";
349
- scheme: string;
350
- version?: number | undefined;
351
- facilitator?: {
352
- url: string;
353
- vendor?: string | undefined;
354
- verifyPath?: string | undefined;
355
- settlePath?: string | undefined;
356
- apiKey?: string | undefined;
357
- apiKeyEnv?: string | undefined;
358
- apiKeyHeader?: string | undefined;
359
- headers?: Record<string, string> | undefined;
360
- timeoutMs?: number | undefined;
361
- } | undefined;
362
- verifier?: string | undefined;
363
- }>, z.ZodObject<{
364
- mode: z.ZodLiteral<"direct">;
365
- proofTypes: z.ZodArray<z.ZodString, "atleastone">;
366
- verifier: z.ZodOptional<z.ZodString>;
367
- instructions: z.ZodOptional<z.ZodString>;
368
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
369
- key: z.ZodString;
370
- label: z.ZodString;
371
- required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
372
- description: z.ZodOptional<z.ZodString>;
373
- example: z.ZodOptional<z.ZodString>;
374
- }, "strip", z.ZodTypeAny, {
375
- key: string;
376
- label: string;
377
- description?: string | undefined;
378
- required?: boolean | undefined;
379
- example?: string | undefined;
380
- }, {
381
- key: string;
382
- label: string;
383
- description?: string | undefined;
384
- required?: boolean | undefined;
385
- example?: string | undefined;
386
- }>, "many">>;
387
- allowsManualReview: z.ZodOptional<z.ZodBoolean>;
388
- }, "strip", z.ZodTypeAny, {
389
- mode: "direct";
390
- proofTypes: [string, ...string[]];
391
- verifier?: string | undefined;
392
- instructions?: string | undefined;
393
- fields?: {
394
- key: string;
395
- label: string;
396
- description?: string | undefined;
397
- required?: boolean | undefined;
398
- example?: string | undefined;
399
- }[] | undefined;
400
- allowsManualReview?: boolean | undefined;
401
- }, {
402
- mode: "direct";
403
- proofTypes: [string, ...string[]];
404
- verifier?: string | undefined;
405
- instructions?: string | undefined;
406
- fields?: {
407
- key: string;
408
- label: string;
409
- description?: string | undefined;
410
- required?: boolean | undefined;
411
- example?: string | undefined;
412
- }[] | undefined;
413
- allowsManualReview?: boolean | undefined;
414
- }>]>;
415
- type PaymentProofConfig = z.infer<typeof paymentProofSchema>;
416
- declare const paymentOptionSchema: z.ZodObject<{
417
- id: z.ZodString;
418
- title: z.ZodString;
419
- description: z.ZodOptional<z.ZodString>;
420
- amount: z.ZodObject<{
421
- value: z.ZodString;
422
- currency: z.ZodObject<{
423
- code: z.ZodEffects<z.ZodString, string, string>;
424
- symbol: z.ZodOptional<z.ZodString>;
425
- decimals: z.ZodOptional<z.ZodNumber>;
426
- kind: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fiat", "crypto"]>>>;
427
- description: z.ZodOptional<z.ZodString>;
428
- }, "strip", z.ZodTypeAny, {
429
- code: string;
430
- symbol?: string | undefined;
431
- decimals?: number | undefined;
432
- kind?: "fiat" | "crypto" | undefined;
433
- description?: string | undefined;
434
- }, {
435
- code: string;
436
- symbol?: string | undefined;
437
- decimals?: number | undefined;
438
- kind?: "fiat" | "crypto" | undefined;
439
- description?: string | undefined;
440
- }>;
441
- display: z.ZodOptional<z.ZodString>;
442
- }, "strip", z.ZodTypeAny, {
443
- value: string;
444
- currency: {
445
- code: string;
446
- symbol?: string | undefined;
447
- decimals?: number | undefined;
448
- kind?: "fiat" | "crypto" | undefined;
449
- description?: string | undefined;
450
- };
451
- display?: string | undefined;
452
- }, {
453
- value: string;
454
- currency: {
455
- code: string;
456
- symbol?: string | undefined;
457
- decimals?: number | undefined;
458
- kind?: "fiat" | "crypto" | undefined;
459
- description?: string | undefined;
460
- };
461
- display?: string | undefined;
462
- }>;
463
- asset: z.ZodObject<{
464
- symbol: z.ZodString;
465
- network: z.ZodOptional<z.ZodString>;
466
- chainId: z.ZodOptional<z.ZodNumber>;
467
- address: z.ZodOptional<z.ZodString>;
468
- decimals: z.ZodOptional<z.ZodNumber>;
469
- standard: z.ZodOptional<z.ZodDefault<z.ZodEnum<["erc20", "spl", "custom"]>>>;
470
- description: z.ZodOptional<z.ZodString>;
471
- }, "strip", z.ZodTypeAny, {
472
- symbol: string;
473
- decimals?: number | undefined;
474
- description?: string | undefined;
475
- network?: string | undefined;
476
- chainId?: number | undefined;
477
- address?: string | undefined;
478
- standard?: "custom" | "erc20" | "spl" | undefined;
479
- }, {
480
- symbol: string;
481
- decimals?: number | undefined;
482
- description?: string | undefined;
483
- network?: string | undefined;
484
- chainId?: number | undefined;
485
- address?: string | undefined;
486
- standard?: "custom" | "erc20" | "spl" | undefined;
487
- }>;
488
- payTo: z.ZodString;
489
- resource: z.ZodOptional<z.ZodString>;
490
- proof: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
491
- mode: z.ZodLiteral<"x402">;
492
- scheme: z.ZodString;
493
- network: z.ZodString;
494
- version: z.ZodOptional<z.ZodNumber>;
495
- facilitator: z.ZodOptional<z.ZodObject<{
496
- url: z.ZodString;
497
- vendor: z.ZodOptional<z.ZodString>;
498
- verifyPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
499
- settlePath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
500
- apiKey: z.ZodOptional<z.ZodString>;
501
- apiKeyEnv: z.ZodOptional<z.ZodString>;
502
- apiKeyHeader: z.ZodOptional<z.ZodDefault<z.ZodString>>;
503
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
504
- timeoutMs: z.ZodOptional<z.ZodNumber>;
505
- }, "strip", z.ZodTypeAny, {
506
- url: string;
507
- vendor?: string | undefined;
508
- verifyPath?: string | undefined;
509
- settlePath?: string | undefined;
510
- apiKey?: string | undefined;
511
- apiKeyEnv?: string | undefined;
512
- apiKeyHeader?: string | undefined;
513
- headers?: Record<string, string> | undefined;
514
- timeoutMs?: number | undefined;
515
- }, {
516
- url: string;
517
- vendor?: string | undefined;
518
- verifyPath?: string | undefined;
519
- settlePath?: string | undefined;
520
- apiKey?: string | undefined;
521
- apiKeyEnv?: string | undefined;
522
- apiKeyHeader?: string | undefined;
523
- headers?: Record<string, string> | undefined;
524
- timeoutMs?: number | undefined;
525
- }>>;
526
- verifier: z.ZodOptional<z.ZodString>;
527
- }, "strip", z.ZodTypeAny, {
528
- network: string;
529
- mode: "x402";
530
- scheme: string;
531
- version?: number | undefined;
532
- facilitator?: {
533
- url: string;
534
- vendor?: string | undefined;
535
- verifyPath?: string | undefined;
536
- settlePath?: string | undefined;
537
- apiKey?: string | undefined;
538
- apiKeyEnv?: string | undefined;
539
- apiKeyHeader?: string | undefined;
540
- headers?: Record<string, string> | undefined;
541
- timeoutMs?: number | undefined;
542
- } | undefined;
543
- verifier?: string | undefined;
544
- }, {
545
- network: string;
546
- mode: "x402";
547
- scheme: string;
548
- version?: number | undefined;
549
- facilitator?: {
550
- url: string;
551
- vendor?: string | undefined;
552
- verifyPath?: string | undefined;
553
- settlePath?: string | undefined;
554
- apiKey?: string | undefined;
555
- apiKeyEnv?: string | undefined;
556
- apiKeyHeader?: string | undefined;
557
- headers?: Record<string, string> | undefined;
558
- timeoutMs?: number | undefined;
559
- } | undefined;
560
- verifier?: string | undefined;
561
- }>, z.ZodObject<{
562
- mode: z.ZodLiteral<"direct">;
563
- proofTypes: z.ZodArray<z.ZodString, "atleastone">;
564
- verifier: z.ZodOptional<z.ZodString>;
565
- instructions: z.ZodOptional<z.ZodString>;
566
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
567
- key: z.ZodString;
568
- label: z.ZodString;
569
- required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
570
- description: z.ZodOptional<z.ZodString>;
571
- example: z.ZodOptional<z.ZodString>;
572
- }, "strip", z.ZodTypeAny, {
573
- key: string;
574
- label: string;
575
- description?: string | undefined;
576
- required?: boolean | undefined;
577
- example?: string | undefined;
578
- }, {
579
- key: string;
580
- label: string;
581
- description?: string | undefined;
582
- required?: boolean | undefined;
583
- example?: string | undefined;
584
- }>, "many">>;
585
- allowsManualReview: z.ZodOptional<z.ZodBoolean>;
586
- }, "strip", z.ZodTypeAny, {
587
- mode: "direct";
588
- proofTypes: [string, ...string[]];
589
- verifier?: string | undefined;
590
- instructions?: string | undefined;
591
- fields?: {
592
- key: string;
593
- label: string;
594
- description?: string | undefined;
595
- required?: boolean | undefined;
596
- example?: string | undefined;
597
- }[] | undefined;
598
- allowsManualReview?: boolean | undefined;
599
- }, {
600
- mode: "direct";
601
- proofTypes: [string, ...string[]];
602
- verifier?: string | undefined;
603
- instructions?: string | undefined;
604
- fields?: {
605
- key: string;
606
- label: string;
607
- description?: string | undefined;
608
- required?: boolean | undefined;
609
- example?: string | undefined;
610
- }[] | undefined;
611
- allowsManualReview?: boolean | undefined;
612
- }>]>;
613
- settlement: z.ZodOptional<z.ZodObject<{
614
- windowSeconds: z.ZodOptional<z.ZodNumber>;
615
- targetConfirmations: z.ZodOptional<z.ZodNumber>;
616
- finalityDescription: z.ZodOptional<z.ZodString>;
617
- slaDescription: z.ZodOptional<z.ZodString>;
618
- }, "strip", z.ZodTypeAny, {
619
- windowSeconds?: number | undefined;
620
- targetConfirmations?: number | undefined;
621
- finalityDescription?: string | undefined;
622
- slaDescription?: string | undefined;
623
- }, {
624
- windowSeconds?: number | undefined;
625
- targetConfirmations?: number | undefined;
626
- finalityDescription?: string | undefined;
627
- slaDescription?: string | undefined;
628
- }>>;
629
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
630
- }, "strip", z.ZodTypeAny, {
631
- id: string;
632
- title: string;
633
- amount: {
634
- value: string;
635
- currency: {
636
- code: string;
637
- symbol?: string | undefined;
638
- decimals?: number | undefined;
639
- kind?: "fiat" | "crypto" | undefined;
640
- description?: string | undefined;
641
- };
642
- display?: string | undefined;
643
- };
644
- asset: {
645
- symbol: string;
646
- decimals?: number | undefined;
647
- description?: string | undefined;
648
- network?: string | undefined;
649
- chainId?: number | undefined;
650
- address?: string | undefined;
651
- standard?: "custom" | "erc20" | "spl" | undefined;
652
- };
653
- payTo: string;
654
- proof: {
655
- network: string;
656
- mode: "x402";
657
- scheme: string;
658
- version?: number | undefined;
659
- facilitator?: {
660
- url: string;
661
- vendor?: string | undefined;
662
- verifyPath?: string | undefined;
663
- settlePath?: string | undefined;
664
- apiKey?: string | undefined;
665
- apiKeyEnv?: string | undefined;
666
- apiKeyHeader?: string | undefined;
667
- headers?: Record<string, string> | undefined;
668
- timeoutMs?: number | undefined;
669
- } | undefined;
670
- verifier?: string | undefined;
671
- } | {
672
- mode: "direct";
673
- proofTypes: [string, ...string[]];
674
- verifier?: string | undefined;
675
- instructions?: string | undefined;
676
- fields?: {
677
- key: string;
678
- label: string;
679
- description?: string | undefined;
680
- required?: boolean | undefined;
681
- example?: string | undefined;
682
- }[] | undefined;
683
- allowsManualReview?: boolean | undefined;
684
- };
685
- description?: string | undefined;
686
- resource?: string | undefined;
687
- settlement?: {
688
- windowSeconds?: number | undefined;
689
- targetConfirmations?: number | undefined;
690
- finalityDescription?: string | undefined;
691
- slaDescription?: string | undefined;
692
- } | undefined;
693
- metadata?: Record<string, unknown> | undefined;
694
- }, {
695
- id: string;
696
- title: string;
697
- amount: {
698
- value: string;
699
- currency: {
700
- code: string;
701
- symbol?: string | undefined;
702
- decimals?: number | undefined;
703
- kind?: "fiat" | "crypto" | undefined;
704
- description?: string | undefined;
705
- };
706
- display?: string | undefined;
707
- };
708
- asset: {
709
- symbol: string;
710
- decimals?: number | undefined;
711
- description?: string | undefined;
712
- network?: string | undefined;
713
- chainId?: number | undefined;
714
- address?: string | undefined;
715
- standard?: "custom" | "erc20" | "spl" | undefined;
716
- };
717
- payTo: string;
718
- proof: {
719
- network: string;
720
- mode: "x402";
721
- scheme: string;
722
- version?: number | undefined;
723
- facilitator?: {
724
- url: string;
725
- vendor?: string | undefined;
726
- verifyPath?: string | undefined;
727
- settlePath?: string | undefined;
728
- apiKey?: string | undefined;
729
- apiKeyEnv?: string | undefined;
730
- apiKeyHeader?: string | undefined;
731
- headers?: Record<string, string> | undefined;
732
- timeoutMs?: number | undefined;
733
- } | undefined;
734
- verifier?: string | undefined;
735
- } | {
736
- mode: "direct";
737
- proofTypes: [string, ...string[]];
738
- verifier?: string | undefined;
739
- instructions?: string | undefined;
740
- fields?: {
741
- key: string;
742
- label: string;
743
- description?: string | undefined;
744
- required?: boolean | undefined;
745
- example?: string | undefined;
746
- }[] | undefined;
747
- allowsManualReview?: boolean | undefined;
748
- };
749
- description?: string | undefined;
750
- resource?: string | undefined;
751
- settlement?: {
752
- windowSeconds?: number | undefined;
753
- targetConfirmations?: number | undefined;
754
- finalityDescription?: string | undefined;
755
- slaDescription?: string | undefined;
756
- } | undefined;
757
- metadata?: Record<string, unknown> | undefined;
758
- }>;
759
- type PaymentOption = z.infer<typeof paymentOptionSchema>;
760
- declare const paymentRequirementsSchema: z.ZodObject<{
761
- schemaVersion: z.ZodLiteral<1>;
762
- message: z.ZodOptional<z.ZodString>;
763
- title: z.ZodOptional<z.ZodString>;
764
- resource: z.ZodOptional<z.ZodString>;
765
- accepts: z.ZodArray<z.ZodObject<{
766
- id: z.ZodString;
767
- title: z.ZodString;
768
- description: z.ZodOptional<z.ZodString>;
769
- amount: z.ZodObject<{
770
- value: z.ZodString;
771
- currency: z.ZodObject<{
772
- code: z.ZodEffects<z.ZodString, string, string>;
773
- symbol: z.ZodOptional<z.ZodString>;
774
- decimals: z.ZodOptional<z.ZodNumber>;
775
- kind: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fiat", "crypto"]>>>;
776
- description: z.ZodOptional<z.ZodString>;
777
- }, "strip", z.ZodTypeAny, {
778
- code: string;
779
- symbol?: string | undefined;
780
- decimals?: number | undefined;
781
- kind?: "fiat" | "crypto" | undefined;
782
- description?: string | undefined;
783
- }, {
784
- code: string;
785
- symbol?: string | undefined;
786
- decimals?: number | undefined;
787
- kind?: "fiat" | "crypto" | undefined;
788
- description?: string | undefined;
789
- }>;
790
- display: z.ZodOptional<z.ZodString>;
791
- }, "strip", z.ZodTypeAny, {
792
- value: string;
793
- currency: {
794
- code: string;
795
- symbol?: string | undefined;
796
- decimals?: number | undefined;
797
- kind?: "fiat" | "crypto" | undefined;
798
- description?: string | undefined;
799
- };
800
- display?: string | undefined;
801
- }, {
802
- value: string;
803
- currency: {
804
- code: string;
805
- symbol?: string | undefined;
806
- decimals?: number | undefined;
807
- kind?: "fiat" | "crypto" | undefined;
808
- description?: string | undefined;
809
- };
810
- display?: string | undefined;
811
- }>;
812
- asset: z.ZodObject<{
813
- symbol: z.ZodString;
814
- network: z.ZodOptional<z.ZodString>;
815
- chainId: z.ZodOptional<z.ZodNumber>;
816
- address: z.ZodOptional<z.ZodString>;
817
- decimals: z.ZodOptional<z.ZodNumber>;
818
- standard: z.ZodOptional<z.ZodDefault<z.ZodEnum<["erc20", "spl", "custom"]>>>;
819
- description: z.ZodOptional<z.ZodString>;
820
- }, "strip", z.ZodTypeAny, {
821
- symbol: string;
822
- decimals?: number | undefined;
823
- description?: string | undefined;
824
- network?: string | undefined;
825
- chainId?: number | undefined;
826
- address?: string | undefined;
827
- standard?: "custom" | "erc20" | "spl" | undefined;
828
- }, {
829
- symbol: string;
830
- decimals?: number | undefined;
831
- description?: string | undefined;
832
- network?: string | undefined;
833
- chainId?: number | undefined;
834
- address?: string | undefined;
835
- standard?: "custom" | "erc20" | "spl" | undefined;
836
- }>;
837
- payTo: z.ZodString;
838
- resource: z.ZodOptional<z.ZodString>;
839
- proof: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
840
- mode: z.ZodLiteral<"x402">;
841
- scheme: z.ZodString;
842
- network: z.ZodString;
843
- version: z.ZodOptional<z.ZodNumber>;
844
- facilitator: z.ZodOptional<z.ZodObject<{
845
- url: z.ZodString;
846
- vendor: z.ZodOptional<z.ZodString>;
847
- verifyPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
848
- settlePath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
849
- apiKey: z.ZodOptional<z.ZodString>;
850
- apiKeyEnv: z.ZodOptional<z.ZodString>;
851
- apiKeyHeader: z.ZodOptional<z.ZodDefault<z.ZodString>>;
852
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
853
- timeoutMs: z.ZodOptional<z.ZodNumber>;
854
- }, "strip", z.ZodTypeAny, {
855
- url: string;
856
- vendor?: string | undefined;
857
- verifyPath?: string | undefined;
858
- settlePath?: string | undefined;
859
- apiKey?: string | undefined;
860
- apiKeyEnv?: string | undefined;
861
- apiKeyHeader?: string | undefined;
862
- headers?: Record<string, string> | undefined;
863
- timeoutMs?: number | undefined;
864
- }, {
865
- url: string;
866
- vendor?: string | undefined;
867
- verifyPath?: string | undefined;
868
- settlePath?: string | undefined;
869
- apiKey?: string | undefined;
870
- apiKeyEnv?: string | undefined;
871
- apiKeyHeader?: string | undefined;
872
- headers?: Record<string, string> | undefined;
873
- timeoutMs?: number | undefined;
874
- }>>;
875
- verifier: z.ZodOptional<z.ZodString>;
876
- }, "strip", z.ZodTypeAny, {
877
- network: string;
878
- mode: "x402";
879
- scheme: string;
880
- version?: number | undefined;
881
- facilitator?: {
882
- url: string;
883
- vendor?: string | undefined;
884
- verifyPath?: string | undefined;
885
- settlePath?: string | undefined;
886
- apiKey?: string | undefined;
887
- apiKeyEnv?: string | undefined;
888
- apiKeyHeader?: string | undefined;
889
- headers?: Record<string, string> | undefined;
890
- timeoutMs?: number | undefined;
891
- } | undefined;
892
- verifier?: string | undefined;
893
- }, {
894
- network: string;
895
- mode: "x402";
896
- scheme: string;
897
- version?: number | undefined;
898
- facilitator?: {
899
- url: string;
900
- vendor?: string | undefined;
901
- verifyPath?: string | undefined;
902
- settlePath?: string | undefined;
903
- apiKey?: string | undefined;
904
- apiKeyEnv?: string | undefined;
905
- apiKeyHeader?: string | undefined;
906
- headers?: Record<string, string> | undefined;
907
- timeoutMs?: number | undefined;
908
- } | undefined;
909
- verifier?: string | undefined;
910
- }>, z.ZodObject<{
911
- mode: z.ZodLiteral<"direct">;
912
- proofTypes: z.ZodArray<z.ZodString, "atleastone">;
913
- verifier: z.ZodOptional<z.ZodString>;
914
- instructions: z.ZodOptional<z.ZodString>;
915
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
916
- key: z.ZodString;
917
- label: z.ZodString;
918
- required: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
919
- description: z.ZodOptional<z.ZodString>;
920
- example: z.ZodOptional<z.ZodString>;
921
- }, "strip", z.ZodTypeAny, {
922
- key: string;
923
- label: string;
924
- description?: string | undefined;
925
- required?: boolean | undefined;
926
- example?: string | undefined;
927
- }, {
928
- key: string;
929
- label: string;
930
- description?: string | undefined;
931
- required?: boolean | undefined;
932
- example?: string | undefined;
933
- }>, "many">>;
934
- allowsManualReview: z.ZodOptional<z.ZodBoolean>;
935
- }, "strip", z.ZodTypeAny, {
936
- mode: "direct";
937
- proofTypes: [string, ...string[]];
938
- verifier?: string | undefined;
939
- instructions?: string | undefined;
940
- fields?: {
941
- key: string;
942
- label: string;
943
- description?: string | undefined;
944
- required?: boolean | undefined;
945
- example?: string | undefined;
946
- }[] | undefined;
947
- allowsManualReview?: boolean | undefined;
948
- }, {
949
- mode: "direct";
950
- proofTypes: [string, ...string[]];
951
- verifier?: string | undefined;
952
- instructions?: string | undefined;
953
- fields?: {
954
- key: string;
955
- label: string;
956
- description?: string | undefined;
957
- required?: boolean | undefined;
958
- example?: string | undefined;
959
- }[] | undefined;
960
- allowsManualReview?: boolean | undefined;
961
- }>]>;
962
- settlement: z.ZodOptional<z.ZodObject<{
963
- windowSeconds: z.ZodOptional<z.ZodNumber>;
964
- targetConfirmations: z.ZodOptional<z.ZodNumber>;
965
- finalityDescription: z.ZodOptional<z.ZodString>;
966
- slaDescription: z.ZodOptional<z.ZodString>;
967
- }, "strip", z.ZodTypeAny, {
968
- windowSeconds?: number | undefined;
969
- targetConfirmations?: number | undefined;
970
- finalityDescription?: string | undefined;
971
- slaDescription?: string | undefined;
972
- }, {
973
- windowSeconds?: number | undefined;
974
- targetConfirmations?: number | undefined;
975
- finalityDescription?: string | undefined;
976
- slaDescription?: string | undefined;
977
- }>>;
978
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
979
- }, "strip", z.ZodTypeAny, {
980
- id: string;
981
- title: string;
982
- amount: {
983
- value: string;
984
- currency: {
985
- code: string;
986
- symbol?: string | undefined;
987
- decimals?: number | undefined;
988
- kind?: "fiat" | "crypto" | undefined;
989
- description?: string | undefined;
990
- };
991
- display?: string | undefined;
992
- };
993
- asset: {
994
- symbol: string;
995
- decimals?: number | undefined;
996
- description?: string | undefined;
997
- network?: string | undefined;
998
- chainId?: number | undefined;
999
- address?: string | undefined;
1000
- standard?: "custom" | "erc20" | "spl" | undefined;
1001
- };
1002
- payTo: string;
1003
- proof: {
1004
- network: string;
1005
- mode: "x402";
1006
- scheme: string;
1007
- version?: number | undefined;
1008
- facilitator?: {
1009
- url: string;
1010
- vendor?: string | undefined;
1011
- verifyPath?: string | undefined;
1012
- settlePath?: string | undefined;
1013
- apiKey?: string | undefined;
1014
- apiKeyEnv?: string | undefined;
1015
- apiKeyHeader?: string | undefined;
1016
- headers?: Record<string, string> | undefined;
1017
- timeoutMs?: number | undefined;
1018
- } | undefined;
1019
- verifier?: string | undefined;
1020
- } | {
1021
- mode: "direct";
1022
- proofTypes: [string, ...string[]];
1023
- verifier?: string | undefined;
1024
- instructions?: string | undefined;
1025
- fields?: {
1026
- key: string;
1027
- label: string;
1028
- description?: string | undefined;
1029
- required?: boolean | undefined;
1030
- example?: string | undefined;
1031
- }[] | undefined;
1032
- allowsManualReview?: boolean | undefined;
1033
- };
1034
- description?: string | undefined;
1035
- resource?: string | undefined;
1036
- settlement?: {
1037
- windowSeconds?: number | undefined;
1038
- targetConfirmations?: number | undefined;
1039
- finalityDescription?: string | undefined;
1040
- slaDescription?: string | undefined;
1041
- } | undefined;
1042
- metadata?: Record<string, unknown> | undefined;
1043
- }, {
1044
- id: string;
1045
- title: string;
1046
- amount: {
1047
- value: string;
1048
- currency: {
1049
- code: string;
1050
- symbol?: string | undefined;
1051
- decimals?: number | undefined;
1052
- kind?: "fiat" | "crypto" | undefined;
1053
- description?: string | undefined;
1054
- };
1055
- display?: string | undefined;
1056
- };
1057
- asset: {
1058
- symbol: string;
1059
- decimals?: number | undefined;
1060
- description?: string | undefined;
1061
- network?: string | undefined;
1062
- chainId?: number | undefined;
1063
- address?: string | undefined;
1064
- standard?: "custom" | "erc20" | "spl" | undefined;
1065
- };
1066
- payTo: string;
1067
- proof: {
1068
- network: string;
1069
- mode: "x402";
1070
- scheme: string;
1071
- version?: number | undefined;
1072
- facilitator?: {
1073
- url: string;
1074
- vendor?: string | undefined;
1075
- verifyPath?: string | undefined;
1076
- settlePath?: string | undefined;
1077
- apiKey?: string | undefined;
1078
- apiKeyEnv?: string | undefined;
1079
- apiKeyHeader?: string | undefined;
1080
- headers?: Record<string, string> | undefined;
1081
- timeoutMs?: number | undefined;
1082
- } | undefined;
1083
- verifier?: string | undefined;
1084
- } | {
1085
- mode: "direct";
1086
- proofTypes: [string, ...string[]];
1087
- verifier?: string | undefined;
1088
- instructions?: string | undefined;
1089
- fields?: {
1090
- key: string;
1091
- label: string;
1092
- description?: string | undefined;
1093
- required?: boolean | undefined;
1094
- example?: string | undefined;
1095
- }[] | undefined;
1096
- allowsManualReview?: boolean | undefined;
1097
- };
1098
- description?: string | undefined;
1099
- resource?: string | undefined;
1100
- settlement?: {
1101
- windowSeconds?: number | undefined;
1102
- targetConfirmations?: number | undefined;
1103
- finalityDescription?: string | undefined;
1104
- slaDescription?: string | undefined;
1105
- } | undefined;
1106
- metadata?: Record<string, unknown> | undefined;
1107
- }>, "atleastone">;
1108
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1109
- fallbackText: z.ZodOptional<z.ZodString>;
1110
- }, "strip", z.ZodTypeAny, {
1111
- schemaVersion: 1;
1112
- accepts: [{
1113
- id: string;
1114
- title: string;
1115
- amount: {
1116
- value: string;
1117
- currency: {
1118
- code: string;
1119
- symbol?: string | undefined;
1120
- decimals?: number | undefined;
1121
- kind?: "fiat" | "crypto" | undefined;
1122
- description?: string | undefined;
1123
- };
1124
- display?: string | undefined;
1125
- };
1126
- asset: {
1127
- symbol: string;
1128
- decimals?: number | undefined;
1129
- description?: string | undefined;
1130
- network?: string | undefined;
1131
- chainId?: number | undefined;
1132
- address?: string | undefined;
1133
- standard?: "custom" | "erc20" | "spl" | undefined;
1134
- };
1135
- payTo: string;
1136
- proof: {
1137
- network: string;
1138
- mode: "x402";
1139
- scheme: string;
1140
- version?: number | undefined;
1141
- facilitator?: {
1142
- url: string;
1143
- vendor?: string | undefined;
1144
- verifyPath?: string | undefined;
1145
- settlePath?: string | undefined;
1146
- apiKey?: string | undefined;
1147
- apiKeyEnv?: string | undefined;
1148
- apiKeyHeader?: string | undefined;
1149
- headers?: Record<string, string> | undefined;
1150
- timeoutMs?: number | undefined;
1151
- } | undefined;
1152
- verifier?: string | undefined;
1153
- } | {
1154
- mode: "direct";
1155
- proofTypes: [string, ...string[]];
1156
- verifier?: string | undefined;
1157
- instructions?: string | undefined;
1158
- fields?: {
1159
- key: string;
1160
- label: string;
1161
- description?: string | undefined;
1162
- required?: boolean | undefined;
1163
- example?: string | undefined;
1164
- }[] | undefined;
1165
- allowsManualReview?: boolean | undefined;
1166
- };
1167
- description?: string | undefined;
1168
- resource?: string | undefined;
1169
- settlement?: {
1170
- windowSeconds?: number | undefined;
1171
- targetConfirmations?: number | undefined;
1172
- finalityDescription?: string | undefined;
1173
- slaDescription?: string | undefined;
1174
- } | undefined;
1175
- metadata?: Record<string, unknown> | undefined;
1176
- }, ...{
1177
- id: string;
1178
- title: string;
1179
- amount: {
1180
- value: string;
1181
- currency: {
1182
- code: string;
1183
- symbol?: string | undefined;
1184
- decimals?: number | undefined;
1185
- kind?: "fiat" | "crypto" | undefined;
1186
- description?: string | undefined;
1187
- };
1188
- display?: string | undefined;
1189
- };
1190
- asset: {
1191
- symbol: string;
1192
- decimals?: number | undefined;
1193
- description?: string | undefined;
1194
- network?: string | undefined;
1195
- chainId?: number | undefined;
1196
- address?: string | undefined;
1197
- standard?: "custom" | "erc20" | "spl" | undefined;
1198
- };
1199
- payTo: string;
1200
- proof: {
1201
- network: string;
1202
- mode: "x402";
1203
- scheme: string;
1204
- version?: number | undefined;
1205
- facilitator?: {
1206
- url: string;
1207
- vendor?: string | undefined;
1208
- verifyPath?: string | undefined;
1209
- settlePath?: string | undefined;
1210
- apiKey?: string | undefined;
1211
- apiKeyEnv?: string | undefined;
1212
- apiKeyHeader?: string | undefined;
1213
- headers?: Record<string, string> | undefined;
1214
- timeoutMs?: number | undefined;
1215
- } | undefined;
1216
- verifier?: string | undefined;
1217
- } | {
1218
- mode: "direct";
1219
- proofTypes: [string, ...string[]];
1220
- verifier?: string | undefined;
1221
- instructions?: string | undefined;
1222
- fields?: {
1223
- key: string;
1224
- label: string;
1225
- description?: string | undefined;
1226
- required?: boolean | undefined;
1227
- example?: string | undefined;
1228
- }[] | undefined;
1229
- allowsManualReview?: boolean | undefined;
1230
- };
1231
- description?: string | undefined;
1232
- resource?: string | undefined;
1233
- settlement?: {
1234
- windowSeconds?: number | undefined;
1235
- targetConfirmations?: number | undefined;
1236
- finalityDescription?: string | undefined;
1237
- slaDescription?: string | undefined;
1238
- } | undefined;
1239
- metadata?: Record<string, unknown> | undefined;
1240
- }[]];
1241
- message?: string | undefined;
1242
- title?: string | undefined;
1243
- resource?: string | undefined;
1244
- metadata?: Record<string, unknown> | undefined;
1245
- fallbackText?: string | undefined;
1246
- }, {
1247
- schemaVersion: 1;
1248
- accepts: [{
1249
- id: string;
1250
- title: string;
1251
- amount: {
1252
- value: string;
1253
- currency: {
1254
- code: string;
1255
- symbol?: string | undefined;
1256
- decimals?: number | undefined;
1257
- kind?: "fiat" | "crypto" | undefined;
1258
- description?: string | undefined;
1259
- };
1260
- display?: string | undefined;
1261
- };
1262
- asset: {
1263
- symbol: string;
1264
- decimals?: number | undefined;
1265
- description?: string | undefined;
1266
- network?: string | undefined;
1267
- chainId?: number | undefined;
1268
- address?: string | undefined;
1269
- standard?: "custom" | "erc20" | "spl" | undefined;
1270
- };
1271
- payTo: string;
1272
- proof: {
1273
- network: string;
1274
- mode: "x402";
1275
- scheme: string;
1276
- version?: number | undefined;
1277
- facilitator?: {
1278
- url: string;
1279
- vendor?: string | undefined;
1280
- verifyPath?: string | undefined;
1281
- settlePath?: string | undefined;
1282
- apiKey?: string | undefined;
1283
- apiKeyEnv?: string | undefined;
1284
- apiKeyHeader?: string | undefined;
1285
- headers?: Record<string, string> | undefined;
1286
- timeoutMs?: number | undefined;
1287
- } | undefined;
1288
- verifier?: string | undefined;
1289
- } | {
1290
- mode: "direct";
1291
- proofTypes: [string, ...string[]];
1292
- verifier?: string | undefined;
1293
- instructions?: string | undefined;
1294
- fields?: {
1295
- key: string;
1296
- label: string;
1297
- description?: string | undefined;
1298
- required?: boolean | undefined;
1299
- example?: string | undefined;
1300
- }[] | undefined;
1301
- allowsManualReview?: boolean | undefined;
1302
- };
1303
- description?: string | undefined;
1304
- resource?: string | undefined;
1305
- settlement?: {
1306
- windowSeconds?: number | undefined;
1307
- targetConfirmations?: number | undefined;
1308
- finalityDescription?: string | undefined;
1309
- slaDescription?: string | undefined;
1310
- } | undefined;
1311
- metadata?: Record<string, unknown> | undefined;
1312
- }, ...{
1313
- id: string;
1314
- title: string;
1315
- amount: {
1316
- value: string;
1317
- currency: {
1318
- code: string;
1319
- symbol?: string | undefined;
1320
- decimals?: number | undefined;
1321
- kind?: "fiat" | "crypto" | undefined;
1322
- description?: string | undefined;
1323
- };
1324
- display?: string | undefined;
1325
- };
1326
- asset: {
1327
- symbol: string;
1328
- decimals?: number | undefined;
1329
- description?: string | undefined;
1330
- network?: string | undefined;
1331
- chainId?: number | undefined;
1332
- address?: string | undefined;
1333
- standard?: "custom" | "erc20" | "spl" | undefined;
1334
- };
1335
- payTo: string;
1336
- proof: {
1337
- network: string;
1338
- mode: "x402";
1339
- scheme: string;
1340
- version?: number | undefined;
1341
- facilitator?: {
1342
- url: string;
1343
- vendor?: string | undefined;
1344
- verifyPath?: string | undefined;
1345
- settlePath?: string | undefined;
1346
- apiKey?: string | undefined;
1347
- apiKeyEnv?: string | undefined;
1348
- apiKeyHeader?: string | undefined;
1349
- headers?: Record<string, string> | undefined;
1350
- timeoutMs?: number | undefined;
1351
- } | undefined;
1352
- verifier?: string | undefined;
1353
- } | {
1354
- mode: "direct";
1355
- proofTypes: [string, ...string[]];
1356
- verifier?: string | undefined;
1357
- instructions?: string | undefined;
1358
- fields?: {
1359
- key: string;
1360
- label: string;
1361
- description?: string | undefined;
1362
- required?: boolean | undefined;
1363
- example?: string | undefined;
1364
- }[] | undefined;
1365
- allowsManualReview?: boolean | undefined;
1366
- };
1367
- description?: string | undefined;
1368
- resource?: string | undefined;
1369
- settlement?: {
1370
- windowSeconds?: number | undefined;
1371
- targetConfirmations?: number | undefined;
1372
- finalityDescription?: string | undefined;
1373
- slaDescription?: string | undefined;
1374
- } | undefined;
1375
- metadata?: Record<string, unknown> | undefined;
1376
- }[]];
1377
- message?: string | undefined;
1378
- title?: string | undefined;
1379
- resource?: string | undefined;
1380
- metadata?: Record<string, unknown> | undefined;
1381
- fallbackText?: string | undefined;
1382
- }>;
1383
- type PaymentRequirementsDefinition = z.infer<typeof paymentRequirementsSchema>;
1384
- declare const x402PaymentHeaderSchema: z.ZodObject<{
1385
- x402Version: z.ZodNumber;
1386
- scheme: z.ZodString;
1387
- network: z.ZodString;
1388
- payload: z.ZodUnknown;
1389
- correlationId: z.ZodOptional<z.ZodString>;
1390
- }, "strip", z.ZodTypeAny, {
1391
- network: string;
1392
- scheme: string;
1393
- x402Version: number;
1394
- payload?: unknown;
1395
- correlationId?: string | undefined;
1396
- }, {
1397
- network: string;
1398
- scheme: string;
1399
- x402Version: number;
1400
- payload?: unknown;
1401
- correlationId?: string | undefined;
1402
- }>;
1403
- type X402PaymentHeader = z.infer<typeof x402PaymentHeaderSchema>;
1404
- declare const directPaymentPayloadSchema: z.ZodObject<{
1405
- schemaVersion: z.ZodLiteral<1>;
1406
- optionId: z.ZodString;
1407
- proofType: z.ZodString;
1408
- payload: z.ZodUnknown;
1409
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1410
- }, "strip", z.ZodTypeAny, {
1411
- schemaVersion: 1;
1412
- optionId: string;
1413
- proofType: string;
1414
- metadata?: Record<string, unknown> | undefined;
1415
- payload?: unknown;
1416
- }, {
1417
- schemaVersion: 1;
1418
- optionId: string;
1419
- proofType: string;
1420
- metadata?: Record<string, unknown> | undefined;
1421
- payload?: unknown;
1422
- }>;
1423
- type DirectPaymentPayload = z.infer<typeof directPaymentPayloadSchema>;
1424
- declare const paymentSuccessMetadataSchema: z.ZodObject<{
1425
- optionId: z.ZodString;
1426
- verifier: z.ZodOptional<z.ZodString>;
1427
- txHash: z.ZodOptional<z.ZodString>;
1428
- networkId: z.ZodOptional<z.ZodString>;
1429
- amount: z.ZodOptional<z.ZodObject<{
1430
- value: z.ZodString;
1431
- currency: z.ZodObject<{
1432
- code: z.ZodEffects<z.ZodString, string, string>;
1433
- symbol: z.ZodOptional<z.ZodString>;
1434
- decimals: z.ZodOptional<z.ZodNumber>;
1435
- kind: z.ZodOptional<z.ZodDefault<z.ZodEnum<["fiat", "crypto"]>>>;
1436
- description: z.ZodOptional<z.ZodString>;
1437
- }, "strip", z.ZodTypeAny, {
1438
- code: string;
1439
- symbol?: string | undefined;
1440
- decimals?: number | undefined;
1441
- kind?: "fiat" | "crypto" | undefined;
1442
- description?: string | undefined;
1443
- }, {
1444
- code: string;
1445
- symbol?: string | undefined;
1446
- decimals?: number | undefined;
1447
- kind?: "fiat" | "crypto" | undefined;
1448
- description?: string | undefined;
1449
- }>;
1450
- display: z.ZodOptional<z.ZodString>;
1451
- }, "strip", z.ZodTypeAny, {
1452
- value: string;
1453
- currency: {
1454
- code: string;
1455
- symbol?: string | undefined;
1456
- decimals?: number | undefined;
1457
- kind?: "fiat" | "crypto" | undefined;
1458
- description?: string | undefined;
1459
- };
1460
- display?: string | undefined;
1461
- }, {
1462
- value: string;
1463
- currency: {
1464
- code: string;
1465
- symbol?: string | undefined;
1466
- decimals?: number | undefined;
1467
- kind?: "fiat" | "crypto" | undefined;
1468
- description?: string | undefined;
1469
- };
1470
- display?: string | undefined;
1471
- }>>;
1472
- settledAt: z.ZodOptional<z.ZodString>;
1473
- payload: z.ZodOptional<z.ZodUnknown>;
1474
- }, "strip", z.ZodTypeAny, {
1475
- optionId: string;
1476
- verifier?: string | undefined;
1477
- amount?: {
1478
- value: string;
1479
- currency: {
1480
- code: string;
1481
- symbol?: string | undefined;
1482
- decimals?: number | undefined;
1483
- kind?: "fiat" | "crypto" | undefined;
1484
- description?: string | undefined;
1485
- };
1486
- display?: string | undefined;
1487
- } | undefined;
1488
- payload?: unknown;
1489
- txHash?: string | undefined;
1490
- networkId?: string | undefined;
1491
- settledAt?: string | undefined;
1492
- }, {
1493
- optionId: string;
1494
- verifier?: string | undefined;
1495
- amount?: {
1496
- value: string;
1497
- currency: {
1498
- code: string;
1499
- symbol?: string | undefined;
1500
- decimals?: number | undefined;
1501
- kind?: "fiat" | "crypto" | undefined;
1502
- description?: string | undefined;
1503
- };
1504
- display?: string | undefined;
1505
- } | undefined;
1506
- payload?: unknown;
1507
- txHash?: string | undefined;
1508
- networkId?: string | undefined;
1509
- settledAt?: string | undefined;
1510
- }>;
1511
- type PaymentSuccessMetadata = z.infer<typeof paymentSuccessMetadataSchema>;
1512
- declare const paymentFailureSchema: z.ZodObject<{
1513
- reason: z.ZodString;
1514
- code: z.ZodOptional<z.ZodDefault<z.ZodEnum<["verifier_not_found", "verification_failed", "invalid_payload", "unsupported_option", "missing_header", "unknown"]>>>;
1515
- retryable: z.ZodOptional<z.ZodBoolean>;
1516
- detail: z.ZodOptional<z.ZodUnknown>;
1517
- }, "strip", z.ZodTypeAny, {
1518
- reason: string;
1519
- code?: "unknown" | "verifier_not_found" | "verification_failed" | "invalid_payload" | "unsupported_option" | "missing_header" | undefined;
1520
- retryable?: boolean | undefined;
1521
- detail?: unknown;
1522
- }, {
1523
- reason: string;
1524
- code?: "unknown" | "verifier_not_found" | "verification_failed" | "invalid_payload" | "unsupported_option" | "missing_header" | undefined;
1525
- retryable?: boolean | undefined;
1526
- detail?: unknown;
1527
- }>;
1528
- type PaymentFailure = z.infer<typeof paymentFailureSchema>;
1529
-
1530
- declare const HEADER_X402 = "X-PAYMENT";
1531
- declare const HEADER_DIRECT = "X-PAYMENT-PROOF";
1532
- declare const HEADER_PAYMENT_RESPONSE = "X-PAYMENT-RESPONSE";
1533
- declare const x402RequirementSchema: z.ZodObject<{
1534
- scheme: z.ZodString;
1535
- network: z.ZodString;
1536
- maxAmountRequired: z.ZodString;
1537
- asset: z.ZodString;
1538
- payTo: z.ZodString;
1539
- resource: z.ZodOptional<z.ZodString>;
1540
- description: z.ZodOptional<z.ZodString>;
1541
- mimeType: z.ZodOptional<z.ZodString>;
1542
- outputSchema: z.ZodOptional<z.ZodUnknown>;
1543
- maxTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
1544
- extra: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1545
- }, "strip", z.ZodTypeAny, {
1546
- network: string;
1547
- scheme: string;
1548
- asset: string;
1549
- payTo: string;
1550
- maxAmountRequired: string;
1551
- description?: string | undefined;
1552
- resource?: string | undefined;
1553
- mimeType?: string | undefined;
1554
- outputSchema?: unknown;
1555
- maxTimeoutSeconds?: number | undefined;
1556
- extra?: Record<string, unknown> | null | undefined;
1557
- }, {
1558
- network: string;
1559
- scheme: string;
1560
- asset: string;
1561
- payTo: string;
1562
- maxAmountRequired: string;
1563
- description?: string | undefined;
1564
- resource?: string | undefined;
1565
- mimeType?: string | undefined;
1566
- outputSchema?: unknown;
1567
- maxTimeoutSeconds?: number | undefined;
1568
- extra?: Record<string, unknown> | null | undefined;
1569
- }>;
1570
- type X402Requirement = z.infer<typeof x402RequirementSchema>;
1571
- interface X402RequirementsResponse {
1572
- x402Version: number;
1573
- error?: string;
1574
- accepts: X402Requirement[];
1575
- }
1576
- interface PaymentRequiredBody extends PaymentRequirementsDefinition {
1577
- x402?: X402RequirementsResponse;
1578
- }
1579
- type PaymentAttempt = {
1580
- type: "x402";
1581
- headerName: typeof HEADER_X402;
1582
- raw: string;
1583
- payload: X402PaymentHeader;
1584
- } | {
1585
- type: "direct";
1586
- headerName: typeof HEADER_DIRECT;
1587
- raw: string;
1588
- payload: DirectPaymentPayload;
1589
- };
1590
- interface ExtractAttemptsResult {
1591
- attempts: PaymentAttempt[];
1592
- failures: PaymentFailure[];
1593
- }
1594
- interface PaymentVerificationContext {
1595
- attempt: PaymentAttempt;
1596
- option: PaymentOption;
1597
- definition: PaymentRequirementsDefinition;
1598
- settle?: boolean;
1599
- }
1600
- interface PaymentVerificationResult {
1601
- success: boolean;
1602
- optionId: string;
1603
- attemptType: PaymentAttempt["type"];
1604
- metadata?: PaymentSuccessMetadata;
1605
- failure?: PaymentFailure;
1606
- responseHeaders?: Record<string, string>;
1607
- }
1608
- type PaymentVerifier = (context: PaymentVerificationContext) => Promise<PaymentVerificationResult>;
1609
- interface VerifyPaymentOptions {
1610
- definition: PaymentRequirementsDefinition;
1611
- request?: Request;
1612
- attempts?: PaymentAttempt[];
1613
- settle?: boolean;
1614
- verifiers?: Record<string, PaymentVerifier>;
1615
- fetchImpl?: typeof fetch;
1616
- }
1617
- declare function createPaymentRequiredBody(definition: PaymentRequirementsDefinition): PaymentRequiredBody;
1618
- declare function paymentRequiredResponse(definition: PaymentRequirementsDefinition, init?: ResponseInit): Response;
1619
- declare function extractPaymentAttempts(source: Request): ExtractAttemptsResult;
1620
- declare function verifyPayment(options: VerifyPaymentOptions): Promise<PaymentVerificationResult>;
1621
- declare function createPaymentResponseHeader(metadata: PaymentSuccessMetadata): string;
1622
- declare const PAYMENT_HEADERS: {
1623
- readonly x402: "X-PAYMENT";
1624
- readonly direct: "X-PAYMENT-PROOF";
1625
- readonly response: "X-PAYMENT-RESPONSE";
1626
- };
1627
-
1628
- interface DefinedPayment {
1629
- definition: PaymentRequirementsDefinition;
1630
- verifiers: Record<string, PaymentVerifier>;
1631
- metadata?: Record<string, unknown>;
1632
- message?: string;
1633
- }
1634
- interface RequirePaymentOptions {
1635
- settle?: boolean;
1636
- verifiers?: Record<string, PaymentVerifier>;
1637
- fetchImpl?: typeof fetch;
1638
- onFailure?: (result: PaymentVerificationResult) => Response;
1639
- }
1640
- interface RequirePaymentSuccess {
1641
- payment: PaymentSuccessMetadata;
1642
- headers: Record<string, string>;
1643
- optionId: string;
1644
- result: PaymentVerificationResult;
1645
- }
1646
- type RequirePaymentOutcome = Response | RequirePaymentSuccess;
1647
- declare class PaymentRequiredError extends Error {
1648
- readonly response: Response;
1649
- readonly verification: PaymentVerificationResult | undefined;
1650
- constructor(response: Response, verification?: PaymentVerificationResult);
1651
- }
1652
- type PaymentContext = RequirePaymentSuccess;
1653
- declare function getPaymentContext(request: Request): PaymentContext | undefined;
1654
- declare function withPaymentRequirement(handler: (request: Request) => Promise<Response> | Response, payment: DefinedPayment | PaymentRequirementsDefinition, options?: RequirePaymentOptions): (request: Request) => Promise<Response>;
1655
- interface DefinePaymentConfig {
1656
- amount: string | number;
1657
- payTo: string;
1658
- currency?: string;
1659
- message?: string;
1660
- resource?: string;
1661
- acceptedMethods?: ("x402" | "402")[];
1662
- acceptedCurrencies?: string[];
1663
- chainIds?: number[];
1664
- facilitator?: "opentool" | "coinbase" | string | X402ProofConfig["facilitator"];
1665
- metadata?: Record<string, unknown>;
1666
- verifiers?: Record<string, PaymentVerifier>;
1667
- x402?: X402Config;
1668
- direct?: DirectConfig;
1669
- }
1670
- interface X402Config {
1671
- id?: string;
1672
- facilitator?: string | X402ProofConfig["facilitator"];
1673
- network?: string;
1674
- assetAddress?: string;
1675
- scheme?: string;
1676
- version?: number;
1677
- settlement?: SettlementTerms;
1678
- }
1679
- interface DirectConfig {
1680
- id?: string;
1681
- verifierId?: string;
1682
- proofType?: string;
1683
- token?: string;
1684
- verify?: PaymentVerifier;
1685
- instructions?: string;
1686
- fields?: PaymentField[];
1687
- allowsManualReview?: boolean;
1688
- settlement?: SettlementTerms;
1689
- }
1690
- declare function definePayment(config: DefinePaymentConfig): DefinedPayment;
1691
- declare function requirePayment(request: Request, payment: DefinedPayment | PaymentRequirementsDefinition, options?: RequirePaymentOptions): Promise<RequirePaymentOutcome>;
1692
-
1693
- export { type RequirePaymentOutcome as $, paymentFailureSchema as A, type PaymentFailure as B, type Currency as C, type DirectProofConfig as D, type X402Requirement as E, type FacilitatorConfig as F, type X402RequirementsResponse as G, HEADER_PAYMENT_RESPONSE as H, type PaymentRequiredBody as I, type PaymentAttempt as J, type ExtractAttemptsResult as K, type PaymentVerificationContext as L, type PaymentVerificationResult as M, type PaymentVerifier as N, createPaymentRequiredBody as O, PAYMENT_SCHEMA_VERSION as P, paymentRequiredResponse as Q, extractPaymentAttempts as R, type SettlementTerms as S, verifyPayment as T, createPaymentResponseHeader as U, type VerifyPaymentOptions as V, PAYMENT_HEADERS as W, type X402ProofConfig as X, type DefinedPayment as Y, type RequirePaymentOptions as Z, type RequirePaymentSuccess as _, type PaymentSchemaVersion as a, PaymentRequiredError as a0, type PaymentContext as a1, getPaymentContext as a2, withPaymentRequirement as a3, type DefinePaymentConfig as a4, type X402Config as a5, type DirectConfig as a6, definePayment as a7, requirePayment as a8, paymentAmountSchema as b, currencySchema as c, decimalStringSchema as d, type PaymentAmount as e, cryptoAssetSchema as f, type CryptoAsset as g, facilitatorConfigSchema as h, paymentFieldSchema as i, type PaymentField as j, directProofSchema as k, paymentProofSchema as l, type PaymentProofConfig as m, paymentOptionSchema as n, type PaymentOption as o, paymentSchemaVersionSchema as p, paymentRequirementsSchema as q, type PaymentRequirementsDefinition as r, settlementTermsSchema as s, x402PaymentHeaderSchema as t, type X402PaymentHeader as u, directPaymentPayloadSchema as v, type DirectPaymentPayload as w, x402ProofSchema as x, paymentSuccessMetadataSchema as y, type PaymentSuccessMetadata as z };