@virtuals-protocol/acp-node 0.3.0-beta.7 → 0.3.0-beta.9

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.js CHANGED
@@ -55,7 +55,7 @@ var require_package = __commonJS({
55
55
  "package.json"(exports2, module2) {
56
56
  module2.exports = {
57
57
  name: "@virtuals-protocol/acp-node",
58
- version: "0.3.0-beta.7",
58
+ version: "0.3.0-beta.9",
59
59
  main: "./dist/index.js",
60
60
  module: "./dist/index.mjs",
61
61
  types: "./dist/index.d.ts",
@@ -73,6 +73,7 @@ var require_package = __commonJS({
73
73
  "@aa-sdk/core": "^4.73.0",
74
74
  "@account-kit/infra": "^4.73.0",
75
75
  "@account-kit/smart-contracts": "^4.73.0",
76
+ "@virtuals-protocol/acp-node": "^0.3.0-beta.8",
76
77
  ajv: "^8.17.1",
77
78
  "socket.io-client": "^4.8.1",
78
79
  tsup: "^8.5.0",
@@ -109,6 +110,8 @@ __export(index_exports, {
109
110
  PositionDirection: () => PositionDirection,
110
111
  baseAcpConfig: () => baseAcpConfig,
111
112
  baseAcpConfigV2: () => baseAcpConfigV2,
113
+ baseAcpX402Config: () => baseAcpX402Config,
114
+ baseAcpX402ConfigV2: () => baseAcpX402ConfigV2,
112
115
  baseSepoliaAcpConfig: () => baseSepoliaAcpConfig,
113
116
  baseSepoliaAcpConfigV2: () => baseSepoliaAcpConfigV2,
114
117
  default: () => index_default,
@@ -120,82 +123,32 @@ module.exports = __toCommonJS(index_exports);
120
123
 
121
124
  // src/abis/acpAbi.ts
122
125
  var ACP_ABI = [
123
- {
124
- inputs: [],
125
- stateMutability: "nonpayable",
126
- type: "constructor"
127
- },
128
- {
129
- inputs: [],
130
- name: "AccessControlBadConfirmation",
131
- type: "error"
132
- },
126
+ { inputs: [], stateMutability: "nonpayable", type: "constructor" },
127
+ { inputs: [], name: "AccessControlBadConfirmation", type: "error" },
133
128
  {
134
129
  inputs: [
135
- {
136
- internalType: "address",
137
- name: "account",
138
- type: "address"
139
- },
140
- {
141
- internalType: "bytes32",
142
- name: "neededRole",
143
- type: "bytes32"
144
- }
130
+ { internalType: "address", name: "account", type: "address" },
131
+ { internalType: "bytes32", name: "neededRole", type: "bytes32" }
145
132
  ],
146
133
  name: "AccessControlUnauthorizedAccount",
147
134
  type: "error"
148
135
  },
149
136
  {
150
- inputs: [
151
- {
152
- internalType: "address",
153
- name: "target",
154
- type: "address"
155
- }
156
- ],
137
+ inputs: [{ internalType: "address", name: "target", type: "address" }],
157
138
  name: "AddressEmptyCode",
158
139
  type: "error"
159
140
  },
160
141
  {
161
- inputs: [
162
- {
163
- internalType: "address",
164
- name: "account",
165
- type: "address"
166
- }
167
- ],
142
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
168
143
  name: "AddressInsufficientBalance",
169
144
  type: "error"
170
145
  },
146
+ { inputs: [], name: "FailedInnerCall", type: "error" },
147
+ { inputs: [], name: "InvalidInitialization", type: "error" },
148
+ { inputs: [], name: "NotInitializing", type: "error" },
149
+ { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
171
150
  {
172
- inputs: [],
173
- name: "FailedInnerCall",
174
- type: "error"
175
- },
176
- {
177
- inputs: [],
178
- name: "InvalidInitialization",
179
- type: "error"
180
- },
181
- {
182
- inputs: [],
183
- name: "NotInitializing",
184
- type: "error"
185
- },
186
- {
187
- inputs: [],
188
- name: "ReentrancyGuardReentrantCall",
189
- type: "error"
190
- },
191
- {
192
- inputs: [
193
- {
194
- internalType: "address",
195
- name: "token",
196
- type: "address"
197
- }
198
- ],
151
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
199
152
  name: "SafeERC20FailedOperation",
200
153
  type: "error"
201
154
  },
@@ -326,6 +279,12 @@ var ACP_ABI = [
326
279
  internalType: "address",
327
280
  name: "paymentToken",
328
281
  type: "address"
282
+ },
283
+ {
284
+ indexed: false,
285
+ internalType: "uint256",
286
+ name: "newBudget",
287
+ type: "uint256"
329
288
  }
330
289
  ],
331
290
  name: "JobPaymentTokenSet",
@@ -346,12 +305,7 @@ var ACP_ABI = [
346
305
  name: "oldPhase",
347
306
  type: "uint8"
348
307
  },
349
- {
350
- indexed: false,
351
- internalType: "uint8",
352
- name: "phase",
353
- type: "uint8"
354
- }
308
+ { indexed: false, internalType: "uint8", name: "phase", type: "uint8" }
355
309
  ],
356
310
  name: "JobPhaseUpdated",
357
311
  type: "event"
@@ -443,6 +397,43 @@ var ACP_ABI = [
443
397
  name: "PayableFeeCollected",
444
398
  type: "event"
445
399
  },
400
+ {
401
+ anonymous: false,
402
+ inputs: [
403
+ {
404
+ indexed: true,
405
+ internalType: "uint256",
406
+ name: "jobId",
407
+ type: "uint256"
408
+ },
409
+ {
410
+ indexed: true,
411
+ internalType: "uint256",
412
+ name: "memoId",
413
+ type: "uint256"
414
+ },
415
+ {
416
+ indexed: true,
417
+ internalType: "address",
418
+ name: "sender",
419
+ type: "address"
420
+ },
421
+ {
422
+ indexed: false,
423
+ internalType: "address",
424
+ name: "token",
425
+ type: "address"
426
+ },
427
+ {
428
+ indexed: false,
429
+ internalType: "uint256",
430
+ name: "amount",
431
+ type: "uint256"
432
+ }
433
+ ],
434
+ name: "PayableFeeRefunded",
435
+ type: "event"
436
+ },
446
437
  {
447
438
  anonymous: false,
448
439
  inputs: [
@@ -541,13 +532,7 @@ var ACP_ABI = [
541
532
  {
542
533
  indexed: true,
543
534
  internalType: "address",
544
- name: "from",
545
- type: "address"
546
- },
547
- {
548
- indexed: false,
549
- internalType: "address",
550
- name: "to",
535
+ name: "sender",
551
536
  type: "address"
552
537
  },
553
538
  {
@@ -563,7 +548,7 @@ var ACP_ABI = [
563
548
  type: "uint256"
564
549
  }
565
550
  ],
566
- name: "PayableRequestExecuted",
551
+ name: "PayableFundsRefunded",
567
552
  type: "event"
568
553
  },
569
554
  {
@@ -581,18 +566,41 @@ var ACP_ABI = [
581
566
  name: "memoId",
582
567
  type: "uint256"
583
568
  },
569
+ { indexed: true, internalType: "address", name: "from", type: "address" },
570
+ { indexed: false, internalType: "address", name: "to", type: "address" },
584
571
  {
585
- indexed: true,
572
+ indexed: false,
586
573
  internalType: "address",
587
- name: "from",
574
+ name: "token",
588
575
  type: "address"
589
576
  },
590
577
  {
591
578
  indexed: false,
592
- internalType: "address",
593
- name: "to",
594
- type: "address"
579
+ internalType: "uint256",
580
+ name: "amount",
581
+ type: "uint256"
582
+ }
583
+ ],
584
+ name: "PayableRequestExecuted",
585
+ type: "event"
586
+ },
587
+ {
588
+ anonymous: false,
589
+ inputs: [
590
+ {
591
+ indexed: true,
592
+ internalType: "uint256",
593
+ name: "jobId",
594
+ type: "uint256"
595
+ },
596
+ {
597
+ indexed: true,
598
+ internalType: "uint256",
599
+ name: "memoId",
600
+ type: "uint256"
595
601
  },
602
+ { indexed: true, internalType: "address", name: "from", type: "address" },
603
+ { indexed: false, internalType: "address", name: "to", type: "address" },
596
604
  {
597
605
  indexed: false,
598
606
  internalType: "address",
@@ -662,12 +670,7 @@ var ACP_ABI = [
662
670
  {
663
671
  anonymous: false,
664
672
  inputs: [
665
- {
666
- indexed: true,
667
- internalType: "bytes32",
668
- name: "role",
669
- type: "bytes32"
670
- },
673
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
671
674
  {
672
675
  indexed: true,
673
676
  internalType: "bytes32",
@@ -687,12 +690,7 @@ var ACP_ABI = [
687
690
  {
688
691
  anonymous: false,
689
692
  inputs: [
690
- {
691
- indexed: true,
692
- internalType: "bytes32",
693
- name: "role",
694
- type: "bytes32"
695
- },
693
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
696
694
  {
697
695
  indexed: true,
698
696
  internalType: "address",
@@ -712,12 +710,7 @@ var ACP_ABI = [
712
710
  {
713
711
  anonymous: false,
714
712
  inputs: [
715
- {
716
- indexed: true,
717
- internalType: "bytes32",
718
- name: "role",
719
- type: "bytes32"
720
- },
713
+ { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
721
714
  {
722
715
  indexed: true,
723
716
  internalType: "address",
@@ -737,187 +730,94 @@ var ACP_ABI = [
737
730
  {
738
731
  inputs: [],
739
732
  name: "ADMIN_ROLE",
740
- outputs: [
741
- {
742
- internalType: "bytes32",
743
- name: "",
744
- type: "bytes32"
745
- }
746
- ],
733
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
747
734
  stateMutability: "view",
748
735
  type: "function"
749
736
  },
750
737
  {
751
738
  inputs: [],
752
739
  name: "DEFAULT_ADMIN_ROLE",
753
- outputs: [
754
- {
755
- internalType: "bytes32",
756
- name: "",
757
- type: "bytes32"
758
- }
759
- ],
740
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
760
741
  stateMutability: "view",
761
742
  type: "function"
762
743
  },
763
744
  {
764
745
  inputs: [],
765
746
  name: "PHASE_COMPLETED",
766
- outputs: [
767
- {
768
- internalType: "uint8",
769
- name: "",
770
- type: "uint8"
771
- }
772
- ],
747
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
773
748
  stateMutability: "view",
774
749
  type: "function"
775
750
  },
776
751
  {
777
752
  inputs: [],
778
753
  name: "PHASE_EVALUATION",
779
- outputs: [
780
- {
781
- internalType: "uint8",
782
- name: "",
783
- type: "uint8"
784
- }
785
- ],
754
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
786
755
  stateMutability: "view",
787
756
  type: "function"
788
757
  },
789
758
  {
790
759
  inputs: [],
791
760
  name: "PHASE_EXPIRED",
792
- outputs: [
793
- {
794
- internalType: "uint8",
795
- name: "",
796
- type: "uint8"
797
- }
798
- ],
761
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
799
762
  stateMutability: "view",
800
763
  type: "function"
801
764
  },
802
765
  {
803
766
  inputs: [],
804
767
  name: "PHASE_NEGOTIATION",
805
- outputs: [
806
- {
807
- internalType: "uint8",
808
- name: "",
809
- type: "uint8"
810
- }
811
- ],
768
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
812
769
  stateMutability: "view",
813
770
  type: "function"
814
771
  },
815
772
  {
816
773
  inputs: [],
817
774
  name: "PHASE_REJECTED",
818
- outputs: [
819
- {
820
- internalType: "uint8",
821
- name: "",
822
- type: "uint8"
823
- }
824
- ],
775
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
825
776
  stateMutability: "view",
826
777
  type: "function"
827
778
  },
828
779
  {
829
780
  inputs: [],
830
781
  name: "PHASE_REQUEST",
831
- outputs: [
832
- {
833
- internalType: "uint8",
834
- name: "",
835
- type: "uint8"
836
- }
837
- ],
782
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
838
783
  stateMutability: "view",
839
784
  type: "function"
840
785
  },
841
786
  {
842
787
  inputs: [],
843
788
  name: "PHASE_TRANSACTION",
844
- outputs: [
845
- {
846
- internalType: "uint8",
847
- name: "",
848
- type: "uint8"
849
- }
850
- ],
789
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
851
790
  stateMutability: "view",
852
791
  type: "function"
853
792
  },
854
793
  {
855
794
  inputs: [],
856
795
  name: "TOTAL_PHASES",
857
- outputs: [
858
- {
859
- internalType: "uint8",
860
- name: "",
861
- type: "uint8"
862
- }
863
- ],
796
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
797
+ stateMutability: "view",
798
+ type: "function"
799
+ },
800
+ {
801
+ inputs: [],
802
+ name: "X402_MANAGER_ROLE",
803
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
864
804
  stateMutability: "view",
865
805
  type: "function"
866
806
  },
867
807
  {
868
808
  inputs: [
869
- {
870
- internalType: "address",
871
- name: "account",
872
- type: "address"
873
- },
809
+ { internalType: "address", name: "account", type: "address" },
874
810
  {
875
811
  components: [
876
- {
877
- internalType: "uint256",
878
- name: "id",
879
- type: "uint256"
880
- },
881
- {
882
- internalType: "address",
883
- name: "client",
884
- type: "address"
885
- },
886
- {
887
- internalType: "address",
888
- name: "provider",
889
- type: "address"
890
- },
891
- {
892
- internalType: "uint256",
893
- name: "budget",
894
- type: "uint256"
895
- },
896
- {
897
- internalType: "uint256",
898
- name: "amountClaimed",
899
- type: "uint256"
900
- },
901
- {
902
- internalType: "uint8",
903
- name: "phase",
904
- type: "uint8"
905
- },
906
- {
907
- internalType: "uint256",
908
- name: "memoCount",
909
- type: "uint256"
910
- },
911
- {
912
- internalType: "uint256",
913
- name: "expiredAt",
914
- type: "uint256"
915
- },
916
- {
917
- internalType: "address",
918
- name: "evaluator",
919
- type: "address"
920
- },
812
+ { internalType: "uint256", name: "id", type: "uint256" },
813
+ { internalType: "address", name: "client", type: "address" },
814
+ { internalType: "address", name: "provider", type: "address" },
815
+ { internalType: "uint256", name: "budget", type: "uint256" },
816
+ { internalType: "uint256", name: "amountClaimed", type: "uint256" },
817
+ { internalType: "uint8", name: "phase", type: "uint8" },
818
+ { internalType: "uint256", name: "memoCount", type: "uint256" },
819
+ { internalType: "uint256", name: "expiredAt", type: "uint256" },
820
+ { internalType: "address", name: "evaluator", type: "address" },
921
821
  {
922
822
  internalType: "contract IERC20",
923
823
  name: "jobPaymentToken",
@@ -930,129 +830,71 @@ var ACP_ABI = [
930
830
  }
931
831
  ],
932
832
  name: "canSign",
933
- outputs: [
934
- {
935
- internalType: "bool",
936
- name: "",
937
- type: "bool"
938
- }
939
- ],
833
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
940
834
  stateMutability: "pure",
941
835
  type: "function"
942
836
  },
943
837
  {
944
- inputs: [
945
- {
946
- internalType: "uint256",
947
- name: "id",
948
- type: "uint256"
949
- }
950
- ],
838
+ inputs: [{ internalType: "uint256", name: "id", type: "uint256" }],
951
839
  name: "claimBudget",
952
840
  outputs: [],
953
841
  stateMutability: "nonpayable",
954
842
  type: "function"
955
843
  },
844
+ {
845
+ inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
846
+ name: "confirmX402PaymentReceived",
847
+ outputs: [],
848
+ stateMutability: "nonpayable",
849
+ type: "function"
850
+ },
956
851
  {
957
852
  inputs: [
958
- {
959
- internalType: "address",
960
- name: "provider",
961
- type: "address"
962
- },
963
- {
964
- internalType: "address",
965
- name: "evaluator",
966
- type: "address"
967
- },
968
- {
969
- internalType: "uint256",
970
- name: "expiredAt",
971
- type: "uint256"
972
- }
853
+ { internalType: "address", name: "provider", type: "address" },
854
+ { internalType: "address", name: "evaluator", type: "address" },
855
+ { internalType: "uint256", name: "expiredAt", type: "uint256" }
973
856
  ],
974
857
  name: "createJob",
975
- outputs: [
976
- {
977
- internalType: "uint256",
978
- name: "",
979
- type: "uint256"
980
- }
858
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
859
+ stateMutability: "nonpayable",
860
+ type: "function"
861
+ },
862
+ {
863
+ inputs: [
864
+ { internalType: "address", name: "provider", type: "address" },
865
+ { internalType: "address", name: "evaluator", type: "address" },
866
+ { internalType: "uint256", name: "expiredAt", type: "uint256" }
981
867
  ],
868
+ name: "createJobWithX402",
869
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
982
870
  stateMutability: "nonpayable",
983
871
  type: "function"
984
872
  },
985
873
  {
986
874
  inputs: [
987
- {
988
- internalType: "uint256",
989
- name: "jobId",
990
- type: "uint256"
991
- },
992
- {
993
- internalType: "string",
994
- name: "content",
995
- type: "string"
996
- },
875
+ { internalType: "uint256", name: "jobId", type: "uint256" },
876
+ { internalType: "string", name: "content", type: "string" },
997
877
  {
998
878
  internalType: "enum InteractionLedger.MemoType",
999
879
  name: "memoType",
1000
880
  type: "uint8"
1001
881
  },
1002
- {
1003
- internalType: "bool",
1004
- name: "isSecured",
1005
- type: "bool"
1006
- },
1007
- {
1008
- internalType: "uint8",
1009
- name: "nextPhase",
1010
- type: "uint8"
1011
- }
882
+ { internalType: "bool", name: "isSecured", type: "bool" },
883
+ { internalType: "uint8", name: "nextPhase", type: "uint8" }
1012
884
  ],
1013
885
  name: "createMemo",
1014
- outputs: [
1015
- {
1016
- internalType: "uint256",
1017
- name: "",
1018
- type: "uint256"
1019
- }
1020
- ],
886
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1021
887
  stateMutability: "nonpayable",
1022
888
  type: "function"
1023
889
  },
1024
890
  {
1025
891
  inputs: [
1026
- {
1027
- internalType: "uint256",
1028
- name: "jobId",
1029
- type: "uint256"
1030
- },
1031
- {
1032
- internalType: "string",
1033
- name: "content",
1034
- type: "string"
1035
- },
1036
- {
1037
- internalType: "address",
1038
- name: "token",
1039
- type: "address"
1040
- },
1041
- {
1042
- internalType: "uint256",
1043
- name: "amount",
1044
- type: "uint256"
1045
- },
1046
- {
1047
- internalType: "address",
1048
- name: "recipient",
1049
- type: "address"
1050
- },
1051
- {
1052
- internalType: "uint256",
1053
- name: "feeAmount",
1054
- type: "uint256"
1055
- },
892
+ { internalType: "uint256", name: "jobId", type: "uint256" },
893
+ { internalType: "string", name: "content", type: "string" },
894
+ { internalType: "address", name: "token", type: "address" },
895
+ { internalType: "uint256", name: "amount", type: "uint256" },
896
+ { internalType: "address", name: "recipient", type: "address" },
897
+ { internalType: "uint256", name: "feeAmount", type: "uint256" },
1056
898
  {
1057
899
  internalType: "enum ACPSimple.FeeType",
1058
900
  name: "feeType",
@@ -1063,198 +905,88 @@ var ACP_ABI = [
1063
905
  name: "memoType",
1064
906
  type: "uint8"
1065
907
  },
1066
- {
1067
- internalType: "uint8",
1068
- name: "nextPhase",
1069
- type: "uint8"
1070
- },
1071
- {
1072
- internalType: "uint256",
1073
- name: "expiredAt",
1074
- type: "uint256"
1075
- }
908
+ { internalType: "uint8", name: "nextPhase", type: "uint8" },
909
+ { internalType: "uint256", name: "expiredAt", type: "uint256" }
1076
910
  ],
1077
911
  name: "createPayableMemo",
1078
- outputs: [
1079
- {
1080
- internalType: "uint256",
1081
- name: "",
1082
- type: "uint256"
1083
- }
1084
- ],
912
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1085
913
  stateMutability: "nonpayable",
1086
914
  type: "function"
1087
915
  },
1088
916
  {
1089
917
  inputs: [],
1090
918
  name: "evaluatorFeeBP",
1091
- outputs: [
1092
- {
1093
- internalType: "uint256",
1094
- name: "",
1095
- type: "uint256"
1096
- }
1097
- ],
919
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1098
920
  stateMutability: "view",
1099
921
  type: "function"
1100
922
  },
1101
923
  {
1102
924
  inputs: [
1103
- {
1104
- internalType: "uint256",
1105
- name: "jobId",
1106
- type: "uint256"
1107
- },
1108
- {
1109
- internalType: "uint256",
1110
- name: "offset",
1111
- type: "uint256"
1112
- },
1113
- {
1114
- internalType: "uint256",
1115
- name: "limit",
1116
- type: "uint256"
1117
- }
925
+ { internalType: "uint256", name: "jobId", type: "uint256" },
926
+ { internalType: "uint256", name: "offset", type: "uint256" },
927
+ { internalType: "uint256", name: "limit", type: "uint256" }
1118
928
  ],
1119
929
  name: "getAllMemos",
1120
930
  outputs: [
1121
931
  {
1122
932
  components: [
1123
- {
1124
- internalType: "string",
1125
- name: "content",
1126
- type: "string"
1127
- },
933
+ { internalType: "string", name: "content", type: "string" },
1128
934
  {
1129
935
  internalType: "enum InteractionLedger.MemoType",
1130
936
  name: "memoType",
1131
937
  type: "uint8"
1132
938
  },
1133
- {
1134
- internalType: "bool",
1135
- name: "isSecured",
1136
- type: "bool"
1137
- },
1138
- {
1139
- internalType: "uint8",
1140
- name: "nextPhase",
1141
- type: "uint8"
1142
- },
1143
- {
1144
- internalType: "uint256",
1145
- name: "jobId",
1146
- type: "uint256"
1147
- },
1148
- {
1149
- internalType: "address",
1150
- name: "sender",
1151
- type: "address"
1152
- }
939
+ { internalType: "bool", name: "isSecured", type: "bool" },
940
+ { internalType: "uint8", name: "nextPhase", type: "uint8" },
941
+ { internalType: "uint256", name: "jobId", type: "uint256" },
942
+ { internalType: "address", name: "sender", type: "address" }
1153
943
  ],
1154
944
  internalType: "struct InteractionLedger.Memo[]",
1155
945
  name: "",
1156
946
  type: "tuple[]"
1157
947
  },
1158
- {
1159
- internalType: "uint256",
1160
- name: "total",
1161
- type: "uint256"
1162
- }
948
+ { internalType: "uint256", name: "total", type: "uint256" }
1163
949
  ],
1164
950
  stateMutability: "view",
1165
951
  type: "function"
1166
952
  },
1167
953
  {
1168
954
  inputs: [
1169
- {
1170
- internalType: "uint256",
1171
- name: "jobId",
1172
- type: "uint256"
1173
- },
1174
- {
1175
- internalType: "uint8",
1176
- name: "phase",
1177
- type: "uint8"
1178
- }
955
+ { internalType: "uint256", name: "jobId", type: "uint256" },
956
+ { internalType: "uint8", name: "phase", type: "uint8" }
1179
957
  ],
1180
958
  name: "getJobPhaseMemoIds",
1181
- outputs: [
1182
- {
1183
- internalType: "uint256[]",
1184
- name: "",
1185
- type: "uint256[]"
1186
- }
1187
- ],
959
+ outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
1188
960
  stateMutability: "view",
1189
961
  type: "function"
1190
962
  },
1191
963
  {
1192
964
  inputs: [
1193
- {
1194
- internalType: "uint256",
1195
- name: "jobId",
1196
- type: "uint256"
1197
- },
1198
- {
1199
- internalType: "uint8",
1200
- name: "phase",
1201
- type: "uint8"
1202
- },
1203
- {
1204
- internalType: "uint256",
1205
- name: "offset",
1206
- type: "uint256"
1207
- },
1208
- {
1209
- internalType: "uint256",
1210
- name: "limit",
1211
- type: "uint256"
1212
- }
1213
- ],
1214
- name: "getMemosForPhase",
1215
- outputs: [
965
+ { internalType: "uint256", name: "jobId", type: "uint256" },
966
+ { internalType: "uint8", name: "phase", type: "uint8" },
967
+ { internalType: "uint256", name: "offset", type: "uint256" },
968
+ { internalType: "uint256", name: "limit", type: "uint256" }
969
+ ],
970
+ name: "getMemosForPhase",
971
+ outputs: [
1216
972
  {
1217
973
  components: [
1218
- {
1219
- internalType: "string",
1220
- name: "content",
1221
- type: "string"
1222
- },
974
+ { internalType: "string", name: "content", type: "string" },
1223
975
  {
1224
976
  internalType: "enum InteractionLedger.MemoType",
1225
977
  name: "memoType",
1226
978
  type: "uint8"
1227
979
  },
1228
- {
1229
- internalType: "bool",
1230
- name: "isSecured",
1231
- type: "bool"
1232
- },
1233
- {
1234
- internalType: "uint8",
1235
- name: "nextPhase",
1236
- type: "uint8"
1237
- },
1238
- {
1239
- internalType: "uint256",
1240
- name: "jobId",
1241
- type: "uint256"
1242
- },
1243
- {
1244
- internalType: "address",
1245
- name: "sender",
1246
- type: "address"
1247
- }
980
+ { internalType: "bool", name: "isSecured", type: "bool" },
981
+ { internalType: "uint8", name: "nextPhase", type: "uint8" },
982
+ { internalType: "uint256", name: "jobId", type: "uint256" },
983
+ { internalType: "address", name: "sender", type: "address" }
1248
984
  ],
1249
985
  internalType: "struct InteractionLedger.Memo[]",
1250
986
  name: "",
1251
987
  type: "tuple[]"
1252
988
  },
1253
- {
1254
- internalType: "uint256",
1255
- name: "total",
1256
- type: "uint256"
1257
- }
989
+ { internalType: "uint256", name: "total", type: "uint256" }
1258
990
  ],
1259
991
  stateMutability: "view",
1260
992
  type: "function"
@@ -1262,47 +994,21 @@ var ACP_ABI = [
1262
994
  {
1263
995
  inputs: [],
1264
996
  name: "getPhases",
1265
- outputs: [
1266
- {
1267
- internalType: "string[7]",
1268
- name: "",
1269
- type: "string[7]"
1270
- }
1271
- ],
997
+ outputs: [{ internalType: "string[7]", name: "", type: "string[7]" }],
1272
998
  stateMutability: "pure",
1273
999
  type: "function"
1274
1000
  },
1275
1001
  {
1276
- inputs: [
1277
- {
1278
- internalType: "bytes32",
1279
- name: "role",
1280
- type: "bytes32"
1281
- }
1282
- ],
1002
+ inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
1283
1003
  name: "getRoleAdmin",
1284
- outputs: [
1285
- {
1286
- internalType: "bytes32",
1287
- name: "",
1288
- type: "bytes32"
1289
- }
1290
- ],
1004
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
1291
1005
  stateMutability: "view",
1292
1006
  type: "function"
1293
1007
  },
1294
1008
  {
1295
1009
  inputs: [
1296
- {
1297
- internalType: "bytes32",
1298
- name: "role",
1299
- type: "bytes32"
1300
- },
1301
- {
1302
- internalType: "address",
1303
- name: "account",
1304
- type: "address"
1305
- }
1010
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1011
+ { internalType: "address", name: "account", type: "address" }
1306
1012
  ],
1307
1013
  name: "grantRole",
1308
1014
  outputs: [],
@@ -1311,50 +1017,20 @@ var ACP_ABI = [
1311
1017
  },
1312
1018
  {
1313
1019
  inputs: [
1314
- {
1315
- internalType: "bytes32",
1316
- name: "role",
1317
- type: "bytes32"
1318
- },
1319
- {
1320
- internalType: "address",
1321
- name: "account",
1322
- type: "address"
1323
- }
1020
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1021
+ { internalType: "address", name: "account", type: "address" }
1324
1022
  ],
1325
1023
  name: "hasRole",
1326
- outputs: [
1327
- {
1328
- internalType: "bool",
1329
- name: "",
1330
- type: "bool"
1331
- }
1332
- ],
1024
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1333
1025
  stateMutability: "view",
1334
1026
  type: "function"
1335
1027
  },
1336
1028
  {
1337
1029
  inputs: [
1338
- {
1339
- internalType: "address",
1340
- name: "paymentTokenAddress",
1341
- type: "address"
1342
- },
1343
- {
1344
- internalType: "uint256",
1345
- name: "evaluatorFeeBP_",
1346
- type: "uint256"
1347
- },
1348
- {
1349
- internalType: "uint256",
1350
- name: "platformFeeBP_",
1351
- type: "uint256"
1352
- },
1353
- {
1354
- internalType: "address",
1355
- name: "platformTreasury_",
1356
- type: "address"
1357
- }
1030
+ { internalType: "address", name: "paymentTokenAddress", type: "address" },
1031
+ { internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" },
1032
+ { internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
1033
+ { internalType: "address", name: "platformTreasury_", type: "address" }
1358
1034
  ],
1359
1035
  name: "initialize",
1360
1036
  outputs: [],
@@ -1363,163 +1039,59 @@ var ACP_ABI = [
1363
1039
  },
1364
1040
  {
1365
1041
  inputs: [
1366
- {
1367
- internalType: "uint256",
1368
- name: "jobId",
1369
- type: "uint256"
1370
- },
1371
- {
1372
- internalType: "address",
1373
- name: "account",
1374
- type: "address"
1375
- }
1042
+ { internalType: "uint256", name: "jobId", type: "uint256" },
1043
+ { internalType: "address", name: "account", type: "address" }
1376
1044
  ],
1377
1045
  name: "isJobEvaluator",
1378
- outputs: [
1379
- {
1380
- internalType: "bool",
1381
- name: "",
1382
- type: "bool"
1383
- }
1384
- ],
1046
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1385
1047
  stateMutability: "view",
1386
1048
  type: "function"
1387
1049
  },
1388
1050
  {
1389
- inputs: [
1390
- {
1391
- internalType: "uint256",
1392
- name: "memoId",
1393
- type: "uint256"
1394
- }
1395
- ],
1051
+ inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
1396
1052
  name: "isPayableMemo",
1397
- outputs: [
1398
- {
1399
- internalType: "bool",
1400
- name: "",
1401
- type: "bool"
1402
- }
1403
- ],
1053
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1404
1054
  stateMutability: "view",
1405
1055
  type: "function"
1406
1056
  },
1407
1057
  {
1408
- inputs: [
1409
- {
1410
- internalType: "uint256",
1411
- name: "jobId",
1412
- type: "uint256"
1413
- }
1414
- ],
1058
+ inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
1415
1059
  name: "jobAdditionalFees",
1416
- outputs: [
1417
- {
1418
- internalType: "uint256",
1419
- name: "",
1420
- type: "uint256"
1421
- }
1422
- ],
1060
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1423
1061
  stateMutability: "view",
1424
1062
  type: "function"
1425
1063
  },
1426
1064
  {
1427
1065
  inputs: [],
1428
1066
  name: "jobCounter",
1429
- outputs: [
1430
- {
1431
- internalType: "uint256",
1432
- name: "",
1433
- type: "uint256"
1434
- }
1435
- ],
1067
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1436
1068
  stateMutability: "view",
1437
1069
  type: "function"
1438
1070
  },
1439
1071
  {
1440
1072
  inputs: [
1441
- {
1442
- internalType: "uint256",
1443
- name: "jobId",
1444
- type: "uint256"
1445
- },
1446
- {
1447
- internalType: "uint8",
1448
- name: "phase",
1449
- type: "uint8"
1450
- },
1451
- {
1452
- internalType: "uint256",
1453
- name: "",
1454
- type: "uint256"
1455
- }
1073
+ { internalType: "uint256", name: "jobId", type: "uint256" },
1074
+ { internalType: "uint8", name: "phase", type: "uint8" },
1075
+ { internalType: "uint256", name: "", type: "uint256" }
1456
1076
  ],
1457
1077
  name: "jobMemoIds",
1458
- outputs: [
1459
- {
1460
- internalType: "uint256",
1461
- name: "memoIds",
1462
- type: "uint256"
1463
- }
1464
- ],
1078
+ outputs: [{ internalType: "uint256", name: "memoIds", type: "uint256" }],
1465
1079
  stateMutability: "view",
1466
1080
  type: "function"
1467
1081
  },
1468
1082
  {
1469
- inputs: [
1470
- {
1471
- internalType: "uint256",
1472
- name: "",
1473
- type: "uint256"
1474
- }
1475
- ],
1083
+ inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1476
1084
  name: "jobs",
1477
1085
  outputs: [
1478
- {
1479
- internalType: "uint256",
1480
- name: "id",
1481
- type: "uint256"
1482
- },
1483
- {
1484
- internalType: "address",
1485
- name: "client",
1486
- type: "address"
1487
- },
1488
- {
1489
- internalType: "address",
1490
- name: "provider",
1491
- type: "address"
1492
- },
1493
- {
1494
- internalType: "uint256",
1495
- name: "budget",
1496
- type: "uint256"
1497
- },
1498
- {
1499
- internalType: "uint256",
1500
- name: "amountClaimed",
1501
- type: "uint256"
1502
- },
1503
- {
1504
- internalType: "uint8",
1505
- name: "phase",
1506
- type: "uint8"
1507
- },
1508
- {
1509
- internalType: "uint256",
1510
- name: "memoCount",
1511
- type: "uint256"
1512
- },
1513
- {
1514
- internalType: "uint256",
1515
- name: "expiredAt",
1516
- type: "uint256"
1517
- },
1518
- {
1519
- internalType: "address",
1520
- name: "evaluator",
1521
- type: "address"
1522
- },
1086
+ { internalType: "uint256", name: "id", type: "uint256" },
1087
+ { internalType: "address", name: "client", type: "address" },
1088
+ { internalType: "address", name: "provider", type: "address" },
1089
+ { internalType: "uint256", name: "budget", type: "uint256" },
1090
+ { internalType: "uint256", name: "amountClaimed", type: "uint256" },
1091
+ { internalType: "uint8", name: "phase", type: "uint8" },
1092
+ { internalType: "uint256", name: "memoCount", type: "uint256" },
1093
+ { internalType: "uint256", name: "expiredAt", type: "uint256" },
1094
+ { internalType: "address", name: "evaluator", type: "address" },
1523
1095
  {
1524
1096
  internalType: "contract IERC20",
1525
1097
  name: "jobPaymentToken",
@@ -1532,75 +1104,31 @@ var ACP_ABI = [
1532
1104
  {
1533
1105
  inputs: [],
1534
1106
  name: "memoCounter",
1535
- outputs: [
1536
- {
1537
- internalType: "uint256",
1538
- name: "",
1539
- type: "uint256"
1540
- }
1541
- ],
1107
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1542
1108
  stateMutability: "view",
1543
1109
  type: "function"
1544
1110
  },
1545
1111
  {
1546
- inputs: [
1547
- {
1548
- internalType: "uint256",
1549
- name: "memoId",
1550
- type: "uint256"
1551
- }
1552
- ],
1112
+ inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
1553
1113
  name: "memoExpiredAt",
1554
- outputs: [
1555
- {
1556
- internalType: "uint256",
1557
- name: "expiredAt",
1558
- type: "uint256"
1559
- }
1560
- ],
1114
+ outputs: [{ internalType: "uint256", name: "expiredAt", type: "uint256" }],
1561
1115
  stateMutability: "view",
1562
1116
  type: "function"
1563
1117
  },
1564
1118
  {
1565
- inputs: [
1566
- {
1567
- internalType: "uint256",
1568
- name: "",
1569
- type: "uint256"
1570
- }
1571
- ],
1119
+ inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1572
1120
  name: "memos",
1573
1121
  outputs: [
1574
- {
1575
- internalType: "string",
1576
- name: "content",
1577
- type: "string"
1578
- },
1122
+ { internalType: "string", name: "content", type: "string" },
1579
1123
  {
1580
1124
  internalType: "enum InteractionLedger.MemoType",
1581
1125
  name: "memoType",
1582
1126
  type: "uint8"
1583
1127
  },
1584
- {
1585
- internalType: "bool",
1586
- name: "isSecured",
1587
- type: "bool"
1588
- },
1589
- {
1590
- internalType: "uint8",
1591
- name: "nextPhase",
1592
- type: "uint8"
1593
- },
1594
- {
1595
- internalType: "uint256",
1596
- name: "jobId",
1597
- type: "uint256"
1598
- },
1599
- {
1600
- internalType: "address",
1601
- name: "sender",
1602
- type: "address"
1603
- }
1128
+ { internalType: "bool", name: "isSecured", type: "bool" },
1129
+ { internalType: "uint8", name: "nextPhase", type: "uint8" },
1130
+ { internalType: "uint256", name: "jobId", type: "uint256" },
1131
+ { internalType: "address", name: "sender", type: "address" }
1604
1132
  ],
1605
1133
  stateMutability: "view",
1606
1134
  type: "function"
@@ -1608,56 +1136,24 @@ var ACP_ABI = [
1608
1136
  {
1609
1137
  inputs: [],
1610
1138
  name: "numEvaluatorsPerJob",
1611
- outputs: [
1612
- {
1613
- internalType: "uint8",
1614
- name: "",
1615
- type: "uint8"
1616
- }
1617
- ],
1139
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
1618
1140
  stateMutability: "view",
1619
1141
  type: "function"
1620
1142
  },
1621
1143
  {
1622
- inputs: [
1623
- {
1624
- internalType: "uint256",
1625
- name: "memoId",
1626
- type: "uint256"
1627
- }
1628
- ],
1144
+ inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
1629
1145
  name: "payableDetails",
1630
1146
  outputs: [
1631
- {
1632
- internalType: "address",
1633
- name: "token",
1634
- type: "address"
1635
- },
1636
- {
1637
- internalType: "uint256",
1638
- name: "amount",
1639
- type: "uint256"
1640
- },
1641
- {
1642
- internalType: "address",
1643
- name: "recipient",
1644
- type: "address"
1645
- },
1646
- {
1647
- internalType: "uint256",
1648
- name: "feeAmount",
1649
- type: "uint256"
1650
- },
1147
+ { internalType: "address", name: "token", type: "address" },
1148
+ { internalType: "uint256", name: "amount", type: "uint256" },
1149
+ { internalType: "address", name: "recipient", type: "address" },
1150
+ { internalType: "uint256", name: "feeAmount", type: "uint256" },
1651
1151
  {
1652
1152
  internalType: "enum ACPSimple.FeeType",
1653
1153
  name: "feeType",
1654
1154
  type: "uint8"
1655
1155
  },
1656
- {
1657
- internalType: "bool",
1658
- name: "isExecuted",
1659
- type: "bool"
1660
- }
1156
+ { internalType: "bool", name: "isExecuted", type: "bool" }
1661
1157
  ],
1662
1158
  stateMutability: "view",
1663
1159
  type: "function"
@@ -1665,54 +1161,28 @@ var ACP_ABI = [
1665
1161
  {
1666
1162
  inputs: [],
1667
1163
  name: "paymentToken",
1668
- outputs: [
1669
- {
1670
- internalType: "contract IERC20",
1671
- name: "",
1672
- type: "address"
1673
- }
1674
- ],
1164
+ outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
1675
1165
  stateMutability: "view",
1676
1166
  type: "function"
1677
1167
  },
1678
1168
  {
1679
1169
  inputs: [],
1680
1170
  name: "platformFeeBP",
1681
- outputs: [
1682
- {
1683
- internalType: "uint256",
1684
- name: "",
1685
- type: "uint256"
1686
- }
1687
- ],
1171
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1688
1172
  stateMutability: "view",
1689
1173
  type: "function"
1690
1174
  },
1691
1175
  {
1692
1176
  inputs: [],
1693
1177
  name: "platformTreasury",
1694
- outputs: [
1695
- {
1696
- internalType: "address",
1697
- name: "",
1698
- type: "address"
1699
- }
1700
- ],
1178
+ outputs: [{ internalType: "address", name: "", type: "address" }],
1701
1179
  stateMutability: "view",
1702
1180
  type: "function"
1703
1181
  },
1704
1182
  {
1705
1183
  inputs: [
1706
- {
1707
- internalType: "bytes32",
1708
- name: "role",
1709
- type: "bytes32"
1710
- },
1711
- {
1712
- internalType: "address",
1713
- name: "callerConfirmation",
1714
- type: "address"
1715
- }
1184
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1185
+ { internalType: "address", name: "callerConfirmation", type: "address" }
1716
1186
  ],
1717
1187
  name: "renounceRole",
1718
1188
  outputs: [],
@@ -1721,16 +1191,8 @@ var ACP_ABI = [
1721
1191
  },
1722
1192
  {
1723
1193
  inputs: [
1724
- {
1725
- internalType: "bytes32",
1726
- name: "role",
1727
- type: "bytes32"
1728
- },
1729
- {
1730
- internalType: "address",
1731
- name: "account",
1732
- type: "address"
1733
- }
1194
+ { internalType: "bytes32", name: "role", type: "bytes32" },
1195
+ { internalType: "address", name: "account", type: "address" }
1734
1196
  ],
1735
1197
  name: "revokeRole",
1736
1198
  outputs: [],
@@ -1739,16 +1201,8 @@ var ACP_ABI = [
1739
1201
  },
1740
1202
  {
1741
1203
  inputs: [
1742
- {
1743
- internalType: "uint256",
1744
- name: "jobId",
1745
- type: "uint256"
1746
- },
1747
- {
1748
- internalType: "uint256",
1749
- name: "amount",
1750
- type: "uint256"
1751
- }
1204
+ { internalType: "uint256", name: "jobId", type: "uint256" },
1205
+ { internalType: "uint256", name: "amount", type: "uint256" }
1752
1206
  ],
1753
1207
  name: "setBudget",
1754
1208
  outputs: [],
@@ -1757,16 +1211,8 @@ var ACP_ABI = [
1757
1211
  },
1758
1212
  {
1759
1213
  inputs: [
1760
- {
1761
- internalType: "uint256",
1762
- name: "jobId",
1763
- type: "uint256"
1764
- },
1765
- {
1766
- internalType: "uint256",
1767
- name: "amount",
1768
- type: "uint256"
1769
- },
1214
+ { internalType: "uint256", name: "jobId", type: "uint256" },
1215
+ { internalType: "uint256", name: "amount", type: "uint256" },
1770
1216
  {
1771
1217
  internalType: "contract IERC20",
1772
1218
  name: "jobPaymentToken_",
@@ -1780,21 +1226,9 @@ var ACP_ABI = [
1780
1226
  },
1781
1227
  {
1782
1228
  inputs: [
1783
- {
1784
- internalType: "uint256",
1785
- name: "memoId",
1786
- type: "uint256"
1787
- },
1788
- {
1789
- internalType: "bool",
1790
- name: "isApproved",
1791
- type: "bool"
1792
- },
1793
- {
1794
- internalType: "string",
1795
- name: "reason",
1796
- type: "string"
1797
- }
1229
+ { internalType: "uint256", name: "memoId", type: "uint256" },
1230
+ { internalType: "bool", name: "isApproved", type: "bool" },
1231
+ { internalType: "string", name: "reason", type: "string" }
1798
1232
  ],
1799
1233
  name: "signMemo",
1800
1234
  outputs: [],
@@ -1803,54 +1237,24 @@ var ACP_ABI = [
1803
1237
  },
1804
1238
  {
1805
1239
  inputs: [
1806
- {
1807
- internalType: "uint256",
1808
- name: "memoId",
1809
- type: "uint256"
1810
- },
1811
- {
1812
- internalType: "address",
1813
- name: "signer",
1814
- type: "address"
1815
- }
1240
+ { internalType: "uint256", name: "memoId", type: "uint256" },
1241
+ { internalType: "address", name: "signer", type: "address" }
1816
1242
  ],
1817
1243
  name: "signatories",
1818
- outputs: [
1819
- {
1820
- internalType: "uint8",
1821
- name: "res",
1822
- type: "uint8"
1823
- }
1824
- ],
1244
+ outputs: [{ internalType: "uint8", name: "res", type: "uint8" }],
1825
1245
  stateMutability: "view",
1826
1246
  type: "function"
1827
1247
  },
1828
1248
  {
1829
- inputs: [
1830
- {
1831
- internalType: "bytes4",
1832
- name: "interfaceId",
1833
- type: "bytes4"
1834
- }
1835
- ],
1249
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
1836
1250
  name: "supportsInterface",
1837
- outputs: [
1838
- {
1839
- internalType: "bool",
1840
- name: "",
1841
- type: "bool"
1842
- }
1843
- ],
1251
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1844
1252
  stateMutability: "view",
1845
1253
  type: "function"
1846
1254
  },
1847
1255
  {
1848
1256
  inputs: [
1849
- {
1850
- internalType: "uint256",
1851
- name: "evaluatorFeeBP_",
1852
- type: "uint256"
1853
- }
1257
+ { internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
1854
1258
  ],
1855
1259
  name: "updateEvaluatorFee",
1856
1260
  outputs: [],
@@ -1859,16 +1263,8 @@ var ACP_ABI = [
1859
1263
  },
1860
1264
  {
1861
1265
  inputs: [
1862
- {
1863
- internalType: "uint256",
1864
- name: "platformFeeBP_",
1865
- type: "uint256"
1866
- },
1867
- {
1868
- internalType: "address",
1869
- name: "platformTreasury_",
1870
- type: "address"
1871
- }
1266
+ { internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
1267
+ { internalType: "address", name: "platformTreasury_", type: "address" }
1872
1268
  ],
1873
1269
  name: "updatePlatformFee",
1874
1270
  outputs: [],
@@ -1876,17 +1272,21 @@ var ACP_ABI = [
1876
1272
  type: "function"
1877
1273
  },
1878
1274
  {
1879
- inputs: [
1880
- {
1881
- internalType: "uint256",
1882
- name: "memoId",
1883
- type: "uint256"
1884
- }
1885
- ],
1275
+ inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
1886
1276
  name: "withdrawEscrowedFunds",
1887
1277
  outputs: [],
1888
1278
  stateMutability: "nonpayable",
1889
1279
  type: "function"
1280
+ },
1281
+ {
1282
+ inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
1283
+ name: "x402PaymentDetails",
1284
+ outputs: [
1285
+ { internalType: "bool", name: "isX402", type: "bool" },
1286
+ { internalType: "bool", name: "isBudgetReceived", type: "bool" }
1287
+ ],
1288
+ stateMutability: "view",
1289
+ type: "function"
1890
1290
  }
1891
1291
  ];
1892
1292
  var acpAbi_default = ACP_ABI;
@@ -2439,6 +1839,33 @@ var ACP_V2_ABI = [
2439
1839
  stateMutability: "nonpayable",
2440
1840
  type: "function"
2441
1841
  },
1842
+ {
1843
+ inputs: [
1844
+ { internalType: "address", name: "provider", type: "address" },
1845
+ { internalType: "address", name: "evaluator", type: "address" },
1846
+ { internalType: "uint256", name: "expiredAt", type: "uint256" },
1847
+ { internalType: "address", name: "paymentToken", type: "address" },
1848
+ { internalType: "uint256", name: "budget", type: "uint256" },
1849
+ { internalType: "string", name: "metadata", type: "string" }
1850
+ ],
1851
+ name: "createX402Job",
1852
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1853
+ stateMutability: "nonpayable",
1854
+ type: "function"
1855
+ },
1856
+ {
1857
+ inputs: [
1858
+ { internalType: "uint256", name: "accountId", type: "uint256" },
1859
+ { internalType: "address", name: "evaluator", type: "address" },
1860
+ { internalType: "uint256", name: "budget", type: "uint256" },
1861
+ { internalType: "address", name: "paymentToken", type: "address" },
1862
+ { internalType: "uint256", name: "expiredAt", type: "uint256" }
1863
+ ],
1864
+ name: "createX402JobWithAccount",
1865
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1866
+ stateMutability: "nonpayable",
1867
+ type: "function"
1868
+ },
2442
1869
  {
2443
1870
  inputs: [],
2444
1871
  name: "defaultPaymentToken",
@@ -2543,7 +1970,7 @@ var ACP_V2_ABI = [
2543
1970
  { internalType: "uint256", name: "offset", type: "uint256" },
2544
1971
  { internalType: "uint256", name: "limit", type: "uint256" }
2545
1972
  ],
2546
- name: "getMemosForPhase",
1973
+ name: "getMemosForMemoType",
2547
1974
  outputs: [
2548
1975
  {
2549
1976
  components: [
@@ -2580,10 +2007,53 @@ var ACP_V2_ABI = [
2580
2007
  type: "function"
2581
2008
  },
2582
2009
  {
2583
- inputs: [],
2584
- name: "getPhases",
2585
- outputs: [{ internalType: "string[7]", name: "", type: "string[7]" }],
2586
- stateMutability: "pure",
2010
+ inputs: [
2011
+ { internalType: "uint256", name: "jobId", type: "uint256" },
2012
+ { internalType: "enum ACPTypes.JobPhase", name: "phase", type: "uint8" },
2013
+ { internalType: "uint256", name: "offset", type: "uint256" },
2014
+ { internalType: "uint256", name: "limit", type: "uint256" }
2015
+ ],
2016
+ name: "getMemosForPhaseType",
2017
+ outputs: [
2018
+ {
2019
+ components: [
2020
+ { internalType: "uint256", name: "id", type: "uint256" },
2021
+ { internalType: "uint256", name: "jobId", type: "uint256" },
2022
+ { internalType: "address", name: "sender", type: "address" },
2023
+ { internalType: "string", name: "content", type: "string" },
2024
+ {
2025
+ internalType: "enum ACPTypes.MemoType",
2026
+ name: "memoType",
2027
+ type: "uint8"
2028
+ },
2029
+ { internalType: "uint256", name: "createdAt", type: "uint256" },
2030
+ { internalType: "bool", name: "isApproved", type: "bool" },
2031
+ { internalType: "address", name: "approvedBy", type: "address" },
2032
+ { internalType: "uint256", name: "approvedAt", type: "uint256" },
2033
+ { internalType: "bool", name: "requiresApproval", type: "bool" },
2034
+ { internalType: "string", name: "metadata", type: "string" },
2035
+ { internalType: "bool", name: "isSecured", type: "bool" },
2036
+ {
2037
+ internalType: "enum ACPTypes.JobPhase",
2038
+ name: "nextPhase",
2039
+ type: "uint8"
2040
+ },
2041
+ { internalType: "uint256", name: "expiredAt", type: "uint256" }
2042
+ ],
2043
+ internalType: "struct ACPTypes.Memo[]",
2044
+ name: "memos",
2045
+ type: "tuple[]"
2046
+ },
2047
+ { internalType: "uint256", name: "total", type: "uint256" }
2048
+ ],
2049
+ stateMutability: "view",
2050
+ type: "function"
2051
+ },
2052
+ {
2053
+ inputs: [],
2054
+ name: "getPhases",
2055
+ outputs: [{ internalType: "string[7]", name: "", type: "string[7]" }],
2056
+ stateMutability: "pure",
2587
2057
  type: "function"
2588
2058
  },
2589
2059
  {
@@ -2695,331 +2165,1136 @@ var ACP_V2_ABI = [
2695
2165
  type: "function"
2696
2166
  },
2697
2167
  {
2698
- inputs: [],
2699
- name: "proxiableUUID",
2700
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2701
- stateMutability: "view",
2168
+ inputs: [],
2169
+ name: "proxiableUUID",
2170
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2171
+ stateMutability: "view",
2172
+ type: "function"
2173
+ },
2174
+ {
2175
+ inputs: [
2176
+ { internalType: "bytes32", name: "role", type: "bytes32" },
2177
+ { internalType: "address", name: "callerConfirmation", type: "address" }
2178
+ ],
2179
+ name: "renounceRole",
2180
+ outputs: [],
2181
+ stateMutability: "nonpayable",
2182
+ type: "function"
2183
+ },
2184
+ {
2185
+ inputs: [
2186
+ { internalType: "bytes32", name: "role", type: "bytes32" },
2187
+ { internalType: "address", name: "account", type: "address" }
2188
+ ],
2189
+ name: "revokeRole",
2190
+ outputs: [],
2191
+ stateMutability: "nonpayable",
2192
+ type: "function"
2193
+ },
2194
+ {
2195
+ inputs: [
2196
+ { internalType: "uint256", name: "jobId", type: "uint256" },
2197
+ { internalType: "uint256", name: "amount", type: "uint256" }
2198
+ ],
2199
+ name: "setBudget",
2200
+ outputs: [],
2201
+ stateMutability: "nonpayable",
2202
+ type: "function"
2203
+ },
2204
+ {
2205
+ inputs: [
2206
+ { internalType: "uint256", name: "jobId", type: "uint256" },
2207
+ { internalType: "uint256", name: "amount", type: "uint256" },
2208
+ { internalType: "address", name: "paymentToken", type: "address" }
2209
+ ],
2210
+ name: "setBudgetWithPaymentToken",
2211
+ outputs: [],
2212
+ stateMutability: "nonpayable",
2213
+ type: "function"
2214
+ },
2215
+ {
2216
+ inputs: [
2217
+ { internalType: "uint256", name: "memoId", type: "uint256" },
2218
+ { internalType: "bool", name: "isApproved", type: "bool" },
2219
+ { internalType: "string", name: "reason", type: "string" }
2220
+ ],
2221
+ name: "signMemo",
2222
+ outputs: [],
2223
+ stateMutability: "nonpayable",
2224
+ type: "function"
2225
+ },
2226
+ {
2227
+ inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
2228
+ name: "supportsInterface",
2229
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2230
+ stateMutability: "view",
2231
+ type: "function"
2232
+ },
2233
+ {
2234
+ inputs: [],
2235
+ name: "unpause",
2236
+ outputs: [],
2237
+ stateMutability: "nonpayable",
2238
+ type: "function"
2239
+ },
2240
+ {
2241
+ inputs: [
2242
+ { internalType: "uint256", name: "accountId", type: "uint256" },
2243
+ { internalType: "string", name: "metadata", type: "string" }
2244
+ ],
2245
+ name: "updateAccountMetadata",
2246
+ outputs: [],
2247
+ stateMutability: "nonpayable",
2248
+ type: "function"
2249
+ },
2250
+ {
2251
+ inputs: [
2252
+ { internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
2253
+ ],
2254
+ name: "updateEvaluatorFee",
2255
+ outputs: [],
2256
+ stateMutability: "nonpayable",
2257
+ type: "function"
2258
+ },
2259
+ {
2260
+ inputs: [
2261
+ { internalType: "string", name: "moduleType", type: "string" },
2262
+ { internalType: "address", name: "moduleAddress", type: "address" }
2263
+ ],
2264
+ name: "updateModule",
2265
+ outputs: [],
2266
+ stateMutability: "nonpayable",
2267
+ type: "function"
2268
+ },
2269
+ {
2270
+ inputs: [
2271
+ { internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
2272
+ { internalType: "address", name: "platformTreasury_", type: "address" },
2273
+ { internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
2274
+ ],
2275
+ name: "updatePlatformConfig",
2276
+ outputs: [],
2277
+ stateMutability: "nonpayable",
2278
+ type: "function"
2279
+ },
2280
+ {
2281
+ inputs: [
2282
+ { internalType: "address", name: "newImplementation", type: "address" },
2283
+ { internalType: "bytes", name: "data", type: "bytes" }
2284
+ ],
2285
+ name: "upgradeToAndCall",
2286
+ outputs: [],
2287
+ stateMutability: "payable",
2288
+ type: "function"
2289
+ }
2290
+ ];
2291
+ var acpAbiV2_default = ACP_V2_ABI;
2292
+
2293
+ // src/configs/acpConfigs.ts
2294
+ var AcpContractConfig2 = class {
2295
+ constructor(chain, contractAddress, baseFare, alchemyRpcUrl, acpUrl, abi, rpcEndpoint, x402Config) {
2296
+ this.chain = chain;
2297
+ this.contractAddress = contractAddress;
2298
+ this.baseFare = baseFare;
2299
+ this.alchemyRpcUrl = alchemyRpcUrl;
2300
+ this.acpUrl = acpUrl;
2301
+ this.abi = abi;
2302
+ this.rpcEndpoint = rpcEndpoint;
2303
+ this.x402Config = x402Config;
2304
+ }
2305
+ };
2306
+ var baseSepoliaAcpConfig = new AcpContractConfig2(
2307
+ import_infra.baseSepolia,
2308
+ "0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
2309
+ new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
2310
+ "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
2311
+ "https://acpx.virtuals.gg",
2312
+ acpAbi_default
2313
+ );
2314
+ var baseSepoliaAcpX402Config = new AcpContractConfig2(
2315
+ import_infra.baseSepolia,
2316
+ "0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
2317
+ new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
2318
+ "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
2319
+ "https://acpx.virtuals.gg",
2320
+ acpAbi_default,
2321
+ void 0,
2322
+ {
2323
+ url: "https://dev-acp-x402.virtuals.io"
2324
+ }
2325
+ );
2326
+ var baseSepoliaAcpConfigV2 = new AcpContractConfig2(
2327
+ import_infra.baseSepolia,
2328
+ "0xdf54E6Ed6cD1d0632d973ADECf96597b7e87893c",
2329
+ new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
2330
+ "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
2331
+ "https://acpx.virtuals.gg",
2332
+ acpAbiV2_default
2333
+ );
2334
+ var baseSepoliaAcpX402ConfigV2 = new AcpContractConfig2(
2335
+ import_infra.baseSepolia,
2336
+ "0xdf54E6Ed6cD1d0632d973ADECf96597b7e87893c",
2337
+ new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
2338
+ "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
2339
+ "https://acpx.virtuals.gg",
2340
+ acpAbiV2_default,
2341
+ void 0,
2342
+ {
2343
+ url: "https://dev-acp-x402.virtuals.io"
2344
+ }
2345
+ );
2346
+ var baseAcpConfig = new AcpContractConfig2(
2347
+ import_infra.base,
2348
+ "0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
2349
+ new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
2350
+ "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
2351
+ "https://acpx.virtuals.io",
2352
+ acpAbi_default
2353
+ );
2354
+ var baseAcpX402Config = new AcpContractConfig2(
2355
+ import_infra.base,
2356
+ "0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
2357
+ new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
2358
+ "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
2359
+ "https://acpx.virtuals.io",
2360
+ acpAbi_default,
2361
+ void 0,
2362
+ {
2363
+ url: "https://acp-x402.virtuals.io"
2364
+ }
2365
+ );
2366
+ var baseAcpConfigV2 = new AcpContractConfig2(
2367
+ import_infra.base,
2368
+ "0xa6C9BA866992cfD7fd6460ba912bfa405adA9df0",
2369
+ new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
2370
+ "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
2371
+ "https://acpx.virtuals.io",
2372
+ acpAbiV2_default
2373
+ );
2374
+ var baseAcpX402ConfigV2 = new AcpContractConfig2(
2375
+ import_infra.base,
2376
+ "0xa6C9BA866992cfD7fd6460ba912bfa405adA9df0",
2377
+ new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
2378
+ "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
2379
+ "https://acpx.virtuals.io",
2380
+ acpAbiV2_default,
2381
+ void 0,
2382
+ {
2383
+ url: "https://acp-x402.virtuals.io"
2384
+ }
2385
+ );
2386
+
2387
+ // src/abis/wethAbi.ts
2388
+ var WETH_ABI = [
2389
+ {
2390
+ anonymous: false,
2391
+ inputs: [
2392
+ { indexed: true, internalType: "address", name: "src", type: "address" },
2393
+ { indexed: true, internalType: "address", name: "guy", type: "address" },
2394
+ { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2395
+ ],
2396
+ name: "Approval",
2397
+ type: "event"
2398
+ },
2399
+ {
2400
+ anonymous: false,
2401
+ inputs: [
2402
+ { indexed: true, internalType: "address", name: "dst", type: "address" },
2403
+ { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2404
+ ],
2405
+ name: "Deposit",
2406
+ type: "event"
2407
+ },
2408
+ {
2409
+ anonymous: false,
2410
+ inputs: [
2411
+ { indexed: true, internalType: "address", name: "src", type: "address" },
2412
+ { indexed: true, internalType: "address", name: "dst", type: "address" },
2413
+ { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2414
+ ],
2415
+ name: "Transfer",
2416
+ type: "event"
2417
+ },
2418
+ {
2419
+ anonymous: false,
2420
+ inputs: [
2421
+ { indexed: true, internalType: "address", name: "src", type: "address" },
2422
+ { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2423
+ ],
2424
+ name: "Withdrawal",
2425
+ type: "event"
2426
+ },
2427
+ { payable: true, stateMutability: "payable", type: "fallback" },
2428
+ {
2429
+ constant: true,
2430
+ inputs: [
2431
+ { internalType: "address", name: "", type: "address" },
2432
+ { internalType: "address", name: "", type: "address" }
2433
+ ],
2434
+ name: "allowance",
2435
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2436
+ payable: false,
2437
+ stateMutability: "view",
2438
+ type: "function"
2439
+ },
2440
+ {
2441
+ constant: false,
2442
+ inputs: [
2443
+ { internalType: "address", name: "guy", type: "address" },
2444
+ { internalType: "uint256", name: "wad", type: "uint256" }
2445
+ ],
2446
+ name: "approve",
2447
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2448
+ payable: false,
2449
+ stateMutability: "nonpayable",
2450
+ type: "function"
2451
+ },
2452
+ {
2453
+ constant: true,
2454
+ inputs: [{ internalType: "address", name: "", type: "address" }],
2455
+ name: "balanceOf",
2456
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2457
+ payable: false,
2458
+ stateMutability: "view",
2459
+ type: "function"
2460
+ },
2461
+ {
2462
+ constant: true,
2463
+ inputs: [],
2464
+ name: "decimals",
2465
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
2466
+ payable: false,
2467
+ stateMutability: "view",
2468
+ type: "function"
2469
+ },
2470
+ {
2471
+ constant: false,
2472
+ inputs: [],
2473
+ name: "deposit",
2474
+ outputs: [],
2475
+ payable: true,
2476
+ stateMutability: "payable",
2477
+ type: "function"
2478
+ },
2479
+ {
2480
+ constant: true,
2481
+ inputs: [],
2482
+ name: "name",
2483
+ outputs: [{ internalType: "string", name: "", type: "string" }],
2484
+ payable: false,
2485
+ stateMutability: "view",
2486
+ type: "function"
2487
+ },
2488
+ {
2489
+ constant: true,
2490
+ inputs: [],
2491
+ name: "symbol",
2492
+ outputs: [{ internalType: "string", name: "", type: "string" }],
2493
+ payable: false,
2494
+ stateMutability: "view",
2495
+ type: "function"
2496
+ },
2497
+ {
2498
+ constant: true,
2499
+ inputs: [],
2500
+ name: "totalSupply",
2501
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2502
+ payable: false,
2503
+ stateMutability: "view",
2504
+ type: "function"
2505
+ },
2506
+ {
2507
+ constant: false,
2508
+ inputs: [
2509
+ { internalType: "address", name: "dst", type: "address" },
2510
+ { internalType: "uint256", name: "wad", type: "uint256" }
2511
+ ],
2512
+ name: "transfer",
2513
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2514
+ payable: false,
2515
+ stateMutability: "nonpayable",
2516
+ type: "function"
2517
+ },
2518
+ {
2519
+ constant: false,
2520
+ inputs: [
2521
+ { internalType: "address", name: "src", type: "address" },
2522
+ { internalType: "address", name: "dst", type: "address" },
2523
+ { internalType: "uint256", name: "wad", type: "uint256" }
2524
+ ],
2525
+ name: "transferFrom",
2526
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2527
+ payable: false,
2528
+ stateMutability: "nonpayable",
2529
+ type: "function"
2530
+ },
2531
+ {
2532
+ constant: false,
2533
+ inputs: [{ internalType: "uint256", name: "wad", type: "uint256" }],
2534
+ name: "withdraw",
2535
+ outputs: [],
2536
+ payable: false,
2537
+ stateMutability: "nonpayable",
2538
+ type: "function"
2539
+ }
2540
+ ];
2541
+ var wethAbi_default = WETH_ABI;
2542
+
2543
+ // src/abis/fiatTokenV2Abi.ts
2544
+ var FIAT_TOKEN_V2_ABI = [
2545
+ {
2546
+ anonymous: false,
2547
+ inputs: [
2548
+ {
2549
+ indexed: true,
2550
+ internalType: "address",
2551
+ name: "owner",
2552
+ type: "address"
2553
+ },
2554
+ {
2555
+ indexed: true,
2556
+ internalType: "address",
2557
+ name: "spender",
2558
+ type: "address"
2559
+ },
2560
+ {
2561
+ indexed: false,
2562
+ internalType: "uint256",
2563
+ name: "value",
2564
+ type: "uint256"
2565
+ }
2566
+ ],
2567
+ name: "Approval",
2568
+ type: "event"
2569
+ },
2570
+ {
2571
+ anonymous: false,
2572
+ inputs: [
2573
+ {
2574
+ indexed: true,
2575
+ internalType: "address",
2576
+ name: "authorizer",
2577
+ type: "address"
2578
+ },
2579
+ {
2580
+ indexed: true,
2581
+ internalType: "bytes32",
2582
+ name: "nonce",
2583
+ type: "bytes32"
2584
+ }
2585
+ ],
2586
+ name: "AuthorizationCanceled",
2587
+ type: "event"
2588
+ },
2589
+ {
2590
+ anonymous: false,
2591
+ inputs: [
2592
+ {
2593
+ indexed: true,
2594
+ internalType: "address",
2595
+ name: "authorizer",
2596
+ type: "address"
2597
+ },
2598
+ {
2599
+ indexed: true,
2600
+ internalType: "bytes32",
2601
+ name: "nonce",
2602
+ type: "bytes32"
2603
+ }
2604
+ ],
2605
+ name: "AuthorizationUsed",
2606
+ type: "event"
2607
+ },
2608
+ {
2609
+ anonymous: false,
2610
+ inputs: [
2611
+ {
2612
+ indexed: true,
2613
+ internalType: "address",
2614
+ name: "_account",
2615
+ type: "address"
2616
+ }
2617
+ ],
2618
+ name: "Blacklisted",
2619
+ type: "event"
2620
+ },
2621
+ {
2622
+ anonymous: false,
2623
+ inputs: [
2624
+ {
2625
+ indexed: true,
2626
+ internalType: "address",
2627
+ name: "newBlacklister",
2628
+ type: "address"
2629
+ }
2630
+ ],
2631
+ name: "BlacklisterChanged",
2632
+ type: "event"
2633
+ },
2634
+ {
2635
+ anonymous: false,
2636
+ inputs: [
2637
+ {
2638
+ indexed: true,
2639
+ internalType: "address",
2640
+ name: "burner",
2641
+ type: "address"
2642
+ },
2643
+ {
2644
+ indexed: false,
2645
+ internalType: "uint256",
2646
+ name: "amount",
2647
+ type: "uint256"
2648
+ }
2649
+ ],
2650
+ name: "Burn",
2651
+ type: "event"
2652
+ },
2653
+ {
2654
+ anonymous: false,
2655
+ inputs: [
2656
+ {
2657
+ indexed: true,
2658
+ internalType: "address",
2659
+ name: "newMasterMinter",
2660
+ type: "address"
2661
+ }
2662
+ ],
2663
+ name: "MasterMinterChanged",
2664
+ type: "event"
2665
+ },
2666
+ {
2667
+ anonymous: false,
2668
+ inputs: [
2669
+ {
2670
+ indexed: true,
2671
+ internalType: "address",
2672
+ name: "minter",
2673
+ type: "address"
2674
+ },
2675
+ { indexed: true, internalType: "address", name: "to", type: "address" },
2676
+ {
2677
+ indexed: false,
2678
+ internalType: "uint256",
2679
+ name: "amount",
2680
+ type: "uint256"
2681
+ }
2682
+ ],
2683
+ name: "Mint",
2684
+ type: "event"
2685
+ },
2686
+ {
2687
+ anonymous: false,
2688
+ inputs: [
2689
+ {
2690
+ indexed: true,
2691
+ internalType: "address",
2692
+ name: "minter",
2693
+ type: "address"
2694
+ },
2695
+ {
2696
+ indexed: false,
2697
+ internalType: "uint256",
2698
+ name: "minterAllowedAmount",
2699
+ type: "uint256"
2700
+ }
2701
+ ],
2702
+ name: "MinterConfigured",
2703
+ type: "event"
2704
+ },
2705
+ {
2706
+ anonymous: false,
2707
+ inputs: [
2708
+ {
2709
+ indexed: true,
2710
+ internalType: "address",
2711
+ name: "oldMinter",
2712
+ type: "address"
2713
+ }
2714
+ ],
2715
+ name: "MinterRemoved",
2716
+ type: "event"
2717
+ },
2718
+ {
2719
+ anonymous: false,
2720
+ inputs: [
2721
+ {
2722
+ indexed: false,
2723
+ internalType: "address",
2724
+ name: "previousOwner",
2725
+ type: "address"
2726
+ },
2727
+ {
2728
+ indexed: false,
2729
+ internalType: "address",
2730
+ name: "newOwner",
2731
+ type: "address"
2732
+ }
2733
+ ],
2734
+ name: "OwnershipTransferred",
2735
+ type: "event"
2736
+ },
2737
+ { anonymous: false, inputs: [], name: "Pause", type: "event" },
2738
+ {
2739
+ anonymous: false,
2740
+ inputs: [
2741
+ {
2742
+ indexed: true,
2743
+ internalType: "address",
2744
+ name: "newAddress",
2745
+ type: "address"
2746
+ }
2747
+ ],
2748
+ name: "PauserChanged",
2749
+ type: "event"
2750
+ },
2751
+ {
2752
+ anonymous: false,
2753
+ inputs: [
2754
+ {
2755
+ indexed: true,
2756
+ internalType: "address",
2757
+ name: "newRescuer",
2758
+ type: "address"
2759
+ }
2760
+ ],
2761
+ name: "RescuerChanged",
2762
+ type: "event"
2763
+ },
2764
+ {
2765
+ anonymous: false,
2766
+ inputs: [
2767
+ { indexed: true, internalType: "address", name: "from", type: "address" },
2768
+ { indexed: true, internalType: "address", name: "to", type: "address" },
2769
+ {
2770
+ indexed: false,
2771
+ internalType: "uint256",
2772
+ name: "value",
2773
+ type: "uint256"
2774
+ }
2775
+ ],
2776
+ name: "Transfer",
2777
+ type: "event"
2778
+ },
2779
+ {
2780
+ anonymous: false,
2781
+ inputs: [
2782
+ {
2783
+ indexed: true,
2784
+ internalType: "address",
2785
+ name: "_account",
2786
+ type: "address"
2787
+ }
2788
+ ],
2789
+ name: "UnBlacklisted",
2790
+ type: "event"
2791
+ },
2792
+ { anonymous: false, inputs: [], name: "Unpause", type: "event" },
2793
+ {
2794
+ inputs: [],
2795
+ name: "CANCEL_AUTHORIZATION_TYPEHASH",
2796
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2797
+ stateMutability: "view",
2798
+ type: "function"
2799
+ },
2800
+ {
2801
+ inputs: [],
2802
+ name: "DOMAIN_SEPARATOR",
2803
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2804
+ stateMutability: "view",
2805
+ type: "function"
2806
+ },
2807
+ {
2808
+ inputs: [],
2809
+ name: "PERMIT_TYPEHASH",
2810
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2811
+ stateMutability: "view",
2812
+ type: "function"
2813
+ },
2814
+ {
2815
+ inputs: [],
2816
+ name: "RECEIVE_WITH_AUTHORIZATION_TYPEHASH",
2817
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2818
+ stateMutability: "view",
2819
+ type: "function"
2820
+ },
2821
+ {
2822
+ inputs: [],
2823
+ name: "TRANSFER_WITH_AUTHORIZATION_TYPEHASH",
2824
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
2825
+ stateMutability: "view",
2826
+ type: "function"
2827
+ },
2828
+ {
2829
+ inputs: [
2830
+ { internalType: "address", name: "owner", type: "address" },
2831
+ { internalType: "address", name: "spender", type: "address" }
2832
+ ],
2833
+ name: "allowance",
2834
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2835
+ stateMutability: "view",
2836
+ type: "function"
2837
+ },
2838
+ {
2839
+ inputs: [
2840
+ { internalType: "address", name: "spender", type: "address" },
2841
+ { internalType: "uint256", name: "value", type: "uint256" }
2842
+ ],
2843
+ name: "approve",
2844
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2845
+ stateMutability: "nonpayable",
2846
+ type: "function"
2847
+ },
2848
+ {
2849
+ inputs: [
2850
+ { internalType: "address", name: "authorizer", type: "address" },
2851
+ { internalType: "bytes32", name: "nonce", type: "bytes32" }
2852
+ ],
2853
+ name: "authorizationState",
2854
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2855
+ stateMutability: "view",
2856
+ type: "function"
2857
+ },
2858
+ {
2859
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
2860
+ name: "balanceOf",
2861
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2862
+ stateMutability: "view",
2863
+ type: "function"
2864
+ },
2865
+ {
2866
+ inputs: [{ internalType: "address", name: "_account", type: "address" }],
2867
+ name: "blacklist",
2868
+ outputs: [],
2869
+ stateMutability: "nonpayable",
2870
+ type: "function"
2871
+ },
2872
+ {
2873
+ inputs: [],
2874
+ name: "blacklister",
2875
+ outputs: [{ internalType: "address", name: "", type: "address" }],
2876
+ stateMutability: "view",
2877
+ type: "function"
2878
+ },
2879
+ {
2880
+ inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
2881
+ name: "burn",
2882
+ outputs: [],
2883
+ stateMutability: "nonpayable",
2884
+ type: "function"
2885
+ },
2886
+ {
2887
+ inputs: [
2888
+ { internalType: "address", name: "authorizer", type: "address" },
2889
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
2890
+ { internalType: "uint8", name: "v", type: "uint8" },
2891
+ { internalType: "bytes32", name: "r", type: "bytes32" },
2892
+ { internalType: "bytes32", name: "s", type: "bytes32" }
2893
+ ],
2894
+ name: "cancelAuthorization",
2895
+ outputs: [],
2896
+ stateMutability: "nonpayable",
2897
+ type: "function"
2898
+ },
2899
+ {
2900
+ inputs: [
2901
+ { internalType: "address", name: "authorizer", type: "address" },
2902
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
2903
+ { internalType: "bytes", name: "signature", type: "bytes" }
2904
+ ],
2905
+ name: "cancelAuthorization",
2906
+ outputs: [],
2907
+ stateMutability: "nonpayable",
2908
+ type: "function"
2909
+ },
2910
+ {
2911
+ inputs: [
2912
+ { internalType: "address", name: "minter", type: "address" },
2913
+ { internalType: "uint256", name: "minterAllowedAmount", type: "uint256" }
2914
+ ],
2915
+ name: "configureMinter",
2916
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2917
+ stateMutability: "nonpayable",
2918
+ type: "function"
2919
+ },
2920
+ {
2921
+ inputs: [],
2922
+ name: "currency",
2923
+ outputs: [{ internalType: "string", name: "", type: "string" }],
2924
+ stateMutability: "view",
2925
+ type: "function"
2926
+ },
2927
+ {
2928
+ inputs: [],
2929
+ name: "decimals",
2930
+ outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
2931
+ stateMutability: "view",
2932
+ type: "function"
2933
+ },
2934
+ {
2935
+ inputs: [
2936
+ { internalType: "address", name: "spender", type: "address" },
2937
+ { internalType: "uint256", name: "decrement", type: "uint256" }
2938
+ ],
2939
+ name: "decreaseAllowance",
2940
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2941
+ stateMutability: "nonpayable",
2702
2942
  type: "function"
2703
2943
  },
2704
2944
  {
2705
2945
  inputs: [
2706
- { internalType: "bytes32", name: "role", type: "bytes32" },
2707
- { internalType: "address", name: "callerConfirmation", type: "address" }
2946
+ { internalType: "address", name: "spender", type: "address" },
2947
+ { internalType: "uint256", name: "increment", type: "uint256" }
2708
2948
  ],
2709
- name: "renounceRole",
2710
- outputs: [],
2949
+ name: "increaseAllowance",
2950
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
2711
2951
  stateMutability: "nonpayable",
2712
2952
  type: "function"
2713
2953
  },
2714
2954
  {
2715
2955
  inputs: [
2716
- { internalType: "bytes32", name: "role", type: "bytes32" },
2717
- { internalType: "address", name: "account", type: "address" }
2956
+ { internalType: "string", name: "tokenName", type: "string" },
2957
+ { internalType: "string", name: "tokenSymbol", type: "string" },
2958
+ { internalType: "string", name: "tokenCurrency", type: "string" },
2959
+ { internalType: "uint8", name: "tokenDecimals", type: "uint8" },
2960
+ { internalType: "address", name: "newMasterMinter", type: "address" },
2961
+ { internalType: "address", name: "newPauser", type: "address" },
2962
+ { internalType: "address", name: "newBlacklister", type: "address" },
2963
+ { internalType: "address", name: "newOwner", type: "address" }
2718
2964
  ],
2719
- name: "revokeRole",
2965
+ name: "initialize",
2720
2966
  outputs: [],
2721
2967
  stateMutability: "nonpayable",
2722
2968
  type: "function"
2723
2969
  },
2724
2970
  {
2725
- inputs: [
2726
- { internalType: "uint256", name: "jobId", type: "uint256" },
2727
- { internalType: "uint256", name: "amount", type: "uint256" }
2728
- ],
2729
- name: "setBudget",
2971
+ inputs: [{ internalType: "string", name: "newName", type: "string" }],
2972
+ name: "initializeV2",
2730
2973
  outputs: [],
2731
2974
  stateMutability: "nonpayable",
2732
2975
  type: "function"
2733
2976
  },
2734
2977
  {
2735
2978
  inputs: [
2736
- { internalType: "uint256", name: "jobId", type: "uint256" },
2737
- { internalType: "uint256", name: "amount", type: "uint256" },
2738
- { internalType: "address", name: "paymentToken", type: "address" }
2979
+ { internalType: "address", name: "lostAndFound", type: "address" }
2739
2980
  ],
2740
- name: "setBudgetWithPaymentToken",
2981
+ name: "initializeV2_1",
2741
2982
  outputs: [],
2742
2983
  stateMutability: "nonpayable",
2743
2984
  type: "function"
2744
2985
  },
2745
2986
  {
2746
2987
  inputs: [
2747
- { internalType: "uint256", name: "memoId", type: "uint256" },
2748
- { internalType: "bool", name: "isApproved", type: "bool" },
2749
- { internalType: "string", name: "reason", type: "string" }
2988
+ {
2989
+ internalType: "address[]",
2990
+ name: "accountsToBlacklist",
2991
+ type: "address[]"
2992
+ },
2993
+ { internalType: "string", name: "newSymbol", type: "string" }
2750
2994
  ],
2751
- name: "signMemo",
2995
+ name: "initializeV2_2",
2752
2996
  outputs: [],
2753
2997
  stateMutability: "nonpayable",
2754
2998
  type: "function"
2755
2999
  },
2756
3000
  {
2757
- inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
2758
- name: "supportsInterface",
3001
+ inputs: [{ internalType: "address", name: "_account", type: "address" }],
3002
+ name: "isBlacklisted",
3003
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
3004
+ stateMutability: "view",
3005
+ type: "function"
3006
+ },
3007
+ {
3008
+ inputs: [{ internalType: "address", name: "account", type: "address" }],
3009
+ name: "isMinter",
2759
3010
  outputs: [{ internalType: "bool", name: "", type: "bool" }],
2760
3011
  stateMutability: "view",
2761
3012
  type: "function"
2762
3013
  },
2763
3014
  {
2764
3015
  inputs: [],
2765
- name: "unpause",
2766
- outputs: [],
2767
- stateMutability: "nonpayable",
3016
+ name: "masterMinter",
3017
+ outputs: [{ internalType: "address", name: "", type: "address" }],
3018
+ stateMutability: "view",
2768
3019
  type: "function"
2769
3020
  },
2770
3021
  {
2771
3022
  inputs: [
2772
- { internalType: "uint256", name: "accountId", type: "uint256" },
2773
- { internalType: "string", name: "metadata", type: "string" }
3023
+ { internalType: "address", name: "_to", type: "address" },
3024
+ { internalType: "uint256", name: "_amount", type: "uint256" }
2774
3025
  ],
2775
- name: "updateAccountMetadata",
3026
+ name: "mint",
3027
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
3028
+ stateMutability: "nonpayable",
3029
+ type: "function"
3030
+ },
3031
+ {
3032
+ inputs: [{ internalType: "address", name: "minter", type: "address" }],
3033
+ name: "minterAllowance",
3034
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
3035
+ stateMutability: "view",
3036
+ type: "function"
3037
+ },
3038
+ {
3039
+ inputs: [],
3040
+ name: "name",
3041
+ outputs: [{ internalType: "string", name: "", type: "string" }],
3042
+ stateMutability: "view",
3043
+ type: "function"
3044
+ },
3045
+ {
3046
+ inputs: [{ internalType: "address", name: "owner", type: "address" }],
3047
+ name: "nonces",
3048
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
3049
+ stateMutability: "view",
3050
+ type: "function"
3051
+ },
3052
+ {
3053
+ inputs: [],
3054
+ name: "owner",
3055
+ outputs: [{ internalType: "address", name: "", type: "address" }],
3056
+ stateMutability: "view",
3057
+ type: "function"
3058
+ },
3059
+ {
3060
+ inputs: [],
3061
+ name: "pause",
2776
3062
  outputs: [],
2777
3063
  stateMutability: "nonpayable",
2778
3064
  type: "function"
2779
3065
  },
3066
+ {
3067
+ inputs: [],
3068
+ name: "paused",
3069
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
3070
+ stateMutability: "view",
3071
+ type: "function"
3072
+ },
3073
+ {
3074
+ inputs: [],
3075
+ name: "pauser",
3076
+ outputs: [{ internalType: "address", name: "", type: "address" }],
3077
+ stateMutability: "view",
3078
+ type: "function"
3079
+ },
2780
3080
  {
2781
3081
  inputs: [
2782
- { internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
3082
+ { internalType: "address", name: "owner", type: "address" },
3083
+ { internalType: "address", name: "spender", type: "address" },
3084
+ { internalType: "uint256", name: "value", type: "uint256" },
3085
+ { internalType: "uint256", name: "deadline", type: "uint256" },
3086
+ { internalType: "bytes", name: "signature", type: "bytes" }
2783
3087
  ],
2784
- name: "updateEvaluatorFee",
3088
+ name: "permit",
2785
3089
  outputs: [],
2786
3090
  stateMutability: "nonpayable",
2787
3091
  type: "function"
2788
3092
  },
2789
3093
  {
2790
3094
  inputs: [
2791
- { internalType: "string", name: "moduleType", type: "string" },
2792
- { internalType: "address", name: "moduleAddress", type: "address" }
3095
+ { internalType: "address", name: "owner", type: "address" },
3096
+ { internalType: "address", name: "spender", type: "address" },
3097
+ { internalType: "uint256", name: "value", type: "uint256" },
3098
+ { internalType: "uint256", name: "deadline", type: "uint256" },
3099
+ { internalType: "uint8", name: "v", type: "uint8" },
3100
+ { internalType: "bytes32", name: "r", type: "bytes32" },
3101
+ { internalType: "bytes32", name: "s", type: "bytes32" }
2793
3102
  ],
2794
- name: "updateModule",
3103
+ name: "permit",
2795
3104
  outputs: [],
2796
3105
  stateMutability: "nonpayable",
2797
3106
  type: "function"
2798
3107
  },
2799
3108
  {
2800
3109
  inputs: [
2801
- { internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
2802
- { internalType: "address", name: "platformTreasury_", type: "address" },
2803
- { internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
3110
+ { internalType: "address", name: "from", type: "address" },
3111
+ { internalType: "address", name: "to", type: "address" },
3112
+ { internalType: "uint256", name: "value", type: "uint256" },
3113
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
3114
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
3115
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
3116
+ { internalType: "bytes", name: "signature", type: "bytes" }
2804
3117
  ],
2805
- name: "updatePlatformConfig",
3118
+ name: "receiveWithAuthorization",
2806
3119
  outputs: [],
2807
3120
  stateMutability: "nonpayable",
2808
3121
  type: "function"
2809
3122
  },
2810
3123
  {
2811
3124
  inputs: [
2812
- { internalType: "address", name: "newImplementation", type: "address" },
2813
- { internalType: "bytes", name: "data", type: "bytes" }
3125
+ { internalType: "address", name: "from", type: "address" },
3126
+ { internalType: "address", name: "to", type: "address" },
3127
+ { internalType: "uint256", name: "value", type: "uint256" },
3128
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
3129
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
3130
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
3131
+ { internalType: "uint8", name: "v", type: "uint8" },
3132
+ { internalType: "bytes32", name: "r", type: "bytes32" },
3133
+ { internalType: "bytes32", name: "s", type: "bytes32" }
2814
3134
  ],
2815
- name: "upgradeToAndCall",
3135
+ name: "receiveWithAuthorization",
2816
3136
  outputs: [],
2817
- stateMutability: "payable",
3137
+ stateMutability: "nonpayable",
2818
3138
  type: "function"
2819
- }
2820
- ];
2821
- var acpAbiV2_default = ACP_V2_ABI;
2822
-
2823
- // src/configs/acpConfigs.ts
2824
- var AcpContractConfig2 = class {
2825
- constructor(chain, contractAddress, baseFare, alchemyRpcUrl, acpUrl, abi, rpcEndpoint) {
2826
- this.chain = chain;
2827
- this.contractAddress = contractAddress;
2828
- this.baseFare = baseFare;
2829
- this.alchemyRpcUrl = alchemyRpcUrl;
2830
- this.acpUrl = acpUrl;
2831
- this.abi = abi;
2832
- this.rpcEndpoint = rpcEndpoint;
2833
- }
2834
- };
2835
- var baseSepoliaAcpConfig = new AcpContractConfig2(
2836
- import_infra.baseSepolia,
2837
- "0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
2838
- new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
2839
- "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
2840
- "https://acpx.virtuals.gg",
2841
- acpAbi_default
2842
- );
2843
- var baseSepoliaAcpConfigV2 = new AcpContractConfig2(
2844
- import_infra.baseSepolia,
2845
- "0xdf54E6Ed6cD1d0632d973ADECf96597b7e87893c",
2846
- new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
2847
- "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
2848
- "https://acpx.virtuals.gg",
2849
- acpAbiV2_default
2850
- );
2851
- var baseAcpConfig = new AcpContractConfig2(
2852
- import_infra.base,
2853
- "0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
2854
- new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
2855
- "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
2856
- "https://acpx.virtuals.io",
2857
- acpAbi_default
2858
- );
2859
- var baseAcpConfigV2 = new AcpContractConfig2(
2860
- import_infra.base,
2861
- "0xa6C9BA866992cfD7fd6460ba912bfa405adA9df0",
2862
- new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
2863
- "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
2864
- "https://acpx.virtuals.io",
2865
- acpAbiV2_default
2866
- );
2867
-
2868
- // src/abis/wethAbi.ts
2869
- var WETH_ABI = [
3139
+ },
2870
3140
  {
2871
- anonymous: false,
2872
- inputs: [
2873
- { indexed: true, internalType: "address", name: "src", type: "address" },
2874
- { indexed: true, internalType: "address", name: "guy", type: "address" },
2875
- { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2876
- ],
2877
- name: "Approval",
2878
- type: "event"
3141
+ inputs: [{ internalType: "address", name: "minter", type: "address" }],
3142
+ name: "removeMinter",
3143
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
3144
+ stateMutability: "nonpayable",
3145
+ type: "function"
2879
3146
  },
2880
3147
  {
2881
- anonymous: false,
2882
3148
  inputs: [
2883
- { indexed: true, internalType: "address", name: "dst", type: "address" },
2884
- { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
3149
+ {
3150
+ internalType: "contract IERC20",
3151
+ name: "tokenContract",
3152
+ type: "address"
3153
+ },
3154
+ { internalType: "address", name: "to", type: "address" },
3155
+ { internalType: "uint256", name: "amount", type: "uint256" }
2885
3156
  ],
2886
- name: "Deposit",
2887
- type: "event"
3157
+ name: "rescueERC20",
3158
+ outputs: [],
3159
+ stateMutability: "nonpayable",
3160
+ type: "function"
2888
3161
  },
2889
3162
  {
2890
- anonymous: false,
2891
- inputs: [
2892
- { indexed: true, internalType: "address", name: "src", type: "address" },
2893
- { indexed: true, internalType: "address", name: "dst", type: "address" },
2894
- { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2895
- ],
2896
- name: "Transfer",
2897
- type: "event"
3163
+ inputs: [],
3164
+ name: "rescuer",
3165
+ outputs: [{ internalType: "address", name: "", type: "address" }],
3166
+ stateMutability: "view",
3167
+ type: "function"
2898
3168
  },
2899
3169
  {
2900
- anonymous: false,
2901
- inputs: [
2902
- { indexed: true, internalType: "address", name: "src", type: "address" },
2903
- { indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
2904
- ],
2905
- name: "Withdrawal",
2906
- type: "event"
3170
+ inputs: [],
3171
+ name: "symbol",
3172
+ outputs: [{ internalType: "string", name: "", type: "string" }],
3173
+ stateMutability: "view",
3174
+ type: "function"
2907
3175
  },
2908
- { payable: true, stateMutability: "payable", type: "fallback" },
2909
3176
  {
2910
- constant: true,
2911
- inputs: [
2912
- { internalType: "address", name: "", type: "address" },
2913
- { internalType: "address", name: "", type: "address" }
2914
- ],
2915
- name: "allowance",
3177
+ inputs: [],
3178
+ name: "totalSupply",
2916
3179
  outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2917
- payable: false,
2918
3180
  stateMutability: "view",
2919
3181
  type: "function"
2920
3182
  },
2921
3183
  {
2922
- constant: false,
2923
3184
  inputs: [
2924
- { internalType: "address", name: "guy", type: "address" },
2925
- { internalType: "uint256", name: "wad", type: "uint256" }
3185
+ { internalType: "address", name: "to", type: "address" },
3186
+ { internalType: "uint256", name: "value", type: "uint256" }
2926
3187
  ],
2927
- name: "approve",
3188
+ name: "transfer",
2928
3189
  outputs: [{ internalType: "bool", name: "", type: "bool" }],
2929
- payable: false,
2930
3190
  stateMutability: "nonpayable",
2931
3191
  type: "function"
2932
3192
  },
2933
3193
  {
2934
- constant: true,
2935
- inputs: [{ internalType: "address", name: "", type: "address" }],
2936
- name: "balanceOf",
2937
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2938
- payable: false,
2939
- stateMutability: "view",
3194
+ inputs: [
3195
+ { internalType: "address", name: "from", type: "address" },
3196
+ { internalType: "address", name: "to", type: "address" },
3197
+ { internalType: "uint256", name: "value", type: "uint256" }
3198
+ ],
3199
+ name: "transferFrom",
3200
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
3201
+ stateMutability: "nonpayable",
2940
3202
  type: "function"
2941
3203
  },
2942
3204
  {
2943
- constant: true,
2944
- inputs: [],
2945
- name: "decimals",
2946
- outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
2947
- payable: false,
2948
- stateMutability: "view",
3205
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
3206
+ name: "transferOwnership",
3207
+ outputs: [],
3208
+ stateMutability: "nonpayable",
2949
3209
  type: "function"
2950
3210
  },
2951
3211
  {
2952
- constant: false,
2953
- inputs: [],
2954
- name: "deposit",
3212
+ inputs: [
3213
+ { internalType: "address", name: "from", type: "address" },
3214
+ { internalType: "address", name: "to", type: "address" },
3215
+ { internalType: "uint256", name: "value", type: "uint256" },
3216
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
3217
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
3218
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
3219
+ { internalType: "bytes", name: "signature", type: "bytes" }
3220
+ ],
3221
+ name: "transferWithAuthorization",
2955
3222
  outputs: [],
2956
- payable: true,
2957
- stateMutability: "payable",
3223
+ stateMutability: "nonpayable",
2958
3224
  type: "function"
2959
3225
  },
2960
3226
  {
2961
- constant: true,
2962
- inputs: [],
2963
- name: "name",
2964
- outputs: [{ internalType: "string", name: "", type: "string" }],
2965
- payable: false,
2966
- stateMutability: "view",
3227
+ inputs: [
3228
+ { internalType: "address", name: "from", type: "address" },
3229
+ { internalType: "address", name: "to", type: "address" },
3230
+ { internalType: "uint256", name: "value", type: "uint256" },
3231
+ { internalType: "uint256", name: "validAfter", type: "uint256" },
3232
+ { internalType: "uint256", name: "validBefore", type: "uint256" },
3233
+ { internalType: "bytes32", name: "nonce", type: "bytes32" },
3234
+ { internalType: "uint8", name: "v", type: "uint8" },
3235
+ { internalType: "bytes32", name: "r", type: "bytes32" },
3236
+ { internalType: "bytes32", name: "s", type: "bytes32" }
3237
+ ],
3238
+ name: "transferWithAuthorization",
3239
+ outputs: [],
3240
+ stateMutability: "nonpayable",
2967
3241
  type: "function"
2968
3242
  },
2969
3243
  {
2970
- constant: true,
2971
- inputs: [],
2972
- name: "symbol",
2973
- outputs: [{ internalType: "string", name: "", type: "string" }],
2974
- payable: false,
2975
- stateMutability: "view",
3244
+ inputs: [{ internalType: "address", name: "_account", type: "address" }],
3245
+ name: "unBlacklist",
3246
+ outputs: [],
3247
+ stateMutability: "nonpayable",
2976
3248
  type: "function"
2977
3249
  },
2978
3250
  {
2979
- constant: true,
2980
3251
  inputs: [],
2981
- name: "totalSupply",
2982
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
2983
- payable: false,
2984
- stateMutability: "view",
3252
+ name: "unpause",
3253
+ outputs: [],
3254
+ stateMutability: "nonpayable",
2985
3255
  type: "function"
2986
3256
  },
2987
3257
  {
2988
- constant: false,
2989
3258
  inputs: [
2990
- { internalType: "address", name: "dst", type: "address" },
2991
- { internalType: "uint256", name: "wad", type: "uint256" }
3259
+ { internalType: "address", name: "_newBlacklister", type: "address" }
2992
3260
  ],
2993
- name: "transfer",
2994
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
2995
- payable: false,
3261
+ name: "updateBlacklister",
3262
+ outputs: [],
2996
3263
  stateMutability: "nonpayable",
2997
3264
  type: "function"
2998
3265
  },
2999
3266
  {
3000
- constant: false,
3001
3267
  inputs: [
3002
- { internalType: "address", name: "src", type: "address" },
3003
- { internalType: "address", name: "dst", type: "address" },
3004
- { internalType: "uint256", name: "wad", type: "uint256" }
3268
+ { internalType: "address", name: "_newMasterMinter", type: "address" }
3005
3269
  ],
3006
- name: "transferFrom",
3007
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
3008
- payable: false,
3270
+ name: "updateMasterMinter",
3271
+ outputs: [],
3009
3272
  stateMutability: "nonpayable",
3010
3273
  type: "function"
3011
3274
  },
3012
3275
  {
3013
- constant: false,
3014
- inputs: [{ internalType: "uint256", name: "wad", type: "uint256" }],
3015
- name: "withdraw",
3276
+ inputs: [{ internalType: "address", name: "_newPauser", type: "address" }],
3277
+ name: "updatePauser",
3278
+ outputs: [],
3279
+ stateMutability: "nonpayable",
3280
+ type: "function"
3281
+ },
3282
+ {
3283
+ inputs: [{ internalType: "address", name: "newRescuer", type: "address" }],
3284
+ name: "updateRescuer",
3016
3285
  outputs: [],
3017
- payable: false,
3018
3286
  stateMutability: "nonpayable",
3019
3287
  type: "function"
3288
+ },
3289
+ {
3290
+ inputs: [],
3291
+ name: "version",
3292
+ outputs: [{ internalType: "string", name: "", type: "string" }],
3293
+ stateMutability: "pure",
3294
+ type: "function"
3020
3295
  }
3021
3296
  ];
3022
- var wethAbi_default = WETH_ABI;
3297
+ var fiatTokenV2Abi_default = FIAT_TOKEN_V2_ABI;
3023
3298
 
3024
3299
  // src/contractClients/baseAcpContractClient.ts
3025
3300
  var MemoType = /* @__PURE__ */ ((MemoType3) => {
@@ -3058,15 +3333,19 @@ var BaseAcpContractClient = class {
3058
3333
  );
3059
3334
  const signature = (0, import_viem2.toEventSignature)(jobCreated);
3060
3335
  this.jobCreatedSignature = (0, import_viem2.keccak256)((0, import_viem2.toHex)(signature));
3336
+ this.publicClient = (0, import_viem2.createPublicClient)({
3337
+ chain: this.chain,
3338
+ transport: (0, import_viem2.http)(this.config.rpcEndpoint)
3339
+ });
3061
3340
  }
3062
3341
  get walletAddress() {
3063
3342
  return this.agentWalletAddress;
3064
3343
  }
3065
- createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt) {
3344
+ createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt, isX402Job) {
3066
3345
  try {
3067
3346
  const data = (0, import_viem2.encodeFunctionData)({
3068
3347
  abi: this.abi,
3069
- functionName: "createJobWithAccount",
3348
+ functionName: isX402Job ? "createX402JobWithAccount" : "createJobWithAccount",
3070
3349
  args: [
3071
3350
  accountId,
3072
3351
  evaluatorAddress,
@@ -3084,11 +3363,11 @@ var BaseAcpContractClient = class {
3084
3363
  throw new acpError_default("Failed to create job with account", error);
3085
3364
  }
3086
3365
  }
3087
- createJob(providerAddress, evaluatorAddress, expiredAt, paymentTokenAddress, budgetBaseUnit, metadata) {
3366
+ createJob(providerAddress, evaluatorAddress, expiredAt, paymentTokenAddress, budgetBaseUnit, metadata, isX402Job) {
3088
3367
  try {
3089
3368
  const data = (0, import_viem2.encodeFunctionData)({
3090
3369
  abi: this.abi,
3091
- functionName: "createJob",
3370
+ functionName: isX402Job ? "createX402Job" : "createJob",
3092
3371
  args: [
3093
3372
  providerAddress,
3094
3373
  evaluatorAddress,
@@ -3218,6 +3497,44 @@ var BaseAcpContractClient = class {
3218
3497
  throw new acpError_default("Failed to wrap eth", error);
3219
3498
  }
3220
3499
  }
3500
+ getX402PaymentDetails(jobId) {
3501
+ return __async(this, null, function* () {
3502
+ try {
3503
+ const result = yield this.publicClient.readContract({
3504
+ address: this.contractAddress,
3505
+ abi: this.abi,
3506
+ functionName: "x402PaymentDetails",
3507
+ args: [BigInt(jobId)]
3508
+ });
3509
+ return {
3510
+ isX402: result[0],
3511
+ isBudgetReceived: result[1]
3512
+ };
3513
+ } catch (error) {
3514
+ throw new acpError_default("Failed to get X402 payment details", error);
3515
+ }
3516
+ });
3517
+ }
3518
+ submitTransferWithAuthorization(from, to, value, validAfter, validBefore, nonce, signature) {
3519
+ return __async(this, null, function* () {
3520
+ try {
3521
+ const operations = [];
3522
+ const data = (0, import_viem2.encodeFunctionData)({
3523
+ abi: fiatTokenV2Abi_default,
3524
+ functionName: "transferWithAuthorization",
3525
+ args: [from, to, value, validAfter, validBefore, nonce, signature]
3526
+ });
3527
+ const payload = {
3528
+ data,
3529
+ contractAddress: this.config.baseFare.contractAddress
3530
+ };
3531
+ operations.push(payload);
3532
+ return operations;
3533
+ } catch (error) {
3534
+ throw new acpError_default("Failed to submit TransferWithAuthorization", error);
3535
+ }
3536
+ });
3537
+ }
3221
3538
  };
3222
3539
  var baseAcpContractClient_default = BaseAcpContractClient;
3223
3540
 
@@ -3276,10 +3593,37 @@ function tryParseJson(content) {
3276
3593
  function preparePayload(payload) {
3277
3594
  return typeof payload === "string" ? payload : JSON.stringify(payload);
3278
3595
  }
3596
+ function safeBase64Encode(data) {
3597
+ if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
3598
+ return globalThis.btoa(data);
3599
+ }
3600
+ return Buffer.from(data).toString("base64");
3601
+ }
3279
3602
 
3280
3603
  // src/acpJobOffering.ts
3281
3604
  var import_viem3 = require("viem");
3282
3605
  var import_ajv = __toESM(require("ajv"));
3606
+
3607
+ // src/constants.ts
3608
+ var import_chains = require("viem/chains");
3609
+ var USDC_TOKEN_ADDRESS = {
3610
+ [import_chains.baseSepolia.id]: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
3611
+ [import_chains.base.id]: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
3612
+ };
3613
+ var X402AuthorizationTypes = [
3614
+ { name: "from", type: "address" },
3615
+ { name: "to", type: "address" },
3616
+ { name: "value", type: "uint256" },
3617
+ { name: "validAfter", type: "uint256" },
3618
+ { name: "validBefore", type: "uint256" },
3619
+ { name: "nonce", type: "bytes32" }
3620
+ ];
3621
+ var HTTP_STATUS_CODES = {
3622
+ OK: 200,
3623
+ PAYMENT_REQUIRED: 402
3624
+ };
3625
+
3626
+ // src/acpJobOffering.ts
3283
3627
  var AcpJobOffering = class {
3284
3628
  constructor(acpClient, acpContractClient, providerAddress, name, price, priceType = "fixed" /* FIXED */, requirement) {
3285
3629
  this.acpClient = acpClient;
@@ -3315,23 +3659,36 @@ var AcpJobOffering = class {
3315
3659
  this.providerAddress,
3316
3660
  this.acpContractClient
3317
3661
  );
3318
- const createJobPayload = [
3662
+ const isV1 = [
3319
3663
  baseSepoliaAcpConfig.contractAddress,
3320
- baseAcpConfig.contractAddress
3321
- ].includes(this.acpContractClient.config.contractAddress) || !account ? yield this.acpContractClient.createJob(
3322
- this.providerAddress,
3323
- evaluatorAddress || this.acpContractClient.walletAddress,
3324
- expiredAt,
3325
- fareAmount.fare.contractAddress,
3326
- fareAmount.amount,
3327
- ""
3328
- ) : yield this.acpContractClient.createJobWithAccount(
3329
- account.id,
3330
- evaluatorAddress || import_viem3.zeroAddress,
3331
- fareAmount.amount,
3332
- fareAmount.fare.contractAddress,
3333
- expiredAt
3334
- );
3664
+ baseSepoliaAcpX402Config.contractAddress,
3665
+ baseAcpConfig.contractAddress,
3666
+ baseAcpX402Config.contractAddress
3667
+ ].includes(this.acpContractClient.config.contractAddress);
3668
+ let createJobPayload;
3669
+ const chainId = this.acpContractClient.config.chain.id;
3670
+ const isUsdcPaymentToken = USDC_TOKEN_ADDRESS[chainId].toLowerCase() === fareAmount.fare.contractAddress.toLowerCase();
3671
+ const isX402Job = this.acpContractClient.config.x402Config && isUsdcPaymentToken;
3672
+ if (isV1 || !account) {
3673
+ createJobPayload = this.acpContractClient.createJob(
3674
+ this.providerAddress,
3675
+ evaluatorAddress || this.acpContractClient.walletAddress,
3676
+ expiredAt,
3677
+ fareAmount.fare.contractAddress,
3678
+ fareAmount.amount,
3679
+ "",
3680
+ isX402Job
3681
+ );
3682
+ } else {
3683
+ createJobPayload = this.acpContractClient.createJobWithAccount(
3684
+ account.id,
3685
+ evaluatorAddress || import_viem3.zeroAddress,
3686
+ fareAmount.amount,
3687
+ fareAmount.fare.contractAddress,
3688
+ expiredAt,
3689
+ isX402Job
3690
+ );
3691
+ }
3335
3692
  const createJobTxnHash = yield this.acpContractClient.handleOperation([
3336
3693
  createJobPayload
3337
3694
  ]);
@@ -3527,6 +3884,10 @@ var AcpJob = class {
3527
3884
  3 /* EVALUATION */
3528
3885
  )
3529
3886
  );
3887
+ const x402PaymentDetails = yield this.acpContractClient.getX402PaymentDetails(this.id);
3888
+ if (x402PaymentDetails.isX402) {
3889
+ yield this.performX402Payment(this.price);
3890
+ }
3530
3891
  return yield this.acpContractClient.handleOperation(operations);
3531
3892
  });
3532
3893
  }
@@ -3703,6 +4064,67 @@ var AcpJob = class {
3703
4064
  return yield this.acpContractClient.handleOperation(operations);
3704
4065
  });
3705
4066
  }
4067
+ performX402Payment(budget) {
4068
+ return __async(this, null, function* () {
4069
+ const paymentUrl = "/acp-budget";
4070
+ const x402PayableREquirements = yield this.acpContractClient.performX402Request(
4071
+ paymentUrl,
4072
+ this.acpContractClient.getAcpVersion(),
4073
+ budget.toString()
4074
+ );
4075
+ if (!x402PayableREquirements.isPaymentRequired) {
4076
+ return;
4077
+ }
4078
+ if (!x402PayableREquirements.data.accepts.length) {
4079
+ throw new acpError_default("No X402 payment requirements found");
4080
+ }
4081
+ const requirement = x402PayableREquirements.data.accepts[0];
4082
+ const { encodedPayment, signature, message } = yield this.acpContractClient.generateX402Payment(
4083
+ {
4084
+ to: requirement.payTo,
4085
+ value: Number(requirement.maxAmountRequired),
4086
+ maxTimeoutSeconds: requirement.maxTimeoutSeconds,
4087
+ asset: requirement.asset
4088
+ },
4089
+ x402PayableREquirements.data
4090
+ );
4091
+ yield this.acpContractClient.updateJobX402Nonce(this.id, message.nonce);
4092
+ const x402Response = yield this.acpContractClient.performX402Request(
4093
+ paymentUrl,
4094
+ this.acpContractClient.getAcpVersion(),
4095
+ budget.toString(),
4096
+ encodedPayment
4097
+ );
4098
+ if (x402Response.isPaymentRequired) {
4099
+ const operations = yield this.acpContractClient.submitTransferWithAuthorization(
4100
+ message.from,
4101
+ message.to,
4102
+ BigInt(message.value),
4103
+ BigInt(message.validAfter),
4104
+ BigInt(message.validBefore),
4105
+ message.nonce,
4106
+ signature
4107
+ );
4108
+ yield this.acpContractClient.handleOperation(operations);
4109
+ }
4110
+ let waitMs = 2e3;
4111
+ const maxWaitMs = 3e4;
4112
+ let iterationCount = 0;
4113
+ const maxIterations = 10;
4114
+ while (true) {
4115
+ const x402PaymentDetails = yield this.acpContractClient.getX402PaymentDetails(this.id);
4116
+ if (x402PaymentDetails.isBudgetReceived) {
4117
+ break;
4118
+ }
4119
+ iterationCount++;
4120
+ if (iterationCount >= maxIterations) {
4121
+ throw new acpError_default("X402 payment timed out");
4122
+ }
4123
+ yield new Promise((resolve) => setTimeout(resolve, waitMs));
4124
+ waitMs = Math.min(waitMs * 2, maxWaitMs);
4125
+ }
4126
+ });
4127
+ }
3706
4128
  };
3707
4129
  var acpJob_default = AcpJob;
3708
4130
 
@@ -3998,26 +4420,31 @@ var AcpClient = class {
3998
4420
  providerAddress,
3999
4421
  this.acpContractClient
4000
4422
  );
4001
- const defaultEvaluatorAddress = [
4002
- baseSepoliaAcpConfig.contractAddress,
4003
- baseAcpConfig.contractAddress
4004
- ].includes(this.acpContractClient.config.contractAddress) && !evaluatorAddress ? this.walletAddress : import_viem4.zeroAddress;
4005
- const createJobPayload = [
4423
+ const isV1 = [
4006
4424
  baseSepoliaAcpConfig.contractAddress,
4007
- baseAcpConfig.contractAddress
4008
- ].includes(this.acpContractClient.config.contractAddress) || !account ? yield this.acpContractClient.createJob(
4425
+ baseSepoliaAcpX402Config.contractAddress,
4426
+ baseAcpConfig.contractAddress,
4427
+ baseAcpX402Config.contractAddress
4428
+ ].includes(this.acpContractClient.config.contractAddress);
4429
+ const defaultEvaluatorAddress = isV1 && !evaluatorAddress ? this.walletAddress : import_viem4.zeroAddress;
4430
+ const chainId = this.acpContractClient.config.chain.id;
4431
+ const isUsdcPaymentToken = USDC_TOKEN_ADDRESS[chainId].toLowerCase() === fareAmount.fare.contractAddress.toLowerCase();
4432
+ const isX402Job = this.acpContractClient.config.x402Config && isUsdcPaymentToken;
4433
+ const createJobPayload = isV1 || !account ? this.acpContractClient.createJob(
4009
4434
  providerAddress,
4010
4435
  evaluatorAddress || defaultEvaluatorAddress,
4011
4436
  expiredAt,
4012
4437
  fareAmount.fare.contractAddress,
4013
4438
  fareAmount.amount,
4014
- ""
4015
- ) : yield this.acpContractClient.createJobWithAccount(
4439
+ "",
4440
+ isX402Job
4441
+ ) : this.acpContractClient.createJobWithAccount(
4016
4442
  account.id,
4017
4443
  evaluatorAddress || defaultEvaluatorAddress,
4018
4444
  fareAmount.amount,
4019
4445
  fareAmount.fare.contractAddress,
4020
- expiredAt
4446
+ expiredAt,
4447
+ isX402Job
4021
4448
  );
4022
4449
  const txHash = yield this.acpContractClient.handleOperation([
4023
4450
  createJobPayload
@@ -4376,11 +4803,159 @@ var acpClient_default = AcpClient;
4376
4803
  var import_core = require("@aa-sdk/core");
4377
4804
  var import_infra2 = require("@account-kit/infra");
4378
4805
  var import_smart_contracts = require("@account-kit/smart-contracts");
4806
+ var import_viem6 = require("viem");
4807
+
4808
+ // src/acpX402.ts
4379
4809
  var import_viem5 = require("viem");
4810
+ var import_crypto = require("crypto");
4811
+ var AcpX402 = class {
4812
+ constructor(config, sessionKeyClient, publicClient) {
4813
+ this.config = config;
4814
+ this.sessionKeyClient = sessionKeyClient;
4815
+ this.publicClient = publicClient;
4816
+ this.config = config;
4817
+ this.sessionKeyClient = sessionKeyClient;
4818
+ this.publicClient = publicClient;
4819
+ }
4820
+ signUpdateJobNonceMessage(jobId, nonce) {
4821
+ return __async(this, null, function* () {
4822
+ const message = `${jobId}-${nonce}`;
4823
+ const signature = yield this.sessionKeyClient.account.getSigner().signMessage(message);
4824
+ return signature;
4825
+ });
4826
+ }
4827
+ updateJobNonce(jobId, nonce) {
4828
+ return __async(this, null, function* () {
4829
+ try {
4830
+ const apiUrl = `${this.config.acpUrl}/api/jobs/${jobId}/x402-nonce`;
4831
+ const signature = yield this.signUpdateJobNonceMessage(jobId, nonce);
4832
+ const response = yield fetch(apiUrl, {
4833
+ method: "POST",
4834
+ headers: {
4835
+ "x-signature": signature,
4836
+ "x-nonce": nonce,
4837
+ "Content-Type": "application/json"
4838
+ },
4839
+ body: JSON.stringify({
4840
+ data: {
4841
+ nonce
4842
+ }
4843
+ })
4844
+ });
4845
+ if (!response.ok) {
4846
+ throw new acpError_default(
4847
+ "Failed to update job X402 nonce",
4848
+ response.statusText
4849
+ );
4850
+ }
4851
+ const acpJob = yield response.json();
4852
+ return acpJob;
4853
+ } catch (error) {
4854
+ throw new acpError_default("Failed to update job X402 nonce", error);
4855
+ }
4856
+ });
4857
+ }
4858
+ generatePayment(payableRequest, requirements) {
4859
+ return __async(this, null, function* () {
4860
+ try {
4861
+ const USDC_CONTRACT = this.config.baseFare.contractAddress;
4862
+ const timeNow = Math.floor(Date.now() / 1e3);
4863
+ const validAfter = timeNow.toString();
4864
+ const validBefore = (timeNow + requirements.accepts[0].maxTimeoutSeconds).toString();
4865
+ const [tokenName, tokenVersion] = yield this.publicClient.multicall({
4866
+ contracts: [
4867
+ {
4868
+ address: USDC_CONTRACT,
4869
+ abi: import_viem5.erc20Abi,
4870
+ functionName: "name"
4871
+ },
4872
+ {
4873
+ address: USDC_CONTRACT,
4874
+ abi: fiatTokenV2Abi_default,
4875
+ functionName: "version"
4876
+ }
4877
+ ]
4878
+ });
4879
+ const nonce = `0x${(0, import_crypto.randomBytes)(32).toString("hex")}`;
4880
+ const message = {
4881
+ from: this.sessionKeyClient.account.address,
4882
+ to: payableRequest.to,
4883
+ value: payableRequest.value.toString(),
4884
+ validAfter: validAfter.toString(),
4885
+ validBefore: validBefore.toString(),
4886
+ nonce
4887
+ };
4888
+ const typedData = {
4889
+ types: {
4890
+ TransferWithAuthorization: X402AuthorizationTypes
4891
+ },
4892
+ domain: {
4893
+ name: tokenName.result,
4894
+ version: tokenVersion.result,
4895
+ chainId: this.config.chain.id,
4896
+ verifyingContract: USDC_CONTRACT
4897
+ },
4898
+ primaryType: "TransferWithAuthorization",
4899
+ message
4900
+ };
4901
+ const signature = yield this.sessionKeyClient.signTypedData({
4902
+ typedData
4903
+ });
4904
+ const payload = {
4905
+ x402Version: requirements.x402Version,
4906
+ scheme: requirements.accepts[0].scheme,
4907
+ network: requirements.accepts[0].network,
4908
+ payload: {
4909
+ signature,
4910
+ authorization: message
4911
+ }
4912
+ };
4913
+ const encodedPayment = safeBase64Encode(JSON.stringify(payload));
4914
+ return {
4915
+ encodedPayment,
4916
+ signature,
4917
+ message
4918
+ };
4919
+ } catch (error) {
4920
+ throw new acpError_default("Failed to generate X402 payment", error);
4921
+ }
4922
+ });
4923
+ }
4924
+ performRequest(url, version2, budget, signature) {
4925
+ return __async(this, null, function* () {
4926
+ var _a;
4927
+ const baseUrl = (_a = this.config.x402Config) == null ? void 0 : _a.url;
4928
+ if (!baseUrl) throw new acpError_default("X402 URL not configured");
4929
+ try {
4930
+ const headers = {};
4931
+ if (signature) headers["x-payment"] = signature;
4932
+ if (budget) headers["x-budget"] = budget.toString();
4933
+ headers["x-acp-version"] = version2;
4934
+ const res = yield fetch(`${baseUrl}${url}`, { method: "GET", headers });
4935
+ const data = yield res.json();
4936
+ if (!res.ok && res.status !== HTTP_STATUS_CODES.PAYMENT_REQUIRED) {
4937
+ throw new acpError_default(
4938
+ "Invalid response status code for X402 request",
4939
+ data
4940
+ );
4941
+ }
4942
+ return {
4943
+ isPaymentRequired: res.status === HTTP_STATUS_CODES.PAYMENT_REQUIRED,
4944
+ data
4945
+ };
4946
+ } catch (error) {
4947
+ throw new acpError_default("Failed to perform X402 request", error);
4948
+ }
4949
+ });
4950
+ }
4951
+ };
4952
+
4953
+ // src/contractClients/acpContractClient.ts
4380
4954
  var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_default {
4381
4955
  constructor(agentWalletAddress, config = baseAcpConfig) {
4382
4956
  super(agentWalletAddress, config);
4383
- this.MAX_RETRIES = 3;
4957
+ this.MAX_RETRIES = 10;
4958
+ // temp fix, while alchemy taking alook into it
4384
4959
  this.PRIORITY_FEE_MULTIPLIER = 2;
4385
4960
  this.MAX_FEE_PER_GAS = 2e7;
4386
4961
  this.MAX_PRIORITY_FEE_PER_GAS = 21e6;
@@ -4408,6 +4983,11 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4408
4983
  isGlobalValidation: true
4409
4984
  }
4410
4985
  });
4986
+ this._acpX402 = new AcpX402(
4987
+ this.config,
4988
+ this.sessionKeyClient,
4989
+ this.publicClient
4990
+ );
4411
4991
  });
4412
4992
  }
4413
4993
  getRandomNonce(bits = 152) {
@@ -4425,6 +5005,12 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4425
5005
  }
4426
5006
  return this._sessionKeyClient;
4427
5007
  }
5008
+ get acpX402() {
5009
+ if (!this._acpX402) {
5010
+ throw new acpError_default("ACP X402 not initialized");
5011
+ }
5012
+ return this._acpX402;
5013
+ }
4428
5014
  calculateGasFees() {
4429
5015
  return __async(this, null, function* () {
4430
5016
  const finalMaxFeePerGas = BigInt(this.MAX_FEE_PER_GAS) + BigInt(this.MAX_PRIORITY_FEE_PER_GAS) * BigInt(Math.max(0, this.PRIORITY_FEE_MULTIPLIER - 1));
@@ -4479,7 +5065,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4479
5065
  const contractLogs = result.logs.filter((log) => {
4480
5066
  return log.address.toLowerCase() === this.contractAddress.toLowerCase();
4481
5067
  }).map(
4482
- (log) => (0, import_viem5.decodeEventLog)({
5068
+ (log) => (0, import_viem6.decodeEventLog)({
4483
5069
  abi: this.abi,
4484
5070
  data: log.data,
4485
5071
  topics: log.topics
@@ -4494,11 +5080,11 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4494
5080
  return Number(createdJobEvent.args.jobId);
4495
5081
  });
4496
5082
  }
4497
- createJob(providerAddress, evaluatorAddress, expireAt, paymentTokenAddress, budgetBaseUnit, metadata) {
5083
+ createJob(providerAddress, evaluatorAddress, expireAt, paymentTokenAddress, budgetBaseUnit, metadata, isX402Job) {
4498
5084
  try {
4499
- const data = (0, import_viem5.encodeFunctionData)({
5085
+ const data = (0, import_viem6.encodeFunctionData)({
4500
5086
  abi: this.abi,
4501
- functionName: "createJob",
5087
+ functionName: isX402Job ? "createJobWithX402" : "createJob",
4502
5088
  args: [
4503
5089
  providerAddress,
4504
5090
  evaluatorAddress,
@@ -4516,7 +5102,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4516
5102
  }
4517
5103
  setBudgetWithPaymentToken(jobId, budgetBaseUnit, paymentTokenAddress = this.config.baseFare.contractAddress) {
4518
5104
  try {
4519
- const data = (0, import_viem5.encodeFunctionData)({
5105
+ const data = (0, import_viem6.encodeFunctionData)({
4520
5106
  abi: this.abi,
4521
5107
  functionName: "setBudgetWithPaymentToken",
4522
5108
  args: [jobId, budgetBaseUnit, paymentTokenAddress]
@@ -4532,7 +5118,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4532
5118
  }
4533
5119
  createPayableMemo(jobId, content, amountBaseUnit, recipient, feeAmountBaseUnit, feeType, nextPhase, type, expiredAt, token = this.config.baseFare.contractAddress, secured = true) {
4534
5120
  try {
4535
- const data = (0, import_viem5.encodeFunctionData)({
5121
+ const data = (0, import_viem6.encodeFunctionData)({
4536
5122
  abi: this.abi,
4537
5123
  functionName: "createPayableMemo",
4538
5124
  args: [
@@ -4557,12 +5143,30 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
4557
5143
  throw new acpError_default("Failed to create payable memo", error);
4558
5144
  }
4559
5145
  }
4560
- createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt) {
5146
+ createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt, isX402Job) {
4561
5147
  throw new acpError_default("Not Supported");
4562
5148
  }
4563
5149
  updateAccountMetadata(accountId, metadata) {
4564
5150
  throw new acpError_default("Not Supported");
4565
5151
  }
5152
+ updateJobX402Nonce(jobId, nonce) {
5153
+ return __async(this, null, function* () {
5154
+ return yield this.acpX402.updateJobNonce(jobId, nonce);
5155
+ });
5156
+ }
5157
+ generateX402Payment(payableRequest, requirements) {
5158
+ return __async(this, null, function* () {
5159
+ return yield this.acpX402.generatePayment(payableRequest, requirements);
5160
+ });
5161
+ }
5162
+ performX402Request(url, version2, budget, signature) {
5163
+ return __async(this, null, function* () {
5164
+ return yield this.acpX402.performRequest(url, version2, budget, signature);
5165
+ });
5166
+ }
5167
+ getAcpVersion() {
5168
+ return "1";
5169
+ }
4566
5170
  };
4567
5171
  var acpContractClient_default = AcpContractClient;
4568
5172
 
@@ -4570,7 +5174,7 @@ var acpContractClient_default = AcpContractClient;
4570
5174
  var import_core2 = require("@aa-sdk/core");
4571
5175
  var import_infra3 = require("@account-kit/infra");
4572
5176
  var import_smart_contracts2 = require("@account-kit/smart-contracts");
4573
- var import_viem6 = require("viem");
5177
+ var import_viem7 = require("viem");
4574
5178
 
4575
5179
  // src/abis/jobManagerAbi.ts
4576
5180
  var JOB_MANAGER_ABI = [
@@ -4633,97 +5237,10 @@ var JOB_MANAGER_ABI = [
4633
5237
  indexed: false,
4634
5238
  internalType: "uint64",
4635
5239
  name: "version",
4636
- type: "uint64"
4637
- }
4638
- ],
4639
- name: "Initialized",
4640
- type: "event"
4641
- },
4642
- {
4643
- anonymous: false,
4644
- inputs: [
4645
- {
4646
- indexed: true,
4647
- internalType: "uint256",
4648
- name: "jobId",
4649
- type: "uint256"
4650
- },
4651
- {
4652
- indexed: true,
4653
- internalType: "address",
4654
- name: "oldAssignee",
4655
- type: "address"
4656
- },
4657
- {
4658
- indexed: true,
4659
- internalType: "address",
4660
- name: "newAssignee",
4661
- type: "address"
4662
- }
4663
- ],
4664
- name: "JobAssigned",
4665
- type: "event"
4666
- },
4667
- {
4668
- anonymous: false,
4669
- inputs: [
4670
- {
4671
- indexed: true,
4672
- internalType: "uint256",
4673
- name: "jobId",
4674
- type: "uint256"
4675
- },
4676
- {
4677
- indexed: true,
4678
- internalType: "uint256",
4679
- name: "accountId",
4680
- type: "uint256"
4681
- },
4682
- {
4683
- indexed: true,
4684
- internalType: "address",
4685
- name: "client",
4686
- type: "address"
4687
- },
4688
- {
4689
- indexed: false,
4690
- internalType: "address",
4691
- name: "provider",
4692
- type: "address"
4693
- },
4694
- {
4695
- indexed: false,
4696
- internalType: "address",
4697
- name: "evaluator",
4698
- type: "address"
4699
- },
4700
- {
4701
- indexed: false,
4702
- internalType: "uint256",
4703
- name: "expiredAt",
4704
- type: "uint256"
4705
- }
4706
- ],
4707
- name: "JobCreated",
4708
- type: "event"
4709
- },
4710
- {
4711
- anonymous: false,
4712
- inputs: [
4713
- {
4714
- indexed: true,
4715
- internalType: "uint256",
4716
- name: "jobId",
4717
- type: "uint256"
4718
- },
4719
- {
4720
- indexed: true,
4721
- internalType: "uint256",
4722
- name: "dependencyJobId",
4723
- type: "uint256"
5240
+ type: "uint64"
4724
5241
  }
4725
5242
  ],
4726
- name: "JobDependencyAdded",
5243
+ name: "Initialized",
4727
5244
  type: "event"
4728
5245
  },
4729
5246
  {
@@ -4738,11 +5255,35 @@ var JOB_MANAGER_ABI = [
4738
5255
  {
4739
5256
  indexed: true,
4740
5257
  internalType: "uint256",
4741
- name: "dependencyJobId",
5258
+ name: "accountId",
5259
+ type: "uint256"
5260
+ },
5261
+ {
5262
+ indexed: true,
5263
+ internalType: "address",
5264
+ name: "client",
5265
+ type: "address"
5266
+ },
5267
+ {
5268
+ indexed: false,
5269
+ internalType: "address",
5270
+ name: "provider",
5271
+ type: "address"
5272
+ },
5273
+ {
5274
+ indexed: false,
5275
+ internalType: "address",
5276
+ name: "evaluator",
5277
+ type: "address"
5278
+ },
5279
+ {
5280
+ indexed: false,
5281
+ internalType: "uint256",
5282
+ name: "expiredAt",
4742
5283
  type: "uint256"
4743
5284
  }
4744
5285
  ],
4745
- name: "JobDependencyRemoved",
5286
+ name: "JobCreated",
4746
5287
  type: "event"
4747
5288
  },
4748
5289
  {
@@ -4795,37 +5336,6 @@ var JOB_MANAGER_ABI = [
4795
5336
  name: "JobPhaseUpdated",
4796
5337
  type: "event"
4797
5338
  },
4798
- {
4799
- anonymous: false,
4800
- inputs: [
4801
- {
4802
- indexed: true,
4803
- internalType: "uint256",
4804
- name: "jobId",
4805
- type: "uint256"
4806
- },
4807
- {
4808
- indexed: false,
4809
- internalType: "enum ACPTypes.JobStatus",
4810
- name: "oldStatus",
4811
- type: "uint8"
4812
- },
4813
- {
4814
- indexed: false,
4815
- internalType: "enum ACPTypes.JobStatus",
4816
- name: "newStatus",
4817
- type: "uint8"
4818
- },
4819
- {
4820
- indexed: false,
4821
- internalType: "address",
4822
- name: "updatedBy",
4823
- type: "address"
4824
- }
4825
- ],
4826
- name: "JobStatusUpdated",
4827
- type: "event"
4828
- },
4829
5339
  {
4830
5340
  anonymous: false,
4831
5341
  inputs: [
@@ -4899,6 +5409,19 @@ var JOB_MANAGER_ABI = [
4899
5409
  name: "Upgraded",
4900
5410
  type: "event"
4901
5411
  },
5412
+ {
5413
+ anonymous: false,
5414
+ inputs: [
5415
+ {
5416
+ indexed: true,
5417
+ internalType: "uint256",
5418
+ name: "jobId",
5419
+ type: "uint256"
5420
+ }
5421
+ ],
5422
+ name: "X402PaymentReceived",
5423
+ type: "event"
5424
+ },
4902
5425
  {
4903
5426
  inputs: [],
4904
5427
  name: "ACP_CONTRACT_ROLE",
@@ -4934,6 +5457,13 @@ var JOB_MANAGER_ABI = [
4934
5457
  stateMutability: "view",
4935
5458
  type: "function"
4936
5459
  },
5460
+ {
5461
+ inputs: [],
5462
+ name: "X402_MANAGER_ROLE",
5463
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
5464
+ stateMutability: "view",
5465
+ type: "function"
5466
+ },
4937
5467
  {
4938
5468
  inputs: [
4939
5469
  { internalType: "uint256", name: "", type: "uint256" },
@@ -4951,40 +5481,6 @@ var JOB_MANAGER_ABI = [
4951
5481
  stateMutability: "view",
4952
5482
  type: "function"
4953
5483
  },
4954
- {
4955
- inputs: [
4956
- { internalType: "uint256", name: "jobId", type: "uint256" },
4957
- { internalType: "uint256", name: "dependencyJobId", type: "uint256" }
4958
- ],
4959
- name: "addJobDependency",
4960
- outputs: [],
4961
- stateMutability: "nonpayable",
4962
- type: "function"
4963
- },
4964
- {
4965
- inputs: [
4966
- { internalType: "uint256", name: "jobId", type: "uint256" },
4967
- { internalType: "address", name: "assignee", type: "address" }
4968
- ],
4969
- name: "assignJob",
4970
- outputs: [],
4971
- stateMutability: "nonpayable",
4972
- type: "function"
4973
- },
4974
- {
4975
- inputs: [
4976
- { internalType: "uint256[]", name: "jobIds", type: "uint256[]" },
4977
- {
4978
- internalType: "enum ACPTypes.JobStatus",
4979
- name: "newStatus",
4980
- type: "uint8"
4981
- }
4982
- ],
4983
- name: "bulkUpdateJobStatus",
4984
- outputs: [],
4985
- stateMutability: "nonpayable",
4986
- type: "function"
4987
- },
4988
5484
  {
4989
5485
  inputs: [
4990
5486
  { internalType: "uint256", name: "jobId", type: "uint256" },
@@ -4997,9 +5493,9 @@ var JOB_MANAGER_ABI = [
4997
5493
  },
4998
5494
  {
4999
5495
  inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
5000
- name: "canStartJob",
5001
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
5002
- stateMutability: "view",
5496
+ name: "confirmX402PaymentReceived",
5497
+ outputs: [],
5498
+ stateMutability: "nonpayable",
5003
5499
  type: "function"
5004
5500
  },
5005
5501
  {
@@ -5023,15 +5519,23 @@ var JOB_MANAGER_ABI = [
5023
5519
  type: "function"
5024
5520
  },
5025
5521
  {
5026
- inputs: [{ internalType: "uint256", name: "accountId", type: "uint256" }],
5027
- name: "getAccountJobStats",
5028
- outputs: [
5029
- { internalType: "uint256", name: "totalJobs", type: "uint256" },
5030
- { internalType: "uint256", name: "completedJobs", type: "uint256" },
5031
- { internalType: "uint256", name: "inProgressJobs", type: "uint256" },
5032
- { internalType: "uint256", name: "pendingJobs", type: "uint256" }
5522
+ inputs: [
5523
+ { internalType: "uint256", name: "accountId", type: "uint256" },
5524
+ { internalType: "address", name: "client", type: "address" },
5525
+ { internalType: "address", name: "provider", type: "address" },
5526
+ { internalType: "address", name: "evaluator", type: "address" },
5527
+ { internalType: "address", name: "creator", type: "address" },
5528
+ { internalType: "uint256", name: "budget", type: "uint256" },
5529
+ {
5530
+ internalType: "contract IERC20",
5531
+ name: "paymentToken",
5532
+ type: "address"
5533
+ },
5534
+ { internalType: "uint256", name: "expiredAt", type: "uint256" }
5033
5535
  ],
5034
- stateMutability: "view",
5536
+ name: "createJobWithX402",
5537
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5538
+ stateMutability: "nonpayable",
5035
5539
  type: "function"
5036
5540
  },
5037
5541
  {
@@ -5050,11 +5554,10 @@ var JOB_MANAGER_ABI = [
5050
5554
  { internalType: "address", name: "provider", type: "address" },
5051
5555
  { internalType: "address", name: "evaluator", type: "address" },
5052
5556
  { internalType: "address", name: "creator", type: "address" },
5053
- { internalType: "address", name: "assignee", type: "address" },
5054
5557
  { internalType: "uint256", name: "budget", type: "uint256" },
5055
5558
  {
5056
5559
  internalType: "contract IERC20",
5057
- name: "paymentToken",
5560
+ name: "jobPaymentToken",
5058
5561
  type: "address"
5059
5562
  },
5060
5563
  {
@@ -5062,22 +5565,11 @@ var JOB_MANAGER_ABI = [
5062
5565
  name: "phase",
5063
5566
  type: "uint8"
5064
5567
  },
5065
- {
5066
- internalType: "enum ACPTypes.JobStatus",
5067
- name: "status",
5068
- type: "uint8"
5069
- },
5070
5568
  { internalType: "uint256", name: "expiredAt", type: "uint256" },
5071
5569
  { internalType: "uint256", name: "createdAt", type: "uint256" },
5072
- { internalType: "uint256", name: "startedAt", type: "uint256" },
5073
- { internalType: "uint256", name: "completedAt", type: "uint256" },
5074
5570
  { internalType: "uint256", name: "memoCount", type: "uint256" },
5075
5571
  { internalType: "string", name: "metadata", type: "string" },
5076
- {
5077
- internalType: "uint256[]",
5078
- name: "dependencies",
5079
- type: "uint256[]"
5080
- }
5572
+ { internalType: "uint256", name: "amountClaimed", type: "uint256" }
5081
5573
  ],
5082
5574
  internalType: "struct ACPTypes.Job[]",
5083
5575
  name: "jobArray",
@@ -5100,11 +5592,10 @@ var JOB_MANAGER_ABI = [
5100
5592
  { internalType: "address", name: "provider", type: "address" },
5101
5593
  { internalType: "address", name: "evaluator", type: "address" },
5102
5594
  { internalType: "address", name: "creator", type: "address" },
5103
- { internalType: "address", name: "assignee", type: "address" },
5104
5595
  { internalType: "uint256", name: "budget", type: "uint256" },
5105
5596
  {
5106
5597
  internalType: "contract IERC20",
5107
- name: "paymentToken",
5598
+ name: "jobPaymentToken",
5108
5599
  type: "address"
5109
5600
  },
5110
5601
  {
@@ -5112,22 +5603,11 @@ var JOB_MANAGER_ABI = [
5112
5603
  name: "phase",
5113
5604
  type: "uint8"
5114
5605
  },
5115
- {
5116
- internalType: "enum ACPTypes.JobStatus",
5117
- name: "status",
5118
- type: "uint8"
5119
- },
5120
5606
  { internalType: "uint256", name: "expiredAt", type: "uint256" },
5121
5607
  { internalType: "uint256", name: "createdAt", type: "uint256" },
5122
- { internalType: "uint256", name: "startedAt", type: "uint256" },
5123
- { internalType: "uint256", name: "completedAt", type: "uint256" },
5124
5608
  { internalType: "uint256", name: "memoCount", type: "uint256" },
5125
5609
  { internalType: "string", name: "metadata", type: "string" },
5126
- {
5127
- internalType: "uint256[]",
5128
- name: "dependencies",
5129
- type: "uint256[]"
5130
- }
5610
+ { internalType: "uint256", name: "amountClaimed", type: "uint256" }
5131
5611
  ],
5132
5612
  internalType: "struct ACPTypes.Job",
5133
5613
  name: "",
@@ -5137,13 +5617,6 @@ var JOB_MANAGER_ABI = [
5137
5617
  stateMutability: "view",
5138
5618
  type: "function"
5139
5619
  },
5140
- {
5141
- inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
5142
- name: "getJobDependencies",
5143
- outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
5144
- stateMutability: "view",
5145
- type: "function"
5146
- },
5147
5620
  {
5148
5621
  inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
5149
5622
  name: "getRoleAdmin",
@@ -5167,11 +5640,10 @@ var JOB_MANAGER_ABI = [
5167
5640
  { internalType: "address", name: "provider", type: "address" },
5168
5641
  { internalType: "address", name: "evaluator", type: "address" },
5169
5642
  { internalType: "address", name: "creator", type: "address" },
5170
- { internalType: "address", name: "assignee", type: "address" },
5171
5643
  { internalType: "uint256", name: "budget", type: "uint256" },
5172
5644
  {
5173
5645
  internalType: "contract IERC20",
5174
- name: "paymentToken",
5646
+ name: "jobPaymentToken",
5175
5647
  type: "address"
5176
5648
  },
5177
5649
  {
@@ -5179,22 +5651,11 @@ var JOB_MANAGER_ABI = [
5179
5651
  name: "phase",
5180
5652
  type: "uint8"
5181
5653
  },
5182
- {
5183
- internalType: "enum ACPTypes.JobStatus",
5184
- name: "status",
5185
- type: "uint8"
5186
- },
5187
5654
  { internalType: "uint256", name: "expiredAt", type: "uint256" },
5188
5655
  { internalType: "uint256", name: "createdAt", type: "uint256" },
5189
- { internalType: "uint256", name: "startedAt", type: "uint256" },
5190
- { internalType: "uint256", name: "completedAt", type: "uint256" },
5191
5656
  { internalType: "uint256", name: "memoCount", type: "uint256" },
5192
5657
  { internalType: "string", name: "metadata", type: "string" },
5193
- {
5194
- internalType: "uint256[]",
5195
- name: "dependencies",
5196
- type: "uint256[]"
5197
- }
5658
+ { internalType: "uint256", name: "amountClaimed", type: "uint256" }
5198
5659
  ],
5199
5660
  internalType: "struct ACPTypes.Job[]",
5200
5661
  name: "jobArray",
@@ -5205,6 +5666,23 @@ var JOB_MANAGER_ABI = [
5205
5666
  stateMutability: "view",
5206
5667
  type: "function"
5207
5668
  },
5669
+ {
5670
+ inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
5671
+ name: "getX402PaymentDetails",
5672
+ outputs: [
5673
+ {
5674
+ components: [
5675
+ { internalType: "bool", name: "isX402", type: "bool" },
5676
+ { internalType: "bool", name: "isBudgetReceived", type: "bool" }
5677
+ ],
5678
+ internalType: "struct ACPTypes.X402PaymentDetail",
5679
+ name: "",
5680
+ type: "tuple"
5681
+ }
5682
+ ],
5683
+ stateMutability: "view",
5684
+ type: "function"
5685
+ },
5208
5686
  {
5209
5687
  inputs: [
5210
5688
  { internalType: "bytes32", name: "role", type: "bytes32" },
@@ -5248,26 +5726,6 @@ var JOB_MANAGER_ABI = [
5248
5726
  stateMutability: "view",
5249
5727
  type: "function"
5250
5728
  },
5251
- {
5252
- inputs: [
5253
- { internalType: "uint256", name: "", type: "uint256" },
5254
- { internalType: "uint256", name: "", type: "uint256" }
5255
- ],
5256
- name: "jobDependencies",
5257
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5258
- stateMutability: "view",
5259
- type: "function"
5260
- },
5261
- {
5262
- inputs: [
5263
- { internalType: "uint256", name: "", type: "uint256" },
5264
- { internalType: "uint256", name: "", type: "uint256" }
5265
- ],
5266
- name: "jobDependents",
5267
- outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5268
- stateMutability: "view",
5269
- type: "function"
5270
- },
5271
5729
  {
5272
5730
  inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5273
5731
  name: "jobs",
@@ -5278,39 +5736,22 @@ var JOB_MANAGER_ABI = [
5278
5736
  { internalType: "address", name: "provider", type: "address" },
5279
5737
  { internalType: "address", name: "evaluator", type: "address" },
5280
5738
  { internalType: "address", name: "creator", type: "address" },
5281
- { internalType: "address", name: "assignee", type: "address" },
5282
5739
  { internalType: "uint256", name: "budget", type: "uint256" },
5283
5740
  {
5284
5741
  internalType: "contract IERC20",
5285
- name: "paymentToken",
5742
+ name: "jobPaymentToken",
5286
5743
  type: "address"
5287
5744
  },
5288
5745
  { internalType: "enum ACPTypes.JobPhase", name: "phase", type: "uint8" },
5289
- {
5290
- internalType: "enum ACPTypes.JobStatus",
5291
- name: "status",
5292
- type: "uint8"
5293
- },
5294
5746
  { internalType: "uint256", name: "expiredAt", type: "uint256" },
5295
5747
  { internalType: "uint256", name: "createdAt", type: "uint256" },
5296
- { internalType: "uint256", name: "startedAt", type: "uint256" },
5297
- { internalType: "uint256", name: "completedAt", type: "uint256" },
5298
5748
  { internalType: "uint256", name: "memoCount", type: "uint256" },
5299
- { internalType: "string", name: "metadata", type: "string" }
5749
+ { internalType: "string", name: "metadata", type: "string" },
5750
+ { internalType: "uint256", name: "amountClaimed", type: "uint256" }
5300
5751
  ],
5301
5752
  stateMutability: "view",
5302
5753
  type: "function"
5303
5754
  },
5304
- {
5305
- inputs: [
5306
- { internalType: "uint256", name: "jobId", type: "uint256" },
5307
- { internalType: "address", name: "completedBy", type: "address" }
5308
- ],
5309
- name: "markJobCompleted",
5310
- outputs: [],
5311
- stateMutability: "nonpayable",
5312
- type: "function"
5313
- },
5314
5755
  {
5315
5756
  inputs: [],
5316
5757
  name: "proxiableUUID",
@@ -5318,16 +5759,6 @@ var JOB_MANAGER_ABI = [
5318
5759
  stateMutability: "view",
5319
5760
  type: "function"
5320
5761
  },
5321
- {
5322
- inputs: [
5323
- { internalType: "uint256", name: "jobId", type: "uint256" },
5324
- { internalType: "uint256", name: "dependencyJobId", type: "uint256" }
5325
- ],
5326
- name: "removeJobDependency",
5327
- outputs: [],
5328
- stateMutability: "nonpayable",
5329
- type: "function"
5330
- },
5331
5762
  {
5332
5763
  inputs: [
5333
5764
  { internalType: "bytes32", name: "role", type: "bytes32" },
@@ -5363,6 +5794,19 @@ var JOB_MANAGER_ABI = [
5363
5794
  stateMutability: "nonpayable",
5364
5795
  type: "function"
5365
5796
  },
5797
+ {
5798
+ inputs: [
5799
+ {
5800
+ internalType: "address",
5801
+ name: "x402PaymentTokenAddress",
5802
+ type: "address"
5803
+ }
5804
+ ],
5805
+ name: "setX402PaymentToken",
5806
+ outputs: [],
5807
+ stateMutability: "nonpayable",
5808
+ type: "function"
5809
+ },
5366
5810
  {
5367
5811
  inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
5368
5812
  name: "supportsInterface",
@@ -5393,20 +5837,6 @@ var JOB_MANAGER_ABI = [
5393
5837
  stateMutability: "nonpayable",
5394
5838
  type: "function"
5395
5839
  },
5396
- {
5397
- inputs: [
5398
- { internalType: "uint256", name: "jobId", type: "uint256" },
5399
- {
5400
- internalType: "enum ACPTypes.JobStatus",
5401
- name: "newStatus",
5402
- type: "uint8"
5403
- }
5404
- ],
5405
- name: "updateJobStatus",
5406
- outputs: [],
5407
- stateMutability: "nonpayable",
5408
- type: "function"
5409
- },
5410
5840
  {
5411
5841
  inputs: [
5412
5842
  { internalType: "address", name: "newImplementation", type: "address" },
@@ -5426,6 +5856,23 @@ var JOB_MANAGER_ABI = [
5426
5856
  outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
5427
5857
  stateMutability: "view",
5428
5858
  type: "function"
5859
+ },
5860
+ {
5861
+ inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
5862
+ name: "x402PaymentDetails",
5863
+ outputs: [
5864
+ { internalType: "bool", name: "isX402", type: "bool" },
5865
+ { internalType: "bool", name: "isBudgetReceived", type: "bool" }
5866
+ ],
5867
+ stateMutability: "view",
5868
+ type: "function"
5869
+ },
5870
+ {
5871
+ inputs: [],
5872
+ name: "x402PaymentToken",
5873
+ outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
5874
+ stateMutability: "view",
5875
+ type: "function"
5429
5876
  }
5430
5877
  ];
5431
5878
  var jobManagerAbi_default = JOB_MANAGER_ABI;
@@ -5444,9 +5891,9 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
5444
5891
  }
5445
5892
  static build(_0, _1, _2) {
5446
5893
  return __async(this, arguments, function* (walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfigV2) {
5447
- const publicClient = (0, import_viem6.createPublicClient)({
5894
+ const publicClient = (0, import_viem7.createPublicClient)({
5448
5895
  chain: config.chain,
5449
- transport: (0, import_viem6.http)(config.rpcEndpoint)
5896
+ transport: (0, import_viem7.http)(config.rpcEndpoint)
5450
5897
  });
5451
5898
  const [jobManagerAddress, memoManagerAddress, accountManagerAddress] = yield publicClient.multicall({
5452
5899
  contracts: [
@@ -5499,6 +5946,11 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
5499
5946
  isGlobalValidation: true
5500
5947
  }
5501
5948
  });
5949
+ this._acpX402 = new AcpX402(
5950
+ this.config,
5951
+ this.sessionKeyClient,
5952
+ this.publicClient
5953
+ );
5502
5954
  });
5503
5955
  }
5504
5956
  getRandomNonce(bits = 152) {
@@ -5516,6 +5968,12 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
5516
5968
  }
5517
5969
  return this._sessionKeyClient;
5518
5970
  }
5971
+ get acpX402() {
5972
+ if (!this._acpX402) {
5973
+ throw new acpError_default("ACP X402 not initialized");
5974
+ }
5975
+ return this._acpX402;
5976
+ }
5519
5977
  calculateGasFees() {
5520
5978
  return __async(this, null, function* () {
5521
5979
  const finalMaxFeePerGas = BigInt(this.MAX_FEE_PER_GAS) + BigInt(this.MAX_PRIORITY_FEE_PER_GAS) * BigInt(Math.max(0, this.PRIORITY_FEE_MULTIPLIER - 1));
@@ -5579,7 +6037,7 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
5579
6037
  const contractLogs = result.logs.filter((log) => {
5580
6038
  return log.address.toLowerCase() === this.jobManagerAddress.toLowerCase();
5581
6039
  }).map(
5582
- (log) => (0, import_viem6.decodeEventLog)({
6040
+ (log) => (0, import_viem7.decodeEventLog)({
5583
6041
  abi: jobManagerAbi_default,
5584
6042
  data: log.data,
5585
6043
  topics: log.topics
@@ -5594,6 +6052,42 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
5594
6052
  return Number(createdJobEvent.args.jobId);
5595
6053
  });
5596
6054
  }
6055
+ updateJobX402Nonce(jobId, nonce) {
6056
+ return __async(this, null, function* () {
6057
+ return yield this.acpX402.updateJobNonce(jobId, nonce);
6058
+ });
6059
+ }
6060
+ generateX402Payment(payableRequest, requirements) {
6061
+ return __async(this, null, function* () {
6062
+ return yield this.acpX402.generatePayment(payableRequest, requirements);
6063
+ });
6064
+ }
6065
+ performX402Request(url, version2, budget, signature) {
6066
+ return __async(this, null, function* () {
6067
+ return yield this.acpX402.performRequest(url, version2, budget, signature);
6068
+ });
6069
+ }
6070
+ getX402PaymentDetails(jobId) {
6071
+ return __async(this, null, function* () {
6072
+ try {
6073
+ const result = yield this.publicClient.readContract({
6074
+ address: this.jobManagerAddress,
6075
+ abi: jobManagerAbi_default,
6076
+ functionName: "x402PaymentDetails",
6077
+ args: [BigInt(jobId)]
6078
+ });
6079
+ return {
6080
+ isX402: result[0],
6081
+ isBudgetReceived: result[1]
6082
+ };
6083
+ } catch (error) {
6084
+ throw new acpError_default("Failed to get X402 payment details", error);
6085
+ }
6086
+ });
6087
+ }
6088
+ getAcpVersion() {
6089
+ return "2";
6090
+ }
5597
6091
  };
5598
6092
  var acpContractClientV2_default = AcpContractClientV2;
5599
6093
 
@@ -5622,6 +6116,8 @@ var index_default = acpClient_default;
5622
6116
  PositionDirection,
5623
6117
  baseAcpConfig,
5624
6118
  baseAcpConfigV2,
6119
+ baseAcpX402Config,
6120
+ baseAcpX402ConfigV2,
5625
6121
  baseSepoliaAcpConfig,
5626
6122
  baseSepoliaAcpConfigV2,
5627
6123
  ethFare,