@nullclear/shared 1.0.0 → 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/dist/index.cjs CHANGED
@@ -25,15 +25,20 @@ __export(index_exports, {
25
25
  BASE_MAINNET: () => BASE_MAINNET,
26
26
  BASE_SEPOLIA: () => BASE_SEPOLIA,
27
27
  CAIP2_TO_CHAIN_ID: () => CAIP2_TO_CHAIN_ID,
28
+ ClearRequestSchema: () => ClearRequestSchema,
28
29
  EIP3009_ABI: () => EIP3009_ABI,
29
30
  EIP3009_TYPES: () => EIP3009_TYPES,
30
31
  ERC8004_IDENTITY_ABI: () => ERC8004_IDENTITY_ABI,
31
32
  ERC8004_REPUTATION_ABI: () => ERC8004_REPUTATION_ABI,
33
+ FallbackTargetSchema: () => FallbackTargetSchema,
34
+ InvariantRuleSchema: () => InvariantRuleSchema,
32
35
  KYA_DOMAIN: () => KYA_DOMAIN,
33
36
  KYA_MANDATE_TYPES: () => KYA_MANDATE_TYPES,
34
37
  NULLCLEAR_ARBITER_ADDRESS: () => NULLCLEAR_ARBITER_ADDRESS,
35
38
  NULLCLEAR_TREASURY_ADDRESS: () => NULLCLEAR_TREASURY_ADDRESS,
36
39
  SUPPORTED_CHAINS: () => SUPPORTED_CHAINS,
40
+ SpendPolicySchema: () => SpendPolicySchema,
41
+ ValidationConfigSchema: () => ValidationConfigSchema,
37
42
  decodeBase64Json: () => decodeBase64Json,
38
43
  encodeBase64Json: () => encodeBase64Json,
39
44
  getChainConfig: () => getChainConfig
@@ -184,6 +189,54 @@ var ARBITER_DOMAIN = {
184
189
  version: "1",
185
190
  chainId: 8453
186
191
  };
192
+
193
+ // src/schemas.ts
194
+ var import_zod = require("zod");
195
+ var InvariantRuleSchema = import_zod.z.object({
196
+ path: import_zod.z.string(),
197
+ gt: import_zod.z.number().optional(),
198
+ gte: import_zod.z.number().optional(),
199
+ lt: import_zod.z.number().optional(),
200
+ lte: import_zod.z.number().optional(),
201
+ eq: import_zod.z.union([import_zod.z.string(), import_zod.z.number(), import_zod.z.boolean()]).optional(),
202
+ neq: import_zod.z.union([import_zod.z.string(), import_zod.z.number(), import_zod.z.boolean()]).optional(),
203
+ minLength: import_zod.z.number().optional(),
204
+ maxLength: import_zod.z.number().optional(),
205
+ pattern: import_zod.z.string().optional(),
206
+ notContains: import_zod.z.array(import_zod.z.string()).optional(),
207
+ maxStalenessSeconds: import_zod.z.number().optional()
208
+ });
209
+ var ValidationConfigSchema = import_zod.z.object({
210
+ expectedStatus: import_zod.z.array(import_zod.z.number()).optional(),
211
+ jsonSchema: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional(),
212
+ requiredFields: import_zod.z.array(import_zod.z.string()).optional(),
213
+ sha256Match: import_zod.z.string().optional(),
214
+ rejectRefusals: import_zod.z.boolean().optional(),
215
+ invariants: import_zod.z.array(InvariantRuleSchema).optional()
216
+ });
217
+ var FallbackTargetSchema = import_zod.z.object({
218
+ targetUrl: import_zod.z.string(),
219
+ sellerAgentId: import_zod.z.string().optional(),
220
+ paymentSignatureHeader: import_zod.z.string(),
221
+ headers: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional()
222
+ });
223
+ var SpendPolicySchema = import_zod.z.object({
224
+ maxPerCallAtomic: import_zod.z.string().optional(),
225
+ maxDailyWalletAtomic: import_zod.z.string().optional()
226
+ });
227
+ var ClearRequestSchema = import_zod.z.object({
228
+ targetUrl: import_zod.z.string(),
229
+ method: import_zod.z.enum(["GET", "POST", "PUT", "DELETE"]).optional().default("GET"),
230
+ headers: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional(),
231
+ body: import_zod.z.unknown().optional(),
232
+ paymentSignatureHeader: import_zod.z.string(),
233
+ sellerAgentId: import_zod.z.string().optional(),
234
+ minTrustScore: import_zod.z.number().optional().default(50),
235
+ twoPhaseRelease: import_zod.z.boolean().optional().default(false),
236
+ validation: ValidationConfigSchema.optional(),
237
+ fallbacks: import_zod.z.array(FallbackTargetSchema).max(3).optional(),
238
+ spendPolicy: SpendPolicySchema.optional()
239
+ });
187
240
  // Annotate the CommonJS export names for ESM import in node:
188
241
  0 && (module.exports = {
189
242
  ARBITER_ATTESTATION_TYPES,
@@ -191,15 +244,20 @@ var ARBITER_DOMAIN = {
191
244
  BASE_MAINNET,
192
245
  BASE_SEPOLIA,
193
246
  CAIP2_TO_CHAIN_ID,
247
+ ClearRequestSchema,
194
248
  EIP3009_ABI,
195
249
  EIP3009_TYPES,
196
250
  ERC8004_IDENTITY_ABI,
197
251
  ERC8004_REPUTATION_ABI,
252
+ FallbackTargetSchema,
253
+ InvariantRuleSchema,
198
254
  KYA_DOMAIN,
199
255
  KYA_MANDATE_TYPES,
200
256
  NULLCLEAR_ARBITER_ADDRESS,
201
257
  NULLCLEAR_TREASURY_ADDRESS,
202
258
  SUPPORTED_CHAINS,
259
+ SpendPolicySchema,
260
+ ValidationConfigSchema,
203
261
  decodeBase64Json,
204
262
  encodeBase64Json,
205
263
  getChainConfig
package/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ import { z } from 'zod';
2
+
1
3
  interface ChainConfig {
2
4
  name: string;
3
5
  chainId: number;
@@ -411,4 +413,381 @@ declare const ARBITER_DOMAIN: {
411
413
  readonly chainId: 8453;
412
414
  };
413
415
 
414
- export { ARBITER_ATTESTATION_TYPES, ARBITER_DOMAIN, BASE_MAINNET, BASE_SEPOLIA, CAIP2_TO_CHAIN_ID, type ChainConfig, type ClearingAttestation, type EIP3009Authorization, EIP3009_ABI, EIP3009_TYPES, ERC8004_IDENTITY_ABI, ERC8004_REPUTATION_ABI, type KYAMandate, KYA_DOMAIN, KYA_MANDATE_TYPES, NULLCLEAR_ARBITER_ADDRESS, NULLCLEAR_TREASURY_ADDRESS, SUPPORTED_CHAINS, type X402PaymentOption, type X402PaymentRequired, type X402PaymentResponse, type X402PaymentSignaturePayload, decodeBase64Json, encodeBase64Json, getChainConfig };
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 };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { z } from 'zod';
2
+
1
3
  interface ChainConfig {
2
4
  name: string;
3
5
  chainId: number;
@@ -411,4 +413,381 @@ declare const ARBITER_DOMAIN: {
411
413
  readonly chainId: 8453;
412
414
  };
413
415
 
414
- export { ARBITER_ATTESTATION_TYPES, ARBITER_DOMAIN, BASE_MAINNET, BASE_SEPOLIA, CAIP2_TO_CHAIN_ID, type ChainConfig, type ClearingAttestation, type EIP3009Authorization, EIP3009_ABI, EIP3009_TYPES, ERC8004_IDENTITY_ABI, ERC8004_REPUTATION_ABI, type KYAMandate, KYA_DOMAIN, KYA_MANDATE_TYPES, NULLCLEAR_ARBITER_ADDRESS, NULLCLEAR_TREASURY_ADDRESS, SUPPORTED_CHAINS, type X402PaymentOption, type X402PaymentRequired, type X402PaymentResponse, type X402PaymentSignaturePayload, decodeBase64Json, encodeBase64Json, getChainConfig };
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 };
package/dist/index.js CHANGED
@@ -142,21 +142,74 @@ var ARBITER_DOMAIN = {
142
142
  version: "1",
143
143
  chainId: 8453
144
144
  };
145
+
146
+ // src/schemas.ts
147
+ import { z } from "zod";
148
+ var InvariantRuleSchema = z.object({
149
+ path: z.string(),
150
+ gt: z.number().optional(),
151
+ gte: z.number().optional(),
152
+ lt: z.number().optional(),
153
+ lte: z.number().optional(),
154
+ eq: z.union([z.string(), z.number(), z.boolean()]).optional(),
155
+ neq: z.union([z.string(), z.number(), z.boolean()]).optional(),
156
+ minLength: z.number().optional(),
157
+ maxLength: z.number().optional(),
158
+ pattern: z.string().optional(),
159
+ notContains: z.array(z.string()).optional(),
160
+ maxStalenessSeconds: z.number().optional()
161
+ });
162
+ var ValidationConfigSchema = z.object({
163
+ expectedStatus: z.array(z.number()).optional(),
164
+ jsonSchema: z.record(z.string(), z.unknown()).optional(),
165
+ requiredFields: z.array(z.string()).optional(),
166
+ sha256Match: z.string().optional(),
167
+ rejectRefusals: z.boolean().optional(),
168
+ invariants: z.array(InvariantRuleSchema).optional()
169
+ });
170
+ var FallbackTargetSchema = z.object({
171
+ targetUrl: z.string(),
172
+ sellerAgentId: z.string().optional(),
173
+ paymentSignatureHeader: z.string(),
174
+ headers: z.record(z.string(), z.string()).optional()
175
+ });
176
+ var SpendPolicySchema = z.object({
177
+ maxPerCallAtomic: z.string().optional(),
178
+ maxDailyWalletAtomic: z.string().optional()
179
+ });
180
+ var ClearRequestSchema = z.object({
181
+ targetUrl: z.string(),
182
+ method: z.enum(["GET", "POST", "PUT", "DELETE"]).optional().default("GET"),
183
+ headers: z.record(z.string(), z.string()).optional(),
184
+ body: z.unknown().optional(),
185
+ paymentSignatureHeader: z.string(),
186
+ sellerAgentId: z.string().optional(),
187
+ minTrustScore: z.number().optional().default(50),
188
+ twoPhaseRelease: z.boolean().optional().default(false),
189
+ validation: ValidationConfigSchema.optional(),
190
+ fallbacks: z.array(FallbackTargetSchema).max(3).optional(),
191
+ spendPolicy: SpendPolicySchema.optional()
192
+ });
145
193
  export {
146
194
  ARBITER_ATTESTATION_TYPES,
147
195
  ARBITER_DOMAIN,
148
196
  BASE_MAINNET,
149
197
  BASE_SEPOLIA,
150
198
  CAIP2_TO_CHAIN_ID,
199
+ ClearRequestSchema,
151
200
  EIP3009_ABI,
152
201
  EIP3009_TYPES,
153
202
  ERC8004_IDENTITY_ABI,
154
203
  ERC8004_REPUTATION_ABI,
204
+ FallbackTargetSchema,
205
+ InvariantRuleSchema,
155
206
  KYA_DOMAIN,
156
207
  KYA_MANDATE_TYPES,
157
208
  NULLCLEAR_ARBITER_ADDRESS,
158
209
  NULLCLEAR_TREASURY_ADDRESS,
159
210
  SUPPORTED_CHAINS,
211
+ SpendPolicySchema,
212
+ ValidationConfigSchema,
160
213
  decodeBase64Json,
161
214
  encodeBase64Json,
162
215
  getChainConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nullclear/shared",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Shared types, ABIs, crypto schemas and chain configurations for NullClear",
5
5
  "license": "MIT",
6
6
  "homepage": "https://nullclear.dev",
@@ -27,7 +27,8 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "viem": "^2.23.0"
30
+ "viem": "^2.23.0",
31
+ "zod": "^3.24.2"
31
32
  },
32
33
  "devDependencies": {
33
34
  "tsup": "^8.3.6",