@virtuals-protocol/acp-node 0.3.0-beta.7 → 0.3.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +231 -109
- package/dist/index.d.ts +231 -109
- package/dist/index.js +1877 -1381
- package/dist/index.mjs +1879 -1381
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -28,7 +28,7 @@ var require_package = __commonJS({
|
|
|
28
28
|
"package.json"(exports, module) {
|
|
29
29
|
module.exports = {
|
|
30
30
|
name: "@virtuals-protocol/acp-node",
|
|
31
|
-
version: "0.3.0-beta.
|
|
31
|
+
version: "0.3.0-beta.9",
|
|
32
32
|
main: "./dist/index.js",
|
|
33
33
|
module: "./dist/index.mjs",
|
|
34
34
|
types: "./dist/index.d.ts",
|
|
@@ -46,6 +46,7 @@ var require_package = __commonJS({
|
|
|
46
46
|
"@aa-sdk/core": "^4.73.0",
|
|
47
47
|
"@account-kit/infra": "^4.73.0",
|
|
48
48
|
"@account-kit/smart-contracts": "^4.73.0",
|
|
49
|
+
"@virtuals-protocol/acp-node": "^0.3.0-beta.8",
|
|
49
50
|
ajv: "^8.17.1",
|
|
50
51
|
"socket.io-client": "^4.8.1",
|
|
51
52
|
tsup: "^8.5.0",
|
|
@@ -60,82 +61,32 @@ var require_package = __commonJS({
|
|
|
60
61
|
|
|
61
62
|
// src/abis/acpAbi.ts
|
|
62
63
|
var ACP_ABI = [
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
stateMutability: "nonpayable",
|
|
66
|
-
type: "constructor"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
inputs: [],
|
|
70
|
-
name: "AccessControlBadConfirmation",
|
|
71
|
-
type: "error"
|
|
72
|
-
},
|
|
64
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
65
|
+
{ inputs: [], name: "AccessControlBadConfirmation", type: "error" },
|
|
73
66
|
{
|
|
74
67
|
inputs: [
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
name: "account",
|
|
78
|
-
type: "address"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
internalType: "bytes32",
|
|
82
|
-
name: "neededRole",
|
|
83
|
-
type: "bytes32"
|
|
84
|
-
}
|
|
68
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
69
|
+
{ internalType: "bytes32", name: "neededRole", type: "bytes32" }
|
|
85
70
|
],
|
|
86
71
|
name: "AccessControlUnauthorizedAccount",
|
|
87
72
|
type: "error"
|
|
88
73
|
},
|
|
89
74
|
{
|
|
90
|
-
inputs: [
|
|
91
|
-
{
|
|
92
|
-
internalType: "address",
|
|
93
|
-
name: "target",
|
|
94
|
-
type: "address"
|
|
95
|
-
}
|
|
96
|
-
],
|
|
75
|
+
inputs: [{ internalType: "address", name: "target", type: "address" }],
|
|
97
76
|
name: "AddressEmptyCode",
|
|
98
77
|
type: "error"
|
|
99
78
|
},
|
|
100
79
|
{
|
|
101
|
-
inputs: [
|
|
102
|
-
{
|
|
103
|
-
internalType: "address",
|
|
104
|
-
name: "account",
|
|
105
|
-
type: "address"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
80
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
108
81
|
name: "AddressInsufficientBalance",
|
|
109
82
|
type: "error"
|
|
110
83
|
},
|
|
84
|
+
{ inputs: [], name: "FailedInnerCall", type: "error" },
|
|
85
|
+
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
86
|
+
{ inputs: [], name: "NotInitializing", type: "error" },
|
|
87
|
+
{ inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
|
|
111
88
|
{
|
|
112
|
-
inputs: [],
|
|
113
|
-
name: "FailedInnerCall",
|
|
114
|
-
type: "error"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
inputs: [],
|
|
118
|
-
name: "InvalidInitialization",
|
|
119
|
-
type: "error"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
inputs: [],
|
|
123
|
-
name: "NotInitializing",
|
|
124
|
-
type: "error"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
inputs: [],
|
|
128
|
-
name: "ReentrancyGuardReentrantCall",
|
|
129
|
-
type: "error"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
inputs: [
|
|
133
|
-
{
|
|
134
|
-
internalType: "address",
|
|
135
|
-
name: "token",
|
|
136
|
-
type: "address"
|
|
137
|
-
}
|
|
138
|
-
],
|
|
89
|
+
inputs: [{ internalType: "address", name: "token", type: "address" }],
|
|
139
90
|
name: "SafeERC20FailedOperation",
|
|
140
91
|
type: "error"
|
|
141
92
|
},
|
|
@@ -266,6 +217,12 @@ var ACP_ABI = [
|
|
|
266
217
|
internalType: "address",
|
|
267
218
|
name: "paymentToken",
|
|
268
219
|
type: "address"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
indexed: false,
|
|
223
|
+
internalType: "uint256",
|
|
224
|
+
name: "newBudget",
|
|
225
|
+
type: "uint256"
|
|
269
226
|
}
|
|
270
227
|
],
|
|
271
228
|
name: "JobPaymentTokenSet",
|
|
@@ -286,12 +243,7 @@ var ACP_ABI = [
|
|
|
286
243
|
name: "oldPhase",
|
|
287
244
|
type: "uint8"
|
|
288
245
|
},
|
|
289
|
-
{
|
|
290
|
-
indexed: false,
|
|
291
|
-
internalType: "uint8",
|
|
292
|
-
name: "phase",
|
|
293
|
-
type: "uint8"
|
|
294
|
-
}
|
|
246
|
+
{ indexed: false, internalType: "uint8", name: "phase", type: "uint8" }
|
|
295
247
|
],
|
|
296
248
|
name: "JobPhaseUpdated",
|
|
297
249
|
type: "event"
|
|
@@ -383,6 +335,43 @@ var ACP_ABI = [
|
|
|
383
335
|
name: "PayableFeeCollected",
|
|
384
336
|
type: "event"
|
|
385
337
|
},
|
|
338
|
+
{
|
|
339
|
+
anonymous: false,
|
|
340
|
+
inputs: [
|
|
341
|
+
{
|
|
342
|
+
indexed: true,
|
|
343
|
+
internalType: "uint256",
|
|
344
|
+
name: "jobId",
|
|
345
|
+
type: "uint256"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
indexed: true,
|
|
349
|
+
internalType: "uint256",
|
|
350
|
+
name: "memoId",
|
|
351
|
+
type: "uint256"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
indexed: true,
|
|
355
|
+
internalType: "address",
|
|
356
|
+
name: "sender",
|
|
357
|
+
type: "address"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
indexed: false,
|
|
361
|
+
internalType: "address",
|
|
362
|
+
name: "token",
|
|
363
|
+
type: "address"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
indexed: false,
|
|
367
|
+
internalType: "uint256",
|
|
368
|
+
name: "amount",
|
|
369
|
+
type: "uint256"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
name: "PayableFeeRefunded",
|
|
373
|
+
type: "event"
|
|
374
|
+
},
|
|
386
375
|
{
|
|
387
376
|
anonymous: false,
|
|
388
377
|
inputs: [
|
|
@@ -481,13 +470,7 @@ var ACP_ABI = [
|
|
|
481
470
|
{
|
|
482
471
|
indexed: true,
|
|
483
472
|
internalType: "address",
|
|
484
|
-
name: "
|
|
485
|
-
type: "address"
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
indexed: false,
|
|
489
|
-
internalType: "address",
|
|
490
|
-
name: "to",
|
|
473
|
+
name: "sender",
|
|
491
474
|
type: "address"
|
|
492
475
|
},
|
|
493
476
|
{
|
|
@@ -503,7 +486,7 @@ var ACP_ABI = [
|
|
|
503
486
|
type: "uint256"
|
|
504
487
|
}
|
|
505
488
|
],
|
|
506
|
-
name: "
|
|
489
|
+
name: "PayableFundsRefunded",
|
|
507
490
|
type: "event"
|
|
508
491
|
},
|
|
509
492
|
{
|
|
@@ -521,18 +504,41 @@ var ACP_ABI = [
|
|
|
521
504
|
name: "memoId",
|
|
522
505
|
type: "uint256"
|
|
523
506
|
},
|
|
507
|
+
{ indexed: true, internalType: "address", name: "from", type: "address" },
|
|
508
|
+
{ indexed: false, internalType: "address", name: "to", type: "address" },
|
|
524
509
|
{
|
|
525
|
-
indexed:
|
|
510
|
+
indexed: false,
|
|
526
511
|
internalType: "address",
|
|
527
|
-
name: "
|
|
512
|
+
name: "token",
|
|
528
513
|
type: "address"
|
|
529
514
|
},
|
|
530
515
|
{
|
|
531
516
|
indexed: false,
|
|
532
|
-
internalType: "
|
|
533
|
-
name: "
|
|
534
|
-
type: "
|
|
517
|
+
internalType: "uint256",
|
|
518
|
+
name: "amount",
|
|
519
|
+
type: "uint256"
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
name: "PayableRequestExecuted",
|
|
523
|
+
type: "event"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
anonymous: false,
|
|
527
|
+
inputs: [
|
|
528
|
+
{
|
|
529
|
+
indexed: true,
|
|
530
|
+
internalType: "uint256",
|
|
531
|
+
name: "jobId",
|
|
532
|
+
type: "uint256"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
indexed: true,
|
|
536
|
+
internalType: "uint256",
|
|
537
|
+
name: "memoId",
|
|
538
|
+
type: "uint256"
|
|
535
539
|
},
|
|
540
|
+
{ indexed: true, internalType: "address", name: "from", type: "address" },
|
|
541
|
+
{ indexed: false, internalType: "address", name: "to", type: "address" },
|
|
536
542
|
{
|
|
537
543
|
indexed: false,
|
|
538
544
|
internalType: "address",
|
|
@@ -602,12 +608,7 @@ var ACP_ABI = [
|
|
|
602
608
|
{
|
|
603
609
|
anonymous: false,
|
|
604
610
|
inputs: [
|
|
605
|
-
{
|
|
606
|
-
indexed: true,
|
|
607
|
-
internalType: "bytes32",
|
|
608
|
-
name: "role",
|
|
609
|
-
type: "bytes32"
|
|
610
|
-
},
|
|
611
|
+
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
611
612
|
{
|
|
612
613
|
indexed: true,
|
|
613
614
|
internalType: "bytes32",
|
|
@@ -627,12 +628,7 @@ var ACP_ABI = [
|
|
|
627
628
|
{
|
|
628
629
|
anonymous: false,
|
|
629
630
|
inputs: [
|
|
630
|
-
{
|
|
631
|
-
indexed: true,
|
|
632
|
-
internalType: "bytes32",
|
|
633
|
-
name: "role",
|
|
634
|
-
type: "bytes32"
|
|
635
|
-
},
|
|
631
|
+
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
636
632
|
{
|
|
637
633
|
indexed: true,
|
|
638
634
|
internalType: "address",
|
|
@@ -652,12 +648,7 @@ var ACP_ABI = [
|
|
|
652
648
|
{
|
|
653
649
|
anonymous: false,
|
|
654
650
|
inputs: [
|
|
655
|
-
{
|
|
656
|
-
indexed: true,
|
|
657
|
-
internalType: "bytes32",
|
|
658
|
-
name: "role",
|
|
659
|
-
type: "bytes32"
|
|
660
|
-
},
|
|
651
|
+
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
661
652
|
{
|
|
662
653
|
indexed: true,
|
|
663
654
|
internalType: "address",
|
|
@@ -677,187 +668,94 @@ var ACP_ABI = [
|
|
|
677
668
|
{
|
|
678
669
|
inputs: [],
|
|
679
670
|
name: "ADMIN_ROLE",
|
|
680
|
-
outputs: [
|
|
681
|
-
{
|
|
682
|
-
internalType: "bytes32",
|
|
683
|
-
name: "",
|
|
684
|
-
type: "bytes32"
|
|
685
|
-
}
|
|
686
|
-
],
|
|
671
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
687
672
|
stateMutability: "view",
|
|
688
673
|
type: "function"
|
|
689
674
|
},
|
|
690
675
|
{
|
|
691
676
|
inputs: [],
|
|
692
677
|
name: "DEFAULT_ADMIN_ROLE",
|
|
693
|
-
outputs: [
|
|
694
|
-
{
|
|
695
|
-
internalType: "bytes32",
|
|
696
|
-
name: "",
|
|
697
|
-
type: "bytes32"
|
|
698
|
-
}
|
|
699
|
-
],
|
|
678
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
700
679
|
stateMutability: "view",
|
|
701
680
|
type: "function"
|
|
702
681
|
},
|
|
703
682
|
{
|
|
704
683
|
inputs: [],
|
|
705
684
|
name: "PHASE_COMPLETED",
|
|
706
|
-
outputs: [
|
|
707
|
-
{
|
|
708
|
-
internalType: "uint8",
|
|
709
|
-
name: "",
|
|
710
|
-
type: "uint8"
|
|
711
|
-
}
|
|
712
|
-
],
|
|
685
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
713
686
|
stateMutability: "view",
|
|
714
687
|
type: "function"
|
|
715
688
|
},
|
|
716
689
|
{
|
|
717
690
|
inputs: [],
|
|
718
691
|
name: "PHASE_EVALUATION",
|
|
719
|
-
outputs: [
|
|
720
|
-
{
|
|
721
|
-
internalType: "uint8",
|
|
722
|
-
name: "",
|
|
723
|
-
type: "uint8"
|
|
724
|
-
}
|
|
725
|
-
],
|
|
692
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
726
693
|
stateMutability: "view",
|
|
727
694
|
type: "function"
|
|
728
695
|
},
|
|
729
696
|
{
|
|
730
697
|
inputs: [],
|
|
731
698
|
name: "PHASE_EXPIRED",
|
|
732
|
-
outputs: [
|
|
733
|
-
{
|
|
734
|
-
internalType: "uint8",
|
|
735
|
-
name: "",
|
|
736
|
-
type: "uint8"
|
|
737
|
-
}
|
|
738
|
-
],
|
|
699
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
739
700
|
stateMutability: "view",
|
|
740
701
|
type: "function"
|
|
741
702
|
},
|
|
742
703
|
{
|
|
743
704
|
inputs: [],
|
|
744
705
|
name: "PHASE_NEGOTIATION",
|
|
745
|
-
outputs: [
|
|
746
|
-
{
|
|
747
|
-
internalType: "uint8",
|
|
748
|
-
name: "",
|
|
749
|
-
type: "uint8"
|
|
750
|
-
}
|
|
751
|
-
],
|
|
706
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
752
707
|
stateMutability: "view",
|
|
753
708
|
type: "function"
|
|
754
709
|
},
|
|
755
710
|
{
|
|
756
711
|
inputs: [],
|
|
757
712
|
name: "PHASE_REJECTED",
|
|
758
|
-
outputs: [
|
|
759
|
-
{
|
|
760
|
-
internalType: "uint8",
|
|
761
|
-
name: "",
|
|
762
|
-
type: "uint8"
|
|
763
|
-
}
|
|
764
|
-
],
|
|
713
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
765
714
|
stateMutability: "view",
|
|
766
715
|
type: "function"
|
|
767
716
|
},
|
|
768
717
|
{
|
|
769
718
|
inputs: [],
|
|
770
719
|
name: "PHASE_REQUEST",
|
|
771
|
-
outputs: [
|
|
772
|
-
{
|
|
773
|
-
internalType: "uint8",
|
|
774
|
-
name: "",
|
|
775
|
-
type: "uint8"
|
|
776
|
-
}
|
|
777
|
-
],
|
|
720
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
778
721
|
stateMutability: "view",
|
|
779
722
|
type: "function"
|
|
780
723
|
},
|
|
781
724
|
{
|
|
782
725
|
inputs: [],
|
|
783
726
|
name: "PHASE_TRANSACTION",
|
|
784
|
-
outputs: [
|
|
785
|
-
{
|
|
786
|
-
internalType: "uint8",
|
|
787
|
-
name: "",
|
|
788
|
-
type: "uint8"
|
|
789
|
-
}
|
|
790
|
-
],
|
|
727
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
791
728
|
stateMutability: "view",
|
|
792
729
|
type: "function"
|
|
793
730
|
},
|
|
794
731
|
{
|
|
795
732
|
inputs: [],
|
|
796
733
|
name: "TOTAL_PHASES",
|
|
797
|
-
outputs: [
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
734
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
735
|
+
stateMutability: "view",
|
|
736
|
+
type: "function"
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
inputs: [],
|
|
740
|
+
name: "X402_MANAGER_ROLE",
|
|
741
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
804
742
|
stateMutability: "view",
|
|
805
743
|
type: "function"
|
|
806
744
|
},
|
|
807
745
|
{
|
|
808
746
|
inputs: [
|
|
809
|
-
{
|
|
810
|
-
internalType: "address",
|
|
811
|
-
name: "account",
|
|
812
|
-
type: "address"
|
|
813
|
-
},
|
|
747
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
814
748
|
{
|
|
815
749
|
components: [
|
|
816
|
-
{
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
internalType: "address",
|
|
828
|
-
name: "provider",
|
|
829
|
-
type: "address"
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
internalType: "uint256",
|
|
833
|
-
name: "budget",
|
|
834
|
-
type: "uint256"
|
|
835
|
-
},
|
|
836
|
-
{
|
|
837
|
-
internalType: "uint256",
|
|
838
|
-
name: "amountClaimed",
|
|
839
|
-
type: "uint256"
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
internalType: "uint8",
|
|
843
|
-
name: "phase",
|
|
844
|
-
type: "uint8"
|
|
845
|
-
},
|
|
846
|
-
{
|
|
847
|
-
internalType: "uint256",
|
|
848
|
-
name: "memoCount",
|
|
849
|
-
type: "uint256"
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
internalType: "uint256",
|
|
853
|
-
name: "expiredAt",
|
|
854
|
-
type: "uint256"
|
|
855
|
-
},
|
|
856
|
-
{
|
|
857
|
-
internalType: "address",
|
|
858
|
-
name: "evaluator",
|
|
859
|
-
type: "address"
|
|
860
|
-
},
|
|
750
|
+
{ internalType: "uint256", name: "id", type: "uint256" },
|
|
751
|
+
{ internalType: "address", name: "client", type: "address" },
|
|
752
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
753
|
+
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
754
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" },
|
|
755
|
+
{ internalType: "uint8", name: "phase", type: "uint8" },
|
|
756
|
+
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
757
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
758
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
861
759
|
{
|
|
862
760
|
internalType: "contract IERC20",
|
|
863
761
|
name: "jobPaymentToken",
|
|
@@ -870,129 +768,71 @@ var ACP_ABI = [
|
|
|
870
768
|
}
|
|
871
769
|
],
|
|
872
770
|
name: "canSign",
|
|
873
|
-
outputs: [
|
|
874
|
-
{
|
|
875
|
-
internalType: "bool",
|
|
876
|
-
name: "",
|
|
877
|
-
type: "bool"
|
|
878
|
-
}
|
|
879
|
-
],
|
|
771
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
880
772
|
stateMutability: "pure",
|
|
881
773
|
type: "function"
|
|
882
774
|
},
|
|
883
775
|
{
|
|
884
|
-
inputs: [
|
|
885
|
-
{
|
|
886
|
-
internalType: "uint256",
|
|
887
|
-
name: "id",
|
|
888
|
-
type: "uint256"
|
|
889
|
-
}
|
|
890
|
-
],
|
|
776
|
+
inputs: [{ internalType: "uint256", name: "id", type: "uint256" }],
|
|
891
777
|
name: "claimBudget",
|
|
892
778
|
outputs: [],
|
|
893
779
|
stateMutability: "nonpayable",
|
|
894
780
|
type: "function"
|
|
895
781
|
},
|
|
782
|
+
{
|
|
783
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
784
|
+
name: "confirmX402PaymentReceived",
|
|
785
|
+
outputs: [],
|
|
786
|
+
stateMutability: "nonpayable",
|
|
787
|
+
type: "function"
|
|
788
|
+
},
|
|
896
789
|
{
|
|
897
790
|
inputs: [
|
|
898
|
-
{
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
type: "address"
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
internalType: "address",
|
|
905
|
-
name: "evaluator",
|
|
906
|
-
type: "address"
|
|
907
|
-
},
|
|
908
|
-
{
|
|
909
|
-
internalType: "uint256",
|
|
910
|
-
name: "expiredAt",
|
|
911
|
-
type: "uint256"
|
|
912
|
-
}
|
|
791
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
792
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
793
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" }
|
|
913
794
|
],
|
|
914
795
|
name: "createJob",
|
|
915
|
-
outputs: [
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
796
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
797
|
+
stateMutability: "nonpayable",
|
|
798
|
+
type: "function"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
inputs: [
|
|
802
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
803
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
804
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" }
|
|
921
805
|
],
|
|
806
|
+
name: "createJobWithX402",
|
|
807
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
922
808
|
stateMutability: "nonpayable",
|
|
923
809
|
type: "function"
|
|
924
810
|
},
|
|
925
811
|
{
|
|
926
812
|
inputs: [
|
|
927
|
-
{
|
|
928
|
-
|
|
929
|
-
name: "jobId",
|
|
930
|
-
type: "uint256"
|
|
931
|
-
},
|
|
932
|
-
{
|
|
933
|
-
internalType: "string",
|
|
934
|
-
name: "content",
|
|
935
|
-
type: "string"
|
|
936
|
-
},
|
|
813
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
814
|
+
{ internalType: "string", name: "content", type: "string" },
|
|
937
815
|
{
|
|
938
816
|
internalType: "enum InteractionLedger.MemoType",
|
|
939
817
|
name: "memoType",
|
|
940
818
|
type: "uint8"
|
|
941
819
|
},
|
|
942
|
-
{
|
|
943
|
-
|
|
944
|
-
name: "isSecured",
|
|
945
|
-
type: "bool"
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
internalType: "uint8",
|
|
949
|
-
name: "nextPhase",
|
|
950
|
-
type: "uint8"
|
|
951
|
-
}
|
|
820
|
+
{ internalType: "bool", name: "isSecured", type: "bool" },
|
|
821
|
+
{ internalType: "uint8", name: "nextPhase", type: "uint8" }
|
|
952
822
|
],
|
|
953
823
|
name: "createMemo",
|
|
954
|
-
outputs: [
|
|
955
|
-
{
|
|
956
|
-
internalType: "uint256",
|
|
957
|
-
name: "",
|
|
958
|
-
type: "uint256"
|
|
959
|
-
}
|
|
960
|
-
],
|
|
824
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
961
825
|
stateMutability: "nonpayable",
|
|
962
826
|
type: "function"
|
|
963
827
|
},
|
|
964
828
|
{
|
|
965
829
|
inputs: [
|
|
966
|
-
{
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
},
|
|
971
|
-
{
|
|
972
|
-
internalType: "string",
|
|
973
|
-
name: "content",
|
|
974
|
-
type: "string"
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
internalType: "address",
|
|
978
|
-
name: "token",
|
|
979
|
-
type: "address"
|
|
980
|
-
},
|
|
981
|
-
{
|
|
982
|
-
internalType: "uint256",
|
|
983
|
-
name: "amount",
|
|
984
|
-
type: "uint256"
|
|
985
|
-
},
|
|
986
|
-
{
|
|
987
|
-
internalType: "address",
|
|
988
|
-
name: "recipient",
|
|
989
|
-
type: "address"
|
|
990
|
-
},
|
|
991
|
-
{
|
|
992
|
-
internalType: "uint256",
|
|
993
|
-
name: "feeAmount",
|
|
994
|
-
type: "uint256"
|
|
995
|
-
},
|
|
830
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
831
|
+
{ internalType: "string", name: "content", type: "string" },
|
|
832
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
833
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
834
|
+
{ internalType: "address", name: "recipient", type: "address" },
|
|
835
|
+
{ internalType: "uint256", name: "feeAmount", type: "uint256" },
|
|
996
836
|
{
|
|
997
837
|
internalType: "enum ACPSimple.FeeType",
|
|
998
838
|
name: "feeType",
|
|
@@ -1003,198 +843,88 @@ var ACP_ABI = [
|
|
|
1003
843
|
name: "memoType",
|
|
1004
844
|
type: "uint8"
|
|
1005
845
|
},
|
|
1006
|
-
{
|
|
1007
|
-
|
|
1008
|
-
name: "nextPhase",
|
|
1009
|
-
type: "uint8"
|
|
1010
|
-
},
|
|
1011
|
-
{
|
|
1012
|
-
internalType: "uint256",
|
|
1013
|
-
name: "expiredAt",
|
|
1014
|
-
type: "uint256"
|
|
1015
|
-
}
|
|
846
|
+
{ internalType: "uint8", name: "nextPhase", type: "uint8" },
|
|
847
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" }
|
|
1016
848
|
],
|
|
1017
849
|
name: "createPayableMemo",
|
|
1018
|
-
outputs: [
|
|
1019
|
-
{
|
|
1020
|
-
internalType: "uint256",
|
|
1021
|
-
name: "",
|
|
1022
|
-
type: "uint256"
|
|
1023
|
-
}
|
|
1024
|
-
],
|
|
850
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1025
851
|
stateMutability: "nonpayable",
|
|
1026
852
|
type: "function"
|
|
1027
853
|
},
|
|
1028
854
|
{
|
|
1029
855
|
inputs: [],
|
|
1030
856
|
name: "evaluatorFeeBP",
|
|
1031
|
-
outputs: [
|
|
1032
|
-
{
|
|
1033
|
-
internalType: "uint256",
|
|
1034
|
-
name: "",
|
|
1035
|
-
type: "uint256"
|
|
1036
|
-
}
|
|
1037
|
-
],
|
|
857
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1038
858
|
stateMutability: "view",
|
|
1039
859
|
type: "function"
|
|
1040
860
|
},
|
|
1041
861
|
{
|
|
1042
862
|
inputs: [
|
|
1043
|
-
{
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
type: "uint256"
|
|
1047
|
-
},
|
|
1048
|
-
{
|
|
1049
|
-
internalType: "uint256",
|
|
1050
|
-
name: "offset",
|
|
1051
|
-
type: "uint256"
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
internalType: "uint256",
|
|
1055
|
-
name: "limit",
|
|
1056
|
-
type: "uint256"
|
|
1057
|
-
}
|
|
863
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
864
|
+
{ internalType: "uint256", name: "offset", type: "uint256" },
|
|
865
|
+
{ internalType: "uint256", name: "limit", type: "uint256" }
|
|
1058
866
|
],
|
|
1059
867
|
name: "getAllMemos",
|
|
1060
868
|
outputs: [
|
|
1061
869
|
{
|
|
1062
870
|
components: [
|
|
1063
|
-
{
|
|
1064
|
-
internalType: "string",
|
|
1065
|
-
name: "content",
|
|
1066
|
-
type: "string"
|
|
1067
|
-
},
|
|
871
|
+
{ internalType: "string", name: "content", type: "string" },
|
|
1068
872
|
{
|
|
1069
873
|
internalType: "enum InteractionLedger.MemoType",
|
|
1070
874
|
name: "memoType",
|
|
1071
875
|
type: "uint8"
|
|
1072
876
|
},
|
|
1073
|
-
{
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
},
|
|
1078
|
-
{
|
|
1079
|
-
internalType: "uint8",
|
|
1080
|
-
name: "nextPhase",
|
|
1081
|
-
type: "uint8"
|
|
1082
|
-
},
|
|
1083
|
-
{
|
|
1084
|
-
internalType: "uint256",
|
|
1085
|
-
name: "jobId",
|
|
1086
|
-
type: "uint256"
|
|
1087
|
-
},
|
|
1088
|
-
{
|
|
1089
|
-
internalType: "address",
|
|
1090
|
-
name: "sender",
|
|
1091
|
-
type: "address"
|
|
1092
|
-
}
|
|
877
|
+
{ internalType: "bool", name: "isSecured", type: "bool" },
|
|
878
|
+
{ internalType: "uint8", name: "nextPhase", type: "uint8" },
|
|
879
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
880
|
+
{ internalType: "address", name: "sender", type: "address" }
|
|
1093
881
|
],
|
|
1094
882
|
internalType: "struct InteractionLedger.Memo[]",
|
|
1095
883
|
name: "",
|
|
1096
884
|
type: "tuple[]"
|
|
1097
885
|
},
|
|
1098
|
-
{
|
|
1099
|
-
internalType: "uint256",
|
|
1100
|
-
name: "total",
|
|
1101
|
-
type: "uint256"
|
|
1102
|
-
}
|
|
886
|
+
{ internalType: "uint256", name: "total", type: "uint256" }
|
|
1103
887
|
],
|
|
1104
888
|
stateMutability: "view",
|
|
1105
889
|
type: "function"
|
|
1106
890
|
},
|
|
1107
891
|
{
|
|
1108
892
|
inputs: [
|
|
1109
|
-
{
|
|
1110
|
-
|
|
1111
|
-
name: "jobId",
|
|
1112
|
-
type: "uint256"
|
|
1113
|
-
},
|
|
1114
|
-
{
|
|
1115
|
-
internalType: "uint8",
|
|
1116
|
-
name: "phase",
|
|
1117
|
-
type: "uint8"
|
|
1118
|
-
}
|
|
893
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
894
|
+
{ internalType: "uint8", name: "phase", type: "uint8" }
|
|
1119
895
|
],
|
|
1120
896
|
name: "getJobPhaseMemoIds",
|
|
1121
|
-
outputs: [
|
|
1122
|
-
{
|
|
1123
|
-
internalType: "uint256[]",
|
|
1124
|
-
name: "",
|
|
1125
|
-
type: "uint256[]"
|
|
1126
|
-
}
|
|
1127
|
-
],
|
|
897
|
+
outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
|
|
1128
898
|
stateMutability: "view",
|
|
1129
899
|
type: "function"
|
|
1130
900
|
},
|
|
1131
901
|
{
|
|
1132
902
|
inputs: [
|
|
1133
|
-
{
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
name: "phase",
|
|
1141
|
-
type: "uint8"
|
|
1142
|
-
},
|
|
1143
|
-
{
|
|
1144
|
-
internalType: "uint256",
|
|
1145
|
-
name: "offset",
|
|
1146
|
-
type: "uint256"
|
|
1147
|
-
},
|
|
1148
|
-
{
|
|
1149
|
-
internalType: "uint256",
|
|
1150
|
-
name: "limit",
|
|
1151
|
-
type: "uint256"
|
|
1152
|
-
}
|
|
1153
|
-
],
|
|
1154
|
-
name: "getMemosForPhase",
|
|
1155
|
-
outputs: [
|
|
903
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
904
|
+
{ internalType: "uint8", name: "phase", type: "uint8" },
|
|
905
|
+
{ internalType: "uint256", name: "offset", type: "uint256" },
|
|
906
|
+
{ internalType: "uint256", name: "limit", type: "uint256" }
|
|
907
|
+
],
|
|
908
|
+
name: "getMemosForPhase",
|
|
909
|
+
outputs: [
|
|
1156
910
|
{
|
|
1157
911
|
components: [
|
|
1158
|
-
{
|
|
1159
|
-
internalType: "string",
|
|
1160
|
-
name: "content",
|
|
1161
|
-
type: "string"
|
|
1162
|
-
},
|
|
912
|
+
{ internalType: "string", name: "content", type: "string" },
|
|
1163
913
|
{
|
|
1164
914
|
internalType: "enum InteractionLedger.MemoType",
|
|
1165
915
|
name: "memoType",
|
|
1166
916
|
type: "uint8"
|
|
1167
917
|
},
|
|
1168
|
-
{
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
internalType: "uint8",
|
|
1175
|
-
name: "nextPhase",
|
|
1176
|
-
type: "uint8"
|
|
1177
|
-
},
|
|
1178
|
-
{
|
|
1179
|
-
internalType: "uint256",
|
|
1180
|
-
name: "jobId",
|
|
1181
|
-
type: "uint256"
|
|
1182
|
-
},
|
|
1183
|
-
{
|
|
1184
|
-
internalType: "address",
|
|
1185
|
-
name: "sender",
|
|
1186
|
-
type: "address"
|
|
1187
|
-
}
|
|
918
|
+
{ internalType: "bool", name: "isSecured", type: "bool" },
|
|
919
|
+
{ internalType: "uint8", name: "nextPhase", type: "uint8" },
|
|
920
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
921
|
+
{ internalType: "address", name: "sender", type: "address" }
|
|
1188
922
|
],
|
|
1189
923
|
internalType: "struct InteractionLedger.Memo[]",
|
|
1190
924
|
name: "",
|
|
1191
925
|
type: "tuple[]"
|
|
1192
926
|
},
|
|
1193
|
-
{
|
|
1194
|
-
internalType: "uint256",
|
|
1195
|
-
name: "total",
|
|
1196
|
-
type: "uint256"
|
|
1197
|
-
}
|
|
927
|
+
{ internalType: "uint256", name: "total", type: "uint256" }
|
|
1198
928
|
],
|
|
1199
929
|
stateMutability: "view",
|
|
1200
930
|
type: "function"
|
|
@@ -1202,47 +932,21 @@ var ACP_ABI = [
|
|
|
1202
932
|
{
|
|
1203
933
|
inputs: [],
|
|
1204
934
|
name: "getPhases",
|
|
1205
|
-
outputs: [
|
|
1206
|
-
{
|
|
1207
|
-
internalType: "string[7]",
|
|
1208
|
-
name: "",
|
|
1209
|
-
type: "string[7]"
|
|
1210
|
-
}
|
|
1211
|
-
],
|
|
935
|
+
outputs: [{ internalType: "string[7]", name: "", type: "string[7]" }],
|
|
1212
936
|
stateMutability: "pure",
|
|
1213
937
|
type: "function"
|
|
1214
938
|
},
|
|
1215
939
|
{
|
|
1216
|
-
inputs: [
|
|
1217
|
-
{
|
|
1218
|
-
internalType: "bytes32",
|
|
1219
|
-
name: "role",
|
|
1220
|
-
type: "bytes32"
|
|
1221
|
-
}
|
|
1222
|
-
],
|
|
940
|
+
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
1223
941
|
name: "getRoleAdmin",
|
|
1224
|
-
outputs: [
|
|
1225
|
-
{
|
|
1226
|
-
internalType: "bytes32",
|
|
1227
|
-
name: "",
|
|
1228
|
-
type: "bytes32"
|
|
1229
|
-
}
|
|
1230
|
-
],
|
|
942
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
1231
943
|
stateMutability: "view",
|
|
1232
944
|
type: "function"
|
|
1233
945
|
},
|
|
1234
946
|
{
|
|
1235
947
|
inputs: [
|
|
1236
|
-
{
|
|
1237
|
-
|
|
1238
|
-
name: "role",
|
|
1239
|
-
type: "bytes32"
|
|
1240
|
-
},
|
|
1241
|
-
{
|
|
1242
|
-
internalType: "address",
|
|
1243
|
-
name: "account",
|
|
1244
|
-
type: "address"
|
|
1245
|
-
}
|
|
948
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
949
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
1246
950
|
],
|
|
1247
951
|
name: "grantRole",
|
|
1248
952
|
outputs: [],
|
|
@@ -1251,50 +955,20 @@ var ACP_ABI = [
|
|
|
1251
955
|
},
|
|
1252
956
|
{
|
|
1253
957
|
inputs: [
|
|
1254
|
-
{
|
|
1255
|
-
|
|
1256
|
-
name: "role",
|
|
1257
|
-
type: "bytes32"
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
internalType: "address",
|
|
1261
|
-
name: "account",
|
|
1262
|
-
type: "address"
|
|
1263
|
-
}
|
|
958
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
959
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
1264
960
|
],
|
|
1265
961
|
name: "hasRole",
|
|
1266
|
-
outputs: [
|
|
1267
|
-
{
|
|
1268
|
-
internalType: "bool",
|
|
1269
|
-
name: "",
|
|
1270
|
-
type: "bool"
|
|
1271
|
-
}
|
|
1272
|
-
],
|
|
962
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
1273
963
|
stateMutability: "view",
|
|
1274
964
|
type: "function"
|
|
1275
965
|
},
|
|
1276
966
|
{
|
|
1277
967
|
inputs: [
|
|
1278
|
-
{
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
},
|
|
1283
|
-
{
|
|
1284
|
-
internalType: "uint256",
|
|
1285
|
-
name: "evaluatorFeeBP_",
|
|
1286
|
-
type: "uint256"
|
|
1287
|
-
},
|
|
1288
|
-
{
|
|
1289
|
-
internalType: "uint256",
|
|
1290
|
-
name: "platformFeeBP_",
|
|
1291
|
-
type: "uint256"
|
|
1292
|
-
},
|
|
1293
|
-
{
|
|
1294
|
-
internalType: "address",
|
|
1295
|
-
name: "platformTreasury_",
|
|
1296
|
-
type: "address"
|
|
1297
|
-
}
|
|
968
|
+
{ internalType: "address", name: "paymentTokenAddress", type: "address" },
|
|
969
|
+
{ internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" },
|
|
970
|
+
{ internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
|
|
971
|
+
{ internalType: "address", name: "platformTreasury_", type: "address" }
|
|
1298
972
|
],
|
|
1299
973
|
name: "initialize",
|
|
1300
974
|
outputs: [],
|
|
@@ -1303,163 +977,59 @@ var ACP_ABI = [
|
|
|
1303
977
|
},
|
|
1304
978
|
{
|
|
1305
979
|
inputs: [
|
|
1306
|
-
{
|
|
1307
|
-
|
|
1308
|
-
name: "jobId",
|
|
1309
|
-
type: "uint256"
|
|
1310
|
-
},
|
|
1311
|
-
{
|
|
1312
|
-
internalType: "address",
|
|
1313
|
-
name: "account",
|
|
1314
|
-
type: "address"
|
|
1315
|
-
}
|
|
980
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
981
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
1316
982
|
],
|
|
1317
983
|
name: "isJobEvaluator",
|
|
1318
|
-
outputs: [
|
|
1319
|
-
{
|
|
1320
|
-
internalType: "bool",
|
|
1321
|
-
name: "",
|
|
1322
|
-
type: "bool"
|
|
1323
|
-
}
|
|
1324
|
-
],
|
|
984
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
1325
985
|
stateMutability: "view",
|
|
1326
986
|
type: "function"
|
|
1327
987
|
},
|
|
1328
988
|
{
|
|
1329
|
-
inputs: [
|
|
1330
|
-
{
|
|
1331
|
-
internalType: "uint256",
|
|
1332
|
-
name: "memoId",
|
|
1333
|
-
type: "uint256"
|
|
1334
|
-
}
|
|
1335
|
-
],
|
|
989
|
+
inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
|
|
1336
990
|
name: "isPayableMemo",
|
|
1337
|
-
outputs: [
|
|
1338
|
-
{
|
|
1339
|
-
internalType: "bool",
|
|
1340
|
-
name: "",
|
|
1341
|
-
type: "bool"
|
|
1342
|
-
}
|
|
1343
|
-
],
|
|
991
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
1344
992
|
stateMutability: "view",
|
|
1345
993
|
type: "function"
|
|
1346
994
|
},
|
|
1347
995
|
{
|
|
1348
|
-
inputs: [
|
|
1349
|
-
{
|
|
1350
|
-
internalType: "uint256",
|
|
1351
|
-
name: "jobId",
|
|
1352
|
-
type: "uint256"
|
|
1353
|
-
}
|
|
1354
|
-
],
|
|
996
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
1355
997
|
name: "jobAdditionalFees",
|
|
1356
|
-
outputs: [
|
|
1357
|
-
{
|
|
1358
|
-
internalType: "uint256",
|
|
1359
|
-
name: "",
|
|
1360
|
-
type: "uint256"
|
|
1361
|
-
}
|
|
1362
|
-
],
|
|
998
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1363
999
|
stateMutability: "view",
|
|
1364
1000
|
type: "function"
|
|
1365
1001
|
},
|
|
1366
1002
|
{
|
|
1367
1003
|
inputs: [],
|
|
1368
1004
|
name: "jobCounter",
|
|
1369
|
-
outputs: [
|
|
1370
|
-
{
|
|
1371
|
-
internalType: "uint256",
|
|
1372
|
-
name: "",
|
|
1373
|
-
type: "uint256"
|
|
1374
|
-
}
|
|
1375
|
-
],
|
|
1005
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1376
1006
|
stateMutability: "view",
|
|
1377
1007
|
type: "function"
|
|
1378
1008
|
},
|
|
1379
1009
|
{
|
|
1380
1010
|
inputs: [
|
|
1381
|
-
{
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
type: "uint256"
|
|
1385
|
-
},
|
|
1386
|
-
{
|
|
1387
|
-
internalType: "uint8",
|
|
1388
|
-
name: "phase",
|
|
1389
|
-
type: "uint8"
|
|
1390
|
-
},
|
|
1391
|
-
{
|
|
1392
|
-
internalType: "uint256",
|
|
1393
|
-
name: "",
|
|
1394
|
-
type: "uint256"
|
|
1395
|
-
}
|
|
1011
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
1012
|
+
{ internalType: "uint8", name: "phase", type: "uint8" },
|
|
1013
|
+
{ internalType: "uint256", name: "", type: "uint256" }
|
|
1396
1014
|
],
|
|
1397
1015
|
name: "jobMemoIds",
|
|
1398
|
-
outputs: [
|
|
1399
|
-
{
|
|
1400
|
-
internalType: "uint256",
|
|
1401
|
-
name: "memoIds",
|
|
1402
|
-
type: "uint256"
|
|
1403
|
-
}
|
|
1404
|
-
],
|
|
1016
|
+
outputs: [{ internalType: "uint256", name: "memoIds", type: "uint256" }],
|
|
1405
1017
|
stateMutability: "view",
|
|
1406
1018
|
type: "function"
|
|
1407
1019
|
},
|
|
1408
1020
|
{
|
|
1409
|
-
inputs: [
|
|
1410
|
-
{
|
|
1411
|
-
internalType: "uint256",
|
|
1412
|
-
name: "",
|
|
1413
|
-
type: "uint256"
|
|
1414
|
-
}
|
|
1415
|
-
],
|
|
1021
|
+
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1416
1022
|
name: "jobs",
|
|
1417
1023
|
outputs: [
|
|
1418
|
-
{
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
},
|
|
1423
|
-
{
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
internalType: "address",
|
|
1430
|
-
name: "provider",
|
|
1431
|
-
type: "address"
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
internalType: "uint256",
|
|
1435
|
-
name: "budget",
|
|
1436
|
-
type: "uint256"
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
internalType: "uint256",
|
|
1440
|
-
name: "amountClaimed",
|
|
1441
|
-
type: "uint256"
|
|
1442
|
-
},
|
|
1443
|
-
{
|
|
1444
|
-
internalType: "uint8",
|
|
1445
|
-
name: "phase",
|
|
1446
|
-
type: "uint8"
|
|
1447
|
-
},
|
|
1448
|
-
{
|
|
1449
|
-
internalType: "uint256",
|
|
1450
|
-
name: "memoCount",
|
|
1451
|
-
type: "uint256"
|
|
1452
|
-
},
|
|
1453
|
-
{
|
|
1454
|
-
internalType: "uint256",
|
|
1455
|
-
name: "expiredAt",
|
|
1456
|
-
type: "uint256"
|
|
1457
|
-
},
|
|
1458
|
-
{
|
|
1459
|
-
internalType: "address",
|
|
1460
|
-
name: "evaluator",
|
|
1461
|
-
type: "address"
|
|
1462
|
-
},
|
|
1024
|
+
{ internalType: "uint256", name: "id", type: "uint256" },
|
|
1025
|
+
{ internalType: "address", name: "client", type: "address" },
|
|
1026
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
1027
|
+
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
1028
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" },
|
|
1029
|
+
{ internalType: "uint8", name: "phase", type: "uint8" },
|
|
1030
|
+
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
1031
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
1032
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
1463
1033
|
{
|
|
1464
1034
|
internalType: "contract IERC20",
|
|
1465
1035
|
name: "jobPaymentToken",
|
|
@@ -1472,75 +1042,31 @@ var ACP_ABI = [
|
|
|
1472
1042
|
{
|
|
1473
1043
|
inputs: [],
|
|
1474
1044
|
name: "memoCounter",
|
|
1475
|
-
outputs: [
|
|
1476
|
-
{
|
|
1477
|
-
internalType: "uint256",
|
|
1478
|
-
name: "",
|
|
1479
|
-
type: "uint256"
|
|
1480
|
-
}
|
|
1481
|
-
],
|
|
1045
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1482
1046
|
stateMutability: "view",
|
|
1483
1047
|
type: "function"
|
|
1484
1048
|
},
|
|
1485
1049
|
{
|
|
1486
|
-
inputs: [
|
|
1487
|
-
{
|
|
1488
|
-
internalType: "uint256",
|
|
1489
|
-
name: "memoId",
|
|
1490
|
-
type: "uint256"
|
|
1491
|
-
}
|
|
1492
|
-
],
|
|
1050
|
+
inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
|
|
1493
1051
|
name: "memoExpiredAt",
|
|
1494
|
-
outputs: [
|
|
1495
|
-
{
|
|
1496
|
-
internalType: "uint256",
|
|
1497
|
-
name: "expiredAt",
|
|
1498
|
-
type: "uint256"
|
|
1499
|
-
}
|
|
1500
|
-
],
|
|
1052
|
+
outputs: [{ internalType: "uint256", name: "expiredAt", type: "uint256" }],
|
|
1501
1053
|
stateMutability: "view",
|
|
1502
1054
|
type: "function"
|
|
1503
1055
|
},
|
|
1504
1056
|
{
|
|
1505
|
-
inputs: [
|
|
1506
|
-
{
|
|
1507
|
-
internalType: "uint256",
|
|
1508
|
-
name: "",
|
|
1509
|
-
type: "uint256"
|
|
1510
|
-
}
|
|
1511
|
-
],
|
|
1057
|
+
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1512
1058
|
name: "memos",
|
|
1513
1059
|
outputs: [
|
|
1514
|
-
{
|
|
1515
|
-
internalType: "string",
|
|
1516
|
-
name: "content",
|
|
1517
|
-
type: "string"
|
|
1518
|
-
},
|
|
1060
|
+
{ internalType: "string", name: "content", type: "string" },
|
|
1519
1061
|
{
|
|
1520
1062
|
internalType: "enum InteractionLedger.MemoType",
|
|
1521
1063
|
name: "memoType",
|
|
1522
1064
|
type: "uint8"
|
|
1523
1065
|
},
|
|
1524
|
-
{
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
},
|
|
1529
|
-
{
|
|
1530
|
-
internalType: "uint8",
|
|
1531
|
-
name: "nextPhase",
|
|
1532
|
-
type: "uint8"
|
|
1533
|
-
},
|
|
1534
|
-
{
|
|
1535
|
-
internalType: "uint256",
|
|
1536
|
-
name: "jobId",
|
|
1537
|
-
type: "uint256"
|
|
1538
|
-
},
|
|
1539
|
-
{
|
|
1540
|
-
internalType: "address",
|
|
1541
|
-
name: "sender",
|
|
1542
|
-
type: "address"
|
|
1543
|
-
}
|
|
1066
|
+
{ internalType: "bool", name: "isSecured", type: "bool" },
|
|
1067
|
+
{ internalType: "uint8", name: "nextPhase", type: "uint8" },
|
|
1068
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
1069
|
+
{ internalType: "address", name: "sender", type: "address" }
|
|
1544
1070
|
],
|
|
1545
1071
|
stateMutability: "view",
|
|
1546
1072
|
type: "function"
|
|
@@ -1548,56 +1074,24 @@ var ACP_ABI = [
|
|
|
1548
1074
|
{
|
|
1549
1075
|
inputs: [],
|
|
1550
1076
|
name: "numEvaluatorsPerJob",
|
|
1551
|
-
outputs: [
|
|
1552
|
-
{
|
|
1553
|
-
internalType: "uint8",
|
|
1554
|
-
name: "",
|
|
1555
|
-
type: "uint8"
|
|
1556
|
-
}
|
|
1557
|
-
],
|
|
1077
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
1558
1078
|
stateMutability: "view",
|
|
1559
1079
|
type: "function"
|
|
1560
1080
|
},
|
|
1561
1081
|
{
|
|
1562
|
-
inputs: [
|
|
1563
|
-
{
|
|
1564
|
-
internalType: "uint256",
|
|
1565
|
-
name: "memoId",
|
|
1566
|
-
type: "uint256"
|
|
1567
|
-
}
|
|
1568
|
-
],
|
|
1082
|
+
inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
|
|
1569
1083
|
name: "payableDetails",
|
|
1570
1084
|
outputs: [
|
|
1571
|
-
{
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
},
|
|
1576
|
-
{
|
|
1577
|
-
internalType: "uint256",
|
|
1578
|
-
name: "amount",
|
|
1579
|
-
type: "uint256"
|
|
1580
|
-
},
|
|
1581
|
-
{
|
|
1582
|
-
internalType: "address",
|
|
1583
|
-
name: "recipient",
|
|
1584
|
-
type: "address"
|
|
1585
|
-
},
|
|
1586
|
-
{
|
|
1587
|
-
internalType: "uint256",
|
|
1588
|
-
name: "feeAmount",
|
|
1589
|
-
type: "uint256"
|
|
1590
|
-
},
|
|
1085
|
+
{ internalType: "address", name: "token", type: "address" },
|
|
1086
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
1087
|
+
{ internalType: "address", name: "recipient", type: "address" },
|
|
1088
|
+
{ internalType: "uint256", name: "feeAmount", type: "uint256" },
|
|
1591
1089
|
{
|
|
1592
1090
|
internalType: "enum ACPSimple.FeeType",
|
|
1593
1091
|
name: "feeType",
|
|
1594
1092
|
type: "uint8"
|
|
1595
1093
|
},
|
|
1596
|
-
{
|
|
1597
|
-
internalType: "bool",
|
|
1598
|
-
name: "isExecuted",
|
|
1599
|
-
type: "bool"
|
|
1600
|
-
}
|
|
1094
|
+
{ internalType: "bool", name: "isExecuted", type: "bool" }
|
|
1601
1095
|
],
|
|
1602
1096
|
stateMutability: "view",
|
|
1603
1097
|
type: "function"
|
|
@@ -1605,54 +1099,28 @@ var ACP_ABI = [
|
|
|
1605
1099
|
{
|
|
1606
1100
|
inputs: [],
|
|
1607
1101
|
name: "paymentToken",
|
|
1608
|
-
outputs: [
|
|
1609
|
-
{
|
|
1610
|
-
internalType: "contract IERC20",
|
|
1611
|
-
name: "",
|
|
1612
|
-
type: "address"
|
|
1613
|
-
}
|
|
1614
|
-
],
|
|
1102
|
+
outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
|
|
1615
1103
|
stateMutability: "view",
|
|
1616
1104
|
type: "function"
|
|
1617
1105
|
},
|
|
1618
1106
|
{
|
|
1619
1107
|
inputs: [],
|
|
1620
1108
|
name: "platformFeeBP",
|
|
1621
|
-
outputs: [
|
|
1622
|
-
{
|
|
1623
|
-
internalType: "uint256",
|
|
1624
|
-
name: "",
|
|
1625
|
-
type: "uint256"
|
|
1626
|
-
}
|
|
1627
|
-
],
|
|
1109
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1628
1110
|
stateMutability: "view",
|
|
1629
1111
|
type: "function"
|
|
1630
1112
|
},
|
|
1631
1113
|
{
|
|
1632
1114
|
inputs: [],
|
|
1633
1115
|
name: "platformTreasury",
|
|
1634
|
-
outputs: [
|
|
1635
|
-
{
|
|
1636
|
-
internalType: "address",
|
|
1637
|
-
name: "",
|
|
1638
|
-
type: "address"
|
|
1639
|
-
}
|
|
1640
|
-
],
|
|
1116
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
1641
1117
|
stateMutability: "view",
|
|
1642
1118
|
type: "function"
|
|
1643
1119
|
},
|
|
1644
1120
|
{
|
|
1645
1121
|
inputs: [
|
|
1646
|
-
{
|
|
1647
|
-
|
|
1648
|
-
name: "role",
|
|
1649
|
-
type: "bytes32"
|
|
1650
|
-
},
|
|
1651
|
-
{
|
|
1652
|
-
internalType: "address",
|
|
1653
|
-
name: "callerConfirmation",
|
|
1654
|
-
type: "address"
|
|
1655
|
-
}
|
|
1122
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
1123
|
+
{ internalType: "address", name: "callerConfirmation", type: "address" }
|
|
1656
1124
|
],
|
|
1657
1125
|
name: "renounceRole",
|
|
1658
1126
|
outputs: [],
|
|
@@ -1661,16 +1129,8 @@ var ACP_ABI = [
|
|
|
1661
1129
|
},
|
|
1662
1130
|
{
|
|
1663
1131
|
inputs: [
|
|
1664
|
-
{
|
|
1665
|
-
|
|
1666
|
-
name: "role",
|
|
1667
|
-
type: "bytes32"
|
|
1668
|
-
},
|
|
1669
|
-
{
|
|
1670
|
-
internalType: "address",
|
|
1671
|
-
name: "account",
|
|
1672
|
-
type: "address"
|
|
1673
|
-
}
|
|
1132
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
1133
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
1674
1134
|
],
|
|
1675
1135
|
name: "revokeRole",
|
|
1676
1136
|
outputs: [],
|
|
@@ -1679,16 +1139,8 @@ var ACP_ABI = [
|
|
|
1679
1139
|
},
|
|
1680
1140
|
{
|
|
1681
1141
|
inputs: [
|
|
1682
|
-
{
|
|
1683
|
-
|
|
1684
|
-
name: "jobId",
|
|
1685
|
-
type: "uint256"
|
|
1686
|
-
},
|
|
1687
|
-
{
|
|
1688
|
-
internalType: "uint256",
|
|
1689
|
-
name: "amount",
|
|
1690
|
-
type: "uint256"
|
|
1691
|
-
}
|
|
1142
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
1143
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
|
1692
1144
|
],
|
|
1693
1145
|
name: "setBudget",
|
|
1694
1146
|
outputs: [],
|
|
@@ -1697,16 +1149,8 @@ var ACP_ABI = [
|
|
|
1697
1149
|
},
|
|
1698
1150
|
{
|
|
1699
1151
|
inputs: [
|
|
1700
|
-
{
|
|
1701
|
-
|
|
1702
|
-
name: "jobId",
|
|
1703
|
-
type: "uint256"
|
|
1704
|
-
},
|
|
1705
|
-
{
|
|
1706
|
-
internalType: "uint256",
|
|
1707
|
-
name: "amount",
|
|
1708
|
-
type: "uint256"
|
|
1709
|
-
},
|
|
1152
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
1153
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
1710
1154
|
{
|
|
1711
1155
|
internalType: "contract IERC20",
|
|
1712
1156
|
name: "jobPaymentToken_",
|
|
@@ -1720,21 +1164,9 @@ var ACP_ABI = [
|
|
|
1720
1164
|
},
|
|
1721
1165
|
{
|
|
1722
1166
|
inputs: [
|
|
1723
|
-
{
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
type: "uint256"
|
|
1727
|
-
},
|
|
1728
|
-
{
|
|
1729
|
-
internalType: "bool",
|
|
1730
|
-
name: "isApproved",
|
|
1731
|
-
type: "bool"
|
|
1732
|
-
},
|
|
1733
|
-
{
|
|
1734
|
-
internalType: "string",
|
|
1735
|
-
name: "reason",
|
|
1736
|
-
type: "string"
|
|
1737
|
-
}
|
|
1167
|
+
{ internalType: "uint256", name: "memoId", type: "uint256" },
|
|
1168
|
+
{ internalType: "bool", name: "isApproved", type: "bool" },
|
|
1169
|
+
{ internalType: "string", name: "reason", type: "string" }
|
|
1738
1170
|
],
|
|
1739
1171
|
name: "signMemo",
|
|
1740
1172
|
outputs: [],
|
|
@@ -1743,54 +1175,24 @@ var ACP_ABI = [
|
|
|
1743
1175
|
},
|
|
1744
1176
|
{
|
|
1745
1177
|
inputs: [
|
|
1746
|
-
{
|
|
1747
|
-
|
|
1748
|
-
name: "memoId",
|
|
1749
|
-
type: "uint256"
|
|
1750
|
-
},
|
|
1751
|
-
{
|
|
1752
|
-
internalType: "address",
|
|
1753
|
-
name: "signer",
|
|
1754
|
-
type: "address"
|
|
1755
|
-
}
|
|
1178
|
+
{ internalType: "uint256", name: "memoId", type: "uint256" },
|
|
1179
|
+
{ internalType: "address", name: "signer", type: "address" }
|
|
1756
1180
|
],
|
|
1757
1181
|
name: "signatories",
|
|
1758
|
-
outputs: [
|
|
1759
|
-
{
|
|
1760
|
-
internalType: "uint8",
|
|
1761
|
-
name: "res",
|
|
1762
|
-
type: "uint8"
|
|
1763
|
-
}
|
|
1764
|
-
],
|
|
1182
|
+
outputs: [{ internalType: "uint8", name: "res", type: "uint8" }],
|
|
1765
1183
|
stateMutability: "view",
|
|
1766
1184
|
type: "function"
|
|
1767
1185
|
},
|
|
1768
1186
|
{
|
|
1769
|
-
inputs: [
|
|
1770
|
-
{
|
|
1771
|
-
internalType: "bytes4",
|
|
1772
|
-
name: "interfaceId",
|
|
1773
|
-
type: "bytes4"
|
|
1774
|
-
}
|
|
1775
|
-
],
|
|
1187
|
+
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
1776
1188
|
name: "supportsInterface",
|
|
1777
|
-
outputs: [
|
|
1778
|
-
{
|
|
1779
|
-
internalType: "bool",
|
|
1780
|
-
name: "",
|
|
1781
|
-
type: "bool"
|
|
1782
|
-
}
|
|
1783
|
-
],
|
|
1189
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
1784
1190
|
stateMutability: "view",
|
|
1785
1191
|
type: "function"
|
|
1786
1192
|
},
|
|
1787
1193
|
{
|
|
1788
1194
|
inputs: [
|
|
1789
|
-
{
|
|
1790
|
-
internalType: "uint256",
|
|
1791
|
-
name: "evaluatorFeeBP_",
|
|
1792
|
-
type: "uint256"
|
|
1793
|
-
}
|
|
1195
|
+
{ internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
|
|
1794
1196
|
],
|
|
1795
1197
|
name: "updateEvaluatorFee",
|
|
1796
1198
|
outputs: [],
|
|
@@ -1799,16 +1201,8 @@ var ACP_ABI = [
|
|
|
1799
1201
|
},
|
|
1800
1202
|
{
|
|
1801
1203
|
inputs: [
|
|
1802
|
-
{
|
|
1803
|
-
|
|
1804
|
-
name: "platformFeeBP_",
|
|
1805
|
-
type: "uint256"
|
|
1806
|
-
},
|
|
1807
|
-
{
|
|
1808
|
-
internalType: "address",
|
|
1809
|
-
name: "platformTreasury_",
|
|
1810
|
-
type: "address"
|
|
1811
|
-
}
|
|
1204
|
+
{ internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
|
|
1205
|
+
{ internalType: "address", name: "platformTreasury_", type: "address" }
|
|
1812
1206
|
],
|
|
1813
1207
|
name: "updatePlatformFee",
|
|
1814
1208
|
outputs: [],
|
|
@@ -1816,17 +1210,21 @@ var ACP_ABI = [
|
|
|
1816
1210
|
type: "function"
|
|
1817
1211
|
},
|
|
1818
1212
|
{
|
|
1819
|
-
inputs: [
|
|
1820
|
-
{
|
|
1821
|
-
internalType: "uint256",
|
|
1822
|
-
name: "memoId",
|
|
1823
|
-
type: "uint256"
|
|
1824
|
-
}
|
|
1825
|
-
],
|
|
1213
|
+
inputs: [{ internalType: "uint256", name: "memoId", type: "uint256" }],
|
|
1826
1214
|
name: "withdrawEscrowedFunds",
|
|
1827
1215
|
outputs: [],
|
|
1828
1216
|
stateMutability: "nonpayable",
|
|
1829
1217
|
type: "function"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
1221
|
+
name: "x402PaymentDetails",
|
|
1222
|
+
outputs: [
|
|
1223
|
+
{ internalType: "bool", name: "isX402", type: "bool" },
|
|
1224
|
+
{ internalType: "bool", name: "isBudgetReceived", type: "bool" }
|
|
1225
|
+
],
|
|
1226
|
+
stateMutability: "view",
|
|
1227
|
+
type: "function"
|
|
1830
1228
|
}
|
|
1831
1229
|
];
|
|
1832
1230
|
var acpAbi_default = ACP_ABI;
|
|
@@ -1837,8 +1235,10 @@ import { io } from "socket.io-client";
|
|
|
1837
1235
|
|
|
1838
1236
|
// src/contractClients/baseAcpContractClient.ts
|
|
1839
1237
|
import {
|
|
1238
|
+
createPublicClient as createPublicClient2,
|
|
1840
1239
|
encodeFunctionData,
|
|
1841
1240
|
erc20Abi as erc20Abi2,
|
|
1241
|
+
http as http2,
|
|
1842
1242
|
keccak256,
|
|
1843
1243
|
toEventSignature,
|
|
1844
1244
|
toHex
|
|
@@ -2391,6 +1791,33 @@ var ACP_V2_ABI = [
|
|
|
2391
1791
|
stateMutability: "nonpayable",
|
|
2392
1792
|
type: "function"
|
|
2393
1793
|
},
|
|
1794
|
+
{
|
|
1795
|
+
inputs: [
|
|
1796
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
1797
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
1798
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
1799
|
+
{ internalType: "address", name: "paymentToken", type: "address" },
|
|
1800
|
+
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
1801
|
+
{ internalType: "string", name: "metadata", type: "string" }
|
|
1802
|
+
],
|
|
1803
|
+
name: "createX402Job",
|
|
1804
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1805
|
+
stateMutability: "nonpayable",
|
|
1806
|
+
type: "function"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
inputs: [
|
|
1810
|
+
{ internalType: "uint256", name: "accountId", type: "uint256" },
|
|
1811
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
1812
|
+
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
1813
|
+
{ internalType: "address", name: "paymentToken", type: "address" },
|
|
1814
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" }
|
|
1815
|
+
],
|
|
1816
|
+
name: "createX402JobWithAccount",
|
|
1817
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
1818
|
+
stateMutability: "nonpayable",
|
|
1819
|
+
type: "function"
|
|
1820
|
+
},
|
|
2394
1821
|
{
|
|
2395
1822
|
inputs: [],
|
|
2396
1823
|
name: "defaultPaymentToken",
|
|
@@ -2495,7 +1922,7 @@ var ACP_V2_ABI = [
|
|
|
2495
1922
|
{ internalType: "uint256", name: "offset", type: "uint256" },
|
|
2496
1923
|
{ internalType: "uint256", name: "limit", type: "uint256" }
|
|
2497
1924
|
],
|
|
2498
|
-
name: "
|
|
1925
|
+
name: "getMemosForMemoType",
|
|
2499
1926
|
outputs: [
|
|
2500
1927
|
{
|
|
2501
1928
|
components: [
|
|
@@ -2532,10 +1959,53 @@ var ACP_V2_ABI = [
|
|
|
2532
1959
|
type: "function"
|
|
2533
1960
|
},
|
|
2534
1961
|
{
|
|
2535
|
-
inputs: [
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
1962
|
+
inputs: [
|
|
1963
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
1964
|
+
{ internalType: "enum ACPTypes.JobPhase", name: "phase", type: "uint8" },
|
|
1965
|
+
{ internalType: "uint256", name: "offset", type: "uint256" },
|
|
1966
|
+
{ internalType: "uint256", name: "limit", type: "uint256" }
|
|
1967
|
+
],
|
|
1968
|
+
name: "getMemosForPhaseType",
|
|
1969
|
+
outputs: [
|
|
1970
|
+
{
|
|
1971
|
+
components: [
|
|
1972
|
+
{ internalType: "uint256", name: "id", type: "uint256" },
|
|
1973
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
1974
|
+
{ internalType: "address", name: "sender", type: "address" },
|
|
1975
|
+
{ internalType: "string", name: "content", type: "string" },
|
|
1976
|
+
{
|
|
1977
|
+
internalType: "enum ACPTypes.MemoType",
|
|
1978
|
+
name: "memoType",
|
|
1979
|
+
type: "uint8"
|
|
1980
|
+
},
|
|
1981
|
+
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
1982
|
+
{ internalType: "bool", name: "isApproved", type: "bool" },
|
|
1983
|
+
{ internalType: "address", name: "approvedBy", type: "address" },
|
|
1984
|
+
{ internalType: "uint256", name: "approvedAt", type: "uint256" },
|
|
1985
|
+
{ internalType: "bool", name: "requiresApproval", type: "bool" },
|
|
1986
|
+
{ internalType: "string", name: "metadata", type: "string" },
|
|
1987
|
+
{ internalType: "bool", name: "isSecured", type: "bool" },
|
|
1988
|
+
{
|
|
1989
|
+
internalType: "enum ACPTypes.JobPhase",
|
|
1990
|
+
name: "nextPhase",
|
|
1991
|
+
type: "uint8"
|
|
1992
|
+
},
|
|
1993
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" }
|
|
1994
|
+
],
|
|
1995
|
+
internalType: "struct ACPTypes.Memo[]",
|
|
1996
|
+
name: "memos",
|
|
1997
|
+
type: "tuple[]"
|
|
1998
|
+
},
|
|
1999
|
+
{ internalType: "uint256", name: "total", type: "uint256" }
|
|
2000
|
+
],
|
|
2001
|
+
stateMutability: "view",
|
|
2002
|
+
type: "function"
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
inputs: [],
|
|
2006
|
+
name: "getPhases",
|
|
2007
|
+
outputs: [{ internalType: "string[7]", name: "", type: "string[7]" }],
|
|
2008
|
+
stateMutability: "pure",
|
|
2539
2009
|
type: "function"
|
|
2540
2010
|
},
|
|
2541
2011
|
{
|
|
@@ -2647,331 +2117,1136 @@ var ACP_V2_ABI = [
|
|
|
2647
2117
|
type: "function"
|
|
2648
2118
|
},
|
|
2649
2119
|
{
|
|
2650
|
-
inputs: [],
|
|
2651
|
-
name: "proxiableUUID",
|
|
2652
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2653
|
-
stateMutability: "view",
|
|
2120
|
+
inputs: [],
|
|
2121
|
+
name: "proxiableUUID",
|
|
2122
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2123
|
+
stateMutability: "view",
|
|
2124
|
+
type: "function"
|
|
2125
|
+
},
|
|
2126
|
+
{
|
|
2127
|
+
inputs: [
|
|
2128
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
2129
|
+
{ internalType: "address", name: "callerConfirmation", type: "address" }
|
|
2130
|
+
],
|
|
2131
|
+
name: "renounceRole",
|
|
2132
|
+
outputs: [],
|
|
2133
|
+
stateMutability: "nonpayable",
|
|
2134
|
+
type: "function"
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
inputs: [
|
|
2138
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
2139
|
+
{ internalType: "address", name: "account", type: "address" }
|
|
2140
|
+
],
|
|
2141
|
+
name: "revokeRole",
|
|
2142
|
+
outputs: [],
|
|
2143
|
+
stateMutability: "nonpayable",
|
|
2144
|
+
type: "function"
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
inputs: [
|
|
2148
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
2149
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
|
2150
|
+
],
|
|
2151
|
+
name: "setBudget",
|
|
2152
|
+
outputs: [],
|
|
2153
|
+
stateMutability: "nonpayable",
|
|
2154
|
+
type: "function"
|
|
2155
|
+
},
|
|
2156
|
+
{
|
|
2157
|
+
inputs: [
|
|
2158
|
+
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
2159
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
2160
|
+
{ internalType: "address", name: "paymentToken", type: "address" }
|
|
2161
|
+
],
|
|
2162
|
+
name: "setBudgetWithPaymentToken",
|
|
2163
|
+
outputs: [],
|
|
2164
|
+
stateMutability: "nonpayable",
|
|
2165
|
+
type: "function"
|
|
2166
|
+
},
|
|
2167
|
+
{
|
|
2168
|
+
inputs: [
|
|
2169
|
+
{ internalType: "uint256", name: "memoId", type: "uint256" },
|
|
2170
|
+
{ internalType: "bool", name: "isApproved", type: "bool" },
|
|
2171
|
+
{ internalType: "string", name: "reason", type: "string" }
|
|
2172
|
+
],
|
|
2173
|
+
name: "signMemo",
|
|
2174
|
+
outputs: [],
|
|
2175
|
+
stateMutability: "nonpayable",
|
|
2176
|
+
type: "function"
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
2180
|
+
name: "supportsInterface",
|
|
2181
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2182
|
+
stateMutability: "view",
|
|
2183
|
+
type: "function"
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
inputs: [],
|
|
2187
|
+
name: "unpause",
|
|
2188
|
+
outputs: [],
|
|
2189
|
+
stateMutability: "nonpayable",
|
|
2190
|
+
type: "function"
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
inputs: [
|
|
2194
|
+
{ internalType: "uint256", name: "accountId", type: "uint256" },
|
|
2195
|
+
{ internalType: "string", name: "metadata", type: "string" }
|
|
2196
|
+
],
|
|
2197
|
+
name: "updateAccountMetadata",
|
|
2198
|
+
outputs: [],
|
|
2199
|
+
stateMutability: "nonpayable",
|
|
2200
|
+
type: "function"
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
inputs: [
|
|
2204
|
+
{ internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
|
|
2205
|
+
],
|
|
2206
|
+
name: "updateEvaluatorFee",
|
|
2207
|
+
outputs: [],
|
|
2208
|
+
stateMutability: "nonpayable",
|
|
2209
|
+
type: "function"
|
|
2210
|
+
},
|
|
2211
|
+
{
|
|
2212
|
+
inputs: [
|
|
2213
|
+
{ internalType: "string", name: "moduleType", type: "string" },
|
|
2214
|
+
{ internalType: "address", name: "moduleAddress", type: "address" }
|
|
2215
|
+
],
|
|
2216
|
+
name: "updateModule",
|
|
2217
|
+
outputs: [],
|
|
2218
|
+
stateMutability: "nonpayable",
|
|
2219
|
+
type: "function"
|
|
2220
|
+
},
|
|
2221
|
+
{
|
|
2222
|
+
inputs: [
|
|
2223
|
+
{ internalType: "uint256", name: "platformFeeBP_", type: "uint256" },
|
|
2224
|
+
{ internalType: "address", name: "platformTreasury_", type: "address" },
|
|
2225
|
+
{ internalType: "uint256", name: "evaluatorFeeBP_", type: "uint256" }
|
|
2226
|
+
],
|
|
2227
|
+
name: "updatePlatformConfig",
|
|
2228
|
+
outputs: [],
|
|
2229
|
+
stateMutability: "nonpayable",
|
|
2230
|
+
type: "function"
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
inputs: [
|
|
2234
|
+
{ internalType: "address", name: "newImplementation", type: "address" },
|
|
2235
|
+
{ internalType: "bytes", name: "data", type: "bytes" }
|
|
2236
|
+
],
|
|
2237
|
+
name: "upgradeToAndCall",
|
|
2238
|
+
outputs: [],
|
|
2239
|
+
stateMutability: "payable",
|
|
2240
|
+
type: "function"
|
|
2241
|
+
}
|
|
2242
|
+
];
|
|
2243
|
+
var acpAbiV2_default = ACP_V2_ABI;
|
|
2244
|
+
|
|
2245
|
+
// src/configs/acpConfigs.ts
|
|
2246
|
+
var AcpContractConfig2 = class {
|
|
2247
|
+
constructor(chain, contractAddress, baseFare, alchemyRpcUrl, acpUrl, abi, rpcEndpoint, x402Config) {
|
|
2248
|
+
this.chain = chain;
|
|
2249
|
+
this.contractAddress = contractAddress;
|
|
2250
|
+
this.baseFare = baseFare;
|
|
2251
|
+
this.alchemyRpcUrl = alchemyRpcUrl;
|
|
2252
|
+
this.acpUrl = acpUrl;
|
|
2253
|
+
this.abi = abi;
|
|
2254
|
+
this.rpcEndpoint = rpcEndpoint;
|
|
2255
|
+
this.x402Config = x402Config;
|
|
2256
|
+
}
|
|
2257
|
+
};
|
|
2258
|
+
var baseSepoliaAcpConfig = new AcpContractConfig2(
|
|
2259
|
+
baseSepolia,
|
|
2260
|
+
"0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
|
|
2261
|
+
new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
|
|
2262
|
+
"https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
2263
|
+
"https://acpx.virtuals.gg",
|
|
2264
|
+
acpAbi_default
|
|
2265
|
+
);
|
|
2266
|
+
var baseSepoliaAcpX402Config = new AcpContractConfig2(
|
|
2267
|
+
baseSepolia,
|
|
2268
|
+
"0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
|
|
2269
|
+
new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
|
|
2270
|
+
"https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
2271
|
+
"https://acpx.virtuals.gg",
|
|
2272
|
+
acpAbi_default,
|
|
2273
|
+
void 0,
|
|
2274
|
+
{
|
|
2275
|
+
url: "https://dev-acp-x402.virtuals.io"
|
|
2276
|
+
}
|
|
2277
|
+
);
|
|
2278
|
+
var baseSepoliaAcpConfigV2 = new AcpContractConfig2(
|
|
2279
|
+
baseSepolia,
|
|
2280
|
+
"0xdf54E6Ed6cD1d0632d973ADECf96597b7e87893c",
|
|
2281
|
+
new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
|
|
2282
|
+
"https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
2283
|
+
"https://acpx.virtuals.gg",
|
|
2284
|
+
acpAbiV2_default
|
|
2285
|
+
);
|
|
2286
|
+
var baseSepoliaAcpX402ConfigV2 = new AcpContractConfig2(
|
|
2287
|
+
baseSepolia,
|
|
2288
|
+
"0xdf54E6Ed6cD1d0632d973ADECf96597b7e87893c",
|
|
2289
|
+
new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
|
|
2290
|
+
"https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
2291
|
+
"https://acpx.virtuals.gg",
|
|
2292
|
+
acpAbiV2_default,
|
|
2293
|
+
void 0,
|
|
2294
|
+
{
|
|
2295
|
+
url: "https://dev-acp-x402.virtuals.io"
|
|
2296
|
+
}
|
|
2297
|
+
);
|
|
2298
|
+
var baseAcpConfig = new AcpContractConfig2(
|
|
2299
|
+
base,
|
|
2300
|
+
"0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
|
|
2301
|
+
new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
|
|
2302
|
+
"https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
2303
|
+
"https://acpx.virtuals.io",
|
|
2304
|
+
acpAbi_default
|
|
2305
|
+
);
|
|
2306
|
+
var baseAcpX402Config = new AcpContractConfig2(
|
|
2307
|
+
base,
|
|
2308
|
+
"0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
|
|
2309
|
+
new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
|
|
2310
|
+
"https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
2311
|
+
"https://acpx.virtuals.io",
|
|
2312
|
+
acpAbi_default,
|
|
2313
|
+
void 0,
|
|
2314
|
+
{
|
|
2315
|
+
url: "https://acp-x402.virtuals.io"
|
|
2316
|
+
}
|
|
2317
|
+
);
|
|
2318
|
+
var baseAcpConfigV2 = new AcpContractConfig2(
|
|
2319
|
+
base,
|
|
2320
|
+
"0xa6C9BA866992cfD7fd6460ba912bfa405adA9df0",
|
|
2321
|
+
new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
|
|
2322
|
+
"https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
2323
|
+
"https://acpx.virtuals.io",
|
|
2324
|
+
acpAbiV2_default
|
|
2325
|
+
);
|
|
2326
|
+
var baseAcpX402ConfigV2 = new AcpContractConfig2(
|
|
2327
|
+
base,
|
|
2328
|
+
"0xa6C9BA866992cfD7fd6460ba912bfa405adA9df0",
|
|
2329
|
+
new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
|
|
2330
|
+
"https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
2331
|
+
"https://acpx.virtuals.io",
|
|
2332
|
+
acpAbiV2_default,
|
|
2333
|
+
void 0,
|
|
2334
|
+
{
|
|
2335
|
+
url: "https://acp-x402.virtuals.io"
|
|
2336
|
+
}
|
|
2337
|
+
);
|
|
2338
|
+
|
|
2339
|
+
// src/abis/wethAbi.ts
|
|
2340
|
+
var WETH_ABI = [
|
|
2341
|
+
{
|
|
2342
|
+
anonymous: false,
|
|
2343
|
+
inputs: [
|
|
2344
|
+
{ indexed: true, internalType: "address", name: "src", type: "address" },
|
|
2345
|
+
{ indexed: true, internalType: "address", name: "guy", type: "address" },
|
|
2346
|
+
{ indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
|
|
2347
|
+
],
|
|
2348
|
+
name: "Approval",
|
|
2349
|
+
type: "event"
|
|
2350
|
+
},
|
|
2351
|
+
{
|
|
2352
|
+
anonymous: false,
|
|
2353
|
+
inputs: [
|
|
2354
|
+
{ indexed: true, internalType: "address", name: "dst", type: "address" },
|
|
2355
|
+
{ indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
|
|
2356
|
+
],
|
|
2357
|
+
name: "Deposit",
|
|
2358
|
+
type: "event"
|
|
2359
|
+
},
|
|
2360
|
+
{
|
|
2361
|
+
anonymous: false,
|
|
2362
|
+
inputs: [
|
|
2363
|
+
{ indexed: true, internalType: "address", name: "src", type: "address" },
|
|
2364
|
+
{ indexed: true, internalType: "address", name: "dst", type: "address" },
|
|
2365
|
+
{ indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
|
|
2366
|
+
],
|
|
2367
|
+
name: "Transfer",
|
|
2368
|
+
type: "event"
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
anonymous: false,
|
|
2372
|
+
inputs: [
|
|
2373
|
+
{ indexed: true, internalType: "address", name: "src", type: "address" },
|
|
2374
|
+
{ indexed: false, internalType: "uint256", name: "wad", type: "uint256" }
|
|
2375
|
+
],
|
|
2376
|
+
name: "Withdrawal",
|
|
2377
|
+
type: "event"
|
|
2378
|
+
},
|
|
2379
|
+
{ payable: true, stateMutability: "payable", type: "fallback" },
|
|
2380
|
+
{
|
|
2381
|
+
constant: true,
|
|
2382
|
+
inputs: [
|
|
2383
|
+
{ internalType: "address", name: "", type: "address" },
|
|
2384
|
+
{ internalType: "address", name: "", type: "address" }
|
|
2385
|
+
],
|
|
2386
|
+
name: "allowance",
|
|
2387
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2388
|
+
payable: false,
|
|
2389
|
+
stateMutability: "view",
|
|
2390
|
+
type: "function"
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
constant: false,
|
|
2394
|
+
inputs: [
|
|
2395
|
+
{ internalType: "address", name: "guy", type: "address" },
|
|
2396
|
+
{ internalType: "uint256", name: "wad", type: "uint256" }
|
|
2397
|
+
],
|
|
2398
|
+
name: "approve",
|
|
2399
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2400
|
+
payable: false,
|
|
2401
|
+
stateMutability: "nonpayable",
|
|
2402
|
+
type: "function"
|
|
2403
|
+
},
|
|
2404
|
+
{
|
|
2405
|
+
constant: true,
|
|
2406
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
2407
|
+
name: "balanceOf",
|
|
2408
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2409
|
+
payable: false,
|
|
2410
|
+
stateMutability: "view",
|
|
2411
|
+
type: "function"
|
|
2412
|
+
},
|
|
2413
|
+
{
|
|
2414
|
+
constant: true,
|
|
2415
|
+
inputs: [],
|
|
2416
|
+
name: "decimals",
|
|
2417
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
2418
|
+
payable: false,
|
|
2419
|
+
stateMutability: "view",
|
|
2420
|
+
type: "function"
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
constant: false,
|
|
2424
|
+
inputs: [],
|
|
2425
|
+
name: "deposit",
|
|
2426
|
+
outputs: [],
|
|
2427
|
+
payable: true,
|
|
2428
|
+
stateMutability: "payable",
|
|
2429
|
+
type: "function"
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
constant: true,
|
|
2433
|
+
inputs: [],
|
|
2434
|
+
name: "name",
|
|
2435
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
2436
|
+
payable: false,
|
|
2437
|
+
stateMutability: "view",
|
|
2438
|
+
type: "function"
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
constant: true,
|
|
2442
|
+
inputs: [],
|
|
2443
|
+
name: "symbol",
|
|
2444
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
2445
|
+
payable: false,
|
|
2446
|
+
stateMutability: "view",
|
|
2447
|
+
type: "function"
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
constant: true,
|
|
2451
|
+
inputs: [],
|
|
2452
|
+
name: "totalSupply",
|
|
2453
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2454
|
+
payable: false,
|
|
2455
|
+
stateMutability: "view",
|
|
2456
|
+
type: "function"
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
constant: false,
|
|
2460
|
+
inputs: [
|
|
2461
|
+
{ internalType: "address", name: "dst", type: "address" },
|
|
2462
|
+
{ internalType: "uint256", name: "wad", type: "uint256" }
|
|
2463
|
+
],
|
|
2464
|
+
name: "transfer",
|
|
2465
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2466
|
+
payable: false,
|
|
2467
|
+
stateMutability: "nonpayable",
|
|
2468
|
+
type: "function"
|
|
2469
|
+
},
|
|
2470
|
+
{
|
|
2471
|
+
constant: false,
|
|
2472
|
+
inputs: [
|
|
2473
|
+
{ internalType: "address", name: "src", type: "address" },
|
|
2474
|
+
{ internalType: "address", name: "dst", type: "address" },
|
|
2475
|
+
{ internalType: "uint256", name: "wad", type: "uint256" }
|
|
2476
|
+
],
|
|
2477
|
+
name: "transferFrom",
|
|
2478
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2479
|
+
payable: false,
|
|
2480
|
+
stateMutability: "nonpayable",
|
|
2481
|
+
type: "function"
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
constant: false,
|
|
2485
|
+
inputs: [{ internalType: "uint256", name: "wad", type: "uint256" }],
|
|
2486
|
+
name: "withdraw",
|
|
2487
|
+
outputs: [],
|
|
2488
|
+
payable: false,
|
|
2489
|
+
stateMutability: "nonpayable",
|
|
2490
|
+
type: "function"
|
|
2491
|
+
}
|
|
2492
|
+
];
|
|
2493
|
+
var wethAbi_default = WETH_ABI;
|
|
2494
|
+
|
|
2495
|
+
// src/abis/fiatTokenV2Abi.ts
|
|
2496
|
+
var FIAT_TOKEN_V2_ABI = [
|
|
2497
|
+
{
|
|
2498
|
+
anonymous: false,
|
|
2499
|
+
inputs: [
|
|
2500
|
+
{
|
|
2501
|
+
indexed: true,
|
|
2502
|
+
internalType: "address",
|
|
2503
|
+
name: "owner",
|
|
2504
|
+
type: "address"
|
|
2505
|
+
},
|
|
2506
|
+
{
|
|
2507
|
+
indexed: true,
|
|
2508
|
+
internalType: "address",
|
|
2509
|
+
name: "spender",
|
|
2510
|
+
type: "address"
|
|
2511
|
+
},
|
|
2512
|
+
{
|
|
2513
|
+
indexed: false,
|
|
2514
|
+
internalType: "uint256",
|
|
2515
|
+
name: "value",
|
|
2516
|
+
type: "uint256"
|
|
2517
|
+
}
|
|
2518
|
+
],
|
|
2519
|
+
name: "Approval",
|
|
2520
|
+
type: "event"
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
anonymous: false,
|
|
2524
|
+
inputs: [
|
|
2525
|
+
{
|
|
2526
|
+
indexed: true,
|
|
2527
|
+
internalType: "address",
|
|
2528
|
+
name: "authorizer",
|
|
2529
|
+
type: "address"
|
|
2530
|
+
},
|
|
2531
|
+
{
|
|
2532
|
+
indexed: true,
|
|
2533
|
+
internalType: "bytes32",
|
|
2534
|
+
name: "nonce",
|
|
2535
|
+
type: "bytes32"
|
|
2536
|
+
}
|
|
2537
|
+
],
|
|
2538
|
+
name: "AuthorizationCanceled",
|
|
2539
|
+
type: "event"
|
|
2540
|
+
},
|
|
2541
|
+
{
|
|
2542
|
+
anonymous: false,
|
|
2543
|
+
inputs: [
|
|
2544
|
+
{
|
|
2545
|
+
indexed: true,
|
|
2546
|
+
internalType: "address",
|
|
2547
|
+
name: "authorizer",
|
|
2548
|
+
type: "address"
|
|
2549
|
+
},
|
|
2550
|
+
{
|
|
2551
|
+
indexed: true,
|
|
2552
|
+
internalType: "bytes32",
|
|
2553
|
+
name: "nonce",
|
|
2554
|
+
type: "bytes32"
|
|
2555
|
+
}
|
|
2556
|
+
],
|
|
2557
|
+
name: "AuthorizationUsed",
|
|
2558
|
+
type: "event"
|
|
2559
|
+
},
|
|
2560
|
+
{
|
|
2561
|
+
anonymous: false,
|
|
2562
|
+
inputs: [
|
|
2563
|
+
{
|
|
2564
|
+
indexed: true,
|
|
2565
|
+
internalType: "address",
|
|
2566
|
+
name: "_account",
|
|
2567
|
+
type: "address"
|
|
2568
|
+
}
|
|
2569
|
+
],
|
|
2570
|
+
name: "Blacklisted",
|
|
2571
|
+
type: "event"
|
|
2572
|
+
},
|
|
2573
|
+
{
|
|
2574
|
+
anonymous: false,
|
|
2575
|
+
inputs: [
|
|
2576
|
+
{
|
|
2577
|
+
indexed: true,
|
|
2578
|
+
internalType: "address",
|
|
2579
|
+
name: "newBlacklister",
|
|
2580
|
+
type: "address"
|
|
2581
|
+
}
|
|
2582
|
+
],
|
|
2583
|
+
name: "BlacklisterChanged",
|
|
2584
|
+
type: "event"
|
|
2585
|
+
},
|
|
2586
|
+
{
|
|
2587
|
+
anonymous: false,
|
|
2588
|
+
inputs: [
|
|
2589
|
+
{
|
|
2590
|
+
indexed: true,
|
|
2591
|
+
internalType: "address",
|
|
2592
|
+
name: "burner",
|
|
2593
|
+
type: "address"
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
indexed: false,
|
|
2597
|
+
internalType: "uint256",
|
|
2598
|
+
name: "amount",
|
|
2599
|
+
type: "uint256"
|
|
2600
|
+
}
|
|
2601
|
+
],
|
|
2602
|
+
name: "Burn",
|
|
2603
|
+
type: "event"
|
|
2604
|
+
},
|
|
2605
|
+
{
|
|
2606
|
+
anonymous: false,
|
|
2607
|
+
inputs: [
|
|
2608
|
+
{
|
|
2609
|
+
indexed: true,
|
|
2610
|
+
internalType: "address",
|
|
2611
|
+
name: "newMasterMinter",
|
|
2612
|
+
type: "address"
|
|
2613
|
+
}
|
|
2614
|
+
],
|
|
2615
|
+
name: "MasterMinterChanged",
|
|
2616
|
+
type: "event"
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
anonymous: false,
|
|
2620
|
+
inputs: [
|
|
2621
|
+
{
|
|
2622
|
+
indexed: true,
|
|
2623
|
+
internalType: "address",
|
|
2624
|
+
name: "minter",
|
|
2625
|
+
type: "address"
|
|
2626
|
+
},
|
|
2627
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
2628
|
+
{
|
|
2629
|
+
indexed: false,
|
|
2630
|
+
internalType: "uint256",
|
|
2631
|
+
name: "amount",
|
|
2632
|
+
type: "uint256"
|
|
2633
|
+
}
|
|
2634
|
+
],
|
|
2635
|
+
name: "Mint",
|
|
2636
|
+
type: "event"
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
anonymous: false,
|
|
2640
|
+
inputs: [
|
|
2641
|
+
{
|
|
2642
|
+
indexed: true,
|
|
2643
|
+
internalType: "address",
|
|
2644
|
+
name: "minter",
|
|
2645
|
+
type: "address"
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
indexed: false,
|
|
2649
|
+
internalType: "uint256",
|
|
2650
|
+
name: "minterAllowedAmount",
|
|
2651
|
+
type: "uint256"
|
|
2652
|
+
}
|
|
2653
|
+
],
|
|
2654
|
+
name: "MinterConfigured",
|
|
2655
|
+
type: "event"
|
|
2656
|
+
},
|
|
2657
|
+
{
|
|
2658
|
+
anonymous: false,
|
|
2659
|
+
inputs: [
|
|
2660
|
+
{
|
|
2661
|
+
indexed: true,
|
|
2662
|
+
internalType: "address",
|
|
2663
|
+
name: "oldMinter",
|
|
2664
|
+
type: "address"
|
|
2665
|
+
}
|
|
2666
|
+
],
|
|
2667
|
+
name: "MinterRemoved",
|
|
2668
|
+
type: "event"
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
anonymous: false,
|
|
2672
|
+
inputs: [
|
|
2673
|
+
{
|
|
2674
|
+
indexed: false,
|
|
2675
|
+
internalType: "address",
|
|
2676
|
+
name: "previousOwner",
|
|
2677
|
+
type: "address"
|
|
2678
|
+
},
|
|
2679
|
+
{
|
|
2680
|
+
indexed: false,
|
|
2681
|
+
internalType: "address",
|
|
2682
|
+
name: "newOwner",
|
|
2683
|
+
type: "address"
|
|
2684
|
+
}
|
|
2685
|
+
],
|
|
2686
|
+
name: "OwnershipTransferred",
|
|
2687
|
+
type: "event"
|
|
2688
|
+
},
|
|
2689
|
+
{ anonymous: false, inputs: [], name: "Pause", type: "event" },
|
|
2690
|
+
{
|
|
2691
|
+
anonymous: false,
|
|
2692
|
+
inputs: [
|
|
2693
|
+
{
|
|
2694
|
+
indexed: true,
|
|
2695
|
+
internalType: "address",
|
|
2696
|
+
name: "newAddress",
|
|
2697
|
+
type: "address"
|
|
2698
|
+
}
|
|
2699
|
+
],
|
|
2700
|
+
name: "PauserChanged",
|
|
2701
|
+
type: "event"
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
anonymous: false,
|
|
2705
|
+
inputs: [
|
|
2706
|
+
{
|
|
2707
|
+
indexed: true,
|
|
2708
|
+
internalType: "address",
|
|
2709
|
+
name: "newRescuer",
|
|
2710
|
+
type: "address"
|
|
2711
|
+
}
|
|
2712
|
+
],
|
|
2713
|
+
name: "RescuerChanged",
|
|
2714
|
+
type: "event"
|
|
2715
|
+
},
|
|
2716
|
+
{
|
|
2717
|
+
anonymous: false,
|
|
2718
|
+
inputs: [
|
|
2719
|
+
{ indexed: true, internalType: "address", name: "from", type: "address" },
|
|
2720
|
+
{ indexed: true, internalType: "address", name: "to", type: "address" },
|
|
2721
|
+
{
|
|
2722
|
+
indexed: false,
|
|
2723
|
+
internalType: "uint256",
|
|
2724
|
+
name: "value",
|
|
2725
|
+
type: "uint256"
|
|
2726
|
+
}
|
|
2727
|
+
],
|
|
2728
|
+
name: "Transfer",
|
|
2729
|
+
type: "event"
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
anonymous: false,
|
|
2733
|
+
inputs: [
|
|
2734
|
+
{
|
|
2735
|
+
indexed: true,
|
|
2736
|
+
internalType: "address",
|
|
2737
|
+
name: "_account",
|
|
2738
|
+
type: "address"
|
|
2739
|
+
}
|
|
2740
|
+
],
|
|
2741
|
+
name: "UnBlacklisted",
|
|
2742
|
+
type: "event"
|
|
2743
|
+
},
|
|
2744
|
+
{ anonymous: false, inputs: [], name: "Unpause", type: "event" },
|
|
2745
|
+
{
|
|
2746
|
+
inputs: [],
|
|
2747
|
+
name: "CANCEL_AUTHORIZATION_TYPEHASH",
|
|
2748
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2749
|
+
stateMutability: "view",
|
|
2750
|
+
type: "function"
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
inputs: [],
|
|
2754
|
+
name: "DOMAIN_SEPARATOR",
|
|
2755
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2756
|
+
stateMutability: "view",
|
|
2757
|
+
type: "function"
|
|
2758
|
+
},
|
|
2759
|
+
{
|
|
2760
|
+
inputs: [],
|
|
2761
|
+
name: "PERMIT_TYPEHASH",
|
|
2762
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2763
|
+
stateMutability: "view",
|
|
2764
|
+
type: "function"
|
|
2765
|
+
},
|
|
2766
|
+
{
|
|
2767
|
+
inputs: [],
|
|
2768
|
+
name: "RECEIVE_WITH_AUTHORIZATION_TYPEHASH",
|
|
2769
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2770
|
+
stateMutability: "view",
|
|
2771
|
+
type: "function"
|
|
2772
|
+
},
|
|
2773
|
+
{
|
|
2774
|
+
inputs: [],
|
|
2775
|
+
name: "TRANSFER_WITH_AUTHORIZATION_TYPEHASH",
|
|
2776
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
2777
|
+
stateMutability: "view",
|
|
2778
|
+
type: "function"
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
inputs: [
|
|
2782
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
2783
|
+
{ internalType: "address", name: "spender", type: "address" }
|
|
2784
|
+
],
|
|
2785
|
+
name: "allowance",
|
|
2786
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2787
|
+
stateMutability: "view",
|
|
2788
|
+
type: "function"
|
|
2789
|
+
},
|
|
2790
|
+
{
|
|
2791
|
+
inputs: [
|
|
2792
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
2793
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
|
2794
|
+
],
|
|
2795
|
+
name: "approve",
|
|
2796
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2797
|
+
stateMutability: "nonpayable",
|
|
2798
|
+
type: "function"
|
|
2799
|
+
},
|
|
2800
|
+
{
|
|
2801
|
+
inputs: [
|
|
2802
|
+
{ internalType: "address", name: "authorizer", type: "address" },
|
|
2803
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" }
|
|
2804
|
+
],
|
|
2805
|
+
name: "authorizationState",
|
|
2806
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2807
|
+
stateMutability: "view",
|
|
2808
|
+
type: "function"
|
|
2809
|
+
},
|
|
2810
|
+
{
|
|
2811
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
2812
|
+
name: "balanceOf",
|
|
2813
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2814
|
+
stateMutability: "view",
|
|
2815
|
+
type: "function"
|
|
2816
|
+
},
|
|
2817
|
+
{
|
|
2818
|
+
inputs: [{ internalType: "address", name: "_account", type: "address" }],
|
|
2819
|
+
name: "blacklist",
|
|
2820
|
+
outputs: [],
|
|
2821
|
+
stateMutability: "nonpayable",
|
|
2822
|
+
type: "function"
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
inputs: [],
|
|
2826
|
+
name: "blacklister",
|
|
2827
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
2828
|
+
stateMutability: "view",
|
|
2829
|
+
type: "function"
|
|
2830
|
+
},
|
|
2831
|
+
{
|
|
2832
|
+
inputs: [{ internalType: "uint256", name: "_amount", type: "uint256" }],
|
|
2833
|
+
name: "burn",
|
|
2834
|
+
outputs: [],
|
|
2835
|
+
stateMutability: "nonpayable",
|
|
2836
|
+
type: "function"
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
inputs: [
|
|
2840
|
+
{ internalType: "address", name: "authorizer", type: "address" },
|
|
2841
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" },
|
|
2842
|
+
{ internalType: "uint8", name: "v", type: "uint8" },
|
|
2843
|
+
{ internalType: "bytes32", name: "r", type: "bytes32" },
|
|
2844
|
+
{ internalType: "bytes32", name: "s", type: "bytes32" }
|
|
2845
|
+
],
|
|
2846
|
+
name: "cancelAuthorization",
|
|
2847
|
+
outputs: [],
|
|
2848
|
+
stateMutability: "nonpayable",
|
|
2849
|
+
type: "function"
|
|
2850
|
+
},
|
|
2851
|
+
{
|
|
2852
|
+
inputs: [
|
|
2853
|
+
{ internalType: "address", name: "authorizer", type: "address" },
|
|
2854
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" },
|
|
2855
|
+
{ internalType: "bytes", name: "signature", type: "bytes" }
|
|
2856
|
+
],
|
|
2857
|
+
name: "cancelAuthorization",
|
|
2858
|
+
outputs: [],
|
|
2859
|
+
stateMutability: "nonpayable",
|
|
2860
|
+
type: "function"
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
inputs: [
|
|
2864
|
+
{ internalType: "address", name: "minter", type: "address" },
|
|
2865
|
+
{ internalType: "uint256", name: "minterAllowedAmount", type: "uint256" }
|
|
2866
|
+
],
|
|
2867
|
+
name: "configureMinter",
|
|
2868
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2869
|
+
stateMutability: "nonpayable",
|
|
2870
|
+
type: "function"
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
inputs: [],
|
|
2874
|
+
name: "currency",
|
|
2875
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
2876
|
+
stateMutability: "view",
|
|
2877
|
+
type: "function"
|
|
2878
|
+
},
|
|
2879
|
+
{
|
|
2880
|
+
inputs: [],
|
|
2881
|
+
name: "decimals",
|
|
2882
|
+
outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
|
|
2883
|
+
stateMutability: "view",
|
|
2884
|
+
type: "function"
|
|
2885
|
+
},
|
|
2886
|
+
{
|
|
2887
|
+
inputs: [
|
|
2888
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
2889
|
+
{ internalType: "uint256", name: "decrement", type: "uint256" }
|
|
2890
|
+
],
|
|
2891
|
+
name: "decreaseAllowance",
|
|
2892
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2893
|
+
stateMutability: "nonpayable",
|
|
2654
2894
|
type: "function"
|
|
2655
2895
|
},
|
|
2656
2896
|
{
|
|
2657
2897
|
inputs: [
|
|
2658
|
-
{ internalType: "
|
|
2659
|
-
{ internalType: "
|
|
2898
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
2899
|
+
{ internalType: "uint256", name: "increment", type: "uint256" }
|
|
2660
2900
|
],
|
|
2661
|
-
name: "
|
|
2662
|
-
outputs: [],
|
|
2901
|
+
name: "increaseAllowance",
|
|
2902
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2663
2903
|
stateMutability: "nonpayable",
|
|
2664
2904
|
type: "function"
|
|
2665
2905
|
},
|
|
2666
2906
|
{
|
|
2667
2907
|
inputs: [
|
|
2668
|
-
{ internalType: "
|
|
2669
|
-
{ internalType: "
|
|
2908
|
+
{ internalType: "string", name: "tokenName", type: "string" },
|
|
2909
|
+
{ internalType: "string", name: "tokenSymbol", type: "string" },
|
|
2910
|
+
{ internalType: "string", name: "tokenCurrency", type: "string" },
|
|
2911
|
+
{ internalType: "uint8", name: "tokenDecimals", type: "uint8" },
|
|
2912
|
+
{ internalType: "address", name: "newMasterMinter", type: "address" },
|
|
2913
|
+
{ internalType: "address", name: "newPauser", type: "address" },
|
|
2914
|
+
{ internalType: "address", name: "newBlacklister", type: "address" },
|
|
2915
|
+
{ internalType: "address", name: "newOwner", type: "address" }
|
|
2670
2916
|
],
|
|
2671
|
-
name: "
|
|
2917
|
+
name: "initialize",
|
|
2672
2918
|
outputs: [],
|
|
2673
2919
|
stateMutability: "nonpayable",
|
|
2674
2920
|
type: "function"
|
|
2675
2921
|
},
|
|
2676
2922
|
{
|
|
2677
|
-
inputs: [
|
|
2678
|
-
|
|
2679
|
-
{ internalType: "uint256", name: "amount", type: "uint256" }
|
|
2680
|
-
],
|
|
2681
|
-
name: "setBudget",
|
|
2923
|
+
inputs: [{ internalType: "string", name: "newName", type: "string" }],
|
|
2924
|
+
name: "initializeV2",
|
|
2682
2925
|
outputs: [],
|
|
2683
2926
|
stateMutability: "nonpayable",
|
|
2684
2927
|
type: "function"
|
|
2685
2928
|
},
|
|
2686
2929
|
{
|
|
2687
2930
|
inputs: [
|
|
2688
|
-
{ internalType: "
|
|
2689
|
-
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
2690
|
-
{ internalType: "address", name: "paymentToken", type: "address" }
|
|
2931
|
+
{ internalType: "address", name: "lostAndFound", type: "address" }
|
|
2691
2932
|
],
|
|
2692
|
-
name: "
|
|
2933
|
+
name: "initializeV2_1",
|
|
2693
2934
|
outputs: [],
|
|
2694
2935
|
stateMutability: "nonpayable",
|
|
2695
2936
|
type: "function"
|
|
2696
2937
|
},
|
|
2697
2938
|
{
|
|
2698
2939
|
inputs: [
|
|
2699
|
-
{
|
|
2700
|
-
|
|
2701
|
-
|
|
2940
|
+
{
|
|
2941
|
+
internalType: "address[]",
|
|
2942
|
+
name: "accountsToBlacklist",
|
|
2943
|
+
type: "address[]"
|
|
2944
|
+
},
|
|
2945
|
+
{ internalType: "string", name: "newSymbol", type: "string" }
|
|
2702
2946
|
],
|
|
2703
|
-
name: "
|
|
2947
|
+
name: "initializeV2_2",
|
|
2704
2948
|
outputs: [],
|
|
2705
2949
|
stateMutability: "nonpayable",
|
|
2706
2950
|
type: "function"
|
|
2707
2951
|
},
|
|
2708
2952
|
{
|
|
2709
|
-
inputs: [{ internalType: "
|
|
2710
|
-
name: "
|
|
2953
|
+
inputs: [{ internalType: "address", name: "_account", type: "address" }],
|
|
2954
|
+
name: "isBlacklisted",
|
|
2955
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2956
|
+
stateMutability: "view",
|
|
2957
|
+
type: "function"
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
2961
|
+
name: "isMinter",
|
|
2711
2962
|
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2712
2963
|
stateMutability: "view",
|
|
2713
2964
|
type: "function"
|
|
2714
2965
|
},
|
|
2715
2966
|
{
|
|
2716
2967
|
inputs: [],
|
|
2717
|
-
name: "
|
|
2718
|
-
outputs: [],
|
|
2719
|
-
stateMutability: "
|
|
2968
|
+
name: "masterMinter",
|
|
2969
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
2970
|
+
stateMutability: "view",
|
|
2720
2971
|
type: "function"
|
|
2721
2972
|
},
|
|
2722
2973
|
{
|
|
2723
2974
|
inputs: [
|
|
2724
|
-
{ internalType: "
|
|
2725
|
-
{ internalType: "
|
|
2975
|
+
{ internalType: "address", name: "_to", type: "address" },
|
|
2976
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" }
|
|
2726
2977
|
],
|
|
2727
|
-
name: "
|
|
2978
|
+
name: "mint",
|
|
2979
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2980
|
+
stateMutability: "nonpayable",
|
|
2981
|
+
type: "function"
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
inputs: [{ internalType: "address", name: "minter", type: "address" }],
|
|
2985
|
+
name: "minterAllowance",
|
|
2986
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2987
|
+
stateMutability: "view",
|
|
2988
|
+
type: "function"
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
inputs: [],
|
|
2992
|
+
name: "name",
|
|
2993
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
2994
|
+
stateMutability: "view",
|
|
2995
|
+
type: "function"
|
|
2996
|
+
},
|
|
2997
|
+
{
|
|
2998
|
+
inputs: [{ internalType: "address", name: "owner", type: "address" }],
|
|
2999
|
+
name: "nonces",
|
|
3000
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
3001
|
+
stateMutability: "view",
|
|
3002
|
+
type: "function"
|
|
3003
|
+
},
|
|
3004
|
+
{
|
|
3005
|
+
inputs: [],
|
|
3006
|
+
name: "owner",
|
|
3007
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
3008
|
+
stateMutability: "view",
|
|
3009
|
+
type: "function"
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
inputs: [],
|
|
3013
|
+
name: "pause",
|
|
2728
3014
|
outputs: [],
|
|
2729
3015
|
stateMutability: "nonpayable",
|
|
2730
3016
|
type: "function"
|
|
2731
3017
|
},
|
|
3018
|
+
{
|
|
3019
|
+
inputs: [],
|
|
3020
|
+
name: "paused",
|
|
3021
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
3022
|
+
stateMutability: "view",
|
|
3023
|
+
type: "function"
|
|
3024
|
+
},
|
|
3025
|
+
{
|
|
3026
|
+
inputs: [],
|
|
3027
|
+
name: "pauser",
|
|
3028
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
3029
|
+
stateMutability: "view",
|
|
3030
|
+
type: "function"
|
|
3031
|
+
},
|
|
2732
3032
|
{
|
|
2733
3033
|
inputs: [
|
|
2734
|
-
{ internalType: "
|
|
3034
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
3035
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
3036
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
3037
|
+
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
3038
|
+
{ internalType: "bytes", name: "signature", type: "bytes" }
|
|
2735
3039
|
],
|
|
2736
|
-
name: "
|
|
3040
|
+
name: "permit",
|
|
2737
3041
|
outputs: [],
|
|
2738
3042
|
stateMutability: "nonpayable",
|
|
2739
3043
|
type: "function"
|
|
2740
3044
|
},
|
|
2741
3045
|
{
|
|
2742
3046
|
inputs: [
|
|
2743
|
-
{ internalType: "
|
|
2744
|
-
{ internalType: "address", name: "
|
|
3047
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
3048
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
3049
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
3050
|
+
{ internalType: "uint256", name: "deadline", type: "uint256" },
|
|
3051
|
+
{ internalType: "uint8", name: "v", type: "uint8" },
|
|
3052
|
+
{ internalType: "bytes32", name: "r", type: "bytes32" },
|
|
3053
|
+
{ internalType: "bytes32", name: "s", type: "bytes32" }
|
|
2745
3054
|
],
|
|
2746
|
-
name: "
|
|
3055
|
+
name: "permit",
|
|
2747
3056
|
outputs: [],
|
|
2748
3057
|
stateMutability: "nonpayable",
|
|
2749
3058
|
type: "function"
|
|
2750
3059
|
},
|
|
2751
3060
|
{
|
|
2752
3061
|
inputs: [
|
|
2753
|
-
{ internalType: "
|
|
2754
|
-
{ internalType: "address", name: "
|
|
2755
|
-
{ internalType: "uint256", name: "
|
|
3062
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
3063
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3064
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
3065
|
+
{ internalType: "uint256", name: "validAfter", type: "uint256" },
|
|
3066
|
+
{ internalType: "uint256", name: "validBefore", type: "uint256" },
|
|
3067
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" },
|
|
3068
|
+
{ internalType: "bytes", name: "signature", type: "bytes" }
|
|
2756
3069
|
],
|
|
2757
|
-
name: "
|
|
3070
|
+
name: "receiveWithAuthorization",
|
|
2758
3071
|
outputs: [],
|
|
2759
3072
|
stateMutability: "nonpayable",
|
|
2760
3073
|
type: "function"
|
|
2761
3074
|
},
|
|
2762
3075
|
{
|
|
2763
3076
|
inputs: [
|
|
2764
|
-
{ internalType: "address", name: "
|
|
2765
|
-
{ internalType: "
|
|
3077
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
3078
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3079
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
3080
|
+
{ internalType: "uint256", name: "validAfter", type: "uint256" },
|
|
3081
|
+
{ internalType: "uint256", name: "validBefore", type: "uint256" },
|
|
3082
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" },
|
|
3083
|
+
{ internalType: "uint8", name: "v", type: "uint8" },
|
|
3084
|
+
{ internalType: "bytes32", name: "r", type: "bytes32" },
|
|
3085
|
+
{ internalType: "bytes32", name: "s", type: "bytes32" }
|
|
2766
3086
|
],
|
|
2767
|
-
name: "
|
|
3087
|
+
name: "receiveWithAuthorization",
|
|
2768
3088
|
outputs: [],
|
|
2769
|
-
stateMutability: "
|
|
3089
|
+
stateMutability: "nonpayable",
|
|
2770
3090
|
type: "function"
|
|
2771
|
-
}
|
|
2772
|
-
];
|
|
2773
|
-
var acpAbiV2_default = ACP_V2_ABI;
|
|
2774
|
-
|
|
2775
|
-
// src/configs/acpConfigs.ts
|
|
2776
|
-
var AcpContractConfig2 = class {
|
|
2777
|
-
constructor(chain, contractAddress, baseFare, alchemyRpcUrl, acpUrl, abi, rpcEndpoint) {
|
|
2778
|
-
this.chain = chain;
|
|
2779
|
-
this.contractAddress = contractAddress;
|
|
2780
|
-
this.baseFare = baseFare;
|
|
2781
|
-
this.alchemyRpcUrl = alchemyRpcUrl;
|
|
2782
|
-
this.acpUrl = acpUrl;
|
|
2783
|
-
this.abi = abi;
|
|
2784
|
-
this.rpcEndpoint = rpcEndpoint;
|
|
2785
|
-
}
|
|
2786
|
-
};
|
|
2787
|
-
var baseSepoliaAcpConfig = new AcpContractConfig2(
|
|
2788
|
-
baseSepolia,
|
|
2789
|
-
"0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
|
|
2790
|
-
new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
|
|
2791
|
-
"https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
2792
|
-
"https://acpx.virtuals.gg",
|
|
2793
|
-
acpAbi_default
|
|
2794
|
-
);
|
|
2795
|
-
var baseSepoliaAcpConfigV2 = new AcpContractConfig2(
|
|
2796
|
-
baseSepolia,
|
|
2797
|
-
"0xdf54E6Ed6cD1d0632d973ADECf96597b7e87893c",
|
|
2798
|
-
new Fare("0x036CbD53842c5426634e7929541eC2318f3dCF7e", 6),
|
|
2799
|
-
"https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
2800
|
-
"https://acpx.virtuals.gg",
|
|
2801
|
-
acpAbiV2_default
|
|
2802
|
-
);
|
|
2803
|
-
var baseAcpConfig = new AcpContractConfig2(
|
|
2804
|
-
base,
|
|
2805
|
-
"0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
|
|
2806
|
-
new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
|
|
2807
|
-
"https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
2808
|
-
"https://acpx.virtuals.io",
|
|
2809
|
-
acpAbi_default
|
|
2810
|
-
);
|
|
2811
|
-
var baseAcpConfigV2 = new AcpContractConfig2(
|
|
2812
|
-
base,
|
|
2813
|
-
"0xa6C9BA866992cfD7fd6460ba912bfa405adA9df0",
|
|
2814
|
-
new Fare("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", 6),
|
|
2815
|
-
"https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
2816
|
-
"https://acpx.virtuals.io",
|
|
2817
|
-
acpAbiV2_default
|
|
2818
|
-
);
|
|
2819
|
-
|
|
2820
|
-
// src/abis/wethAbi.ts
|
|
2821
|
-
var WETH_ABI = [
|
|
3091
|
+
},
|
|
2822
3092
|
{
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
],
|
|
2829
|
-
name: "Approval",
|
|
2830
|
-
type: "event"
|
|
3093
|
+
inputs: [{ internalType: "address", name: "minter", type: "address" }],
|
|
3094
|
+
name: "removeMinter",
|
|
3095
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
3096
|
+
stateMutability: "nonpayable",
|
|
3097
|
+
type: "function"
|
|
2831
3098
|
},
|
|
2832
3099
|
{
|
|
2833
|
-
anonymous: false,
|
|
2834
3100
|
inputs: [
|
|
2835
|
-
{
|
|
2836
|
-
|
|
3101
|
+
{
|
|
3102
|
+
internalType: "contract IERC20",
|
|
3103
|
+
name: "tokenContract",
|
|
3104
|
+
type: "address"
|
|
3105
|
+
},
|
|
3106
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3107
|
+
{ internalType: "uint256", name: "amount", type: "uint256" }
|
|
2837
3108
|
],
|
|
2838
|
-
name: "
|
|
2839
|
-
|
|
3109
|
+
name: "rescueERC20",
|
|
3110
|
+
outputs: [],
|
|
3111
|
+
stateMutability: "nonpayable",
|
|
3112
|
+
type: "function"
|
|
2840
3113
|
},
|
|
2841
3114
|
{
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
],
|
|
2848
|
-
name: "Transfer",
|
|
2849
|
-
type: "event"
|
|
3115
|
+
inputs: [],
|
|
3116
|
+
name: "rescuer",
|
|
3117
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
3118
|
+
stateMutability: "view",
|
|
3119
|
+
type: "function"
|
|
2850
3120
|
},
|
|
2851
3121
|
{
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
name: "Withdrawal",
|
|
2858
|
-
type: "event"
|
|
3122
|
+
inputs: [],
|
|
3123
|
+
name: "symbol",
|
|
3124
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
3125
|
+
stateMutability: "view",
|
|
3126
|
+
type: "function"
|
|
2859
3127
|
},
|
|
2860
|
-
{ payable: true, stateMutability: "payable", type: "fallback" },
|
|
2861
3128
|
{
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
{ internalType: "address", name: "", type: "address" },
|
|
2865
|
-
{ internalType: "address", name: "", type: "address" }
|
|
2866
|
-
],
|
|
2867
|
-
name: "allowance",
|
|
3129
|
+
inputs: [],
|
|
3130
|
+
name: "totalSupply",
|
|
2868
3131
|
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
2869
|
-
payable: false,
|
|
2870
3132
|
stateMutability: "view",
|
|
2871
3133
|
type: "function"
|
|
2872
3134
|
},
|
|
2873
3135
|
{
|
|
2874
|
-
constant: false,
|
|
2875
3136
|
inputs: [
|
|
2876
|
-
{ internalType: "address", name: "
|
|
2877
|
-
{ internalType: "uint256", name: "
|
|
3137
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3138
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
|
2878
3139
|
],
|
|
2879
|
-
name: "
|
|
3140
|
+
name: "transfer",
|
|
2880
3141
|
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
2881
|
-
payable: false,
|
|
2882
3142
|
stateMutability: "nonpayable",
|
|
2883
3143
|
type: "function"
|
|
2884
3144
|
},
|
|
2885
3145
|
{
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
3146
|
+
inputs: [
|
|
3147
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
3148
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3149
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
|
3150
|
+
],
|
|
3151
|
+
name: "transferFrom",
|
|
3152
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
3153
|
+
stateMutability: "nonpayable",
|
|
2892
3154
|
type: "function"
|
|
2893
3155
|
},
|
|
2894
3156
|
{
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
payable: false,
|
|
2900
|
-
stateMutability: "view",
|
|
3157
|
+
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
3158
|
+
name: "transferOwnership",
|
|
3159
|
+
outputs: [],
|
|
3160
|
+
stateMutability: "nonpayable",
|
|
2901
3161
|
type: "function"
|
|
2902
3162
|
},
|
|
2903
3163
|
{
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
3164
|
+
inputs: [
|
|
3165
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
3166
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3167
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
3168
|
+
{ internalType: "uint256", name: "validAfter", type: "uint256" },
|
|
3169
|
+
{ internalType: "uint256", name: "validBefore", type: "uint256" },
|
|
3170
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" },
|
|
3171
|
+
{ internalType: "bytes", name: "signature", type: "bytes" }
|
|
3172
|
+
],
|
|
3173
|
+
name: "transferWithAuthorization",
|
|
2907
3174
|
outputs: [],
|
|
2908
|
-
|
|
2909
|
-
stateMutability: "payable",
|
|
3175
|
+
stateMutability: "nonpayable",
|
|
2910
3176
|
type: "function"
|
|
2911
3177
|
},
|
|
2912
3178
|
{
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
3179
|
+
inputs: [
|
|
3180
|
+
{ internalType: "address", name: "from", type: "address" },
|
|
3181
|
+
{ internalType: "address", name: "to", type: "address" },
|
|
3182
|
+
{ internalType: "uint256", name: "value", type: "uint256" },
|
|
3183
|
+
{ internalType: "uint256", name: "validAfter", type: "uint256" },
|
|
3184
|
+
{ internalType: "uint256", name: "validBefore", type: "uint256" },
|
|
3185
|
+
{ internalType: "bytes32", name: "nonce", type: "bytes32" },
|
|
3186
|
+
{ internalType: "uint8", name: "v", type: "uint8" },
|
|
3187
|
+
{ internalType: "bytes32", name: "r", type: "bytes32" },
|
|
3188
|
+
{ internalType: "bytes32", name: "s", type: "bytes32" }
|
|
3189
|
+
],
|
|
3190
|
+
name: "transferWithAuthorization",
|
|
3191
|
+
outputs: [],
|
|
3192
|
+
stateMutability: "nonpayable",
|
|
2919
3193
|
type: "function"
|
|
2920
3194
|
},
|
|
2921
3195
|
{
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
payable: false,
|
|
2927
|
-
stateMutability: "view",
|
|
3196
|
+
inputs: [{ internalType: "address", name: "_account", type: "address" }],
|
|
3197
|
+
name: "unBlacklist",
|
|
3198
|
+
outputs: [],
|
|
3199
|
+
stateMutability: "nonpayable",
|
|
2928
3200
|
type: "function"
|
|
2929
3201
|
},
|
|
2930
3202
|
{
|
|
2931
|
-
constant: true,
|
|
2932
3203
|
inputs: [],
|
|
2933
|
-
name: "
|
|
2934
|
-
outputs: [
|
|
2935
|
-
|
|
2936
|
-
stateMutability: "view",
|
|
3204
|
+
name: "unpause",
|
|
3205
|
+
outputs: [],
|
|
3206
|
+
stateMutability: "nonpayable",
|
|
2937
3207
|
type: "function"
|
|
2938
3208
|
},
|
|
2939
3209
|
{
|
|
2940
|
-
constant: false,
|
|
2941
3210
|
inputs: [
|
|
2942
|
-
{ internalType: "address", name: "
|
|
2943
|
-
{ internalType: "uint256", name: "wad", type: "uint256" }
|
|
3211
|
+
{ internalType: "address", name: "_newBlacklister", type: "address" }
|
|
2944
3212
|
],
|
|
2945
|
-
name: "
|
|
2946
|
-
outputs: [
|
|
2947
|
-
payable: false,
|
|
3213
|
+
name: "updateBlacklister",
|
|
3214
|
+
outputs: [],
|
|
2948
3215
|
stateMutability: "nonpayable",
|
|
2949
3216
|
type: "function"
|
|
2950
3217
|
},
|
|
2951
3218
|
{
|
|
2952
|
-
constant: false,
|
|
2953
3219
|
inputs: [
|
|
2954
|
-
{ internalType: "address", name: "
|
|
2955
|
-
{ internalType: "address", name: "dst", type: "address" },
|
|
2956
|
-
{ internalType: "uint256", name: "wad", type: "uint256" }
|
|
3220
|
+
{ internalType: "address", name: "_newMasterMinter", type: "address" }
|
|
2957
3221
|
],
|
|
2958
|
-
name: "
|
|
2959
|
-
outputs: [
|
|
2960
|
-
payable: false,
|
|
3222
|
+
name: "updateMasterMinter",
|
|
3223
|
+
outputs: [],
|
|
2961
3224
|
stateMutability: "nonpayable",
|
|
2962
3225
|
type: "function"
|
|
2963
3226
|
},
|
|
2964
3227
|
{
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
3228
|
+
inputs: [{ internalType: "address", name: "_newPauser", type: "address" }],
|
|
3229
|
+
name: "updatePauser",
|
|
3230
|
+
outputs: [],
|
|
3231
|
+
stateMutability: "nonpayable",
|
|
3232
|
+
type: "function"
|
|
3233
|
+
},
|
|
3234
|
+
{
|
|
3235
|
+
inputs: [{ internalType: "address", name: "newRescuer", type: "address" }],
|
|
3236
|
+
name: "updateRescuer",
|
|
2968
3237
|
outputs: [],
|
|
2969
|
-
payable: false,
|
|
2970
3238
|
stateMutability: "nonpayable",
|
|
2971
3239
|
type: "function"
|
|
3240
|
+
},
|
|
3241
|
+
{
|
|
3242
|
+
inputs: [],
|
|
3243
|
+
name: "version",
|
|
3244
|
+
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
3245
|
+
stateMutability: "pure",
|
|
3246
|
+
type: "function"
|
|
2972
3247
|
}
|
|
2973
3248
|
];
|
|
2974
|
-
var
|
|
3249
|
+
var fiatTokenV2Abi_default = FIAT_TOKEN_V2_ABI;
|
|
2975
3250
|
|
|
2976
3251
|
// src/contractClients/baseAcpContractClient.ts
|
|
2977
3252
|
var MemoType = /* @__PURE__ */ ((MemoType3) => {
|
|
@@ -3010,15 +3285,19 @@ var BaseAcpContractClient = class {
|
|
|
3010
3285
|
);
|
|
3011
3286
|
const signature = toEventSignature(jobCreated);
|
|
3012
3287
|
this.jobCreatedSignature = keccak256(toHex(signature));
|
|
3288
|
+
this.publicClient = createPublicClient2({
|
|
3289
|
+
chain: this.chain,
|
|
3290
|
+
transport: http2(this.config.rpcEndpoint)
|
|
3291
|
+
});
|
|
3013
3292
|
}
|
|
3014
3293
|
get walletAddress() {
|
|
3015
3294
|
return this.agentWalletAddress;
|
|
3016
3295
|
}
|
|
3017
|
-
createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt) {
|
|
3296
|
+
createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt, isX402Job) {
|
|
3018
3297
|
try {
|
|
3019
3298
|
const data = encodeFunctionData({
|
|
3020
3299
|
abi: this.abi,
|
|
3021
|
-
functionName: "createJobWithAccount",
|
|
3300
|
+
functionName: isX402Job ? "createX402JobWithAccount" : "createJobWithAccount",
|
|
3022
3301
|
args: [
|
|
3023
3302
|
accountId,
|
|
3024
3303
|
evaluatorAddress,
|
|
@@ -3036,11 +3315,11 @@ var BaseAcpContractClient = class {
|
|
|
3036
3315
|
throw new acpError_default("Failed to create job with account", error);
|
|
3037
3316
|
}
|
|
3038
3317
|
}
|
|
3039
|
-
createJob(providerAddress, evaluatorAddress, expiredAt, paymentTokenAddress, budgetBaseUnit, metadata) {
|
|
3318
|
+
createJob(providerAddress, evaluatorAddress, expiredAt, paymentTokenAddress, budgetBaseUnit, metadata, isX402Job) {
|
|
3040
3319
|
try {
|
|
3041
3320
|
const data = encodeFunctionData({
|
|
3042
3321
|
abi: this.abi,
|
|
3043
|
-
functionName: "createJob",
|
|
3322
|
+
functionName: isX402Job ? "createX402Job" : "createJob",
|
|
3044
3323
|
args: [
|
|
3045
3324
|
providerAddress,
|
|
3046
3325
|
evaluatorAddress,
|
|
@@ -3170,6 +3449,44 @@ var BaseAcpContractClient = class {
|
|
|
3170
3449
|
throw new acpError_default("Failed to wrap eth", error);
|
|
3171
3450
|
}
|
|
3172
3451
|
}
|
|
3452
|
+
getX402PaymentDetails(jobId) {
|
|
3453
|
+
return __async(this, null, function* () {
|
|
3454
|
+
try {
|
|
3455
|
+
const result = yield this.publicClient.readContract({
|
|
3456
|
+
address: this.contractAddress,
|
|
3457
|
+
abi: this.abi,
|
|
3458
|
+
functionName: "x402PaymentDetails",
|
|
3459
|
+
args: [BigInt(jobId)]
|
|
3460
|
+
});
|
|
3461
|
+
return {
|
|
3462
|
+
isX402: result[0],
|
|
3463
|
+
isBudgetReceived: result[1]
|
|
3464
|
+
};
|
|
3465
|
+
} catch (error) {
|
|
3466
|
+
throw new acpError_default("Failed to get X402 payment details", error);
|
|
3467
|
+
}
|
|
3468
|
+
});
|
|
3469
|
+
}
|
|
3470
|
+
submitTransferWithAuthorization(from, to, value, validAfter, validBefore, nonce, signature) {
|
|
3471
|
+
return __async(this, null, function* () {
|
|
3472
|
+
try {
|
|
3473
|
+
const operations = [];
|
|
3474
|
+
const data = encodeFunctionData({
|
|
3475
|
+
abi: fiatTokenV2Abi_default,
|
|
3476
|
+
functionName: "transferWithAuthorization",
|
|
3477
|
+
args: [from, to, value, validAfter, validBefore, nonce, signature]
|
|
3478
|
+
});
|
|
3479
|
+
const payload = {
|
|
3480
|
+
data,
|
|
3481
|
+
contractAddress: this.config.baseFare.contractAddress
|
|
3482
|
+
};
|
|
3483
|
+
operations.push(payload);
|
|
3484
|
+
return operations;
|
|
3485
|
+
} catch (error) {
|
|
3486
|
+
throw new acpError_default("Failed to submit TransferWithAuthorization", error);
|
|
3487
|
+
}
|
|
3488
|
+
});
|
|
3489
|
+
}
|
|
3173
3490
|
};
|
|
3174
3491
|
var baseAcpContractClient_default = BaseAcpContractClient;
|
|
3175
3492
|
|
|
@@ -3228,10 +3545,37 @@ function tryParseJson(content) {
|
|
|
3228
3545
|
function preparePayload(payload) {
|
|
3229
3546
|
return typeof payload === "string" ? payload : JSON.stringify(payload);
|
|
3230
3547
|
}
|
|
3548
|
+
function safeBase64Encode(data) {
|
|
3549
|
+
if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") {
|
|
3550
|
+
return globalThis.btoa(data);
|
|
3551
|
+
}
|
|
3552
|
+
return Buffer.from(data).toString("base64");
|
|
3553
|
+
}
|
|
3231
3554
|
|
|
3232
3555
|
// src/acpJobOffering.ts
|
|
3233
3556
|
import { zeroAddress } from "viem";
|
|
3234
3557
|
import Ajv from "ajv";
|
|
3558
|
+
|
|
3559
|
+
// src/constants.ts
|
|
3560
|
+
import { base as base2, baseSepolia as baseSepolia2 } from "viem/chains";
|
|
3561
|
+
var USDC_TOKEN_ADDRESS = {
|
|
3562
|
+
[baseSepolia2.id]: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
|
|
3563
|
+
[base2.id]: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
|
3564
|
+
};
|
|
3565
|
+
var X402AuthorizationTypes = [
|
|
3566
|
+
{ name: "from", type: "address" },
|
|
3567
|
+
{ name: "to", type: "address" },
|
|
3568
|
+
{ name: "value", type: "uint256" },
|
|
3569
|
+
{ name: "validAfter", type: "uint256" },
|
|
3570
|
+
{ name: "validBefore", type: "uint256" },
|
|
3571
|
+
{ name: "nonce", type: "bytes32" }
|
|
3572
|
+
];
|
|
3573
|
+
var HTTP_STATUS_CODES = {
|
|
3574
|
+
OK: 200,
|
|
3575
|
+
PAYMENT_REQUIRED: 402
|
|
3576
|
+
};
|
|
3577
|
+
|
|
3578
|
+
// src/acpJobOffering.ts
|
|
3235
3579
|
var AcpJobOffering = class {
|
|
3236
3580
|
constructor(acpClient, acpContractClient, providerAddress, name, price, priceType = "fixed" /* FIXED */, requirement) {
|
|
3237
3581
|
this.acpClient = acpClient;
|
|
@@ -3267,23 +3611,36 @@ var AcpJobOffering = class {
|
|
|
3267
3611
|
this.providerAddress,
|
|
3268
3612
|
this.acpContractClient
|
|
3269
3613
|
);
|
|
3270
|
-
const
|
|
3614
|
+
const isV1 = [
|
|
3271
3615
|
baseSepoliaAcpConfig.contractAddress,
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3616
|
+
baseSepoliaAcpX402Config.contractAddress,
|
|
3617
|
+
baseAcpConfig.contractAddress,
|
|
3618
|
+
baseAcpX402Config.contractAddress
|
|
3619
|
+
].includes(this.acpContractClient.config.contractAddress);
|
|
3620
|
+
let createJobPayload;
|
|
3621
|
+
const chainId = this.acpContractClient.config.chain.id;
|
|
3622
|
+
const isUsdcPaymentToken = USDC_TOKEN_ADDRESS[chainId].toLowerCase() === fareAmount.fare.contractAddress.toLowerCase();
|
|
3623
|
+
const isX402Job = this.acpContractClient.config.x402Config && isUsdcPaymentToken;
|
|
3624
|
+
if (isV1 || !account) {
|
|
3625
|
+
createJobPayload = this.acpContractClient.createJob(
|
|
3626
|
+
this.providerAddress,
|
|
3627
|
+
evaluatorAddress || this.acpContractClient.walletAddress,
|
|
3628
|
+
expiredAt,
|
|
3629
|
+
fareAmount.fare.contractAddress,
|
|
3630
|
+
fareAmount.amount,
|
|
3631
|
+
"",
|
|
3632
|
+
isX402Job
|
|
3633
|
+
);
|
|
3634
|
+
} else {
|
|
3635
|
+
createJobPayload = this.acpContractClient.createJobWithAccount(
|
|
3636
|
+
account.id,
|
|
3637
|
+
evaluatorAddress || zeroAddress,
|
|
3638
|
+
fareAmount.amount,
|
|
3639
|
+
fareAmount.fare.contractAddress,
|
|
3640
|
+
expiredAt,
|
|
3641
|
+
isX402Job
|
|
3642
|
+
);
|
|
3643
|
+
}
|
|
3287
3644
|
const createJobTxnHash = yield this.acpContractClient.handleOperation([
|
|
3288
3645
|
createJobPayload
|
|
3289
3646
|
]);
|
|
@@ -3479,6 +3836,10 @@ var AcpJob = class {
|
|
|
3479
3836
|
3 /* EVALUATION */
|
|
3480
3837
|
)
|
|
3481
3838
|
);
|
|
3839
|
+
const x402PaymentDetails = yield this.acpContractClient.getX402PaymentDetails(this.id);
|
|
3840
|
+
if (x402PaymentDetails.isX402) {
|
|
3841
|
+
yield this.performX402Payment(this.price);
|
|
3842
|
+
}
|
|
3482
3843
|
return yield this.acpContractClient.handleOperation(operations);
|
|
3483
3844
|
});
|
|
3484
3845
|
}
|
|
@@ -3655,6 +4016,67 @@ var AcpJob = class {
|
|
|
3655
4016
|
return yield this.acpContractClient.handleOperation(operations);
|
|
3656
4017
|
});
|
|
3657
4018
|
}
|
|
4019
|
+
performX402Payment(budget) {
|
|
4020
|
+
return __async(this, null, function* () {
|
|
4021
|
+
const paymentUrl = "/acp-budget";
|
|
4022
|
+
const x402PayableREquirements = yield this.acpContractClient.performX402Request(
|
|
4023
|
+
paymentUrl,
|
|
4024
|
+
this.acpContractClient.getAcpVersion(),
|
|
4025
|
+
budget.toString()
|
|
4026
|
+
);
|
|
4027
|
+
if (!x402PayableREquirements.isPaymentRequired) {
|
|
4028
|
+
return;
|
|
4029
|
+
}
|
|
4030
|
+
if (!x402PayableREquirements.data.accepts.length) {
|
|
4031
|
+
throw new acpError_default("No X402 payment requirements found");
|
|
4032
|
+
}
|
|
4033
|
+
const requirement = x402PayableREquirements.data.accepts[0];
|
|
4034
|
+
const { encodedPayment, signature, message } = yield this.acpContractClient.generateX402Payment(
|
|
4035
|
+
{
|
|
4036
|
+
to: requirement.payTo,
|
|
4037
|
+
value: Number(requirement.maxAmountRequired),
|
|
4038
|
+
maxTimeoutSeconds: requirement.maxTimeoutSeconds,
|
|
4039
|
+
asset: requirement.asset
|
|
4040
|
+
},
|
|
4041
|
+
x402PayableREquirements.data
|
|
4042
|
+
);
|
|
4043
|
+
yield this.acpContractClient.updateJobX402Nonce(this.id, message.nonce);
|
|
4044
|
+
const x402Response = yield this.acpContractClient.performX402Request(
|
|
4045
|
+
paymentUrl,
|
|
4046
|
+
this.acpContractClient.getAcpVersion(),
|
|
4047
|
+
budget.toString(),
|
|
4048
|
+
encodedPayment
|
|
4049
|
+
);
|
|
4050
|
+
if (x402Response.isPaymentRequired) {
|
|
4051
|
+
const operations = yield this.acpContractClient.submitTransferWithAuthorization(
|
|
4052
|
+
message.from,
|
|
4053
|
+
message.to,
|
|
4054
|
+
BigInt(message.value),
|
|
4055
|
+
BigInt(message.validAfter),
|
|
4056
|
+
BigInt(message.validBefore),
|
|
4057
|
+
message.nonce,
|
|
4058
|
+
signature
|
|
4059
|
+
);
|
|
4060
|
+
yield this.acpContractClient.handleOperation(operations);
|
|
4061
|
+
}
|
|
4062
|
+
let waitMs = 2e3;
|
|
4063
|
+
const maxWaitMs = 3e4;
|
|
4064
|
+
let iterationCount = 0;
|
|
4065
|
+
const maxIterations = 10;
|
|
4066
|
+
while (true) {
|
|
4067
|
+
const x402PaymentDetails = yield this.acpContractClient.getX402PaymentDetails(this.id);
|
|
4068
|
+
if (x402PaymentDetails.isBudgetReceived) {
|
|
4069
|
+
break;
|
|
4070
|
+
}
|
|
4071
|
+
iterationCount++;
|
|
4072
|
+
if (iterationCount >= maxIterations) {
|
|
4073
|
+
throw new acpError_default("X402 payment timed out");
|
|
4074
|
+
}
|
|
4075
|
+
yield new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
4076
|
+
waitMs = Math.min(waitMs * 2, maxWaitMs);
|
|
4077
|
+
}
|
|
4078
|
+
});
|
|
4079
|
+
}
|
|
3658
4080
|
};
|
|
3659
4081
|
var acpJob_default = AcpJob;
|
|
3660
4082
|
|
|
@@ -3950,26 +4372,31 @@ var AcpClient = class {
|
|
|
3950
4372
|
providerAddress,
|
|
3951
4373
|
this.acpContractClient
|
|
3952
4374
|
);
|
|
3953
|
-
const
|
|
3954
|
-
baseSepoliaAcpConfig.contractAddress,
|
|
3955
|
-
baseAcpConfig.contractAddress
|
|
3956
|
-
].includes(this.acpContractClient.config.contractAddress) && !evaluatorAddress ? this.walletAddress : zeroAddress2;
|
|
3957
|
-
const createJobPayload = [
|
|
4375
|
+
const isV1 = [
|
|
3958
4376
|
baseSepoliaAcpConfig.contractAddress,
|
|
3959
|
-
|
|
3960
|
-
|
|
4377
|
+
baseSepoliaAcpX402Config.contractAddress,
|
|
4378
|
+
baseAcpConfig.contractAddress,
|
|
4379
|
+
baseAcpX402Config.contractAddress
|
|
4380
|
+
].includes(this.acpContractClient.config.contractAddress);
|
|
4381
|
+
const defaultEvaluatorAddress = isV1 && !evaluatorAddress ? this.walletAddress : zeroAddress2;
|
|
4382
|
+
const chainId = this.acpContractClient.config.chain.id;
|
|
4383
|
+
const isUsdcPaymentToken = USDC_TOKEN_ADDRESS[chainId].toLowerCase() === fareAmount.fare.contractAddress.toLowerCase();
|
|
4384
|
+
const isX402Job = this.acpContractClient.config.x402Config && isUsdcPaymentToken;
|
|
4385
|
+
const createJobPayload = isV1 || !account ? this.acpContractClient.createJob(
|
|
3961
4386
|
providerAddress,
|
|
3962
4387
|
evaluatorAddress || defaultEvaluatorAddress,
|
|
3963
4388
|
expiredAt,
|
|
3964
4389
|
fareAmount.fare.contractAddress,
|
|
3965
4390
|
fareAmount.amount,
|
|
3966
|
-
""
|
|
3967
|
-
|
|
4391
|
+
"",
|
|
4392
|
+
isX402Job
|
|
4393
|
+
) : this.acpContractClient.createJobWithAccount(
|
|
3968
4394
|
account.id,
|
|
3969
4395
|
evaluatorAddress || defaultEvaluatorAddress,
|
|
3970
4396
|
fareAmount.amount,
|
|
3971
4397
|
fareAmount.fare.contractAddress,
|
|
3972
|
-
expiredAt
|
|
4398
|
+
expiredAt,
|
|
4399
|
+
isX402Job
|
|
3973
4400
|
);
|
|
3974
4401
|
const txHash = yield this.acpContractClient.handleOperation([
|
|
3975
4402
|
createJobPayload
|
|
@@ -4330,11 +4757,161 @@ import { alchemy } from "@account-kit/infra";
|
|
|
4330
4757
|
import {
|
|
4331
4758
|
createModularAccountV2Client
|
|
4332
4759
|
} from "@account-kit/smart-contracts";
|
|
4333
|
-
import { decodeEventLog, encodeFunctionData as
|
|
4760
|
+
import { decodeEventLog, encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
4761
|
+
|
|
4762
|
+
// src/acpX402.ts
|
|
4763
|
+
import {
|
|
4764
|
+
erc20Abi as erc20Abi3
|
|
4765
|
+
} from "viem";
|
|
4766
|
+
import { randomBytes } from "crypto";
|
|
4767
|
+
var AcpX402 = class {
|
|
4768
|
+
constructor(config, sessionKeyClient, publicClient) {
|
|
4769
|
+
this.config = config;
|
|
4770
|
+
this.sessionKeyClient = sessionKeyClient;
|
|
4771
|
+
this.publicClient = publicClient;
|
|
4772
|
+
this.config = config;
|
|
4773
|
+
this.sessionKeyClient = sessionKeyClient;
|
|
4774
|
+
this.publicClient = publicClient;
|
|
4775
|
+
}
|
|
4776
|
+
signUpdateJobNonceMessage(jobId, nonce) {
|
|
4777
|
+
return __async(this, null, function* () {
|
|
4778
|
+
const message = `${jobId}-${nonce}`;
|
|
4779
|
+
const signature = yield this.sessionKeyClient.account.getSigner().signMessage(message);
|
|
4780
|
+
return signature;
|
|
4781
|
+
});
|
|
4782
|
+
}
|
|
4783
|
+
updateJobNonce(jobId, nonce) {
|
|
4784
|
+
return __async(this, null, function* () {
|
|
4785
|
+
try {
|
|
4786
|
+
const apiUrl = `${this.config.acpUrl}/api/jobs/${jobId}/x402-nonce`;
|
|
4787
|
+
const signature = yield this.signUpdateJobNonceMessage(jobId, nonce);
|
|
4788
|
+
const response = yield fetch(apiUrl, {
|
|
4789
|
+
method: "POST",
|
|
4790
|
+
headers: {
|
|
4791
|
+
"x-signature": signature,
|
|
4792
|
+
"x-nonce": nonce,
|
|
4793
|
+
"Content-Type": "application/json"
|
|
4794
|
+
},
|
|
4795
|
+
body: JSON.stringify({
|
|
4796
|
+
data: {
|
|
4797
|
+
nonce
|
|
4798
|
+
}
|
|
4799
|
+
})
|
|
4800
|
+
});
|
|
4801
|
+
if (!response.ok) {
|
|
4802
|
+
throw new acpError_default(
|
|
4803
|
+
"Failed to update job X402 nonce",
|
|
4804
|
+
response.statusText
|
|
4805
|
+
);
|
|
4806
|
+
}
|
|
4807
|
+
const acpJob = yield response.json();
|
|
4808
|
+
return acpJob;
|
|
4809
|
+
} catch (error) {
|
|
4810
|
+
throw new acpError_default("Failed to update job X402 nonce", error);
|
|
4811
|
+
}
|
|
4812
|
+
});
|
|
4813
|
+
}
|
|
4814
|
+
generatePayment(payableRequest, requirements) {
|
|
4815
|
+
return __async(this, null, function* () {
|
|
4816
|
+
try {
|
|
4817
|
+
const USDC_CONTRACT = this.config.baseFare.contractAddress;
|
|
4818
|
+
const timeNow = Math.floor(Date.now() / 1e3);
|
|
4819
|
+
const validAfter = timeNow.toString();
|
|
4820
|
+
const validBefore = (timeNow + requirements.accepts[0].maxTimeoutSeconds).toString();
|
|
4821
|
+
const [tokenName, tokenVersion] = yield this.publicClient.multicall({
|
|
4822
|
+
contracts: [
|
|
4823
|
+
{
|
|
4824
|
+
address: USDC_CONTRACT,
|
|
4825
|
+
abi: erc20Abi3,
|
|
4826
|
+
functionName: "name"
|
|
4827
|
+
},
|
|
4828
|
+
{
|
|
4829
|
+
address: USDC_CONTRACT,
|
|
4830
|
+
abi: fiatTokenV2Abi_default,
|
|
4831
|
+
functionName: "version"
|
|
4832
|
+
}
|
|
4833
|
+
]
|
|
4834
|
+
});
|
|
4835
|
+
const nonce = `0x${randomBytes(32).toString("hex")}`;
|
|
4836
|
+
const message = {
|
|
4837
|
+
from: this.sessionKeyClient.account.address,
|
|
4838
|
+
to: payableRequest.to,
|
|
4839
|
+
value: payableRequest.value.toString(),
|
|
4840
|
+
validAfter: validAfter.toString(),
|
|
4841
|
+
validBefore: validBefore.toString(),
|
|
4842
|
+
nonce
|
|
4843
|
+
};
|
|
4844
|
+
const typedData = {
|
|
4845
|
+
types: {
|
|
4846
|
+
TransferWithAuthorization: X402AuthorizationTypes
|
|
4847
|
+
},
|
|
4848
|
+
domain: {
|
|
4849
|
+
name: tokenName.result,
|
|
4850
|
+
version: tokenVersion.result,
|
|
4851
|
+
chainId: this.config.chain.id,
|
|
4852
|
+
verifyingContract: USDC_CONTRACT
|
|
4853
|
+
},
|
|
4854
|
+
primaryType: "TransferWithAuthorization",
|
|
4855
|
+
message
|
|
4856
|
+
};
|
|
4857
|
+
const signature = yield this.sessionKeyClient.signTypedData({
|
|
4858
|
+
typedData
|
|
4859
|
+
});
|
|
4860
|
+
const payload = {
|
|
4861
|
+
x402Version: requirements.x402Version,
|
|
4862
|
+
scheme: requirements.accepts[0].scheme,
|
|
4863
|
+
network: requirements.accepts[0].network,
|
|
4864
|
+
payload: {
|
|
4865
|
+
signature,
|
|
4866
|
+
authorization: message
|
|
4867
|
+
}
|
|
4868
|
+
};
|
|
4869
|
+
const encodedPayment = safeBase64Encode(JSON.stringify(payload));
|
|
4870
|
+
return {
|
|
4871
|
+
encodedPayment,
|
|
4872
|
+
signature,
|
|
4873
|
+
message
|
|
4874
|
+
};
|
|
4875
|
+
} catch (error) {
|
|
4876
|
+
throw new acpError_default("Failed to generate X402 payment", error);
|
|
4877
|
+
}
|
|
4878
|
+
});
|
|
4879
|
+
}
|
|
4880
|
+
performRequest(url, version2, budget, signature) {
|
|
4881
|
+
return __async(this, null, function* () {
|
|
4882
|
+
var _a;
|
|
4883
|
+
const baseUrl = (_a = this.config.x402Config) == null ? void 0 : _a.url;
|
|
4884
|
+
if (!baseUrl) throw new acpError_default("X402 URL not configured");
|
|
4885
|
+
try {
|
|
4886
|
+
const headers = {};
|
|
4887
|
+
if (signature) headers["x-payment"] = signature;
|
|
4888
|
+
if (budget) headers["x-budget"] = budget.toString();
|
|
4889
|
+
headers["x-acp-version"] = version2;
|
|
4890
|
+
const res = yield fetch(`${baseUrl}${url}`, { method: "GET", headers });
|
|
4891
|
+
const data = yield res.json();
|
|
4892
|
+
if (!res.ok && res.status !== HTTP_STATUS_CODES.PAYMENT_REQUIRED) {
|
|
4893
|
+
throw new acpError_default(
|
|
4894
|
+
"Invalid response status code for X402 request",
|
|
4895
|
+
data
|
|
4896
|
+
);
|
|
4897
|
+
}
|
|
4898
|
+
return {
|
|
4899
|
+
isPaymentRequired: res.status === HTTP_STATUS_CODES.PAYMENT_REQUIRED,
|
|
4900
|
+
data
|
|
4901
|
+
};
|
|
4902
|
+
} catch (error) {
|
|
4903
|
+
throw new acpError_default("Failed to perform X402 request", error);
|
|
4904
|
+
}
|
|
4905
|
+
});
|
|
4906
|
+
}
|
|
4907
|
+
};
|
|
4908
|
+
|
|
4909
|
+
// src/contractClients/acpContractClient.ts
|
|
4334
4910
|
var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_default {
|
|
4335
4911
|
constructor(agentWalletAddress, config = baseAcpConfig) {
|
|
4336
4912
|
super(agentWalletAddress, config);
|
|
4337
|
-
this.MAX_RETRIES =
|
|
4913
|
+
this.MAX_RETRIES = 10;
|
|
4914
|
+
// temp fix, while alchemy taking alook into it
|
|
4338
4915
|
this.PRIORITY_FEE_MULTIPLIER = 2;
|
|
4339
4916
|
this.MAX_FEE_PER_GAS = 2e7;
|
|
4340
4917
|
this.MAX_PRIORITY_FEE_PER_GAS = 21e6;
|
|
@@ -4362,6 +4939,11 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4362
4939
|
isGlobalValidation: true
|
|
4363
4940
|
}
|
|
4364
4941
|
});
|
|
4942
|
+
this._acpX402 = new AcpX402(
|
|
4943
|
+
this.config,
|
|
4944
|
+
this.sessionKeyClient,
|
|
4945
|
+
this.publicClient
|
|
4946
|
+
);
|
|
4365
4947
|
});
|
|
4366
4948
|
}
|
|
4367
4949
|
getRandomNonce(bits = 152) {
|
|
@@ -4379,6 +4961,12 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4379
4961
|
}
|
|
4380
4962
|
return this._sessionKeyClient;
|
|
4381
4963
|
}
|
|
4964
|
+
get acpX402() {
|
|
4965
|
+
if (!this._acpX402) {
|
|
4966
|
+
throw new acpError_default("ACP X402 not initialized");
|
|
4967
|
+
}
|
|
4968
|
+
return this._acpX402;
|
|
4969
|
+
}
|
|
4382
4970
|
calculateGasFees() {
|
|
4383
4971
|
return __async(this, null, function* () {
|
|
4384
4972
|
const finalMaxFeePerGas = BigInt(this.MAX_FEE_PER_GAS) + BigInt(this.MAX_PRIORITY_FEE_PER_GAS) * BigInt(Math.max(0, this.PRIORITY_FEE_MULTIPLIER - 1));
|
|
@@ -4448,11 +5036,11 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4448
5036
|
return Number(createdJobEvent.args.jobId);
|
|
4449
5037
|
});
|
|
4450
5038
|
}
|
|
4451
|
-
createJob(providerAddress, evaluatorAddress, expireAt, paymentTokenAddress, budgetBaseUnit, metadata) {
|
|
5039
|
+
createJob(providerAddress, evaluatorAddress, expireAt, paymentTokenAddress, budgetBaseUnit, metadata, isX402Job) {
|
|
4452
5040
|
try {
|
|
4453
|
-
const data =
|
|
5041
|
+
const data = encodeFunctionData3({
|
|
4454
5042
|
abi: this.abi,
|
|
4455
|
-
functionName: "createJob",
|
|
5043
|
+
functionName: isX402Job ? "createJobWithX402" : "createJob",
|
|
4456
5044
|
args: [
|
|
4457
5045
|
providerAddress,
|
|
4458
5046
|
evaluatorAddress,
|
|
@@ -4470,7 +5058,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4470
5058
|
}
|
|
4471
5059
|
setBudgetWithPaymentToken(jobId, budgetBaseUnit, paymentTokenAddress = this.config.baseFare.contractAddress) {
|
|
4472
5060
|
try {
|
|
4473
|
-
const data =
|
|
5061
|
+
const data = encodeFunctionData3({
|
|
4474
5062
|
abi: this.abi,
|
|
4475
5063
|
functionName: "setBudgetWithPaymentToken",
|
|
4476
5064
|
args: [jobId, budgetBaseUnit, paymentTokenAddress]
|
|
@@ -4486,7 +5074,7 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4486
5074
|
}
|
|
4487
5075
|
createPayableMemo(jobId, content, amountBaseUnit, recipient, feeAmountBaseUnit, feeType, nextPhase, type, expiredAt, token = this.config.baseFare.contractAddress, secured = true) {
|
|
4488
5076
|
try {
|
|
4489
|
-
const data =
|
|
5077
|
+
const data = encodeFunctionData3({
|
|
4490
5078
|
abi: this.abi,
|
|
4491
5079
|
functionName: "createPayableMemo",
|
|
4492
5080
|
args: [
|
|
@@ -4511,12 +5099,30 @@ var AcpContractClient = class _AcpContractClient extends baseAcpContractClient_d
|
|
|
4511
5099
|
throw new acpError_default("Failed to create payable memo", error);
|
|
4512
5100
|
}
|
|
4513
5101
|
}
|
|
4514
|
-
createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt) {
|
|
5102
|
+
createJobWithAccount(accountId, evaluatorAddress, budgetBaseUnit, paymentTokenAddress, expiredAt, isX402Job) {
|
|
4515
5103
|
throw new acpError_default("Not Supported");
|
|
4516
5104
|
}
|
|
4517
5105
|
updateAccountMetadata(accountId, metadata) {
|
|
4518
5106
|
throw new acpError_default("Not Supported");
|
|
4519
5107
|
}
|
|
5108
|
+
updateJobX402Nonce(jobId, nonce) {
|
|
5109
|
+
return __async(this, null, function* () {
|
|
5110
|
+
return yield this.acpX402.updateJobNonce(jobId, nonce);
|
|
5111
|
+
});
|
|
5112
|
+
}
|
|
5113
|
+
generateX402Payment(payableRequest, requirements) {
|
|
5114
|
+
return __async(this, null, function* () {
|
|
5115
|
+
return yield this.acpX402.generatePayment(payableRequest, requirements);
|
|
5116
|
+
});
|
|
5117
|
+
}
|
|
5118
|
+
performX402Request(url, version2, budget, signature) {
|
|
5119
|
+
return __async(this, null, function* () {
|
|
5120
|
+
return yield this.acpX402.performRequest(url, version2, budget, signature);
|
|
5121
|
+
});
|
|
5122
|
+
}
|
|
5123
|
+
getAcpVersion() {
|
|
5124
|
+
return "1";
|
|
5125
|
+
}
|
|
4520
5126
|
};
|
|
4521
5127
|
var acpContractClient_default = AcpContractClient;
|
|
4522
5128
|
|
|
@@ -4526,7 +5132,7 @@ import { alchemy as alchemy2 } from "@account-kit/infra";
|
|
|
4526
5132
|
import {
|
|
4527
5133
|
createModularAccountV2Client as createModularAccountV2Client2
|
|
4528
5134
|
} from "@account-kit/smart-contracts";
|
|
4529
|
-
import { createPublicClient as
|
|
5135
|
+
import { createPublicClient as createPublicClient4, decodeEventLog as decodeEventLog2, http as http3 } from "viem";
|
|
4530
5136
|
|
|
4531
5137
|
// src/abis/jobManagerAbi.ts
|
|
4532
5138
|
var JOB_MANAGER_ABI = [
|
|
@@ -4588,98 +5194,11 @@ var JOB_MANAGER_ABI = [
|
|
|
4588
5194
|
{
|
|
4589
5195
|
indexed: false,
|
|
4590
5196
|
internalType: "uint64",
|
|
4591
|
-
name: "version",
|
|
4592
|
-
type: "uint64"
|
|
4593
|
-
}
|
|
4594
|
-
],
|
|
4595
|
-
name: "Initialized",
|
|
4596
|
-
type: "event"
|
|
4597
|
-
},
|
|
4598
|
-
{
|
|
4599
|
-
anonymous: false,
|
|
4600
|
-
inputs: [
|
|
4601
|
-
{
|
|
4602
|
-
indexed: true,
|
|
4603
|
-
internalType: "uint256",
|
|
4604
|
-
name: "jobId",
|
|
4605
|
-
type: "uint256"
|
|
4606
|
-
},
|
|
4607
|
-
{
|
|
4608
|
-
indexed: true,
|
|
4609
|
-
internalType: "address",
|
|
4610
|
-
name: "oldAssignee",
|
|
4611
|
-
type: "address"
|
|
4612
|
-
},
|
|
4613
|
-
{
|
|
4614
|
-
indexed: true,
|
|
4615
|
-
internalType: "address",
|
|
4616
|
-
name: "newAssignee",
|
|
4617
|
-
type: "address"
|
|
4618
|
-
}
|
|
4619
|
-
],
|
|
4620
|
-
name: "JobAssigned",
|
|
4621
|
-
type: "event"
|
|
4622
|
-
},
|
|
4623
|
-
{
|
|
4624
|
-
anonymous: false,
|
|
4625
|
-
inputs: [
|
|
4626
|
-
{
|
|
4627
|
-
indexed: true,
|
|
4628
|
-
internalType: "uint256",
|
|
4629
|
-
name: "jobId",
|
|
4630
|
-
type: "uint256"
|
|
4631
|
-
},
|
|
4632
|
-
{
|
|
4633
|
-
indexed: true,
|
|
4634
|
-
internalType: "uint256",
|
|
4635
|
-
name: "accountId",
|
|
4636
|
-
type: "uint256"
|
|
4637
|
-
},
|
|
4638
|
-
{
|
|
4639
|
-
indexed: true,
|
|
4640
|
-
internalType: "address",
|
|
4641
|
-
name: "client",
|
|
4642
|
-
type: "address"
|
|
4643
|
-
},
|
|
4644
|
-
{
|
|
4645
|
-
indexed: false,
|
|
4646
|
-
internalType: "address",
|
|
4647
|
-
name: "provider",
|
|
4648
|
-
type: "address"
|
|
4649
|
-
},
|
|
4650
|
-
{
|
|
4651
|
-
indexed: false,
|
|
4652
|
-
internalType: "address",
|
|
4653
|
-
name: "evaluator",
|
|
4654
|
-
type: "address"
|
|
4655
|
-
},
|
|
4656
|
-
{
|
|
4657
|
-
indexed: false,
|
|
4658
|
-
internalType: "uint256",
|
|
4659
|
-
name: "expiredAt",
|
|
4660
|
-
type: "uint256"
|
|
4661
|
-
}
|
|
4662
|
-
],
|
|
4663
|
-
name: "JobCreated",
|
|
4664
|
-
type: "event"
|
|
4665
|
-
},
|
|
4666
|
-
{
|
|
4667
|
-
anonymous: false,
|
|
4668
|
-
inputs: [
|
|
4669
|
-
{
|
|
4670
|
-
indexed: true,
|
|
4671
|
-
internalType: "uint256",
|
|
4672
|
-
name: "jobId",
|
|
4673
|
-
type: "uint256"
|
|
4674
|
-
},
|
|
4675
|
-
{
|
|
4676
|
-
indexed: true,
|
|
4677
|
-
internalType: "uint256",
|
|
4678
|
-
name: "dependencyJobId",
|
|
4679
|
-
type: "uint256"
|
|
5197
|
+
name: "version",
|
|
5198
|
+
type: "uint64"
|
|
4680
5199
|
}
|
|
4681
5200
|
],
|
|
4682
|
-
name: "
|
|
5201
|
+
name: "Initialized",
|
|
4683
5202
|
type: "event"
|
|
4684
5203
|
},
|
|
4685
5204
|
{
|
|
@@ -4694,11 +5213,35 @@ var JOB_MANAGER_ABI = [
|
|
|
4694
5213
|
{
|
|
4695
5214
|
indexed: true,
|
|
4696
5215
|
internalType: "uint256",
|
|
4697
|
-
name: "
|
|
5216
|
+
name: "accountId",
|
|
5217
|
+
type: "uint256"
|
|
5218
|
+
},
|
|
5219
|
+
{
|
|
5220
|
+
indexed: true,
|
|
5221
|
+
internalType: "address",
|
|
5222
|
+
name: "client",
|
|
5223
|
+
type: "address"
|
|
5224
|
+
},
|
|
5225
|
+
{
|
|
5226
|
+
indexed: false,
|
|
5227
|
+
internalType: "address",
|
|
5228
|
+
name: "provider",
|
|
5229
|
+
type: "address"
|
|
5230
|
+
},
|
|
5231
|
+
{
|
|
5232
|
+
indexed: false,
|
|
5233
|
+
internalType: "address",
|
|
5234
|
+
name: "evaluator",
|
|
5235
|
+
type: "address"
|
|
5236
|
+
},
|
|
5237
|
+
{
|
|
5238
|
+
indexed: false,
|
|
5239
|
+
internalType: "uint256",
|
|
5240
|
+
name: "expiredAt",
|
|
4698
5241
|
type: "uint256"
|
|
4699
5242
|
}
|
|
4700
5243
|
],
|
|
4701
|
-
name: "
|
|
5244
|
+
name: "JobCreated",
|
|
4702
5245
|
type: "event"
|
|
4703
5246
|
},
|
|
4704
5247
|
{
|
|
@@ -4751,37 +5294,6 @@ var JOB_MANAGER_ABI = [
|
|
|
4751
5294
|
name: "JobPhaseUpdated",
|
|
4752
5295
|
type: "event"
|
|
4753
5296
|
},
|
|
4754
|
-
{
|
|
4755
|
-
anonymous: false,
|
|
4756
|
-
inputs: [
|
|
4757
|
-
{
|
|
4758
|
-
indexed: true,
|
|
4759
|
-
internalType: "uint256",
|
|
4760
|
-
name: "jobId",
|
|
4761
|
-
type: "uint256"
|
|
4762
|
-
},
|
|
4763
|
-
{
|
|
4764
|
-
indexed: false,
|
|
4765
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
4766
|
-
name: "oldStatus",
|
|
4767
|
-
type: "uint8"
|
|
4768
|
-
},
|
|
4769
|
-
{
|
|
4770
|
-
indexed: false,
|
|
4771
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
4772
|
-
name: "newStatus",
|
|
4773
|
-
type: "uint8"
|
|
4774
|
-
},
|
|
4775
|
-
{
|
|
4776
|
-
indexed: false,
|
|
4777
|
-
internalType: "address",
|
|
4778
|
-
name: "updatedBy",
|
|
4779
|
-
type: "address"
|
|
4780
|
-
}
|
|
4781
|
-
],
|
|
4782
|
-
name: "JobStatusUpdated",
|
|
4783
|
-
type: "event"
|
|
4784
|
-
},
|
|
4785
5297
|
{
|
|
4786
5298
|
anonymous: false,
|
|
4787
5299
|
inputs: [
|
|
@@ -4855,6 +5367,19 @@ var JOB_MANAGER_ABI = [
|
|
|
4855
5367
|
name: "Upgraded",
|
|
4856
5368
|
type: "event"
|
|
4857
5369
|
},
|
|
5370
|
+
{
|
|
5371
|
+
anonymous: false,
|
|
5372
|
+
inputs: [
|
|
5373
|
+
{
|
|
5374
|
+
indexed: true,
|
|
5375
|
+
internalType: "uint256",
|
|
5376
|
+
name: "jobId",
|
|
5377
|
+
type: "uint256"
|
|
5378
|
+
}
|
|
5379
|
+
],
|
|
5380
|
+
name: "X402PaymentReceived",
|
|
5381
|
+
type: "event"
|
|
5382
|
+
},
|
|
4858
5383
|
{
|
|
4859
5384
|
inputs: [],
|
|
4860
5385
|
name: "ACP_CONTRACT_ROLE",
|
|
@@ -4890,6 +5415,13 @@ var JOB_MANAGER_ABI = [
|
|
|
4890
5415
|
stateMutability: "view",
|
|
4891
5416
|
type: "function"
|
|
4892
5417
|
},
|
|
5418
|
+
{
|
|
5419
|
+
inputs: [],
|
|
5420
|
+
name: "X402_MANAGER_ROLE",
|
|
5421
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
5422
|
+
stateMutability: "view",
|
|
5423
|
+
type: "function"
|
|
5424
|
+
},
|
|
4893
5425
|
{
|
|
4894
5426
|
inputs: [
|
|
4895
5427
|
{ internalType: "uint256", name: "", type: "uint256" },
|
|
@@ -4907,40 +5439,6 @@ var JOB_MANAGER_ABI = [
|
|
|
4907
5439
|
stateMutability: "view",
|
|
4908
5440
|
type: "function"
|
|
4909
5441
|
},
|
|
4910
|
-
{
|
|
4911
|
-
inputs: [
|
|
4912
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
4913
|
-
{ internalType: "uint256", name: "dependencyJobId", type: "uint256" }
|
|
4914
|
-
],
|
|
4915
|
-
name: "addJobDependency",
|
|
4916
|
-
outputs: [],
|
|
4917
|
-
stateMutability: "nonpayable",
|
|
4918
|
-
type: "function"
|
|
4919
|
-
},
|
|
4920
|
-
{
|
|
4921
|
-
inputs: [
|
|
4922
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
4923
|
-
{ internalType: "address", name: "assignee", type: "address" }
|
|
4924
|
-
],
|
|
4925
|
-
name: "assignJob",
|
|
4926
|
-
outputs: [],
|
|
4927
|
-
stateMutability: "nonpayable",
|
|
4928
|
-
type: "function"
|
|
4929
|
-
},
|
|
4930
|
-
{
|
|
4931
|
-
inputs: [
|
|
4932
|
-
{ internalType: "uint256[]", name: "jobIds", type: "uint256[]" },
|
|
4933
|
-
{
|
|
4934
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
4935
|
-
name: "newStatus",
|
|
4936
|
-
type: "uint8"
|
|
4937
|
-
}
|
|
4938
|
-
],
|
|
4939
|
-
name: "bulkUpdateJobStatus",
|
|
4940
|
-
outputs: [],
|
|
4941
|
-
stateMutability: "nonpayable",
|
|
4942
|
-
type: "function"
|
|
4943
|
-
},
|
|
4944
5442
|
{
|
|
4945
5443
|
inputs: [
|
|
4946
5444
|
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
@@ -4953,9 +5451,9 @@ var JOB_MANAGER_ABI = [
|
|
|
4953
5451
|
},
|
|
4954
5452
|
{
|
|
4955
5453
|
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
4956
|
-
name: "
|
|
4957
|
-
outputs: [
|
|
4958
|
-
stateMutability: "
|
|
5454
|
+
name: "confirmX402PaymentReceived",
|
|
5455
|
+
outputs: [],
|
|
5456
|
+
stateMutability: "nonpayable",
|
|
4959
5457
|
type: "function"
|
|
4960
5458
|
},
|
|
4961
5459
|
{
|
|
@@ -4979,15 +5477,23 @@ var JOB_MANAGER_ABI = [
|
|
|
4979
5477
|
type: "function"
|
|
4980
5478
|
},
|
|
4981
5479
|
{
|
|
4982
|
-
inputs: [
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
{ internalType: "
|
|
4986
|
-
{ internalType: "
|
|
4987
|
-
{ internalType: "
|
|
4988
|
-
{ internalType: "uint256", name: "
|
|
5480
|
+
inputs: [
|
|
5481
|
+
{ internalType: "uint256", name: "accountId", type: "uint256" },
|
|
5482
|
+
{ internalType: "address", name: "client", type: "address" },
|
|
5483
|
+
{ internalType: "address", name: "provider", type: "address" },
|
|
5484
|
+
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5485
|
+
{ internalType: "address", name: "creator", type: "address" },
|
|
5486
|
+
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5487
|
+
{
|
|
5488
|
+
internalType: "contract IERC20",
|
|
5489
|
+
name: "paymentToken",
|
|
5490
|
+
type: "address"
|
|
5491
|
+
},
|
|
5492
|
+
{ internalType: "uint256", name: "expiredAt", type: "uint256" }
|
|
4989
5493
|
],
|
|
4990
|
-
|
|
5494
|
+
name: "createJobWithX402",
|
|
5495
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5496
|
+
stateMutability: "nonpayable",
|
|
4991
5497
|
type: "function"
|
|
4992
5498
|
},
|
|
4993
5499
|
{
|
|
@@ -5006,11 +5512,10 @@ var JOB_MANAGER_ABI = [
|
|
|
5006
5512
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5007
5513
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5008
5514
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5009
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5010
5515
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5011
5516
|
{
|
|
5012
5517
|
internalType: "contract IERC20",
|
|
5013
|
-
name: "
|
|
5518
|
+
name: "jobPaymentToken",
|
|
5014
5519
|
type: "address"
|
|
5015
5520
|
},
|
|
5016
5521
|
{
|
|
@@ -5018,22 +5523,11 @@ var JOB_MANAGER_ABI = [
|
|
|
5018
5523
|
name: "phase",
|
|
5019
5524
|
type: "uint8"
|
|
5020
5525
|
},
|
|
5021
|
-
{
|
|
5022
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5023
|
-
name: "status",
|
|
5024
|
-
type: "uint8"
|
|
5025
|
-
},
|
|
5026
5526
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5027
5527
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5028
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5029
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5030
5528
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5031
5529
|
{ internalType: "string", name: "metadata", type: "string" },
|
|
5032
|
-
{
|
|
5033
|
-
internalType: "uint256[]",
|
|
5034
|
-
name: "dependencies",
|
|
5035
|
-
type: "uint256[]"
|
|
5036
|
-
}
|
|
5530
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5037
5531
|
],
|
|
5038
5532
|
internalType: "struct ACPTypes.Job[]",
|
|
5039
5533
|
name: "jobArray",
|
|
@@ -5056,11 +5550,10 @@ var JOB_MANAGER_ABI = [
|
|
|
5056
5550
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5057
5551
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5058
5552
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5059
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5060
5553
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5061
5554
|
{
|
|
5062
5555
|
internalType: "contract IERC20",
|
|
5063
|
-
name: "
|
|
5556
|
+
name: "jobPaymentToken",
|
|
5064
5557
|
type: "address"
|
|
5065
5558
|
},
|
|
5066
5559
|
{
|
|
@@ -5068,22 +5561,11 @@ var JOB_MANAGER_ABI = [
|
|
|
5068
5561
|
name: "phase",
|
|
5069
5562
|
type: "uint8"
|
|
5070
5563
|
},
|
|
5071
|
-
{
|
|
5072
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5073
|
-
name: "status",
|
|
5074
|
-
type: "uint8"
|
|
5075
|
-
},
|
|
5076
5564
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5077
5565
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5078
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5079
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5080
5566
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5081
5567
|
{ internalType: "string", name: "metadata", type: "string" },
|
|
5082
|
-
{
|
|
5083
|
-
internalType: "uint256[]",
|
|
5084
|
-
name: "dependencies",
|
|
5085
|
-
type: "uint256[]"
|
|
5086
|
-
}
|
|
5568
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5087
5569
|
],
|
|
5088
5570
|
internalType: "struct ACPTypes.Job",
|
|
5089
5571
|
name: "",
|
|
@@ -5093,13 +5575,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5093
5575
|
stateMutability: "view",
|
|
5094
5576
|
type: "function"
|
|
5095
5577
|
},
|
|
5096
|
-
{
|
|
5097
|
-
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
5098
|
-
name: "getJobDependencies",
|
|
5099
|
-
outputs: [{ internalType: "uint256[]", name: "", type: "uint256[]" }],
|
|
5100
|
-
stateMutability: "view",
|
|
5101
|
-
type: "function"
|
|
5102
|
-
},
|
|
5103
5578
|
{
|
|
5104
5579
|
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
5105
5580
|
name: "getRoleAdmin",
|
|
@@ -5123,11 +5598,10 @@ var JOB_MANAGER_ABI = [
|
|
|
5123
5598
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5124
5599
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5125
5600
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5126
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5127
5601
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5128
5602
|
{
|
|
5129
5603
|
internalType: "contract IERC20",
|
|
5130
|
-
name: "
|
|
5604
|
+
name: "jobPaymentToken",
|
|
5131
5605
|
type: "address"
|
|
5132
5606
|
},
|
|
5133
5607
|
{
|
|
@@ -5135,22 +5609,11 @@ var JOB_MANAGER_ABI = [
|
|
|
5135
5609
|
name: "phase",
|
|
5136
5610
|
type: "uint8"
|
|
5137
5611
|
},
|
|
5138
|
-
{
|
|
5139
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5140
|
-
name: "status",
|
|
5141
|
-
type: "uint8"
|
|
5142
|
-
},
|
|
5143
5612
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5144
5613
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5145
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5146
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5147
5614
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5148
5615
|
{ internalType: "string", name: "metadata", type: "string" },
|
|
5149
|
-
{
|
|
5150
|
-
internalType: "uint256[]",
|
|
5151
|
-
name: "dependencies",
|
|
5152
|
-
type: "uint256[]"
|
|
5153
|
-
}
|
|
5616
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5154
5617
|
],
|
|
5155
5618
|
internalType: "struct ACPTypes.Job[]",
|
|
5156
5619
|
name: "jobArray",
|
|
@@ -5161,6 +5624,23 @@ var JOB_MANAGER_ABI = [
|
|
|
5161
5624
|
stateMutability: "view",
|
|
5162
5625
|
type: "function"
|
|
5163
5626
|
},
|
|
5627
|
+
{
|
|
5628
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
5629
|
+
name: "getX402PaymentDetails",
|
|
5630
|
+
outputs: [
|
|
5631
|
+
{
|
|
5632
|
+
components: [
|
|
5633
|
+
{ internalType: "bool", name: "isX402", type: "bool" },
|
|
5634
|
+
{ internalType: "bool", name: "isBudgetReceived", type: "bool" }
|
|
5635
|
+
],
|
|
5636
|
+
internalType: "struct ACPTypes.X402PaymentDetail",
|
|
5637
|
+
name: "",
|
|
5638
|
+
type: "tuple"
|
|
5639
|
+
}
|
|
5640
|
+
],
|
|
5641
|
+
stateMutability: "view",
|
|
5642
|
+
type: "function"
|
|
5643
|
+
},
|
|
5164
5644
|
{
|
|
5165
5645
|
inputs: [
|
|
5166
5646
|
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
@@ -5204,26 +5684,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5204
5684
|
stateMutability: "view",
|
|
5205
5685
|
type: "function"
|
|
5206
5686
|
},
|
|
5207
|
-
{
|
|
5208
|
-
inputs: [
|
|
5209
|
-
{ internalType: "uint256", name: "", type: "uint256" },
|
|
5210
|
-
{ internalType: "uint256", name: "", type: "uint256" }
|
|
5211
|
-
],
|
|
5212
|
-
name: "jobDependencies",
|
|
5213
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5214
|
-
stateMutability: "view",
|
|
5215
|
-
type: "function"
|
|
5216
|
-
},
|
|
5217
|
-
{
|
|
5218
|
-
inputs: [
|
|
5219
|
-
{ internalType: "uint256", name: "", type: "uint256" },
|
|
5220
|
-
{ internalType: "uint256", name: "", type: "uint256" }
|
|
5221
|
-
],
|
|
5222
|
-
name: "jobDependents",
|
|
5223
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5224
|
-
stateMutability: "view",
|
|
5225
|
-
type: "function"
|
|
5226
|
-
},
|
|
5227
5687
|
{
|
|
5228
5688
|
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5229
5689
|
name: "jobs",
|
|
@@ -5234,39 +5694,22 @@ var JOB_MANAGER_ABI = [
|
|
|
5234
5694
|
{ internalType: "address", name: "provider", type: "address" },
|
|
5235
5695
|
{ internalType: "address", name: "evaluator", type: "address" },
|
|
5236
5696
|
{ internalType: "address", name: "creator", type: "address" },
|
|
5237
|
-
{ internalType: "address", name: "assignee", type: "address" },
|
|
5238
5697
|
{ internalType: "uint256", name: "budget", type: "uint256" },
|
|
5239
5698
|
{
|
|
5240
5699
|
internalType: "contract IERC20",
|
|
5241
|
-
name: "
|
|
5700
|
+
name: "jobPaymentToken",
|
|
5242
5701
|
type: "address"
|
|
5243
5702
|
},
|
|
5244
5703
|
{ internalType: "enum ACPTypes.JobPhase", name: "phase", type: "uint8" },
|
|
5245
|
-
{
|
|
5246
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5247
|
-
name: "status",
|
|
5248
|
-
type: "uint8"
|
|
5249
|
-
},
|
|
5250
5704
|
{ internalType: "uint256", name: "expiredAt", type: "uint256" },
|
|
5251
5705
|
{ internalType: "uint256", name: "createdAt", type: "uint256" },
|
|
5252
|
-
{ internalType: "uint256", name: "startedAt", type: "uint256" },
|
|
5253
|
-
{ internalType: "uint256", name: "completedAt", type: "uint256" },
|
|
5254
5706
|
{ internalType: "uint256", name: "memoCount", type: "uint256" },
|
|
5255
|
-
{ internalType: "string", name: "metadata", type: "string" }
|
|
5707
|
+
{ internalType: "string", name: "metadata", type: "string" },
|
|
5708
|
+
{ internalType: "uint256", name: "amountClaimed", type: "uint256" }
|
|
5256
5709
|
],
|
|
5257
5710
|
stateMutability: "view",
|
|
5258
5711
|
type: "function"
|
|
5259
5712
|
},
|
|
5260
|
-
{
|
|
5261
|
-
inputs: [
|
|
5262
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
5263
|
-
{ internalType: "address", name: "completedBy", type: "address" }
|
|
5264
|
-
],
|
|
5265
|
-
name: "markJobCompleted",
|
|
5266
|
-
outputs: [],
|
|
5267
|
-
stateMutability: "nonpayable",
|
|
5268
|
-
type: "function"
|
|
5269
|
-
},
|
|
5270
5713
|
{
|
|
5271
5714
|
inputs: [],
|
|
5272
5715
|
name: "proxiableUUID",
|
|
@@ -5274,16 +5717,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5274
5717
|
stateMutability: "view",
|
|
5275
5718
|
type: "function"
|
|
5276
5719
|
},
|
|
5277
|
-
{
|
|
5278
|
-
inputs: [
|
|
5279
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
5280
|
-
{ internalType: "uint256", name: "dependencyJobId", type: "uint256" }
|
|
5281
|
-
],
|
|
5282
|
-
name: "removeJobDependency",
|
|
5283
|
-
outputs: [],
|
|
5284
|
-
stateMutability: "nonpayable",
|
|
5285
|
-
type: "function"
|
|
5286
|
-
},
|
|
5287
5720
|
{
|
|
5288
5721
|
inputs: [
|
|
5289
5722
|
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
@@ -5319,6 +5752,19 @@ var JOB_MANAGER_ABI = [
|
|
|
5319
5752
|
stateMutability: "nonpayable",
|
|
5320
5753
|
type: "function"
|
|
5321
5754
|
},
|
|
5755
|
+
{
|
|
5756
|
+
inputs: [
|
|
5757
|
+
{
|
|
5758
|
+
internalType: "address",
|
|
5759
|
+
name: "x402PaymentTokenAddress",
|
|
5760
|
+
type: "address"
|
|
5761
|
+
}
|
|
5762
|
+
],
|
|
5763
|
+
name: "setX402PaymentToken",
|
|
5764
|
+
outputs: [],
|
|
5765
|
+
stateMutability: "nonpayable",
|
|
5766
|
+
type: "function"
|
|
5767
|
+
},
|
|
5322
5768
|
{
|
|
5323
5769
|
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
5324
5770
|
name: "supportsInterface",
|
|
@@ -5349,20 +5795,6 @@ var JOB_MANAGER_ABI = [
|
|
|
5349
5795
|
stateMutability: "nonpayable",
|
|
5350
5796
|
type: "function"
|
|
5351
5797
|
},
|
|
5352
|
-
{
|
|
5353
|
-
inputs: [
|
|
5354
|
-
{ internalType: "uint256", name: "jobId", type: "uint256" },
|
|
5355
|
-
{
|
|
5356
|
-
internalType: "enum ACPTypes.JobStatus",
|
|
5357
|
-
name: "newStatus",
|
|
5358
|
-
type: "uint8"
|
|
5359
|
-
}
|
|
5360
|
-
],
|
|
5361
|
-
name: "updateJobStatus",
|
|
5362
|
-
outputs: [],
|
|
5363
|
-
stateMutability: "nonpayable",
|
|
5364
|
-
type: "function"
|
|
5365
|
-
},
|
|
5366
5798
|
{
|
|
5367
5799
|
inputs: [
|
|
5368
5800
|
{ internalType: "address", name: "newImplementation", type: "address" },
|
|
@@ -5382,6 +5814,23 @@ var JOB_MANAGER_ABI = [
|
|
|
5382
5814
|
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
5383
5815
|
stateMutability: "view",
|
|
5384
5816
|
type: "function"
|
|
5817
|
+
},
|
|
5818
|
+
{
|
|
5819
|
+
inputs: [{ internalType: "uint256", name: "jobId", type: "uint256" }],
|
|
5820
|
+
name: "x402PaymentDetails",
|
|
5821
|
+
outputs: [
|
|
5822
|
+
{ internalType: "bool", name: "isX402", type: "bool" },
|
|
5823
|
+
{ internalType: "bool", name: "isBudgetReceived", type: "bool" }
|
|
5824
|
+
],
|
|
5825
|
+
stateMutability: "view",
|
|
5826
|
+
type: "function"
|
|
5827
|
+
},
|
|
5828
|
+
{
|
|
5829
|
+
inputs: [],
|
|
5830
|
+
name: "x402PaymentToken",
|
|
5831
|
+
outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
|
|
5832
|
+
stateMutability: "view",
|
|
5833
|
+
type: "function"
|
|
5385
5834
|
}
|
|
5386
5835
|
];
|
|
5387
5836
|
var jobManagerAbi_default = JOB_MANAGER_ABI;
|
|
@@ -5400,9 +5849,9 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5400
5849
|
}
|
|
5401
5850
|
static build(_0, _1, _2) {
|
|
5402
5851
|
return __async(this, arguments, function* (walletPrivateKey, sessionEntityKeyId, agentWalletAddress, config = baseAcpConfigV2) {
|
|
5403
|
-
const publicClient =
|
|
5852
|
+
const publicClient = createPublicClient4({
|
|
5404
5853
|
chain: config.chain,
|
|
5405
|
-
transport:
|
|
5854
|
+
transport: http3(config.rpcEndpoint)
|
|
5406
5855
|
});
|
|
5407
5856
|
const [jobManagerAddress, memoManagerAddress, accountManagerAddress] = yield publicClient.multicall({
|
|
5408
5857
|
contracts: [
|
|
@@ -5455,6 +5904,11 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5455
5904
|
isGlobalValidation: true
|
|
5456
5905
|
}
|
|
5457
5906
|
});
|
|
5907
|
+
this._acpX402 = new AcpX402(
|
|
5908
|
+
this.config,
|
|
5909
|
+
this.sessionKeyClient,
|
|
5910
|
+
this.publicClient
|
|
5911
|
+
);
|
|
5458
5912
|
});
|
|
5459
5913
|
}
|
|
5460
5914
|
getRandomNonce(bits = 152) {
|
|
@@ -5472,6 +5926,12 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5472
5926
|
}
|
|
5473
5927
|
return this._sessionKeyClient;
|
|
5474
5928
|
}
|
|
5929
|
+
get acpX402() {
|
|
5930
|
+
if (!this._acpX402) {
|
|
5931
|
+
throw new acpError_default("ACP X402 not initialized");
|
|
5932
|
+
}
|
|
5933
|
+
return this._acpX402;
|
|
5934
|
+
}
|
|
5475
5935
|
calculateGasFees() {
|
|
5476
5936
|
return __async(this, null, function* () {
|
|
5477
5937
|
const finalMaxFeePerGas = BigInt(this.MAX_FEE_PER_GAS) + BigInt(this.MAX_PRIORITY_FEE_PER_GAS) * BigInt(Math.max(0, this.PRIORITY_FEE_MULTIPLIER - 1));
|
|
@@ -5550,6 +6010,42 @@ var AcpContractClientV2 = class _AcpContractClientV2 extends baseAcpContractClie
|
|
|
5550
6010
|
return Number(createdJobEvent.args.jobId);
|
|
5551
6011
|
});
|
|
5552
6012
|
}
|
|
6013
|
+
updateJobX402Nonce(jobId, nonce) {
|
|
6014
|
+
return __async(this, null, function* () {
|
|
6015
|
+
return yield this.acpX402.updateJobNonce(jobId, nonce);
|
|
6016
|
+
});
|
|
6017
|
+
}
|
|
6018
|
+
generateX402Payment(payableRequest, requirements) {
|
|
6019
|
+
return __async(this, null, function* () {
|
|
6020
|
+
return yield this.acpX402.generatePayment(payableRequest, requirements);
|
|
6021
|
+
});
|
|
6022
|
+
}
|
|
6023
|
+
performX402Request(url, version2, budget, signature) {
|
|
6024
|
+
return __async(this, null, function* () {
|
|
6025
|
+
return yield this.acpX402.performRequest(url, version2, budget, signature);
|
|
6026
|
+
});
|
|
6027
|
+
}
|
|
6028
|
+
getX402PaymentDetails(jobId) {
|
|
6029
|
+
return __async(this, null, function* () {
|
|
6030
|
+
try {
|
|
6031
|
+
const result = yield this.publicClient.readContract({
|
|
6032
|
+
address: this.jobManagerAddress,
|
|
6033
|
+
abi: jobManagerAbi_default,
|
|
6034
|
+
functionName: "x402PaymentDetails",
|
|
6035
|
+
args: [BigInt(jobId)]
|
|
6036
|
+
});
|
|
6037
|
+
return {
|
|
6038
|
+
isX402: result[0],
|
|
6039
|
+
isBudgetReceived: result[1]
|
|
6040
|
+
};
|
|
6041
|
+
} catch (error) {
|
|
6042
|
+
throw new acpError_default("Failed to get X402 payment details", error);
|
|
6043
|
+
}
|
|
6044
|
+
});
|
|
6045
|
+
}
|
|
6046
|
+
getAcpVersion() {
|
|
6047
|
+
return "2";
|
|
6048
|
+
}
|
|
5553
6049
|
};
|
|
5554
6050
|
var acpContractClientV2_default = AcpContractClientV2;
|
|
5555
6051
|
|
|
@@ -5577,6 +6073,8 @@ export {
|
|
|
5577
6073
|
PositionDirection,
|
|
5578
6074
|
baseAcpConfig,
|
|
5579
6075
|
baseAcpConfigV2,
|
|
6076
|
+
baseAcpX402Config,
|
|
6077
|
+
baseAcpX402ConfigV2,
|
|
5580
6078
|
baseSepoliaAcpConfig,
|
|
5581
6079
|
baseSepoliaAcpConfigV2,
|
|
5582
6080
|
index_default as default,
|