@virtuals-protocol/acp-node 0.3.0-beta.8 → 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.d.mts +231 -109
- package/dist/index.d.ts +231 -109
- package/dist/index.js +1872 -1377
- package/dist/index.mjs +1874 -1377
- package/package.json +2 -1
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.
|
|
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
|
-
|
|
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
|
-
|
|
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: "
|
|
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: "
|
|
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:
|
|
572
|
+
indexed: false,
|
|
586
573
|
internalType: "address",
|
|
587
|
-
name: "
|
|
574
|
+
name: "token",
|
|
588
575
|
type: "address"
|
|
589
576
|
},
|
|
590
577
|
{
|
|
591
578
|
indexed: false,
|
|
592
|
-
internalType: "
|
|
593
|
-
name: "
|
|
594
|
-
type: "
|
|
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
|
-
|
|
860
|
-
|
|
861
|
-
|
|
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
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
},
|
|
881
|
-
{
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
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
|
-
|
|
960
|
-
|
|
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
|
-
|
|
978
|
-
|
|
979
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1105
|
-
|
|
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
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
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
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1443
|
-
|
|
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
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
},
|
|
1483
|
-
{
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
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
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
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
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1785
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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: "
|
|
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
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
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
|
{
|
|
@@ -2696,330 +2166,1135 @@ var ACP_V2_ABI = [
|
|
|
2696
2166
|
},
|
|
2697
2167
|
{
|
|
2698
2168
|
inputs: [],
|
|
2699
|
-
name: "proxiableUUID",
|
|
2700
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
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" }],
|
|
2701
2931
|
stateMutability: "view",
|
|
2702
2932
|
type: "function"
|
|
2703
2933
|
},
|
|
2704
2934
|
{
|
|
2705
2935
|
inputs: [
|
|
2706
|
-
{ internalType: "
|
|
2707
|
-
{ internalType: "
|
|
2936
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
2937
|
+
{ internalType: "uint256", name: "decrement", type: "uint256" }
|
|
2708
2938
|
],
|
|
2709
|
-
name: "
|
|
2710
|
-
outputs: [],
|
|
2939
|
+
name: "decreaseAllowance",
|
|
2940
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2711
2941
|
stateMutability: "nonpayable",
|
|
2712
2942
|
type: "function"
|
|
2713
2943
|
},
|
|
2714
2944
|
{
|
|
2715
2945
|
inputs: [
|
|
2716
|
-
{ internalType: "
|
|
2717
|
-
{ internalType: "
|
|
2946
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
2947
|
+
{ internalType: "uint256", name: "increment", type: "uint256" }
|
|
2718
2948
|
],
|
|
2719
|
-
name: "
|
|
2720
|
-
outputs: [],
|
|
2949
|
+
name: "increaseAllowance",
|
|
2950
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2721
2951
|
stateMutability: "nonpayable",
|
|
2722
2952
|
type: "function"
|
|
2723
2953
|
},
|
|
2724
2954
|
{
|
|
2725
2955
|
inputs: [
|
|
2726
|
-
{ internalType: "
|
|
2727
|
-
{ internalType: "
|
|
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" }
|
|
2728
2964
|
],
|
|
2729
|
-
name: "
|
|
2965
|
+
name: "initialize",
|
|
2966
|
+
outputs: [],
|
|
2967
|
+
stateMutability: "nonpayable",
|
|
2968
|
+
type: "function"
|
|
2969
|
+
},
|
|
2970
|
+
{
|
|
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: "
|
|
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: "
|
|
2981
|
+
name: "initializeV2_1",
|
|
2741
2982
|
outputs: [],
|
|
2742
2983
|
stateMutability: "nonpayable",
|
|
2743
2984
|
type: "function"
|
|
2744
2985
|
},
|
|
2745
2986
|
{
|
|
2746
2987
|
inputs: [
|
|
2747
|
-
{
|
|
2748
|
-
|
|
2749
|
-
|
|
2988
|
+
{
|
|
2989
|
+
internalType: "address[]",
|
|
2990
|
+
name: "accountsToBlacklist",
|
|
2991
|
+
type: "address[]"
|
|
2992
|
+
},
|
|
2993
|
+
{ internalType: "string", name: "newSymbol", type: "string" }
|
|
2750
2994
|
],
|
|
2751
|
-
name: "
|
|
2995
|
+
name: "initializeV2_2",
|
|
2752
2996
|
outputs: [],
|
|
2753
2997
|
stateMutability: "nonpayable",
|
|
2754
2998
|
type: "function"
|
|
2755
2999
|
},
|
|
2756
3000
|
{
|
|
2757
|
-
inputs: [{ internalType: "
|
|
2758
|
-
name: "
|
|
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: "
|
|
2766
|
-
outputs: [],
|
|
2767
|
-
stateMutability: "
|
|
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: "
|
|
2773
|
-
{ internalType: "
|
|
3023
|
+
{ internalType: "address", name: "_to", type: "address" },
|
|
3024
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" }
|
|
2774
3025
|
],
|
|
2775
|
-
name: "
|
|
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: "
|
|
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: "
|
|
3088
|
+
name: "permit",
|
|
2785
3089
|
outputs: [],
|
|
2786
3090
|
stateMutability: "nonpayable",
|
|
2787
3091
|
type: "function"
|
|
2788
3092
|
},
|
|
2789
3093
|
{
|
|
2790
3094
|
inputs: [
|
|
2791
|
-
{ internalType: "
|
|
2792
|
-
{ internalType: "address", name: "
|
|
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: "
|
|
3103
|
+
name: "permit",
|
|
2795
3104
|
outputs: [],
|
|
2796
3105
|
stateMutability: "nonpayable",
|
|
2797
3106
|
type: "function"
|
|
2798
3107
|
},
|
|
2799
3108
|
{
|
|
2800
3109
|
inputs: [
|
|
2801
|
-
{ internalType: "
|
|
2802
|
-
{ internalType: "address", name: "
|
|
2803
|
-
{ internalType: "uint256", name: "
|
|
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: "
|
|
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: "
|
|
2813
|
-
{ internalType: "
|
|
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: "
|
|
3135
|
+
name: "receiveWithAuthorization",
|
|
2816
3136
|
outputs: [],
|
|
2817
|
-
stateMutability: "
|
|
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
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
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
|
-
{
|
|
2884
|
-
|
|
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: "
|
|
2887
|
-
|
|
3157
|
+
name: "rescueERC20",
|
|
3158
|
+
outputs: [],
|
|
3159
|
+
stateMutability: "nonpayable",
|
|
3160
|
+
type: "function"
|
|
2888
3161
|
},
|
|
2889
3162
|
{
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
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
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
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
|
-
|
|
2911
|
-
|
|
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: "
|
|
2925
|
-
{ internalType: "uint256", name: "
|
|
3185
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3186
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
|
2926
3187
|
],
|
|
2927
|
-
name: "
|
|
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
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
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
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
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
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
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
|
-
|
|
2957
|
-
stateMutability: "payable",
|
|
3223
|
+
stateMutability: "nonpayable",
|
|
2958
3224
|
type: "function"
|
|
2959
3225
|
},
|
|
2960
3226
|
{
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
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
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
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: "
|
|
2982
|
-
outputs: [
|
|
2983
|
-
|
|
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: "
|
|
2991
|
-
{ internalType: "uint256", name: "wad", type: "uint256" }
|
|
3259
|
+
{ internalType: "address", name: "_newBlacklister", type: "address" }
|
|
2992
3260
|
],
|
|
2993
|
-
name: "
|
|
2994
|
-
outputs: [
|
|
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: "
|
|
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: "
|
|
3007
|
-
outputs: [
|
|
3008
|
-
payable: false,
|
|
3270
|
+
name: "updateMasterMinter",
|
|
3271
|
+
outputs: [],
|
|
3009
3272
|
stateMutability: "nonpayable",
|
|
3010
3273
|
type: "function"
|
|
3011
3274
|
},
|
|
3012
3275
|
{
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
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
|
|
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
|
|
3662
|
+
const isV1 = [
|
|
3319
3663
|
baseSepoliaAcpConfig.contractAddress,
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
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
|
|
4423
|
+
const isV1 = [
|
|
4002
4424
|
baseSepoliaAcpConfig.contractAddress,
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
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
|
-
|
|
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,7 +4803,154 @@ 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);
|
|
@@ -4409,6 +4983,11 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4409
4983
|
isGlobalValidation: true
|
|
4410
4984
|
}
|
|
4411
4985
|
});
|
|
4986
|
+
this._acpX402 = new AcpX402(
|
|
4987
|
+
this.config,
|
|
4988
|
+
this.sessionKeyClient,
|
|
4989
|
+
this.publicClient
|
|
4990
|
+
);
|
|
4412
4991
|
});
|
|
4413
4992
|
}
|
|
4414
4993
|
getRandomNonce(bits = 152) {
|
|
@@ -4426,6 +5005,12 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4426
5005
|
}
|
|
4427
5006
|
return this._sessionKeyClient;
|
|
4428
5007
|
}
|
|
5008
|
+
get acpX402() {
|
|
5009
|
+
if (!this._acpX402) {
|
|
5010
|
+
throw new acpError_default("ACP X402 not initialized");
|
|
5011
|
+
}
|
|
5012
|
+
return this._acpX402;
|
|
5013
|
+
}
|
|
4429
5014
|
calculateGasFees() {
|
|
4430
5015
|
return __async(this, null, function* () {
|
|
4431
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));
|
|
@@ -4480,7 +5065,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4480
5065
|
const contractLogs = result.logs.filter((log) => {
|
|
4481
5066
|
return log.address.toLowerCase() === this.contractAddress.toLowerCase();
|
|
4482
5067
|
}).map(
|
|
4483
|
-
(log) => (0,
|
|
5068
|
+
(log) => (0, import_viem6.decodeEventLog)({
|
|
4484
5069
|
abi: this.abi,
|
|
4485
5070
|
data: log.data,
|
|
4486
5071
|
topics: log.topics
|
|
@@ -4495,11 +5080,11 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4495
5080
|
return Number(createdJobEvent.args.jobId);
|
|
4496
5081
|
});
|
|
4497
5082
|
}
|
|
4498
|
-
createJob(providerAddress, evaluatorAddress, expireAt, paymentTokenAddress, budgetBaseUnit, metadata) {
|
|
5083
|
+
createJob(providerAddress, evaluatorAddress, expireAt, paymentTokenAddress, budgetBaseUnit, metadata, isX402Job) {
|
|
4499
5084
|
try {
|
|
4500
|
-
const data = (0,
|
|
5085
|
+
const data = (0, import_viem6.encodeFunctionData)({
|
|
4501
5086
|
abi: this.abi,
|
|
4502
|
-
functionName: "createJob",
|
|
5087
|
+
functionName: isX402Job ? "createJobWithX402" : "createJob",
|
|
4503
5088
|
args: [
|
|
4504
5089
|
providerAddress,
|
|
4505
5090
|
evaluatorAddress,
|
|
@@ -4517,7 +5102,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4517
5102
|
}
|
|
4518
5103
|
setBudgetWithPaymentToken(jobId, budgetBaseUnit, paymentTokenAddress = this.config.baseFare.contractAddress) {
|
|
4519
5104
|
try {
|
|
4520
|
-
const data = (0,
|
|
5105
|
+
const data = (0, import_viem6.encodeFunctionData)({
|
|
4521
5106
|
abi: this.abi,
|
|
4522
5107
|
functionName: "setBudgetWithPaymentToken",
|
|
4523
5108
|
args: [jobId, budgetBaseUnit, paymentTokenAddress]
|
|
@@ -4533,7 +5118,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4533
5118
|
}
|
|
4534
5119
|
createPayableMemo(jobId, content, amountBaseUnit, recipient, feeAmountBaseUnit, feeType, nextPhase, type, expiredAt, token = this.config.baseFare.contractAddress, secured = true) {
|
|
4535
5120
|
try {
|
|
4536
|
-
const data = (0,
|
|
5121
|
+
const data = (0, import_viem6.encodeFunctionData)({
|
|
4537
5122
|
abi: this.abi,
|
|
4538
5123
|
functionName: "createPayableMemo",
|
|
4539
5124
|
args: [
|
|
@@ -4558,12 +5143,30 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4558
5143
|
throw new acpError_default("Failed to create payable memo", error);
|
|
4559
5144
|
}
|
|
4560
5145
|
}
|
|
4561
|
-
createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt) {
|
|
5146
|
+
createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt, isX402Job) {
|
|
4562
5147
|
throw new acpError_default("Not Supported");
|
|
4563
5148
|
}
|
|
4564
5149
|
updateAccountMetadata(accountId, metadata) {
|
|
4565
5150
|
throw new acpError_default("Not Supported");
|
|
4566
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
|
+
}
|
|
4567
5170
|
};
|
|
4568
5171
|
var acpContractClient_default = AcpContractClient;
|
|
4569
5172
|
|
|
@@ -4571,7 +5174,7 @@ var acpContractClient_default = AcpContractClient;
|
|
|
4571
5174
|
var import_core2 = require("@aa-sdk/core");
|
|
4572
5175
|
var import_infra3 = require("@account-kit/infra");
|
|
4573
5176
|
var import_smart_contracts2 = require("@account-kit/smart-contracts");
|
|
4574
|
-
var
|
|
5177
|
+
var import_viem7 = require("viem");
|
|
4575
5178
|
|
|
4576
5179
|
// src/abis/jobManagerAbi.ts
|
|
4577
5180
|
var JOB_MANAGER_ABI = [
|
|
@@ -4634,97 +5237,10 @@ var JOB_MANAGER_ABI = [
|
|
|
4634
5237
|
indexed: false,
|
|
4635
5238
|
internalType: "uint64",
|
|
4636
5239
|
name: "version",
|
|
4637
|
-
type: "uint64"
|
|
4638
|
-
}
|
|
4639
|
-
],
|
|
4640
|
-
name: "Initialized",
|
|
4641
|
-
type: "event"
|
|
4642
|
-
},
|
|
4643
|
-
{
|
|
4644
|
-
anonymous: false,
|
|
4645
|
-
inputs: [
|
|
4646
|
-
{
|
|
4647
|
-
indexed: true,
|
|
4648
|
-
internalType: "uint256",
|
|
4649
|
-
name: "jobId",
|
|
4650
|
-
type: "uint256"
|
|
4651
|
-
},
|
|
4652
|
-
{
|
|
4653
|
-
indexed: true,
|
|
4654
|
-
internalType: "address",
|
|
4655
|
-
name: "oldAssignee",
|
|
4656
|
-
type: "address"
|
|
4657
|
-
},
|
|
4658
|
-
{
|
|
4659
|
-
indexed: true,
|
|
4660
|
-
internalType: "address",
|
|
4661
|
-
name: "newAssignee",
|
|
4662
|
-
type: "address"
|
|
4663
|
-
}
|
|
4664
|
-
],
|
|
4665
|
-
name: "JobAssigned",
|
|
4666
|
-
type: "event"
|
|
4667
|
-
},
|
|
4668
|
-
{
|
|
4669
|
-
anonymous: false,
|
|
4670
|
-
inputs: [
|
|
4671
|
-
{
|
|
4672
|
-
indexed: true,
|
|
4673
|
-
internalType: "uint256",
|
|
4674
|
-
name: "jobId",
|
|
4675
|
-
type: "uint256"
|
|
4676
|
-
},
|
|
4677
|
-
{
|
|
4678
|
-
indexed: true,
|
|
4679
|
-
internalType: "uint256",
|
|
4680
|
-
name: "accountId",
|
|
4681
|
-
type: "uint256"
|
|
4682
|
-
},
|
|
4683
|
-
{
|
|
4684
|
-
indexed: true,
|
|
4685
|
-
internalType: "address",
|
|
4686
|
-
name: "client",
|
|
4687
|
-
type: "address"
|
|
4688
|
-
},
|
|
4689
|
-
{
|
|
4690
|
-
indexed: false,
|
|
4691
|
-
internalType: "address",
|
|
4692
|
-
name: "provider",
|
|
4693
|
-
type: "address"
|
|
4694
|
-
},
|
|
4695
|
-
{
|
|
4696
|
-
indexed: false,
|
|
4697
|
-
internalType: "address",
|
|
4698
|
-
name: "evaluator",
|
|
4699
|
-
type: "address"
|
|
4700
|
-
},
|
|
4701
|
-
{
|
|
4702
|
-
indexed: false,
|
|
4703
|
-
internalType: "uint256",
|
|
4704
|
-
name: "expiredAt",
|
|
4705
|
-
type: "uint256"
|
|
4706
|
-
}
|
|
4707
|
-
],
|
|
4708
|
-
name: "JobCreated",
|
|
4709
|
-
type: "event"
|
|
4710
|
-
},
|
|
4711
|
-
{
|
|
4712
|
-
anonymous: false,
|
|
4713
|
-
inputs: [
|
|
4714
|
-
{
|
|
4715
|
-
indexed: true,
|
|
4716
|
-
internalType: "uint256",
|
|
4717
|
-
name: "jobId",
|
|
4718
|
-
type: "uint256"
|
|
4719
|
-
},
|
|
4720
|
-
{
|
|
4721
|
-
indexed: true,
|
|
4722
|
-
internalType: "uint256",
|
|
4723
|
-
name: "dependencyJobId",
|
|
4724
|
-
type: "uint256"
|
|
5240
|
+
type: "uint64"
|
|
4725
5241
|
}
|
|
4726
5242
|
],
|
|
4727
|
-
name: "
|
|
5243
|
+
name: "Initialized",
|
|
4728
5244
|
type: "event"
|
|
4729
5245
|
},
|
|
4730
5246
|
{
|
|
@@ -4739,11 +5255,35 @@ var JOB_MANAGER_ABI = [
|
|
|
4739
5255
|
{
|
|
4740
5256
|
indexed: true,
|
|
4741
5257
|
internalType: "uint256",
|
|
4742
|
-
name: "
|
|
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",
|
|
4743
5283
|
type: "uint256"
|
|
4744
5284
|
}
|
|
4745
5285
|
],
|
|
4746
|
-
name: "
|
|
5286
|
+
name: "JobCreated",
|
|
4747
5287
|
type: "event"
|
|
4748
5288
|
},
|
|
4749
5289
|
{
|
|
@@ -4796,37 +5336,6 @@ var JOB_MANAGER_ABI = [
|
|
|
4796
5336
|
name: "JobPhaseUpdated",
|
|
4797
5337
|
type: "event"
|
|
4798
5338
|
},
|
|
4799
|
-
{
|
|
4800
|
-
anonymous: false,
|
|
4801
|
-
inputs: [
|
|
4802
|
-
{
|
|
4803
|
-
indexed: true,
|
|
4804
|
-
internalType: "uint256",
|
|
4805
|
-
name: "jobId",
|
|
4806
|
-
type: "uint256"
|
|
4807
|
-
},
|
|
4808
|
-
{
|
|
4809
|
-
indexed: false,
|
|
4810
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
4811
|
-
name: "oldStatus",
|
|
4812
|
-
type: "uint8"
|
|
4813
|
-
},
|
|
4814
|
-
{
|
|
4815
|
-
indexed: false,
|
|
4816
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
4817
|
-
name: "newStatus",
|
|
4818
|
-
type: "uint8"
|
|
4819
|
-
},
|
|
4820
|
-
{
|
|
4821
|
-
indexed: false,
|
|
4822
|
-
internalType: "address",
|
|
4823
|
-
name: "updatedBy",
|
|
4824
|
-
type: "address"
|
|
4825
|
-
}
|
|
4826
|
-
],
|
|
4827
|
-
name: "JobStatusUpdated",
|
|
4828
|
-
type: "event"
|
|
4829
|
-
},
|
|
4830
5339
|
{
|
|
4831
5340
|
anonymous: false,
|
|
4832
5341
|
inputs: [
|
|
@@ -4900,6 +5409,19 @@ var JOB_MANAGER_ABI = [
|
|
|
4900
5409
|
name: "Upgraded",
|
|
4901
5410
|
type: "event"
|
|
4902
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
|
+
},
|
|
4903
5425
|
{
|
|
4904
5426
|
inputs: [],
|
|
4905
5427
|
name: "ACP_CONTRACT_ROLE",
|
|
@@ -4935,6 +5457,13 @@ var JOB_MANAGER_ABI = [
|
|
|
4935
5457
|
stateMutability: "view",
|
|
4936
5458
|
type: "function"
|
|
4937
5459
|
},
|
|
5460
|
+
{
|
|
5461
|
+
inputs: [],
|
|
5462
|
+
name: "X402_MANAGER_ROLE",
|
|
5463
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
5464
|
+
stateMutability: "view",
|
|
5465
|
+
type: "function"
|
|
5466
|
+
},
|
|
4938
5467
|
{
|
|
4939
5468
|
inputs: [
|
|
4940
5469
|
{ internalType: "uint256", name: "", type: "uint256" },
|
|
@@ -4952,40 +5481,6 @@ var JOB_MANAGER_ABI = [
|
|
|
4952
5481
|
stateMutability: "view",
|
|
4953
5482
|
type: "function"
|
|
4954
5483
|
},
|
|
4955
|
-
{
|
|
4956
|
-
inputs: [
|
|
4957
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
4958
|
-
{ internalType: "uint256", name: "dependencyJobId", type: "uint256" }
|
|
4959
|
-
],
|
|
4960
|
-
name: "addJobDependency",
|
|
4961
|
-
outputs: [],
|
|
4962
|
-
stateMutability: "nonpayable",
|
|
4963
|
-
type: "function"
|
|
4964
|
-
},
|
|
4965
|
-
{
|
|
4966
|
-
inputs: [
|
|
4967
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
4968
|
-
{ internalType: "address", name: "assignee", type: "address" }
|
|
4969
|
-
],
|
|
4970
|
-
name: "assignJob",
|
|
4971
|
-
outputs: [],
|
|
4972
|
-
stateMutability: "nonpayable",
|
|
4973
|
-
type: "function"
|
|
4974
|
-
},
|
|
4975
|
-
{
|
|
4976
|
-
inputs: [
|
|
4977
|
-
{ internalType: "uint256[]", name: "jobIds", type: "uint256[]" },
|
|
4978
|
-
{
|
|
4979
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
4980
|
-
name: "newStatus",
|
|
4981
|
-
type: "uint8"
|
|
4982
|
-
}
|
|
4983
|
-
],
|
|
4984
|
-
name: "bulkUpdateJobStatus",
|
|
4985
|
-
outputs: [],
|
|
4986
|
-
stateMutability: "nonpayable",
|
|
4987
|
-
type: "function"
|
|
4988
|
-
},
|
|
4989
5484
|
{
|
|
4990
5485
|
inputs: [
|
|
4991
5486
|
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
@@ -4998,9 +5493,9 @@ var JOB_MANAGER_ABI = [
|
|
|
4998
5493
|
},
|
|
4999
5494
|
{
|
|
5000
5495
|
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
5001
|
-
name: "
|
|
5002
|
-
outputs: [
|
|
5003
|
-
stateMutability: "
|
|
5496
|
+
name: "confirmX402PaymentReceived",
|
|
5497
|
+
outputs: [],
|
|
5498
|
+
stateMutability: "nonpayable",
|
|
5004
5499
|
type: "function"
|
|
5005
5500
|
},
|
|
5006
5501
|
{
|
|
@@ -5024,15 +5519,23 @@ var JOB_MANAGER_ABI = [
|
|
|
5024
5519
|
type: "function"
|
|
5025
5520
|
},
|
|
5026
5521
|
{
|
|
5027
|
-
inputs: [
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
{ internalType: "
|
|
5031
|
-
{ internalType: "
|
|
5032
|
-
{ internalType: "
|
|
5033
|
-
{ internalType: "uint256", name: "
|
|
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" }
|
|
5034
5535
|
],
|
|
5035
|
-
|
|
5536
|
+
name: "createJobWithX402",
|
|
5537
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5538
|
+
stateMutability: "nonpayable",
|
|
5036
5539
|
type: "function"
|
|
5037
5540
|
},
|
|
5038
5541
|
{
|
|
@@ -5051,11 +5554,10 @@ var JOB_MANAGER_ABI = [
|
|
|
5051
5554
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5052
5555
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5053
5556
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5054
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5055
5557
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5056
5558
|
{
|
|
5057
5559
|
internalType: "contract IERC20",
|
|
5058
|
-
name: "
|
|
5560
|
+
name: "jobPaymentToken",
|
|
5059
5561
|
type: "address"
|
|
5060
5562
|
},
|
|
5061
5563
|
{
|
|
@@ -5063,22 +5565,11 @@ var JOB_MANAGER_ABI = [
|
|
|
5063
5565
|
name: "phase",
|
|
5064
5566
|
type: "uint8"
|
|
5065
5567
|
},
|
|
5066
|
-
{
|
|
5067
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5068
|
-
name: "status",
|
|
5069
|
-
type: "uint8"
|
|
5070
|
-
},
|
|
5071
5568
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5072
5569
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5073
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5074
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5075
5570
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5076
5571
|
{ internalType: "string", name: "metadata", type: "string" },
|
|
5077
|
-
{
|
|
5078
|
-
internalType: "uint256[]",
|
|
5079
|
-
name: "dependencies",
|
|
5080
|
-
type: "uint256[]"
|
|
5081
|
-
}
|
|
5572
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5082
5573
|
],
|
|
5083
5574
|
internalType: "struct ACPTypes.Job[]",
|
|
5084
5575
|
name: "jobArray",
|
|
@@ -5101,11 +5592,10 @@ var JOB_MANAGER_ABI = [
|
|
|
5101
5592
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5102
5593
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5103
5594
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5104
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5105
5595
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5106
5596
|
{
|
|
5107
5597
|
internalType: "contract IERC20",
|
|
5108
|
-
name: "
|
|
5598
|
+
name: "jobPaymentToken",
|
|
5109
5599
|
type: "address"
|
|
5110
5600
|
},
|
|
5111
5601
|
{
|
|
@@ -5113,22 +5603,11 @@ var JOB_MANAGER_ABI = [
|
|
|
5113
5603
|
name: "phase",
|
|
5114
5604
|
type: "uint8"
|
|
5115
5605
|
},
|
|
5116
|
-
{
|
|
5117
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5118
|
-
name: "status",
|
|
5119
|
-
type: "uint8"
|
|
5120
|
-
},
|
|
5121
5606
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5122
5607
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5123
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5124
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5125
5608
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5126
5609
|
{ internalType: "string", name: "metadata", type: "string" },
|
|
5127
|
-
{
|
|
5128
|
-
internalType: "uint256[]",
|
|
5129
|
-
name: "dependencies",
|
|
5130
|
-
type: "uint256[]"
|
|
5131
|
-
}
|
|
5610
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5132
5611
|
],
|
|
5133
5612
|
internalType: "struct ACPTypes.Job",
|
|
5134
5613
|
name: "",
|
|
@@ -5138,13 +5617,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5138
5617
|
stateMutability: "view",
|
|
5139
5618
|
type: "function"
|
|
5140
5619
|
},
|
|
5141
|
-
{
|
|
5142
|
-
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
5143
|
-
name: "getJobDependencies",
|
|
5144
|
-
outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
|
|
5145
|
-
stateMutability: "view",
|
|
5146
|
-
type: "function"
|
|
5147
|
-
},
|
|
5148
5620
|
{
|
|
5149
5621
|
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
5150
5622
|
name: "getRoleAdmin",
|
|
@@ -5168,11 +5640,10 @@ var JOB_MANAGER_ABI = [
|
|
|
5168
5640
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5169
5641
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5170
5642
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5171
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5172
5643
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5173
5644
|
{
|
|
5174
5645
|
internalType: "contract IERC20",
|
|
5175
|
-
name: "
|
|
5646
|
+
name: "jobPaymentToken",
|
|
5176
5647
|
type: "address"
|
|
5177
5648
|
},
|
|
5178
5649
|
{
|
|
@@ -5180,22 +5651,11 @@ var JOB_MANAGER_ABI = [
|
|
|
5180
5651
|
name: "phase",
|
|
5181
5652
|
type: "uint8"
|
|
5182
5653
|
},
|
|
5183
|
-
{
|
|
5184
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5185
|
-
name: "status",
|
|
5186
|
-
type: "uint8"
|
|
5187
|
-
},
|
|
5188
5654
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5189
5655
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5190
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5191
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5192
5656
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5193
5657
|
{ internalType: "string", name: "metadata", type: "string" },
|
|
5194
|
-
{
|
|
5195
|
-
internalType: "uint256[]",
|
|
5196
|
-
name: "dependencies",
|
|
5197
|
-
type: "uint256[]"
|
|
5198
|
-
}
|
|
5658
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5199
5659
|
],
|
|
5200
5660
|
internalType: "struct ACPTypes.Job[]",
|
|
5201
5661
|
name: "jobArray",
|
|
@@ -5206,6 +5666,23 @@ var JOB_MANAGER_ABI = [
|
|
|
5206
5666
|
stateMutability: "view",
|
|
5207
5667
|
type: "function"
|
|
5208
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
|
+
},
|
|
5209
5686
|
{
|
|
5210
5687
|
inputs: [
|
|
5211
5688
|
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
@@ -5249,26 +5726,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5249
5726
|
stateMutability: "view",
|
|
5250
5727
|
type: "function"
|
|
5251
5728
|
},
|
|
5252
|
-
{
|
|
5253
|
-
inputs: [
|
|
5254
|
-
{ internalType: "uint256", name: "", type: "uint256" },
|
|
5255
|
-
{ internalType: "uint256", name: "", type: "uint256" }
|
|
5256
|
-
],
|
|
5257
|
-
name: "jobDependencies",
|
|
5258
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5259
|
-
stateMutability: "view",
|
|
5260
|
-
type: "function"
|
|
5261
|
-
},
|
|
5262
|
-
{
|
|
5263
|
-
inputs: [
|
|
5264
|
-
{ internalType: "uint256", name: "", type: "uint256" },
|
|
5265
|
-
{ internalType: "uint256", name: "", type: "uint256" }
|
|
5266
|
-
],
|
|
5267
|
-
name: "jobDependents",
|
|
5268
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5269
|
-
stateMutability: "view",
|
|
5270
|
-
type: "function"
|
|
5271
|
-
},
|
|
5272
5729
|
{
|
|
5273
5730
|
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5274
5731
|
name: "jobs",
|
|
@@ -5279,39 +5736,22 @@ var JOB_MANAGER_ABI = [
|
|
|
5279
5736
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5280
5737
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5281
5738
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5282
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5283
5739
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5284
5740
|
{
|
|
5285
5741
|
internalType: "contract IERC20",
|
|
5286
|
-
name: "
|
|
5742
|
+
name: "jobPaymentToken",
|
|
5287
5743
|
type: "address"
|
|
5288
5744
|
},
|
|
5289
5745
|
{ internalType: "enum ACPTypes.JobPhase", name: "phase", type: "uint8" },
|
|
5290
|
-
{
|
|
5291
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5292
|
-
name: "status",
|
|
5293
|
-
type: "uint8"
|
|
5294
|
-
},
|
|
5295
5746
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5296
5747
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5297
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5298
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5299
5748
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5300
|
-
{ internalType: "string", name: "metadata", type: "string" }
|
|
5749
|
+
{ internalType: "string", name: "metadata", type: "string" },
|
|
5750
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5301
5751
|
],
|
|
5302
5752
|
stateMutability: "view",
|
|
5303
5753
|
type: "function"
|
|
5304
5754
|
},
|
|
5305
|
-
{
|
|
5306
|
-
inputs: [
|
|
5307
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
5308
|
-
{ internalType: "address", name: "completedBy", type: "address" }
|
|
5309
|
-
],
|
|
5310
|
-
name: "markJobCompleted",
|
|
5311
|
-
outputs: [],
|
|
5312
|
-
stateMutability: "nonpayable",
|
|
5313
|
-
type: "function"
|
|
5314
|
-
},
|
|
5315
5755
|
{
|
|
5316
5756
|
inputs: [],
|
|
5317
5757
|
name: "proxiableUUID",
|
|
@@ -5319,16 +5759,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5319
5759
|
stateMutability: "view",
|
|
5320
5760
|
type: "function"
|
|
5321
5761
|
},
|
|
5322
|
-
{
|
|
5323
|
-
inputs: [
|
|
5324
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
5325
|
-
{ internalType: "uint256", name: "dependencyJobId", type: "uint256" }
|
|
5326
|
-
],
|
|
5327
|
-
name: "removeJobDependency",
|
|
5328
|
-
outputs: [],
|
|
5329
|
-
stateMutability: "nonpayable",
|
|
5330
|
-
type: "function"
|
|
5331
|
-
},
|
|
5332
5762
|
{
|
|
5333
5763
|
inputs: [
|
|
5334
5764
|
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
@@ -5364,6 +5794,19 @@ var JOB_MANAGER_ABI = [
|
|
|
5364
5794
|
stateMutability: "nonpayable",
|
|
5365
5795
|
type: "function"
|
|
5366
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
|
+
},
|
|
5367
5810
|
{
|
|
5368
5811
|
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
5369
5812
|
name: "supportsInterface",
|
|
@@ -5394,20 +5837,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5394
5837
|
stateMutability: "nonpayable",
|
|
5395
5838
|
type: "function"
|
|
5396
5839
|
},
|
|
5397
|
-
{
|
|
5398
|
-
inputs: [
|
|
5399
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
5400
|
-
{
|
|
5401
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5402
|
-
name: "newStatus",
|
|
5403
|
-
type: "uint8"
|
|
5404
|
-
}
|
|
5405
|
-
],
|
|
5406
|
-
name: "updateJobStatus",
|
|
5407
|
-
outputs: [],
|
|
5408
|
-
stateMutability: "nonpayable",
|
|
5409
|
-
type: "function"
|
|
5410
|
-
},
|
|
5411
5840
|
{
|
|
5412
5841
|
inputs: [
|
|
5413
5842
|
{ internalType: "address", name: "newImplementation", type: "address" },
|
|
@@ -5427,6 +5856,23 @@ var JOB_MANAGER_ABI = [
|
|
|
5427
5856
|
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5428
5857
|
stateMutability: "view",
|
|
5429
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"
|
|
5430
5876
|
}
|
|
5431
5877
|
];
|
|
5432
5878
|
var jobManagerAbi_default = JOB_MANAGER_ABI;
|
|
@@ -5445,9 +5891,9 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5445
5891
|
}
|
|
5446
5892
|
static build(_0, _1, _2) {
|
|
5447
5893
|
return __async(this, arguments, function* (walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfigV2) {
|
|
5448
|
-
const publicClient = (0,
|
|
5894
|
+
const publicClient = (0, import_viem7.createPublicClient)({
|
|
5449
5895
|
chain: config.chain,
|
|
5450
|
-
transport: (0,
|
|
5896
|
+
transport: (0, import_viem7.http)(config.rpcEndpoint)
|
|
5451
5897
|
});
|
|
5452
5898
|
const [jobManagerAddress, memoManagerAddress, accountManagerAddress] = yield publicClient.multicall({
|
|
5453
5899
|
contracts: [
|
|
@@ -5500,6 +5946,11 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5500
5946
|
isGlobalValidation: true
|
|
5501
5947
|
}
|
|
5502
5948
|
});
|
|
5949
|
+
this._acpX402 = new AcpX402(
|
|
5950
|
+
this.config,
|
|
5951
|
+
this.sessionKeyClient,
|
|
5952
|
+
this.publicClient
|
|
5953
|
+
);
|
|
5503
5954
|
});
|
|
5504
5955
|
}
|
|
5505
5956
|
getRandomNonce(bits = 152) {
|
|
@@ -5517,6 +5968,12 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5517
5968
|
}
|
|
5518
5969
|
return this._sessionKeyClient;
|
|
5519
5970
|
}
|
|
5971
|
+
get acpX402() {
|
|
5972
|
+
if (!this._acpX402) {
|
|
5973
|
+
throw new acpError_default("ACP X402 not initialized");
|
|
5974
|
+
}
|
|
5975
|
+
return this._acpX402;
|
|
5976
|
+
}
|
|
5520
5977
|
calculateGasFees() {
|
|
5521
5978
|
return __async(this, null, function* () {
|
|
5522
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));
|
|
@@ -5580,7 +6037,7 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5580
6037
|
const contractLogs = result.logs.filter((log) => {
|
|
5581
6038
|
return log.address.toLowerCase() === this.jobManagerAddress.toLowerCase();
|
|
5582
6039
|
}).map(
|
|
5583
|
-
(log) => (0,
|
|
6040
|
+
(log) => (0, import_viem7.decodeEventLog)({
|
|
5584
6041
|
abi: jobManagerAbi_default,
|
|
5585
6042
|
data: log.data,
|
|
5586
6043
|
topics: log.topics
|
|
@@ -5595,6 +6052,42 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5595
6052
|
return Number(createdJobEvent.args.jobId);
|
|
5596
6053
|
});
|
|
5597
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
|
+
}
|
|
5598
6091
|
};
|
|
5599
6092
|
var acpContractClientV2_default = AcpContractClientV2;
|
|
5600
6093
|
|
|
@@ -5623,6 +6116,8 @@ var index_default = acpClient_default;
|
|
|
5623
6116
|
PositionDirection,
|
|
5624
6117
|
baseAcpConfig,
|
|
5625
6118
|
baseAcpConfigV2,
|
|
6119
|
+
baseAcpX402Config,
|
|
6120
|
+
baseAcpX402ConfigV2,
|
|
5626
6121
|
baseSepoliaAcpConfig,
|
|
5627
6122
|
baseSepoliaAcpConfigV2,
|
|
5628
6123
|
ethFare,
|