@virtuals-protocol/acp-node 0.1.0-beta-fund.2 → 0.1.0-beta-usdc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -20
- package/dist/index.d.mts +89 -64
- package/dist/index.d.ts +89 -64
- package/dist/index.js +1162 -279
- package/dist/index.mjs +1160 -280
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
21
|
}
|
|
20
22
|
return a;
|
|
21
23
|
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
25
|
var __commonJS = (cb, mod) => function __require() {
|
|
23
26
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
27
|
};
|
|
@@ -69,7 +72,7 @@ var require_package = __commonJS({
|
|
|
69
72
|
"package.json"(exports2, module2) {
|
|
70
73
|
module2.exports = {
|
|
71
74
|
name: "@virtuals-protocol/acp-node",
|
|
72
|
-
version: "0.1.0-beta-
|
|
75
|
+
version: "0.1.0-beta-usdc.1",
|
|
73
76
|
main: "./dist/index.js",
|
|
74
77
|
module: "./dist/index.mjs",
|
|
75
78
|
types: "./dist/index.d.ts",
|
|
@@ -105,10 +108,14 @@ __export(index_exports, {
|
|
|
105
108
|
ACP_ABI: () => acpAbi_default,
|
|
106
109
|
AcpAgentSort: () => AcpAgentSort,
|
|
107
110
|
AcpContractClient: () => acpContractClient_default,
|
|
111
|
+
AcpGraduationStatus: () => AcpGraduationStatus,
|
|
108
112
|
AcpJob: () => acpJob_default,
|
|
109
113
|
AcpJobPhases: () => AcpJobPhases,
|
|
110
114
|
AcpMemo: () => acpMemo_default,
|
|
115
|
+
AcpMemoStatus: () => AcpMemoStatus,
|
|
116
|
+
AcpOnlineStatus: () => AcpOnlineStatus,
|
|
111
117
|
MemoType: () => MemoType,
|
|
118
|
+
PayloadType: () => PayloadType,
|
|
112
119
|
baseAcpConfig: () => baseAcpConfig,
|
|
113
120
|
baseSepoliaAcpConfig: () => baseSepoliaAcpConfig,
|
|
114
121
|
default: () => index_default
|
|
@@ -117,32 +124,82 @@ module.exports = __toCommonJS(index_exports);
|
|
|
117
124
|
|
|
118
125
|
// src/acpAbi.ts
|
|
119
126
|
var ACP_ABI = [
|
|
120
|
-
{
|
|
121
|
-
|
|
127
|
+
{
|
|
128
|
+
inputs: [],
|
|
129
|
+
stateMutability: "nonpayable",
|
|
130
|
+
type: "constructor"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
inputs: [],
|
|
134
|
+
name: "AccessControlBadConfirmation",
|
|
135
|
+
type: "error"
|
|
136
|
+
},
|
|
122
137
|
{
|
|
123
138
|
inputs: [
|
|
124
|
-
{
|
|
125
|
-
|
|
139
|
+
{
|
|
140
|
+
internalType: "address",
|
|
141
|
+
name: "account",
|
|
142
|
+
type: "address"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
internalType: "bytes32",
|
|
146
|
+
name: "neededRole",
|
|
147
|
+
type: "bytes32"
|
|
148
|
+
}
|
|
126
149
|
],
|
|
127
150
|
name: "AccessControlUnauthorizedAccount",
|
|
128
151
|
type: "error"
|
|
129
152
|
},
|
|
130
153
|
{
|
|
131
|
-
inputs: [
|
|
154
|
+
inputs: [
|
|
155
|
+
{
|
|
156
|
+
internalType: "address",
|
|
157
|
+
name: "target",
|
|
158
|
+
type: "address"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
132
161
|
name: "AddressEmptyCode",
|
|
133
162
|
type: "error"
|
|
134
163
|
},
|
|
135
164
|
{
|
|
136
|
-
inputs: [
|
|
165
|
+
inputs: [
|
|
166
|
+
{
|
|
167
|
+
internalType: "address",
|
|
168
|
+
name: "account",
|
|
169
|
+
type: "address"
|
|
170
|
+
}
|
|
171
|
+
],
|
|
137
172
|
name: "AddressInsufficientBalance",
|
|
138
173
|
type: "error"
|
|
139
174
|
},
|
|
140
|
-
{ inputs: [], name: "FailedInnerCall", type: "error" },
|
|
141
|
-
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
142
|
-
{ inputs: [], name: "NotInitializing", type: "error" },
|
|
143
|
-
{ inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
|
|
144
175
|
{
|
|
145
|
-
inputs: [
|
|
176
|
+
inputs: [],
|
|
177
|
+
name: "FailedInnerCall",
|
|
178
|
+
type: "error"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
inputs: [],
|
|
182
|
+
name: "InvalidInitialization",
|
|
183
|
+
type: "error"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
inputs: [],
|
|
187
|
+
name: "NotInitializing",
|
|
188
|
+
type: "error"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
inputs: [],
|
|
192
|
+
name: "ReentrancyGuardReentrantCall",
|
|
193
|
+
type: "error"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
inputs: [
|
|
197
|
+
{
|
|
198
|
+
internalType: "address",
|
|
199
|
+
name: "token",
|
|
200
|
+
type: "address"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
146
203
|
name: "SafeERC20FailedOperation",
|
|
147
204
|
type: "error"
|
|
148
205
|
},
|
|
@@ -259,6 +316,25 @@ var ACP_ABI = [
|
|
|
259
316
|
name: "JobCreated",
|
|
260
317
|
type: "event"
|
|
261
318
|
},
|
|
319
|
+
{
|
|
320
|
+
anonymous: false,
|
|
321
|
+
inputs: [
|
|
322
|
+
{
|
|
323
|
+
indexed: true,
|
|
324
|
+
internalType: "uint256",
|
|
325
|
+
name: "jobId",
|
|
326
|
+
type: "uint256"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
indexed: true,
|
|
330
|
+
internalType: "address",
|
|
331
|
+
name: "paymentToken",
|
|
332
|
+
type: "address"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
name: "JobPaymentTokenSet",
|
|
336
|
+
type: "event"
|
|
337
|
+
},
|
|
262
338
|
{
|
|
263
339
|
anonymous: false,
|
|
264
340
|
inputs: [
|
|
@@ -274,7 +350,12 @@ var ACP_ABI = [
|
|
|
274
350
|
name: "oldPhase",
|
|
275
351
|
type: "uint8"
|
|
276
352
|
},
|
|
277
|
-
{
|
|
353
|
+
{
|
|
354
|
+
indexed: false,
|
|
355
|
+
internalType: "uint8",
|
|
356
|
+
name: "phase",
|
|
357
|
+
type: "uint8"
|
|
358
|
+
}
|
|
278
359
|
],
|
|
279
360
|
name: "JobPhaseUpdated",
|
|
280
361
|
type: "event"
|
|
@@ -418,8 +499,61 @@ var ACP_ABI = [
|
|
|
418
499
|
name: "memoId",
|
|
419
500
|
type: "uint256"
|
|
420
501
|
},
|
|
421
|
-
{
|
|
422
|
-
|
|
502
|
+
{
|
|
503
|
+
indexed: true,
|
|
504
|
+
internalType: "address",
|
|
505
|
+
name: "sender",
|
|
506
|
+
type: "address"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
indexed: false,
|
|
510
|
+
internalType: "address",
|
|
511
|
+
name: "token",
|
|
512
|
+
type: "address"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
indexed: false,
|
|
516
|
+
internalType: "uint256",
|
|
517
|
+
name: "amount",
|
|
518
|
+
type: "uint256"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
indexed: false,
|
|
522
|
+
internalType: "uint256",
|
|
523
|
+
name: "feeAmount",
|
|
524
|
+
type: "uint256"
|
|
525
|
+
}
|
|
526
|
+
],
|
|
527
|
+
name: "PayableFundsEscrowed",
|
|
528
|
+
type: "event"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
anonymous: false,
|
|
532
|
+
inputs: [
|
|
533
|
+
{
|
|
534
|
+
indexed: true,
|
|
535
|
+
internalType: "uint256",
|
|
536
|
+
name: "jobId",
|
|
537
|
+
type: "uint256"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
indexed: true,
|
|
541
|
+
internalType: "uint256",
|
|
542
|
+
name: "memoId",
|
|
543
|
+
type: "uint256"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
indexed: true,
|
|
547
|
+
internalType: "address",
|
|
548
|
+
name: "from",
|
|
549
|
+
type: "address"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
indexed: false,
|
|
553
|
+
internalType: "address",
|
|
554
|
+
name: "to",
|
|
555
|
+
type: "address"
|
|
556
|
+
},
|
|
423
557
|
{
|
|
424
558
|
indexed: false,
|
|
425
559
|
internalType: "address",
|
|
@@ -451,8 +585,18 @@ var ACP_ABI = [
|
|
|
451
585
|
name: "memoId",
|
|
452
586
|
type: "uint256"
|
|
453
587
|
},
|
|
454
|
-
{
|
|
455
|
-
|
|
588
|
+
{
|
|
589
|
+
indexed: true,
|
|
590
|
+
internalType: "address",
|
|
591
|
+
name: "from",
|
|
592
|
+
type: "address"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
indexed: false,
|
|
596
|
+
internalType: "address",
|
|
597
|
+
name: "to",
|
|
598
|
+
type: "address"
|
|
599
|
+
},
|
|
456
600
|
{
|
|
457
601
|
indexed: false,
|
|
458
602
|
internalType: "address",
|
|
@@ -522,7 +666,12 @@ var ACP_ABI = [
|
|
|
522
666
|
{
|
|
523
667
|
anonymous: false,
|
|
524
668
|
inputs: [
|
|
525
|
-
{
|
|
669
|
+
{
|
|
670
|
+
indexed: true,
|
|
671
|
+
internalType: "bytes32",
|
|
672
|
+
name: "role",
|
|
673
|
+
type: "bytes32"
|
|
674
|
+
},
|
|
526
675
|
{
|
|
527
676
|
indexed: true,
|
|
528
677
|
internalType: "bytes32",
|
|
@@ -542,7 +691,12 @@ var ACP_ABI = [
|
|
|
542
691
|
{
|
|
543
692
|
anonymous: false,
|
|
544
693
|
inputs: [
|
|
545
|
-
{
|
|
694
|
+
{
|
|
695
|
+
indexed: true,
|
|
696
|
+
internalType: "bytes32",
|
|
697
|
+
name: "role",
|
|
698
|
+
type: "bytes32"
|
|
699
|
+
},
|
|
546
700
|
{
|
|
547
701
|
indexed: true,
|
|
548
702
|
internalType: "address",
|
|
@@ -562,7 +716,12 @@ var ACP_ABI = [
|
|
|
562
716
|
{
|
|
563
717
|
anonymous: false,
|
|
564
718
|
inputs: [
|
|
565
|
-
{
|
|
719
|
+
{
|
|
720
|
+
indexed: true,
|
|
721
|
+
internalType: "bytes32",
|
|
722
|
+
name: "role",
|
|
723
|
+
type: "bytes32"
|
|
724
|
+
},
|
|
566
725
|
{
|
|
567
726
|
indexed: true,
|
|
568
727
|
internalType: "address",
|
|
@@ -582,87 +741,192 @@ var ACP_ABI = [
|
|
|
582
741
|
{
|
|
583
742
|
inputs: [],
|
|
584
743
|
name: "ADMIN_ROLE",
|
|
585
|
-
outputs: [
|
|
744
|
+
outputs: [
|
|
745
|
+
{
|
|
746
|
+
internalType: "bytes32",
|
|
747
|
+
name: "",
|
|
748
|
+
type: "bytes32"
|
|
749
|
+
}
|
|
750
|
+
],
|
|
586
751
|
stateMutability: "view",
|
|
587
752
|
type: "function"
|
|
588
753
|
},
|
|
589
754
|
{
|
|
590
755
|
inputs: [],
|
|
591
756
|
name: "DEFAULT_ADMIN_ROLE",
|
|
592
|
-
outputs: [
|
|
757
|
+
outputs: [
|
|
758
|
+
{
|
|
759
|
+
internalType: "bytes32",
|
|
760
|
+
name: "",
|
|
761
|
+
type: "bytes32"
|
|
762
|
+
}
|
|
763
|
+
],
|
|
593
764
|
stateMutability: "view",
|
|
594
765
|
type: "function"
|
|
595
766
|
},
|
|
596
767
|
{
|
|
597
768
|
inputs: [],
|
|
598
769
|
name: "PHASE_COMPLETED",
|
|
599
|
-
outputs: [
|
|
770
|
+
outputs: [
|
|
771
|
+
{
|
|
772
|
+
internalType: "uint8",
|
|
773
|
+
name: "",
|
|
774
|
+
type: "uint8"
|
|
775
|
+
}
|
|
776
|
+
],
|
|
600
777
|
stateMutability: "view",
|
|
601
778
|
type: "function"
|
|
602
779
|
},
|
|
603
780
|
{
|
|
604
781
|
inputs: [],
|
|
605
782
|
name: "PHASE_EVALUATION",
|
|
606
|
-
outputs: [
|
|
783
|
+
outputs: [
|
|
784
|
+
{
|
|
785
|
+
internalType: "uint8",
|
|
786
|
+
name: "",
|
|
787
|
+
type: "uint8"
|
|
788
|
+
}
|
|
789
|
+
],
|
|
607
790
|
stateMutability: "view",
|
|
608
791
|
type: "function"
|
|
609
792
|
},
|
|
610
793
|
{
|
|
611
794
|
inputs: [],
|
|
612
795
|
name: "PHASE_EXPIRED",
|
|
613
|
-
outputs: [
|
|
796
|
+
outputs: [
|
|
797
|
+
{
|
|
798
|
+
internalType: "uint8",
|
|
799
|
+
name: "",
|
|
800
|
+
type: "uint8"
|
|
801
|
+
}
|
|
802
|
+
],
|
|
614
803
|
stateMutability: "view",
|
|
615
804
|
type: "function"
|
|
616
805
|
},
|
|
617
806
|
{
|
|
618
807
|
inputs: [],
|
|
619
808
|
name: "PHASE_NEGOTIATION",
|
|
620
|
-
outputs: [
|
|
809
|
+
outputs: [
|
|
810
|
+
{
|
|
811
|
+
internalType: "uint8",
|
|
812
|
+
name: "",
|
|
813
|
+
type: "uint8"
|
|
814
|
+
}
|
|
815
|
+
],
|
|
621
816
|
stateMutability: "view",
|
|
622
817
|
type: "function"
|
|
623
818
|
},
|
|
624
819
|
{
|
|
625
820
|
inputs: [],
|
|
626
821
|
name: "PHASE_REJECTED",
|
|
627
|
-
outputs: [
|
|
822
|
+
outputs: [
|
|
823
|
+
{
|
|
824
|
+
internalType: "uint8",
|
|
825
|
+
name: "",
|
|
826
|
+
type: "uint8"
|
|
827
|
+
}
|
|
828
|
+
],
|
|
628
829
|
stateMutability: "view",
|
|
629
830
|
type: "function"
|
|
630
831
|
},
|
|
631
832
|
{
|
|
632
833
|
inputs: [],
|
|
633
834
|
name: "PHASE_REQUEST",
|
|
634
|
-
outputs: [
|
|
835
|
+
outputs: [
|
|
836
|
+
{
|
|
837
|
+
internalType: "uint8",
|
|
838
|
+
name: "",
|
|
839
|
+
type: "uint8"
|
|
840
|
+
}
|
|
841
|
+
],
|
|
635
842
|
stateMutability: "view",
|
|
636
843
|
type: "function"
|
|
637
844
|
},
|
|
638
845
|
{
|
|
639
846
|
inputs: [],
|
|
640
847
|
name: "PHASE_TRANSACTION",
|
|
641
|
-
outputs: [
|
|
848
|
+
outputs: [
|
|
849
|
+
{
|
|
850
|
+
internalType: "uint8",
|
|
851
|
+
name: "",
|
|
852
|
+
type: "uint8"
|
|
853
|
+
}
|
|
854
|
+
],
|
|
642
855
|
stateMutability: "view",
|
|
643
856
|
type: "function"
|
|
644
857
|
},
|
|
645
858
|
{
|
|
646
859
|
inputs: [],
|
|
647
860
|
name: "TOTAL_PHASES",
|
|
648
|
-
outputs: [
|
|
861
|
+
outputs: [
|
|
862
|
+
{
|
|
863
|
+
internalType: "uint8",
|
|
864
|
+
name: "",
|
|
865
|
+
type: "uint8"
|
|
866
|
+
}
|
|
867
|
+
],
|
|
649
868
|
stateMutability: "view",
|
|
650
869
|
type: "function"
|
|
651
870
|
},
|
|
652
871
|
{
|
|
653
872
|
inputs: [
|
|
654
|
-
{
|
|
873
|
+
{
|
|
874
|
+
internalType: "address",
|
|
875
|
+
name: "account",
|
|
876
|
+
type: "address"
|
|
877
|
+
},
|
|
655
878
|
{
|
|
656
879
|
components: [
|
|
657
|
-
{
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
{
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
880
|
+
{
|
|
881
|
+
internalType: "uint256",
|
|
882
|
+
name: "id",
|
|
883
|
+
type: "uint256"
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
internalType: "address",
|
|
887
|
+
name: "client",
|
|
888
|
+
type: "address"
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
internalType: "address",
|
|
892
|
+
name: "provider",
|
|
893
|
+
type: "address"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
internalType: "uint256",
|
|
897
|
+
name: "budget",
|
|
898
|
+
type: "uint256"
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
internalType: "uint256",
|
|
902
|
+
name: "amountClaimed",
|
|
903
|
+
type: "uint256"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
internalType: "uint8",
|
|
907
|
+
name: "phase",
|
|
908
|
+
type: "uint8"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
internalType: "uint256",
|
|
912
|
+
name: "memoCount",
|
|
913
|
+
type: "uint256"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
internalType: "uint256",
|
|
917
|
+
name: "expiredAt",
|
|
918
|
+
type: "uint256"
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
internalType: "address",
|
|
922
|
+
name: "evaluator",
|
|
923
|
+
type: "address"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
internalType: "contract IERC20",
|
|
927
|
+
name: "jobPaymentToken",
|
|
928
|
+
type: "address"
|
|
929
|
+
}
|
|
666
930
|
],
|
|
667
931
|
internalType: "struct ACPSimple.Job",
|
|
668
932
|
name: "job",
|
|
@@ -670,53 +934,129 @@ var ACP_ABI = [
|
|
|
670
934
|
}
|
|
671
935
|
],
|
|
672
936
|
name: "canSign",
|
|
673
|
-
outputs: [
|
|
937
|
+
outputs: [
|
|
938
|
+
{
|
|
939
|
+
internalType: "bool",
|
|
940
|
+
name: "",
|
|
941
|
+
type: "bool"
|
|
942
|
+
}
|
|
943
|
+
],
|
|
674
944
|
stateMutability: "pure",
|
|
675
945
|
type: "function"
|
|
676
946
|
},
|
|
677
947
|
{
|
|
678
|
-
inputs: [
|
|
679
|
-
|
|
680
|
-
|
|
948
|
+
inputs: [
|
|
949
|
+
{
|
|
950
|
+
internalType: "uint256",
|
|
951
|
+
name: "id",
|
|
952
|
+
type: "uint256"
|
|
953
|
+
}
|
|
954
|
+
],
|
|
955
|
+
name: "claimBudget",
|
|
956
|
+
outputs: [],
|
|
681
957
|
stateMutability: "nonpayable",
|
|
682
958
|
type: "function"
|
|
683
959
|
},
|
|
684
960
|
{
|
|
685
961
|
inputs: [
|
|
686
|
-
{
|
|
687
|
-
|
|
688
|
-
|
|
962
|
+
{
|
|
963
|
+
internalType: "address",
|
|
964
|
+
name: "provider",
|
|
965
|
+
type: "address"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
internalType: "address",
|
|
969
|
+
name: "evaluator",
|
|
970
|
+
type: "address"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
internalType: "uint256",
|
|
974
|
+
name: "expiredAt",
|
|
975
|
+
type: "uint256"
|
|
976
|
+
}
|
|
689
977
|
],
|
|
690
978
|
name: "createJob",
|
|
691
|
-
outputs: [
|
|
979
|
+
outputs: [
|
|
980
|
+
{
|
|
981
|
+
internalType: "uint256",
|
|
982
|
+
name: "",
|
|
983
|
+
type: "uint256"
|
|
984
|
+
}
|
|
985
|
+
],
|
|
692
986
|
stateMutability: "nonpayable",
|
|
693
987
|
type: "function"
|
|
694
988
|
},
|
|
695
989
|
{
|
|
696
990
|
inputs: [
|
|
697
|
-
{
|
|
698
|
-
|
|
991
|
+
{
|
|
992
|
+
internalType: "uint256",
|
|
993
|
+
name: "jobId",
|
|
994
|
+
type: "uint256"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
internalType: "string",
|
|
998
|
+
name: "content",
|
|
999
|
+
type: "string"
|
|
1000
|
+
},
|
|
699
1001
|
{
|
|
700
1002
|
internalType: "enum InteractionLedger.MemoType",
|
|
701
1003
|
name: "memoType",
|
|
702
1004
|
type: "uint8"
|
|
703
1005
|
},
|
|
704
|
-
{
|
|
705
|
-
|
|
1006
|
+
{
|
|
1007
|
+
internalType: "bool",
|
|
1008
|
+
name: "isSecured",
|
|
1009
|
+
type: "bool"
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
internalType: "uint8",
|
|
1013
|
+
name: "nextPhase",
|
|
1014
|
+
type: "uint8"
|
|
1015
|
+
}
|
|
706
1016
|
],
|
|
707
1017
|
name: "createMemo",
|
|
708
|
-
outputs: [
|
|
1018
|
+
outputs: [
|
|
1019
|
+
{
|
|
1020
|
+
internalType: "uint256",
|
|
1021
|
+
name: "",
|
|
1022
|
+
type: "uint256"
|
|
1023
|
+
}
|
|
1024
|
+
],
|
|
709
1025
|
stateMutability: "nonpayable",
|
|
710
1026
|
type: "function"
|
|
711
1027
|
},
|
|
712
1028
|
{
|
|
713
1029
|
inputs: [
|
|
714
|
-
{
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
{
|
|
1030
|
+
{
|
|
1031
|
+
internalType: "uint256",
|
|
1032
|
+
name: "jobId",
|
|
1033
|
+
type: "uint256"
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
internalType: "string",
|
|
1037
|
+
name: "content",
|
|
1038
|
+
type: "string"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
internalType: "address",
|
|
1042
|
+
name: "token",
|
|
1043
|
+
type: "address"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
internalType: "uint256",
|
|
1047
|
+
name: "amount",
|
|
1048
|
+
type: "uint256"
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
internalType: "address",
|
|
1052
|
+
name: "recipient",
|
|
1053
|
+
type: "address"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
internalType: "uint256",
|
|
1057
|
+
name: "feeAmount",
|
|
1058
|
+
type: "uint256"
|
|
1059
|
+
},
|
|
720
1060
|
{
|
|
721
1061
|
internalType: "enum ACPSimple.FeeType",
|
|
722
1062
|
name: "feeType",
|
|
@@ -727,88 +1067,198 @@ var ACP_ABI = [
|
|
|
727
1067
|
name: "memoType",
|
|
728
1068
|
type: "uint8"
|
|
729
1069
|
},
|
|
730
|
-
{
|
|
731
|
-
|
|
1070
|
+
{
|
|
1071
|
+
internalType: "uint8",
|
|
1072
|
+
name: "nextPhase",
|
|
1073
|
+
type: "uint8"
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
internalType: "uint256",
|
|
1077
|
+
name: "expiredAt",
|
|
1078
|
+
type: "uint256"
|
|
1079
|
+
}
|
|
732
1080
|
],
|
|
733
1081
|
name: "createPayableMemo",
|
|
734
|
-
outputs: [
|
|
1082
|
+
outputs: [
|
|
1083
|
+
{
|
|
1084
|
+
internalType: "uint256",
|
|
1085
|
+
name: "",
|
|
1086
|
+
type: "uint256"
|
|
1087
|
+
}
|
|
1088
|
+
],
|
|
735
1089
|
stateMutability: "nonpayable",
|
|
736
1090
|
type: "function"
|
|
737
1091
|
},
|
|
738
1092
|
{
|
|
739
1093
|
inputs: [],
|
|
740
1094
|
name: "evaluatorFeeBP",
|
|
741
|
-
outputs: [
|
|
1095
|
+
outputs: [
|
|
1096
|
+
{
|
|
1097
|
+
internalType: "uint256",
|
|
1098
|
+
name: "",
|
|
1099
|
+
type: "uint256"
|
|
1100
|
+
}
|
|
1101
|
+
],
|
|
742
1102
|
stateMutability: "view",
|
|
743
1103
|
type: "function"
|
|
744
1104
|
},
|
|
745
1105
|
{
|
|
746
1106
|
inputs: [
|
|
747
|
-
{
|
|
748
|
-
|
|
749
|
-
|
|
1107
|
+
{
|
|
1108
|
+
internalType: "uint256",
|
|
1109
|
+
name: "jobId",
|
|
1110
|
+
type: "uint256"
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
internalType: "uint256",
|
|
1114
|
+
name: "offset",
|
|
1115
|
+
type: "uint256"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
internalType: "uint256",
|
|
1119
|
+
name: "limit",
|
|
1120
|
+
type: "uint256"
|
|
1121
|
+
}
|
|
750
1122
|
],
|
|
751
1123
|
name: "getAllMemos",
|
|
752
1124
|
outputs: [
|
|
753
1125
|
{
|
|
754
1126
|
components: [
|
|
755
|
-
{
|
|
1127
|
+
{
|
|
1128
|
+
internalType: "string",
|
|
1129
|
+
name: "content",
|
|
1130
|
+
type: "string"
|
|
1131
|
+
},
|
|
756
1132
|
{
|
|
757
1133
|
internalType: "enum InteractionLedger.MemoType",
|
|
758
1134
|
name: "memoType",
|
|
759
1135
|
type: "uint8"
|
|
760
1136
|
},
|
|
761
|
-
{
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
1137
|
+
{
|
|
1138
|
+
internalType: "bool",
|
|
1139
|
+
name: "isSecured",
|
|
1140
|
+
type: "bool"
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
internalType: "uint8",
|
|
1144
|
+
name: "nextPhase",
|
|
1145
|
+
type: "uint8"
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
internalType: "uint256",
|
|
1149
|
+
name: "jobId",
|
|
1150
|
+
type: "uint256"
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
internalType: "address",
|
|
1154
|
+
name: "sender",
|
|
1155
|
+
type: "address"
|
|
1156
|
+
}
|
|
765
1157
|
],
|
|
766
1158
|
internalType: "struct InteractionLedger.Memo[]",
|
|
767
1159
|
name: "",
|
|
768
1160
|
type: "tuple[]"
|
|
769
1161
|
},
|
|
770
|
-
{
|
|
1162
|
+
{
|
|
1163
|
+
internalType: "uint256",
|
|
1164
|
+
name: "total",
|
|
1165
|
+
type: "uint256"
|
|
1166
|
+
}
|
|
771
1167
|
],
|
|
772
1168
|
stateMutability: "view",
|
|
773
1169
|
type: "function"
|
|
774
1170
|
},
|
|
775
1171
|
{
|
|
776
1172
|
inputs: [
|
|
777
|
-
{
|
|
778
|
-
|
|
1173
|
+
{
|
|
1174
|
+
internalType: "uint256",
|
|
1175
|
+
name: "jobId",
|
|
1176
|
+
type: "uint256"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
internalType: "uint8",
|
|
1180
|
+
name: "phase",
|
|
1181
|
+
type: "uint8"
|
|
1182
|
+
}
|
|
779
1183
|
],
|
|
780
1184
|
name: "getJobPhaseMemoIds",
|
|
781
|
-
outputs: [
|
|
1185
|
+
outputs: [
|
|
1186
|
+
{
|
|
1187
|
+
internalType: "uint256[]",
|
|
1188
|
+
name: "",
|
|
1189
|
+
type: "uint256[]"
|
|
1190
|
+
}
|
|
1191
|
+
],
|
|
782
1192
|
stateMutability: "view",
|
|
783
1193
|
type: "function"
|
|
784
1194
|
},
|
|
785
1195
|
{
|
|
786
1196
|
inputs: [
|
|
787
|
-
{
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1197
|
+
{
|
|
1198
|
+
internalType: "uint256",
|
|
1199
|
+
name: "jobId",
|
|
1200
|
+
type: "uint256"
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
internalType: "uint8",
|
|
1204
|
+
name: "phase",
|
|
1205
|
+
type: "uint8"
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
internalType: "uint256",
|
|
1209
|
+
name: "offset",
|
|
1210
|
+
type: "uint256"
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
internalType: "uint256",
|
|
1214
|
+
name: "limit",
|
|
1215
|
+
type: "uint256"
|
|
1216
|
+
}
|
|
791
1217
|
],
|
|
792
1218
|
name: "getMemosForPhase",
|
|
793
1219
|
outputs: [
|
|
794
1220
|
{
|
|
795
1221
|
components: [
|
|
796
|
-
{
|
|
1222
|
+
{
|
|
1223
|
+
internalType: "string",
|
|
1224
|
+
name: "content",
|
|
1225
|
+
type: "string"
|
|
1226
|
+
},
|
|
797
1227
|
{
|
|
798
1228
|
internalType: "enum InteractionLedger.MemoType",
|
|
799
1229
|
name: "memoType",
|
|
800
1230
|
type: "uint8"
|
|
801
1231
|
},
|
|
802
|
-
{
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
1232
|
+
{
|
|
1233
|
+
internalType: "bool",
|
|
1234
|
+
name: "isSecured",
|
|
1235
|
+
type: "bool"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
internalType: "uint8",
|
|
1239
|
+
name: "nextPhase",
|
|
1240
|
+
type: "uint8"
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
internalType: "uint256",
|
|
1244
|
+
name: "jobId",
|
|
1245
|
+
type: "uint256"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
internalType: "address",
|
|
1249
|
+
name: "sender",
|
|
1250
|
+
type: "address"
|
|
1251
|
+
}
|
|
806
1252
|
],
|
|
807
1253
|
internalType: "struct InteractionLedger.Memo[]",
|
|
808
1254
|
name: "",
|
|
809
1255
|
type: "tuple[]"
|
|
810
1256
|
},
|
|
811
|
-
{
|
|
1257
|
+
{
|
|
1258
|
+
internalType: "uint256",
|
|
1259
|
+
name: "total",
|
|
1260
|
+
type: "uint256"
|
|
1261
|
+
}
|
|
812
1262
|
],
|
|
813
1263
|
stateMutability: "view",
|
|
814
1264
|
type: "function"
|
|
@@ -816,21 +1266,47 @@ var ACP_ABI = [
|
|
|
816
1266
|
{
|
|
817
1267
|
inputs: [],
|
|
818
1268
|
name: "getPhases",
|
|
819
|
-
outputs: [
|
|
1269
|
+
outputs: [
|
|
1270
|
+
{
|
|
1271
|
+
internalType: "string[7]",
|
|
1272
|
+
name: "",
|
|
1273
|
+
type: "string[7]"
|
|
1274
|
+
}
|
|
1275
|
+
],
|
|
820
1276
|
stateMutability: "pure",
|
|
821
1277
|
type: "function"
|
|
822
1278
|
},
|
|
823
1279
|
{
|
|
824
|
-
inputs: [
|
|
1280
|
+
inputs: [
|
|
1281
|
+
{
|
|
1282
|
+
internalType: "bytes32",
|
|
1283
|
+
name: "role",
|
|
1284
|
+
type: "bytes32"
|
|
1285
|
+
}
|
|
1286
|
+
],
|
|
825
1287
|
name: "getRoleAdmin",
|
|
826
|
-
outputs: [
|
|
1288
|
+
outputs: [
|
|
1289
|
+
{
|
|
1290
|
+
internalType: "bytes32",
|
|
1291
|
+
name: "",
|
|
1292
|
+
type: "bytes32"
|
|
1293
|
+
}
|
|
1294
|
+
],
|
|
827
1295
|
stateMutability: "view",
|
|
828
1296
|
type: "function"
|
|
829
1297
|
},
|
|
830
1298
|
{
|
|
831
1299
|
inputs: [
|
|
832
|
-
{
|
|
833
|
-
|
|
1300
|
+
{
|
|
1301
|
+
internalType: "bytes32",
|
|
1302
|
+
name: "role",
|
|
1303
|
+
type: "bytes32"
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
internalType: "address",
|
|
1307
|
+
name: "account",
|
|
1308
|
+
type: "address"
|
|
1309
|
+
}
|
|
834
1310
|
],
|
|
835
1311
|
name: "grantRole",
|
|
836
1312
|
outputs: [],
|
|
@@ -839,20 +1315,50 @@ var ACP_ABI = [
|
|
|
839
1315
|
},
|
|
840
1316
|
{
|
|
841
1317
|
inputs: [
|
|
842
|
-
{
|
|
843
|
-
|
|
1318
|
+
{
|
|
1319
|
+
internalType: "bytes32",
|
|
1320
|
+
name: "role",
|
|
1321
|
+
type: "bytes32"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
internalType: "address",
|
|
1325
|
+
name: "account",
|
|
1326
|
+
type: "address"
|
|
1327
|
+
}
|
|
844
1328
|
],
|
|
845
1329
|
name: "hasRole",
|
|
846
|
-
outputs: [
|
|
1330
|
+
outputs: [
|
|
1331
|
+
{
|
|
1332
|
+
internalType: "bool",
|
|
1333
|
+
name: "",
|
|
1334
|
+
type: "bool"
|
|
1335
|
+
}
|
|
1336
|
+
],
|
|
847
1337
|
stateMutability: "view",
|
|
848
1338
|
type: "function"
|
|
849
1339
|
},
|
|
850
1340
|
{
|
|
851
1341
|
inputs: [
|
|
852
|
-
{
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1342
|
+
{
|
|
1343
|
+
internalType: "address",
|
|
1344
|
+
name: "paymentTokenAddress",
|
|
1345
|
+
type: "address"
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
internalType: "uint256",
|
|
1349
|
+
name: "evaluatorFeeBP_",
|
|
1350
|
+
type: "uint256"
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
internalType: "uint256",
|
|
1354
|
+
name: "platformFeeBP_",
|
|
1355
|
+
type: "uint256"
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
internalType: "address",
|
|
1359
|
+
name: "platformTreasury_",
|
|
1360
|
+
type: "address"
|
|
1361
|
+
}
|
|
856
1362
|
],
|
|
857
1363
|
name: "initialize",
|
|
858
1364
|
outputs: [],
|
|
@@ -861,59 +1367,168 @@ var ACP_ABI = [
|
|
|
861
1367
|
},
|
|
862
1368
|
{
|
|
863
1369
|
inputs: [
|
|
864
|
-
{
|
|
865
|
-
|
|
1370
|
+
{
|
|
1371
|
+
internalType: "uint256",
|
|
1372
|
+
name: "jobId",
|
|
1373
|
+
type: "uint256"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
internalType: "address",
|
|
1377
|
+
name: "account",
|
|
1378
|
+
type: "address"
|
|
1379
|
+
}
|
|
866
1380
|
],
|
|
867
1381
|
name: "isJobEvaluator",
|
|
868
|
-
outputs: [
|
|
1382
|
+
outputs: [
|
|
1383
|
+
{
|
|
1384
|
+
internalType: "bool",
|
|
1385
|
+
name: "",
|
|
1386
|
+
type: "bool"
|
|
1387
|
+
}
|
|
1388
|
+
],
|
|
869
1389
|
stateMutability: "view",
|
|
870
1390
|
type: "function"
|
|
871
1391
|
},
|
|
872
1392
|
{
|
|
873
|
-
inputs: [
|
|
1393
|
+
inputs: [
|
|
1394
|
+
{
|
|
1395
|
+
internalType: "uint256",
|
|
1396
|
+
name: "memoId",
|
|
1397
|
+
type: "uint256"
|
|
1398
|
+
}
|
|
1399
|
+
],
|
|
874
1400
|
name: "isPayableMemo",
|
|
875
|
-
outputs: [
|
|
1401
|
+
outputs: [
|
|
1402
|
+
{
|
|
1403
|
+
internalType: "bool",
|
|
1404
|
+
name: "",
|
|
1405
|
+
type: "bool"
|
|
1406
|
+
}
|
|
1407
|
+
],
|
|
876
1408
|
stateMutability: "view",
|
|
877
1409
|
type: "function"
|
|
878
1410
|
},
|
|
879
1411
|
{
|
|
880
|
-
inputs: [
|
|
1412
|
+
inputs: [
|
|
1413
|
+
{
|
|
1414
|
+
internalType: "uint256",
|
|
1415
|
+
name: "jobId",
|
|
1416
|
+
type: "uint256"
|
|
1417
|
+
}
|
|
1418
|
+
],
|
|
881
1419
|
name: "jobAdditionalFees",
|
|
882
|
-
outputs: [
|
|
1420
|
+
outputs: [
|
|
1421
|
+
{
|
|
1422
|
+
internalType: "uint256",
|
|
1423
|
+
name: "",
|
|
1424
|
+
type: "uint256"
|
|
1425
|
+
}
|
|
1426
|
+
],
|
|
883
1427
|
stateMutability: "view",
|
|
884
1428
|
type: "function"
|
|
885
1429
|
},
|
|
886
1430
|
{
|
|
887
1431
|
inputs: [],
|
|
888
1432
|
name: "jobCounter",
|
|
889
|
-
outputs: [
|
|
1433
|
+
outputs: [
|
|
1434
|
+
{
|
|
1435
|
+
internalType: "uint256",
|
|
1436
|
+
name: "",
|
|
1437
|
+
type: "uint256"
|
|
1438
|
+
}
|
|
1439
|
+
],
|
|
890
1440
|
stateMutability: "view",
|
|
891
1441
|
type: "function"
|
|
892
1442
|
},
|
|
893
1443
|
{
|
|
894
1444
|
inputs: [
|
|
895
|
-
{
|
|
896
|
-
|
|
897
|
-
|
|
1445
|
+
{
|
|
1446
|
+
internalType: "uint256",
|
|
1447
|
+
name: "jobId",
|
|
1448
|
+
type: "uint256"
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
internalType: "uint8",
|
|
1452
|
+
name: "phase",
|
|
1453
|
+
type: "uint8"
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
internalType: "uint256",
|
|
1457
|
+
name: "",
|
|
1458
|
+
type: "uint256"
|
|
1459
|
+
}
|
|
898
1460
|
],
|
|
899
1461
|
name: "jobMemoIds",
|
|
900
|
-
outputs: [
|
|
1462
|
+
outputs: [
|
|
1463
|
+
{
|
|
1464
|
+
internalType: "uint256",
|
|
1465
|
+
name: "memoIds",
|
|
1466
|
+
type: "uint256"
|
|
1467
|
+
}
|
|
1468
|
+
],
|
|
901
1469
|
stateMutability: "view",
|
|
902
1470
|
type: "function"
|
|
903
1471
|
},
|
|
904
1472
|
{
|
|
905
|
-
inputs: [
|
|
1473
|
+
inputs: [
|
|
1474
|
+
{
|
|
1475
|
+
internalType: "uint256",
|
|
1476
|
+
name: "",
|
|
1477
|
+
type: "uint256"
|
|
1478
|
+
}
|
|
1479
|
+
],
|
|
906
1480
|
name: "jobs",
|
|
907
1481
|
outputs: [
|
|
908
|
-
{
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
{
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1482
|
+
{
|
|
1483
|
+
internalType: "uint256",
|
|
1484
|
+
name: "id",
|
|
1485
|
+
type: "uint256"
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
internalType: "address",
|
|
1489
|
+
name: "client",
|
|
1490
|
+
type: "address"
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
internalType: "address",
|
|
1494
|
+
name: "provider",
|
|
1495
|
+
type: "address"
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
internalType: "uint256",
|
|
1499
|
+
name: "budget",
|
|
1500
|
+
type: "uint256"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
internalType: "uint256",
|
|
1504
|
+
name: "amountClaimed",
|
|
1505
|
+
type: "uint256"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
internalType: "uint8",
|
|
1509
|
+
name: "phase",
|
|
1510
|
+
type: "uint8"
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
internalType: "uint256",
|
|
1514
|
+
name: "memoCount",
|
|
1515
|
+
type: "uint256"
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
internalType: "uint256",
|
|
1519
|
+
name: "expiredAt",
|
|
1520
|
+
type: "uint256"
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
internalType: "address",
|
|
1524
|
+
name: "evaluator",
|
|
1525
|
+
type: "address"
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
internalType: "contract IERC20",
|
|
1529
|
+
name: "jobPaymentToken",
|
|
1530
|
+
type: "address"
|
|
1531
|
+
}
|
|
917
1532
|
],
|
|
918
1533
|
stateMutability: "view",
|
|
919
1534
|
type: "function"
|
|
@@ -921,31 +1536,75 @@ var ACP_ABI = [
|
|
|
921
1536
|
{
|
|
922
1537
|
inputs: [],
|
|
923
1538
|
name: "memoCounter",
|
|
924
|
-
outputs: [
|
|
1539
|
+
outputs: [
|
|
1540
|
+
{
|
|
1541
|
+
internalType: "uint256",
|
|
1542
|
+
name: "",
|
|
1543
|
+
type: "uint256"
|
|
1544
|
+
}
|
|
1545
|
+
],
|
|
925
1546
|
stateMutability: "view",
|
|
926
1547
|
type: "function"
|
|
927
1548
|
},
|
|
928
1549
|
{
|
|
929
|
-
inputs: [
|
|
1550
|
+
inputs: [
|
|
1551
|
+
{
|
|
1552
|
+
internalType: "uint256",
|
|
1553
|
+
name: "memoId",
|
|
1554
|
+
type: "uint256"
|
|
1555
|
+
}
|
|
1556
|
+
],
|
|
930
1557
|
name: "memoExpiredAt",
|
|
931
|
-
outputs: [
|
|
1558
|
+
outputs: [
|
|
1559
|
+
{
|
|
1560
|
+
internalType: "uint256",
|
|
1561
|
+
name: "expiredAt",
|
|
1562
|
+
type: "uint256"
|
|
1563
|
+
}
|
|
1564
|
+
],
|
|
932
1565
|
stateMutability: "view",
|
|
933
1566
|
type: "function"
|
|
934
1567
|
},
|
|
935
1568
|
{
|
|
936
|
-
inputs: [
|
|
1569
|
+
inputs: [
|
|
1570
|
+
{
|
|
1571
|
+
internalType: "uint256",
|
|
1572
|
+
name: "",
|
|
1573
|
+
type: "uint256"
|
|
1574
|
+
}
|
|
1575
|
+
],
|
|
937
1576
|
name: "memos",
|
|
938
1577
|
outputs: [
|
|
939
|
-
{
|
|
1578
|
+
{
|
|
1579
|
+
internalType: "string",
|
|
1580
|
+
name: "content",
|
|
1581
|
+
type: "string"
|
|
1582
|
+
},
|
|
940
1583
|
{
|
|
941
1584
|
internalType: "enum InteractionLedger.MemoType",
|
|
942
1585
|
name: "memoType",
|
|
943
1586
|
type: "uint8"
|
|
944
1587
|
},
|
|
945
|
-
{
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1588
|
+
{
|
|
1589
|
+
internalType: "bool",
|
|
1590
|
+
name: "isSecured",
|
|
1591
|
+
type: "bool"
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
internalType: "uint8",
|
|
1595
|
+
name: "nextPhase",
|
|
1596
|
+
type: "uint8"
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
internalType: "uint256",
|
|
1600
|
+
name: "jobId",
|
|
1601
|
+
type: "uint256"
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
internalType: "address",
|
|
1605
|
+
name: "sender",
|
|
1606
|
+
type: "address"
|
|
1607
|
+
}
|
|
949
1608
|
],
|
|
950
1609
|
stateMutability: "view",
|
|
951
1610
|
type: "function"
|
|
@@ -953,24 +1612,56 @@ var ACP_ABI = [
|
|
|
953
1612
|
{
|
|
954
1613
|
inputs: [],
|
|
955
1614
|
name: "numEvaluatorsPerJob",
|
|
956
|
-
outputs: [
|
|
1615
|
+
outputs: [
|
|
1616
|
+
{
|
|
1617
|
+
internalType: "uint8",
|
|
1618
|
+
name: "",
|
|
1619
|
+
type: "uint8"
|
|
1620
|
+
}
|
|
1621
|
+
],
|
|
957
1622
|
stateMutability: "view",
|
|
958
1623
|
type: "function"
|
|
959
1624
|
},
|
|
960
1625
|
{
|
|
961
|
-
inputs: [
|
|
1626
|
+
inputs: [
|
|
1627
|
+
{
|
|
1628
|
+
internalType: "uint256",
|
|
1629
|
+
name: "memoId",
|
|
1630
|
+
type: "uint256"
|
|
1631
|
+
}
|
|
1632
|
+
],
|
|
962
1633
|
name: "payableDetails",
|
|
963
1634
|
outputs: [
|
|
964
|
-
{
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1635
|
+
{
|
|
1636
|
+
internalType: "address",
|
|
1637
|
+
name: "token",
|
|
1638
|
+
type: "address"
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
internalType: "uint256",
|
|
1642
|
+
name: "amount",
|
|
1643
|
+
type: "uint256"
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
internalType: "address",
|
|
1647
|
+
name: "recipient",
|
|
1648
|
+
type: "address"
|
|
1649
|
+
},
|
|
1650
|
+
{
|
|
1651
|
+
internalType: "uint256",
|
|
1652
|
+
name: "feeAmount",
|
|
1653
|
+
type: "uint256"
|
|
1654
|
+
},
|
|
968
1655
|
{
|
|
969
1656
|
internalType: "enum ACPSimple.FeeType",
|
|
970
1657
|
name: "feeType",
|
|
971
1658
|
type: "uint8"
|
|
972
1659
|
},
|
|
973
|
-
{
|
|
1660
|
+
{
|
|
1661
|
+
internalType: "bool",
|
|
1662
|
+
name: "isExecuted",
|
|
1663
|
+
type: "bool"
|
|
1664
|
+
}
|
|
974
1665
|
],
|
|
975
1666
|
stateMutability: "view",
|
|
976
1667
|
type: "function"
|
|
@@ -978,28 +1669,54 @@ var ACP_ABI = [
|
|
|
978
1669
|
{
|
|
979
1670
|
inputs: [],
|
|
980
1671
|
name: "paymentToken",
|
|
981
|
-
outputs: [
|
|
1672
|
+
outputs: [
|
|
1673
|
+
{
|
|
1674
|
+
internalType: "contract IERC20",
|
|
1675
|
+
name: "",
|
|
1676
|
+
type: "address"
|
|
1677
|
+
}
|
|
1678
|
+
],
|
|
982
1679
|
stateMutability: "view",
|
|
983
1680
|
type: "function"
|
|
984
1681
|
},
|
|
985
1682
|
{
|
|
986
1683
|
inputs: [],
|
|
987
1684
|
name: "platformFeeBP",
|
|
988
|
-
outputs: [
|
|
1685
|
+
outputs: [
|
|
1686
|
+
{
|
|
1687
|
+
internalType: "uint256",
|
|
1688
|
+
name: "",
|
|
1689
|
+
type: "uint256"
|
|
1690
|
+
}
|
|
1691
|
+
],
|
|
989
1692
|
stateMutability: "view",
|
|
990
1693
|
type: "function"
|
|
991
1694
|
},
|
|
992
1695
|
{
|
|
993
1696
|
inputs: [],
|
|
994
1697
|
name: "platformTreasury",
|
|
995
|
-
outputs: [
|
|
1698
|
+
outputs: [
|
|
1699
|
+
{
|
|
1700
|
+
internalType: "address",
|
|
1701
|
+
name: "",
|
|
1702
|
+
type: "address"
|
|
1703
|
+
}
|
|
1704
|
+
],
|
|
996
1705
|
stateMutability: "view",
|
|
997
1706
|
type: "function"
|
|
998
1707
|
},
|
|
999
1708
|
{
|
|
1000
1709
|
inputs: [
|
|
1001
|
-
{
|
|
1002
|
-
|
|
1710
|
+
{
|
|
1711
|
+
internalType: "bytes32",
|
|
1712
|
+
name: "role",
|
|
1713
|
+
type: "bytes32"
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
internalType: "address",
|
|
1717
|
+
name: "callerConfirmation",
|
|
1718
|
+
type: "address"
|
|
1719
|
+
}
|
|
1003
1720
|
],
|
|
1004
1721
|
name: "renounceRole",
|
|
1005
1722
|
outputs: [],
|
|
@@ -1008,8 +1725,16 @@ var ACP_ABI = [
|
|
|
1008
1725
|
},
|
|
1009
1726
|
{
|
|
1010
1727
|
inputs: [
|
|
1011
|
-
{
|
|
1012
|
-
|
|
1728
|
+
{
|
|
1729
|
+
internalType: "bytes32",
|
|
1730
|
+
name: "role",
|
|
1731
|
+
type: "bytes32"
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
internalType: "address",
|
|
1735
|
+
name: "account",
|
|
1736
|
+
type: "address"
|
|
1737
|
+
}
|
|
1013
1738
|
],
|
|
1014
1739
|
name: "revokeRole",
|
|
1015
1740
|
outputs: [],
|
|
@@ -1018,8 +1743,16 @@ var ACP_ABI = [
|
|
|
1018
1743
|
},
|
|
1019
1744
|
{
|
|
1020
1745
|
inputs: [
|
|
1021
|
-
{
|
|
1022
|
-
|
|
1746
|
+
{
|
|
1747
|
+
internalType: "uint256",
|
|
1748
|
+
name: "jobId",
|
|
1749
|
+
type: "uint256"
|
|
1750
|
+
},
|
|
1751
|
+
{
|
|
1752
|
+
internalType: "uint256",
|
|
1753
|
+
name: "amount",
|
|
1754
|
+
type: "uint256"
|
|
1755
|
+
}
|
|
1023
1756
|
],
|
|
1024
1757
|
name: "setBudget",
|
|
1025
1758
|
outputs: [],
|
|
@@ -1028,9 +1761,44 @@ var ACP_ABI = [
|
|
|
1028
1761
|
},
|
|
1029
1762
|
{
|
|
1030
1763
|
inputs: [
|
|
1031
|
-
{
|
|
1032
|
-
|
|
1033
|
-
|
|
1764
|
+
{
|
|
1765
|
+
internalType: "uint256",
|
|
1766
|
+
name: "jobId",
|
|
1767
|
+
type: "uint256"
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
internalType: "uint256",
|
|
1771
|
+
name: "amount",
|
|
1772
|
+
type: "uint256"
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
internalType: "contract IERC20",
|
|
1776
|
+
name: "jobPaymentToken_",
|
|
1777
|
+
type: "address"
|
|
1778
|
+
}
|
|
1779
|
+
],
|
|
1780
|
+
name: "setBudgetWithPaymentToken",
|
|
1781
|
+
outputs: [],
|
|
1782
|
+
stateMutability: "nonpayable",
|
|
1783
|
+
type: "function"
|
|
1784
|
+
},
|
|
1785
|
+
{
|
|
1786
|
+
inputs: [
|
|
1787
|
+
{
|
|
1788
|
+
internalType: "uint256",
|
|
1789
|
+
name: "memoId",
|
|
1790
|
+
type: "uint256"
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
internalType: "bool",
|
|
1794
|
+
name: "isApproved",
|
|
1795
|
+
type: "bool"
|
|
1796
|
+
},
|
|
1797
|
+
{
|
|
1798
|
+
internalType: "string",
|
|
1799
|
+
name: "reason",
|
|
1800
|
+
type: "string"
|
|
1801
|
+
}
|
|
1034
1802
|
],
|
|
1035
1803
|
name: "signMemo",
|
|
1036
1804
|
outputs: [],
|
|
@@ -1039,24 +1807,54 @@ var ACP_ABI = [
|
|
|
1039
1807
|
},
|
|
1040
1808
|
{
|
|
1041
1809
|
inputs: [
|
|
1042
|
-
{
|
|
1043
|
-
|
|
1810
|
+
{
|
|
1811
|
+
internalType: "uint256",
|
|
1812
|
+
name: "memoId",
|
|
1813
|
+
type: "uint256"
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
internalType: "address",
|
|
1817
|
+
name: "signer",
|
|
1818
|
+
type: "address"
|
|
1819
|
+
}
|
|
1044
1820
|
],
|
|
1045
1821
|
name: "signatories",
|
|
1046
|
-
outputs: [
|
|
1822
|
+
outputs: [
|
|
1823
|
+
{
|
|
1824
|
+
internalType: "uint8",
|
|
1825
|
+
name: "res",
|
|
1826
|
+
type: "uint8"
|
|
1827
|
+
}
|
|
1828
|
+
],
|
|
1047
1829
|
stateMutability: "view",
|
|
1048
1830
|
type: "function"
|
|
1049
1831
|
},
|
|
1050
1832
|
{
|
|
1051
|
-
inputs: [
|
|
1833
|
+
inputs: [
|
|
1834
|
+
{
|
|
1835
|
+
internalType: "bytes4",
|
|
1836
|
+
name: "interfaceId",
|
|
1837
|
+
type: "bytes4"
|
|
1838
|
+
}
|
|
1839
|
+
],
|
|
1052
1840
|
name: "supportsInterface",
|
|
1053
|
-
outputs: [
|
|
1841
|
+
outputs: [
|
|
1842
|
+
{
|
|
1843
|
+
internalType: "bool",
|
|
1844
|
+
name: "",
|
|
1845
|
+
type: "bool"
|
|
1846
|
+
}
|
|
1847
|
+
],
|
|
1054
1848
|
stateMutability: "view",
|
|
1055
1849
|
type: "function"
|
|
1056
1850
|
},
|
|
1057
1851
|
{
|
|
1058
1852
|
inputs: [
|
|
1059
|
-
{
|
|
1853
|
+
{
|
|
1854
|
+
internalType: "uint256",
|
|
1855
|
+
name: "evaluatorFeeBP_",
|
|
1856
|
+
type: "uint256"
|
|
1857
|
+
}
|
|
1060
1858
|
],
|
|
1061
1859
|
name: "updateEvaluatorFee",
|
|
1062
1860
|
outputs: [],
|
|
@@ -1065,19 +1863,39 @@ var ACP_ABI = [
|
|
|
1065
1863
|
},
|
|
1066
1864
|
{
|
|
1067
1865
|
inputs: [
|
|
1068
|
-
{
|
|
1069
|
-
|
|
1866
|
+
{
|
|
1867
|
+
internalType: "uint256",
|
|
1868
|
+
name: "platformFeeBP_",
|
|
1869
|
+
type: "uint256"
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
internalType: "address",
|
|
1873
|
+
name: "platformTreasury_",
|
|
1874
|
+
type: "address"
|
|
1875
|
+
}
|
|
1070
1876
|
],
|
|
1071
1877
|
name: "updatePlatformFee",
|
|
1072
1878
|
outputs: [],
|
|
1073
1879
|
stateMutability: "nonpayable",
|
|
1074
1880
|
type: "function"
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
inputs: [
|
|
1884
|
+
{
|
|
1885
|
+
internalType: "uint256",
|
|
1886
|
+
name: "memoId",
|
|
1887
|
+
type: "uint256"
|
|
1888
|
+
}
|
|
1889
|
+
],
|
|
1890
|
+
name: "withdrawEscrowedFunds",
|
|
1891
|
+
outputs: [],
|
|
1892
|
+
stateMutability: "nonpayable",
|
|
1893
|
+
type: "function"
|
|
1075
1894
|
}
|
|
1076
1895
|
];
|
|
1077
1896
|
var acpAbi_default = ACP_ABI;
|
|
1078
1897
|
|
|
1079
1898
|
// src/acpClient.ts
|
|
1080
|
-
var import_viem2 = require("viem");
|
|
1081
1899
|
var import_socket = require("socket.io-client");
|
|
1082
1900
|
|
|
1083
1901
|
// src/acpContractClient.ts
|
|
@@ -1090,7 +1908,8 @@ var import_infra = require("@account-kit/infra");
|
|
|
1090
1908
|
var baseSepoliaAcpConfig = {
|
|
1091
1909
|
chain: import_infra.baseSepolia,
|
|
1092
1910
|
contractAddress: "0x8Db6B1c839Fc8f6bd35777E194677B67b4D51928",
|
|
1093
|
-
|
|
1911
|
+
paymentTokenAddress: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
|
|
1912
|
+
paymentTokenDecimals: 6,
|
|
1094
1913
|
alchemyRpcUrl: "https://alchemy-proxy.virtuals.io/api/proxy/rpc",
|
|
1095
1914
|
acpUrl: "https://acpx.virtuals.gg",
|
|
1096
1915
|
priorityFeeMultiplier: 2,
|
|
@@ -1100,7 +1919,8 @@ var baseSepoliaAcpConfig = {
|
|
|
1100
1919
|
var baseAcpConfig = {
|
|
1101
1920
|
chain: import_infra.base,
|
|
1102
1921
|
contractAddress: "0x6a1FE26D54ab0d3E1e3168f2e0c0cDa5cC0A0A4A",
|
|
1103
|
-
|
|
1922
|
+
paymentTokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
1923
|
+
paymentTokenDecimals: 6,
|
|
1104
1924
|
alchemyRpcUrl: "https://alchemy-proxy-prod.virtuals.io/api/proxy/rpc",
|
|
1105
1925
|
acpUrl: "https://acpx.virtuals.io",
|
|
1106
1926
|
priorityFeeMultiplier: 2,
|
|
@@ -1120,8 +1940,7 @@ var MemoType = /* @__PURE__ */ ((MemoType2) => {
|
|
|
1120
1940
|
MemoType2[MemoType2["TXHASH"] = 5] = "TXHASH";
|
|
1121
1941
|
MemoType2[MemoType2["PAYABLE_REQUEST"] = 6] = "PAYABLE_REQUEST";
|
|
1122
1942
|
MemoType2[MemoType2["PAYABLE_TRANSFER"] = 7] = "PAYABLE_TRANSFER";
|
|
1123
|
-
MemoType2[MemoType2["
|
|
1124
|
-
MemoType2[MemoType2["PAYABLE_FEE_REQUEST"] = 9] = "PAYABLE_FEE_REQUEST";
|
|
1943
|
+
MemoType2[MemoType2["PAYABLE_TRANSFER_ESCROW"] = 8] = "PAYABLE_TRANSFER_ESCROW";
|
|
1125
1944
|
return MemoType2;
|
|
1126
1945
|
})(MemoType || {});
|
|
1127
1946
|
var AcpJobPhases = /* @__PURE__ */ ((AcpJobPhases2) => {
|
|
@@ -1144,7 +1963,7 @@ var AcpContractClient = class _AcpContractClient {
|
|
|
1144
1963
|
this.MAX_RETRIES = 3;
|
|
1145
1964
|
this.chain = config.chain;
|
|
1146
1965
|
this.contractAddress = config.contractAddress;
|
|
1147
|
-
this.
|
|
1966
|
+
this.paymentTokenAddress = config.paymentTokenAddress;
|
|
1148
1967
|
this.customRpcUrl = customRpcUrl;
|
|
1149
1968
|
this.customRpcClient = (0, import_viem.createPublicClient)({
|
|
1150
1969
|
chain: this.chain,
|
|
@@ -1254,6 +2073,9 @@ var AcpContractClient = class _AcpContractClient {
|
|
|
1254
2073
|
return (0, import_viem.fromHex)(contractLogs.data, "number");
|
|
1255
2074
|
});
|
|
1256
2075
|
}
|
|
2076
|
+
formatAmount(amount) {
|
|
2077
|
+
return (0, import_viem.parseUnits)(amount.toString(), this.config.paymentTokenDecimals);
|
|
2078
|
+
}
|
|
1257
2079
|
createJob(providerAddress, evaluatorAddress, expireAt) {
|
|
1258
2080
|
return __async(this, null, function* () {
|
|
1259
2081
|
try {
|
|
@@ -1275,57 +2097,23 @@ var AcpContractClient = class _AcpContractClient {
|
|
|
1275
2097
|
}
|
|
1276
2098
|
});
|
|
1277
2099
|
}
|
|
1278
|
-
approveAllowance(
|
|
1279
|
-
return __async(this,
|
|
2100
|
+
approveAllowance(_0) {
|
|
2101
|
+
return __async(this, arguments, function* (amount, paymentTokenAddress = this.paymentTokenAddress) {
|
|
1280
2102
|
try {
|
|
1281
2103
|
const data = (0, import_viem.encodeFunctionData)({
|
|
1282
2104
|
abi: import_viem.erc20Abi,
|
|
1283
2105
|
functionName: "approve",
|
|
1284
|
-
args: [this.contractAddress,
|
|
2106
|
+
args: [this.contractAddress, this.formatAmount(amount)]
|
|
1285
2107
|
});
|
|
1286
|
-
return yield this.handleSendUserOperation(
|
|
1287
|
-
data,
|
|
1288
|
-
this.virtualsTokenAddress
|
|
1289
|
-
);
|
|
2108
|
+
return yield this.handleSendUserOperation(data, paymentTokenAddress);
|
|
1290
2109
|
} catch (error) {
|
|
1291
2110
|
console.error(`Failed to approve allowance ${error}`);
|
|
1292
2111
|
throw new Error("Failed to approve allowance");
|
|
1293
2112
|
}
|
|
1294
2113
|
});
|
|
1295
2114
|
}
|
|
1296
|
-
createPayableFeeMemo(jobId, content, amount, memoType, nextPhase) {
|
|
1297
|
-
return __async(this, null, function* () {
|
|
1298
|
-
let retries = 3;
|
|
1299
|
-
while (retries > 0) {
|
|
1300
|
-
try {
|
|
1301
|
-
const data = (0, import_viem.encodeFunctionData)({
|
|
1302
|
-
abi: acpAbi_default,
|
|
1303
|
-
functionName: "createPayableFeeMemo",
|
|
1304
|
-
args: [jobId, content, amount, memoType, nextPhase]
|
|
1305
|
-
});
|
|
1306
|
-
const { hash } = yield this.sessionKeyClient.sendUserOperation({
|
|
1307
|
-
uo: {
|
|
1308
|
-
target: this.contractAddress,
|
|
1309
|
-
data
|
|
1310
|
-
}
|
|
1311
|
-
});
|
|
1312
|
-
yield this.sessionKeyClient.waitForUserOperationTransaction({
|
|
1313
|
-
hash
|
|
1314
|
-
});
|
|
1315
|
-
return hash;
|
|
1316
|
-
} catch (error) {
|
|
1317
|
-
console.error(
|
|
1318
|
-
`failed to create payable fee memo ${jobId} ${content} ${error}`
|
|
1319
|
-
);
|
|
1320
|
-
retries -= 1;
|
|
1321
|
-
yield new Promise((resolve) => setTimeout(resolve, 2e3 * retries));
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
throw new Error("Failed to create payable fee memo");
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
2115
|
createPayableMemo(_0, _1, _2, _3, _4, _5, _6, _7, _8) {
|
|
1328
|
-
return __async(this, arguments, function* (jobId, content, amount, recipient, feeAmount, feeType, nextPhase, type, expiredAt, token = this.
|
|
2116
|
+
return __async(this, arguments, function* (jobId, content, amount, recipient, feeAmount, feeType, nextPhase, type, expiredAt, token = this.paymentTokenAddress) {
|
|
1329
2117
|
let retries = 3;
|
|
1330
2118
|
while (retries > 0) {
|
|
1331
2119
|
try {
|
|
@@ -1336,13 +2124,13 @@ var AcpContractClient = class _AcpContractClient {
|
|
|
1336
2124
|
jobId,
|
|
1337
2125
|
content,
|
|
1338
2126
|
token,
|
|
1339
|
-
amount,
|
|
2127
|
+
this.formatAmount(amount),
|
|
1340
2128
|
recipient,
|
|
1341
|
-
feeAmount,
|
|
2129
|
+
this.formatAmount(feeAmount),
|
|
1342
2130
|
feeType,
|
|
1343
2131
|
type,
|
|
1344
2132
|
nextPhase,
|
|
1345
|
-
|
|
2133
|
+
Math.floor(expiredAt.getTime() / 1e3)
|
|
1346
2134
|
]
|
|
1347
2135
|
});
|
|
1348
2136
|
const { hash } = yield this.sessionKeyClient.sendUserOperation({
|
|
@@ -1425,7 +2213,22 @@ var AcpContractClient = class _AcpContractClient {
|
|
|
1425
2213
|
const data = (0, import_viem.encodeFunctionData)({
|
|
1426
2214
|
abi: acpAbi_default,
|
|
1427
2215
|
functionName: "setBudget",
|
|
1428
|
-
args: [jobId, budget]
|
|
2216
|
+
args: [jobId, this.formatAmount(budget)]
|
|
2217
|
+
});
|
|
2218
|
+
return yield this.handleSendUserOperation(data);
|
|
2219
|
+
} catch (error) {
|
|
2220
|
+
console.error(`Failed to set budget ${error}`);
|
|
2221
|
+
throw new Error("Failed to set budget");
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
setBudgetWithPaymentToken(_0, _1) {
|
|
2226
|
+
return __async(this, arguments, function* (jobId, budget, paymentTokenAddress = this.paymentTokenAddress) {
|
|
2227
|
+
try {
|
|
2228
|
+
const data = (0, import_viem.encodeFunctionData)({
|
|
2229
|
+
abi: acpAbi_default,
|
|
2230
|
+
functionName: "setBudgetWithPaymentToken",
|
|
2231
|
+
args: [jobId, this.formatAmount(budget), paymentTokenAddress]
|
|
1429
2232
|
});
|
|
1430
2233
|
return yield this.handleSendUserOperation(data);
|
|
1431
2234
|
} catch (error) {
|
|
@@ -1438,14 +2241,41 @@ var AcpContractClient = class _AcpContractClient {
|
|
|
1438
2241
|
var acpContractClient_default = AcpContractClient;
|
|
1439
2242
|
|
|
1440
2243
|
// src/interfaces.ts
|
|
2244
|
+
var AcpMemoStatus = /* @__PURE__ */ ((AcpMemoStatus2) => {
|
|
2245
|
+
AcpMemoStatus2["PENDING"] = "PENDING";
|
|
2246
|
+
AcpMemoStatus2["APPROVED"] = "APPROVED";
|
|
2247
|
+
AcpMemoStatus2["REJECTED"] = "REJECTED";
|
|
2248
|
+
return AcpMemoStatus2;
|
|
2249
|
+
})(AcpMemoStatus || {});
|
|
1441
2250
|
var AcpAgentSort = /* @__PURE__ */ ((AcpAgentSort2) => {
|
|
1442
2251
|
AcpAgentSort2["SUCCESSFUL_JOB_COUNT"] = "successfulJobCount";
|
|
1443
2252
|
AcpAgentSort2["SUCCESS_RATE"] = "successRate";
|
|
1444
2253
|
AcpAgentSort2["UNIQUE_BUYER_COUNT"] = "uniqueBuyerCount";
|
|
1445
2254
|
AcpAgentSort2["MINS_FROM_LAST_ONLINE"] = "minsFromLastOnlineTime";
|
|
1446
|
-
AcpAgentSort2["IS_ONLINE"] = "isOnline";
|
|
1447
2255
|
return AcpAgentSort2;
|
|
1448
2256
|
})(AcpAgentSort || {});
|
|
2257
|
+
var AcpGraduationStatus = /* @__PURE__ */ ((AcpGraduationStatus2) => {
|
|
2258
|
+
AcpGraduationStatus2["ALL"] = "all";
|
|
2259
|
+
AcpGraduationStatus2["GRADUATED"] = "graduated";
|
|
2260
|
+
AcpGraduationStatus2["NOT_GRADUATED"] = "not_graduated";
|
|
2261
|
+
return AcpGraduationStatus2;
|
|
2262
|
+
})(AcpGraduationStatus || {});
|
|
2263
|
+
var AcpOnlineStatus = /* @__PURE__ */ ((AcpOnlineStatus2) => {
|
|
2264
|
+
AcpOnlineStatus2["ALL"] = "all";
|
|
2265
|
+
AcpOnlineStatus2["ONLINE"] = "online";
|
|
2266
|
+
AcpOnlineStatus2["OFFLINE"] = "offline";
|
|
2267
|
+
return AcpOnlineStatus2;
|
|
2268
|
+
})(AcpOnlineStatus || {});
|
|
2269
|
+
var PayloadType = /* @__PURE__ */ ((PayloadType2) => {
|
|
2270
|
+
PayloadType2["FUND_RESPONSE"] = "fund_response";
|
|
2271
|
+
PayloadType2["OPEN_POSITION"] = "open_position";
|
|
2272
|
+
PayloadType2["CLOSE_PARTIAL_POSITION"] = "close_partial_position";
|
|
2273
|
+
PayloadType2["CLOSE_POSITION"] = "close_position";
|
|
2274
|
+
PayloadType2["POSITION_FULFILLED"] = "position_fulfilled";
|
|
2275
|
+
PayloadType2["CLOSE_JOB_AND_WITHDRAW"] = "close_job_and_withdraw";
|
|
2276
|
+
PayloadType2["UNFULFILLED_POSITION"] = "unfulfilled_position";
|
|
2277
|
+
return PayloadType2;
|
|
2278
|
+
})(PayloadType || {});
|
|
1449
2279
|
|
|
1450
2280
|
// src/utils.ts
|
|
1451
2281
|
function tryParseJson(content) {
|
|
@@ -1458,20 +2288,45 @@ function tryParseJson(content) {
|
|
|
1458
2288
|
|
|
1459
2289
|
// src/acpJob.ts
|
|
1460
2290
|
var AcpJob = class {
|
|
1461
|
-
constructor(acpClient, id, clientAddress, providerAddress, evaluatorAddress, price, memos, phase, context) {
|
|
2291
|
+
constructor(acpClient, id, clientAddress, providerAddress, evaluatorAddress, price, priceTokenAddress, memos, phase, context) {
|
|
1462
2292
|
this.acpClient = acpClient;
|
|
1463
2293
|
this.id = id;
|
|
1464
2294
|
this.clientAddress = clientAddress;
|
|
1465
2295
|
this.providerAddress = providerAddress;
|
|
1466
2296
|
this.evaluatorAddress = evaluatorAddress;
|
|
1467
2297
|
this.price = price;
|
|
2298
|
+
this.priceTokenAddress = priceTokenAddress;
|
|
1468
2299
|
this.memos = memos;
|
|
1469
2300
|
this.phase = phase;
|
|
1470
2301
|
this.context = context;
|
|
1471
2302
|
}
|
|
1472
2303
|
get serviceRequirement() {
|
|
1473
2304
|
var _a;
|
|
1474
|
-
|
|
2305
|
+
const content = (_a = this.memos.find(
|
|
2306
|
+
(m) => m.nextPhase === 1 /* NEGOTIATION */
|
|
2307
|
+
)) == null ? void 0 : _a.content;
|
|
2308
|
+
if (!content) {
|
|
2309
|
+
return void 0;
|
|
2310
|
+
}
|
|
2311
|
+
const contentObj = tryParseJson(content);
|
|
2312
|
+
if (!contentObj) {
|
|
2313
|
+
return content;
|
|
2314
|
+
}
|
|
2315
|
+
if (contentObj.serviceRequirement) {
|
|
2316
|
+
return contentObj.serviceRequirement;
|
|
2317
|
+
}
|
|
2318
|
+
return contentObj;
|
|
2319
|
+
}
|
|
2320
|
+
get serviceName() {
|
|
2321
|
+
var _a;
|
|
2322
|
+
const content = (_a = this.memos.find(
|
|
2323
|
+
(m) => m.nextPhase === 1 /* NEGOTIATION */
|
|
2324
|
+
)) == null ? void 0 : _a.content;
|
|
2325
|
+
if (!content) {
|
|
2326
|
+
return void 0;
|
|
2327
|
+
}
|
|
2328
|
+
const contentObj = tryParseJson(content);
|
|
2329
|
+
return contentObj == null ? void 0 : contentObj.serviceName;
|
|
1475
2330
|
}
|
|
1476
2331
|
get deliverable() {
|
|
1477
2332
|
var _a;
|
|
@@ -1521,10 +2376,7 @@ var AcpJob = class {
|
|
|
1521
2376
|
if (((_a = this.latestMemo) == null ? void 0 : _a.nextPhase) !== 3 /* EVALUATION */) {
|
|
1522
2377
|
throw new Error("No transaction memo found");
|
|
1523
2378
|
}
|
|
1524
|
-
return yield this.acpClient.deliverJob(
|
|
1525
|
-
this.id,
|
|
1526
|
-
JSON.stringify(deliverable)
|
|
1527
|
-
);
|
|
2379
|
+
return yield this.acpClient.deliverJob(this.id, deliverable);
|
|
1528
2380
|
});
|
|
1529
2381
|
}
|
|
1530
2382
|
evaluate(accept, reason) {
|
|
@@ -1540,8 +2392,8 @@ var AcpJob = class {
|
|
|
1540
2392
|
);
|
|
1541
2393
|
});
|
|
1542
2394
|
}
|
|
1543
|
-
openPosition(
|
|
1544
|
-
return __async(this,
|
|
2395
|
+
openPosition(_0, _1) {
|
|
2396
|
+
return __async(this, arguments, function* (payload, feeAmount, expiredAt = new Date(Date.now() + 1e3 * 60 * 3), walletAddress) {
|
|
1545
2397
|
if (payload.length === 0) {
|
|
1546
2398
|
throw new Error("No positions to open");
|
|
1547
2399
|
}
|
|
@@ -1563,7 +2415,7 @@ var AcpJob = class {
|
|
|
1563
2415
|
responseOpenPosition(memoId, accept, reason) {
|
|
1564
2416
|
return __async(this, null, function* () {
|
|
1565
2417
|
const memo = this.memos.find((m) => m.id === memoId);
|
|
1566
|
-
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !==
|
|
2418
|
+
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !== 8 /* PAYABLE_TRANSFER_ESCROW */) {
|
|
1567
2419
|
throw new Error("No open position memo found");
|
|
1568
2420
|
}
|
|
1569
2421
|
const payload = tryParseJson(
|
|
@@ -1575,8 +2427,8 @@ var AcpJob = class {
|
|
|
1575
2427
|
return yield this.acpClient.responseFundsTransfer(memo.id, accept, reason);
|
|
1576
2428
|
});
|
|
1577
2429
|
}
|
|
1578
|
-
closePartialPosition(
|
|
1579
|
-
return __async(this,
|
|
2430
|
+
closePartialPosition(_0) {
|
|
2431
|
+
return __async(this, arguments, function* (payload, expireAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1580
2432
|
return yield this.acpClient.requestFunds(
|
|
1581
2433
|
this.id,
|
|
1582
2434
|
payload.amount,
|
|
@@ -1587,7 +2439,8 @@ var AcpJob = class {
|
|
|
1587
2439
|
type: "close_partial_position" /* CLOSE_PARTIAL_POSITION */,
|
|
1588
2440
|
data: payload
|
|
1589
2441
|
},
|
|
1590
|
-
2 /* TRANSACTION
|
|
2442
|
+
2 /* TRANSACTION */,
|
|
2443
|
+
expireAt
|
|
1591
2444
|
);
|
|
1592
2445
|
});
|
|
1593
2446
|
}
|
|
@@ -1623,8 +2476,8 @@ var AcpJob = class {
|
|
|
1623
2476
|
);
|
|
1624
2477
|
});
|
|
1625
2478
|
}
|
|
1626
|
-
responseRequestClosePosition(
|
|
1627
|
-
return __async(this,
|
|
2479
|
+
responseRequestClosePosition(_0, _1, _2, _3) {
|
|
2480
|
+
return __async(this, arguments, function* (memoId, accept, payload, reason, expiredAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1628
2481
|
const memo = this.memos.find((m) => m.id === memoId);
|
|
1629
2482
|
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !== 0 /* MESSAGE */) {
|
|
1630
2483
|
throw new Error("No message memo found");
|
|
@@ -1645,7 +2498,8 @@ var AcpJob = class {
|
|
|
1645
2498
|
type: "close_position" /* CLOSE_POSITION */,
|
|
1646
2499
|
data: payload
|
|
1647
2500
|
},
|
|
1648
|
-
2 /* TRANSACTION
|
|
2501
|
+
2 /* TRANSACTION */,
|
|
2502
|
+
expiredAt
|
|
1649
2503
|
);
|
|
1650
2504
|
}
|
|
1651
2505
|
});
|
|
@@ -1653,7 +2507,7 @@ var AcpJob = class {
|
|
|
1653
2507
|
confirmClosePosition(memoId, accept, reason) {
|
|
1654
2508
|
return __async(this, null, function* () {
|
|
1655
2509
|
const memo = this.memos.find((m) => m.id === memoId);
|
|
1656
|
-
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !==
|
|
2510
|
+
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !== 8 /* PAYABLE_TRANSFER_ESCROW */) {
|
|
1657
2511
|
throw new Error("No payable transfer memo found");
|
|
1658
2512
|
}
|
|
1659
2513
|
const payload = tryParseJson(
|
|
@@ -1665,8 +2519,8 @@ var AcpJob = class {
|
|
|
1665
2519
|
yield memo.sign(accept, reason);
|
|
1666
2520
|
});
|
|
1667
2521
|
}
|
|
1668
|
-
positionFulfilled(
|
|
1669
|
-
return __async(this,
|
|
2522
|
+
positionFulfilled(_0) {
|
|
2523
|
+
return __async(this, arguments, function* (payload, expiredAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1670
2524
|
return yield this.acpClient.transferFunds(
|
|
1671
2525
|
this.id,
|
|
1672
2526
|
payload.amount,
|
|
@@ -1677,12 +2531,13 @@ var AcpJob = class {
|
|
|
1677
2531
|
type: "position_fulfilled" /* POSITION_FULFILLED */,
|
|
1678
2532
|
data: payload
|
|
1679
2533
|
},
|
|
1680
|
-
2 /* TRANSACTION
|
|
2534
|
+
2 /* TRANSACTION */,
|
|
2535
|
+
expiredAt
|
|
1681
2536
|
);
|
|
1682
2537
|
});
|
|
1683
2538
|
}
|
|
1684
|
-
unfulfilledPosition(
|
|
1685
|
-
return __async(this,
|
|
2539
|
+
unfulfilledPosition(_0) {
|
|
2540
|
+
return __async(this, arguments, function* (payload, expiredAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1686
2541
|
return yield this.acpClient.transferFunds(
|
|
1687
2542
|
this.id,
|
|
1688
2543
|
payload.amount,
|
|
@@ -1693,14 +2548,15 @@ var AcpJob = class {
|
|
|
1693
2548
|
type: "unfulfilled_position" /* UNFULFILLED_POSITION */,
|
|
1694
2549
|
data: payload
|
|
1695
2550
|
},
|
|
1696
|
-
2 /* TRANSACTION
|
|
2551
|
+
2 /* TRANSACTION */,
|
|
2552
|
+
expiredAt
|
|
1697
2553
|
);
|
|
1698
2554
|
});
|
|
1699
2555
|
}
|
|
1700
2556
|
responseUnfulfilledPosition(memoId, accept, reason) {
|
|
1701
2557
|
return __async(this, null, function* () {
|
|
1702
2558
|
const memo = this.memos.find((m) => m.id === memoId);
|
|
1703
|
-
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !==
|
|
2559
|
+
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !== 8 /* PAYABLE_TRANSFER_ESCROW */) {
|
|
1704
2560
|
throw new Error("No unfulfilled position memo found");
|
|
1705
2561
|
}
|
|
1706
2562
|
const payload = tryParseJson(
|
|
@@ -1715,7 +2571,7 @@ var AcpJob = class {
|
|
|
1715
2571
|
responsePositionFulfilled(memoId, accept, reason) {
|
|
1716
2572
|
return __async(this, null, function* () {
|
|
1717
2573
|
const memo = this.memos.find((m) => m.id === memoId);
|
|
1718
|
-
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !==
|
|
2574
|
+
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !== 8 /* PAYABLE_TRANSFER_ESCROW */) {
|
|
1719
2575
|
throw new Error("No position fulfilled memo found");
|
|
1720
2576
|
}
|
|
1721
2577
|
const payload = tryParseJson(
|
|
@@ -1741,8 +2597,8 @@ var AcpJob = class {
|
|
|
1741
2597
|
);
|
|
1742
2598
|
});
|
|
1743
2599
|
}
|
|
1744
|
-
responseCloseJob(
|
|
1745
|
-
return __async(this,
|
|
2600
|
+
responseCloseJob(_0, _1, _2, _3) {
|
|
2601
|
+
return __async(this, arguments, function* (memoId, accept, fulfilledPositions, reason, expiredAt = new Date(Date.now() + 1e3 * 60 * 60 * 24)) {
|
|
1746
2602
|
const memo = this.memos.find((m) => m.id === memoId);
|
|
1747
2603
|
if ((memo == null ? void 0 : memo.nextPhase) !== 2 /* TRANSACTION */ || (memo == null ? void 0 : memo.type) !== 0 /* MESSAGE */) {
|
|
1748
2604
|
throw new Error("No message memo found");
|
|
@@ -1781,7 +2637,8 @@ var AcpJob = class {
|
|
|
1781
2637
|
type: "close_job_and_withdraw" /* CLOSE_JOB_AND_WITHDRAW */,
|
|
1782
2638
|
data: fulfilledPositions
|
|
1783
2639
|
},
|
|
1784
|
-
4 /* COMPLETED
|
|
2640
|
+
4 /* COMPLETED */,
|
|
2641
|
+
expiredAt
|
|
1785
2642
|
);
|
|
1786
2643
|
});
|
|
1787
2644
|
}
|
|
@@ -1805,12 +2662,14 @@ var acpJob_default = AcpJob;
|
|
|
1805
2662
|
|
|
1806
2663
|
// src/acpMemo.ts
|
|
1807
2664
|
var AcpMemo = class {
|
|
1808
|
-
constructor(acpClient, id, type, content, nextPhase, expiry) {
|
|
2665
|
+
constructor(acpClient, id, type, content, nextPhase, status, signedReason, expiry) {
|
|
1809
2666
|
this.acpClient = acpClient;
|
|
1810
2667
|
this.id = id;
|
|
1811
2668
|
this.type = type;
|
|
1812
2669
|
this.content = content;
|
|
1813
2670
|
this.nextPhase = nextPhase;
|
|
2671
|
+
this.status = status;
|
|
2672
|
+
this.signedReason = signedReason;
|
|
1814
2673
|
this.expiry = expiry;
|
|
1815
2674
|
this.structuredContent = tryParseJson(this.content) || void 0;
|
|
1816
2675
|
}
|
|
@@ -1847,10 +2706,10 @@ var acpMemo_default = AcpMemo;
|
|
|
1847
2706
|
// src/acpJobOffering.ts
|
|
1848
2707
|
var import_ajv = __toESM(require("ajv"));
|
|
1849
2708
|
var AcpJobOffering = class {
|
|
1850
|
-
constructor(acpClient, providerAddress,
|
|
2709
|
+
constructor(acpClient, providerAddress, name, price, requirementSchema) {
|
|
1851
2710
|
this.acpClient = acpClient;
|
|
1852
2711
|
this.providerAddress = providerAddress;
|
|
1853
|
-
this.
|
|
2712
|
+
this.name = name;
|
|
1854
2713
|
this.price = price;
|
|
1855
2714
|
this.requirementSchema = requirementSchema;
|
|
1856
2715
|
this.ajv = new import_ajv.default({ allErrors: true });
|
|
@@ -1864,9 +2723,21 @@ var AcpJobOffering = class {
|
|
|
1864
2723
|
throw new Error(this.ajv.errorsText(validator.errors));
|
|
1865
2724
|
}
|
|
1866
2725
|
}
|
|
2726
|
+
let finalServiceRequirement = {
|
|
2727
|
+
serviceName: this.name
|
|
2728
|
+
};
|
|
2729
|
+
if (typeof serviceRequirement === "string") {
|
|
2730
|
+
finalServiceRequirement = __spreadProps(__spreadValues({}, finalServiceRequirement), {
|
|
2731
|
+
message: serviceRequirement
|
|
2732
|
+
});
|
|
2733
|
+
} else {
|
|
2734
|
+
finalServiceRequirement = __spreadProps(__spreadValues({}, finalServiceRequirement), {
|
|
2735
|
+
serviceRequirement
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
1867
2738
|
return yield this.acpClient.initiateJob(
|
|
1868
2739
|
this.providerAddress,
|
|
1869
|
-
|
|
2740
|
+
finalServiceRequirement,
|
|
1870
2741
|
this.price,
|
|
1871
2742
|
evaluatorAddress,
|
|
1872
2743
|
expiredAt
|
|
@@ -1921,6 +2792,7 @@ var AcpClient = class {
|
|
|
1921
2792
|
data.providerAddress,
|
|
1922
2793
|
data.evaluatorAddress,
|
|
1923
2794
|
data.price,
|
|
2795
|
+
data.priceTokenAddress,
|
|
1924
2796
|
data.memos.map((memo) => {
|
|
1925
2797
|
return new acpMemo_default(
|
|
1926
2798
|
this,
|
|
@@ -1928,7 +2800,9 @@ var AcpClient = class {
|
|
|
1928
2800
|
memo.memoType,
|
|
1929
2801
|
memo.content,
|
|
1930
2802
|
memo.nextPhase,
|
|
1931
|
-
memo.
|
|
2803
|
+
memo.status,
|
|
2804
|
+
memo.signedReason,
|
|
2805
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
1932
2806
|
);
|
|
1933
2807
|
}),
|
|
1934
2808
|
data.phase,
|
|
@@ -1950,6 +2824,7 @@ var AcpClient = class {
|
|
|
1950
2824
|
data.providerAddress,
|
|
1951
2825
|
data.evaluatorAddress,
|
|
1952
2826
|
data.price,
|
|
2827
|
+
data.priceTokenAddress,
|
|
1953
2828
|
data.memos.map((memo) => {
|
|
1954
2829
|
return new acpMemo_default(
|
|
1955
2830
|
this,
|
|
@@ -1957,7 +2832,9 @@ var AcpClient = class {
|
|
|
1957
2832
|
memo.memoType,
|
|
1958
2833
|
memo.content,
|
|
1959
2834
|
memo.nextPhase,
|
|
1960
|
-
memo.
|
|
2835
|
+
memo.status,
|
|
2836
|
+
memo.signedReason,
|
|
2837
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
1961
2838
|
);
|
|
1962
2839
|
}),
|
|
1963
2840
|
data.phase,
|
|
@@ -1982,28 +2859,26 @@ var AcpClient = class {
|
|
|
1982
2859
|
}
|
|
1983
2860
|
browseAgents(keyword, options) {
|
|
1984
2861
|
return __async(this, null, function* () {
|
|
1985
|
-
let { cluster, sort_by,
|
|
1986
|
-
rerank = rerank != null ? rerank : true;
|
|
2862
|
+
let { cluster, sort_by, top_k, graduationStatus, onlineStatus } = options;
|
|
1987
2863
|
top_k = top_k != null ? top_k : 5;
|
|
1988
|
-
|
|
1989
|
-
let url = `${this.acpUrl}/api/agents?search=${keyword}`;
|
|
2864
|
+
let url = `${this.acpUrl}/api/agents/v2/search?search=${keyword}`;
|
|
1990
2865
|
if (sort_by && sort_by.length > 0) {
|
|
1991
|
-
url += `&
|
|
2866
|
+
url += `&sortBy=${sort_by.map((s) => s).join(",")}`;
|
|
1992
2867
|
}
|
|
1993
2868
|
if (top_k) {
|
|
1994
2869
|
url += `&top_k=${top_k}`;
|
|
1995
2870
|
}
|
|
1996
|
-
if (rerank) {
|
|
1997
|
-
url += `&rerank=true`;
|
|
1998
|
-
}
|
|
1999
2871
|
if (this.acpContractClient.walletAddress) {
|
|
2000
|
-
url += `&
|
|
2872
|
+
url += `&walletAddressesToExclude=${this.acpContractClient.walletAddress}`;
|
|
2001
2873
|
}
|
|
2002
2874
|
if (cluster) {
|
|
2003
|
-
url += `&
|
|
2875
|
+
url += `&cluster=${cluster}`;
|
|
2004
2876
|
}
|
|
2005
|
-
if (
|
|
2006
|
-
url += `&
|
|
2877
|
+
if (graduationStatus) {
|
|
2878
|
+
url += `&graduationStatus=${graduationStatus}`;
|
|
2879
|
+
}
|
|
2880
|
+
if (onlineStatus) {
|
|
2881
|
+
url += `&onlineStatus=${onlineStatus}`;
|
|
2007
2882
|
}
|
|
2008
2883
|
const response = yield fetch(url);
|
|
2009
2884
|
const data = yield response.json();
|
|
@@ -2017,7 +2892,7 @@ var AcpClient = class {
|
|
|
2017
2892
|
this,
|
|
2018
2893
|
agent.walletAddress,
|
|
2019
2894
|
offering.name,
|
|
2020
|
-
offering.
|
|
2895
|
+
offering.priceUsd,
|
|
2021
2896
|
offering.requirementSchema
|
|
2022
2897
|
);
|
|
2023
2898
|
}),
|
|
@@ -2035,12 +2910,7 @@ var AcpClient = class {
|
|
|
2035
2910
|
evaluatorAddress || this.acpContractClient.walletAddress,
|
|
2036
2911
|
expiredAt
|
|
2037
2912
|
);
|
|
2038
|
-
|
|
2039
|
-
yield this.acpContractClient.setBudget(
|
|
2040
|
-
jobId,
|
|
2041
|
-
(0, import_viem2.parseEther)(amount.toString())
|
|
2042
|
-
);
|
|
2043
|
-
}
|
|
2913
|
+
yield this.acpContractClient.setBudgetWithPaymentToken(jobId, amount);
|
|
2044
2914
|
yield this.acpContractClient.createMemo(
|
|
2045
2915
|
jobId,
|
|
2046
2916
|
typeof serviceRequirement === "string" ? serviceRequirement : JSON.stringify(serviceRequirement),
|
|
@@ -2069,9 +2939,7 @@ var AcpClient = class {
|
|
|
2069
2939
|
payJob(jobId, amount, memoId, reason) {
|
|
2070
2940
|
return __async(this, null, function* () {
|
|
2071
2941
|
if (amount > 0) {
|
|
2072
|
-
yield this.acpContractClient.approveAllowance(
|
|
2073
|
-
(0, import_viem2.parseEther)(amount.toString())
|
|
2074
|
-
);
|
|
2942
|
+
yield this.acpContractClient.approveAllowance(amount);
|
|
2075
2943
|
}
|
|
2076
2944
|
yield this.acpContractClient.signMemo(memoId, true, reason);
|
|
2077
2945
|
return yield this.acpContractClient.createMemo(
|
|
@@ -2083,17 +2951,18 @@ var AcpClient = class {
|
|
|
2083
2951
|
);
|
|
2084
2952
|
});
|
|
2085
2953
|
}
|
|
2086
|
-
requestFunds(jobId, amount, recipient, feeAmount, feeType, reason, nextPhase) {
|
|
2954
|
+
requestFunds(jobId, amount, recipient, feeAmount, feeType, reason, nextPhase, expiredAt) {
|
|
2087
2955
|
return __async(this, null, function* () {
|
|
2088
2956
|
return yield this.acpContractClient.createPayableMemo(
|
|
2089
2957
|
jobId,
|
|
2090
2958
|
JSON.stringify(reason),
|
|
2091
|
-
|
|
2959
|
+
amount,
|
|
2092
2960
|
recipient,
|
|
2093
|
-
|
|
2961
|
+
feeAmount,
|
|
2094
2962
|
feeType,
|
|
2095
2963
|
nextPhase,
|
|
2096
|
-
6 /* PAYABLE_REQUEST
|
|
2964
|
+
6 /* PAYABLE_REQUEST */,
|
|
2965
|
+
expiredAt
|
|
2097
2966
|
);
|
|
2098
2967
|
});
|
|
2099
2968
|
}
|
|
@@ -2103,9 +2972,7 @@ var AcpClient = class {
|
|
|
2103
2972
|
return yield this.acpContractClient.signMemo(memoId, accept, reason);
|
|
2104
2973
|
}
|
|
2105
2974
|
if (amount > 0) {
|
|
2106
|
-
yield this.acpContractClient.approveAllowance(
|
|
2107
|
-
(0, import_viem2.parseEther)(amount.toString())
|
|
2108
|
-
);
|
|
2975
|
+
yield this.acpContractClient.approveAllowance(amount);
|
|
2109
2976
|
}
|
|
2110
2977
|
return yield this.acpContractClient.signMemo(memoId, true, reason);
|
|
2111
2978
|
});
|
|
@@ -2114,19 +2981,17 @@ var AcpClient = class {
|
|
|
2114
2981
|
return __async(this, null, function* () {
|
|
2115
2982
|
const totalAmount = amount + feeAmount;
|
|
2116
2983
|
if (totalAmount > 0) {
|
|
2117
|
-
yield this.acpContractClient.approveAllowance(
|
|
2118
|
-
(0, import_viem2.parseEther)((amount + feeAmount).toString())
|
|
2119
|
-
);
|
|
2984
|
+
yield this.acpContractClient.approveAllowance(totalAmount);
|
|
2120
2985
|
}
|
|
2121
2986
|
return yield this.acpContractClient.createPayableMemo(
|
|
2122
2987
|
jobId,
|
|
2123
2988
|
JSON.stringify(reason),
|
|
2124
|
-
|
|
2989
|
+
amount,
|
|
2125
2990
|
recipient,
|
|
2126
|
-
|
|
2991
|
+
feeAmount,
|
|
2127
2992
|
feeType,
|
|
2128
2993
|
nextPhase,
|
|
2129
|
-
|
|
2994
|
+
8 /* PAYABLE_TRANSFER_ESCROW */,
|
|
2130
2995
|
expiredAt
|
|
2131
2996
|
);
|
|
2132
2997
|
});
|
|
@@ -2151,7 +3016,7 @@ var AcpClient = class {
|
|
|
2151
3016
|
return __async(this, null, function* () {
|
|
2152
3017
|
return yield this.acpContractClient.createMemo(
|
|
2153
3018
|
jobId,
|
|
2154
|
-
deliverable,
|
|
3019
|
+
JSON.stringify(deliverable),
|
|
2155
3020
|
4 /* OBJECT_URL */,
|
|
2156
3021
|
true,
|
|
2157
3022
|
4 /* COMPLETED */
|
|
@@ -2179,6 +3044,7 @@ var AcpClient = class {
|
|
|
2179
3044
|
job.providerAddress,
|
|
2180
3045
|
job.evaluatorAddress,
|
|
2181
3046
|
job.price,
|
|
3047
|
+
job.priceTokenAddress,
|
|
2182
3048
|
job.memos.map((memo) => {
|
|
2183
3049
|
return new acpMemo_default(
|
|
2184
3050
|
this,
|
|
@@ -2186,7 +3052,9 @@ var AcpClient = class {
|
|
|
2186
3052
|
memo.memoType,
|
|
2187
3053
|
memo.content,
|
|
2188
3054
|
memo.nextPhase,
|
|
2189
|
-
memo.
|
|
3055
|
+
memo.status,
|
|
3056
|
+
memo.signedReason,
|
|
3057
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
2190
3058
|
);
|
|
2191
3059
|
}),
|
|
2192
3060
|
job.phase,
|
|
@@ -2219,6 +3087,7 @@ var AcpClient = class {
|
|
|
2219
3087
|
job.providerAddress,
|
|
2220
3088
|
job.evaluatorAddress,
|
|
2221
3089
|
job.price,
|
|
3090
|
+
job.priceTokenAddress,
|
|
2222
3091
|
job.memos.map((memo) => {
|
|
2223
3092
|
return new acpMemo_default(
|
|
2224
3093
|
this,
|
|
@@ -2226,7 +3095,9 @@ var AcpClient = class {
|
|
|
2226
3095
|
memo.memoType,
|
|
2227
3096
|
memo.content,
|
|
2228
3097
|
memo.nextPhase,
|
|
2229
|
-
memo.
|
|
3098
|
+
memo.status,
|
|
3099
|
+
memo.signedReason,
|
|
3100
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
2230
3101
|
);
|
|
2231
3102
|
}),
|
|
2232
3103
|
job.phase,
|
|
@@ -2259,6 +3130,7 @@ var AcpClient = class {
|
|
|
2259
3130
|
job.providerAddress,
|
|
2260
3131
|
job.evaluatorAddress,
|
|
2261
3132
|
job.price,
|
|
3133
|
+
job.priceTokenAddress,
|
|
2262
3134
|
job.memos.map((memo) => {
|
|
2263
3135
|
return new acpMemo_default(
|
|
2264
3136
|
this,
|
|
@@ -2266,7 +3138,9 @@ var AcpClient = class {
|
|
|
2266
3138
|
memo.memoType,
|
|
2267
3139
|
memo.content,
|
|
2268
3140
|
memo.nextPhase,
|
|
2269
|
-
memo.
|
|
3141
|
+
memo.status,
|
|
3142
|
+
memo.signedReason,
|
|
3143
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
2270
3144
|
);
|
|
2271
3145
|
}),
|
|
2272
3146
|
job.phase,
|
|
@@ -2302,6 +3176,7 @@ var AcpClient = class {
|
|
|
2302
3176
|
job.providerAddress,
|
|
2303
3177
|
job.evaluatorAddress,
|
|
2304
3178
|
job.price,
|
|
3179
|
+
job.priceTokenAddress,
|
|
2305
3180
|
job.memos.map((memo) => {
|
|
2306
3181
|
return new acpMemo_default(
|
|
2307
3182
|
this,
|
|
@@ -2309,7 +3184,9 @@ var AcpClient = class {
|
|
|
2309
3184
|
memo.memoType,
|
|
2310
3185
|
memo.content,
|
|
2311
3186
|
memo.nextPhase,
|
|
2312
|
-
memo.
|
|
3187
|
+
memo.status,
|
|
3188
|
+
memo.signedReason,
|
|
3189
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
2313
3190
|
);
|
|
2314
3191
|
}),
|
|
2315
3192
|
job.phase,
|
|
@@ -2343,7 +3220,9 @@ var AcpClient = class {
|
|
|
2343
3220
|
memo.memoType,
|
|
2344
3221
|
memo.content,
|
|
2345
3222
|
memo.nextPhase,
|
|
2346
|
-
memo.
|
|
3223
|
+
memo.status,
|
|
3224
|
+
memo.signedReason,
|
|
3225
|
+
memo.expiry ? new Date(parseInt(memo.expiry)) : void 0
|
|
2347
3226
|
);
|
|
2348
3227
|
} catch (error) {
|
|
2349
3228
|
throw error;
|
|
@@ -2372,10 +3251,14 @@ var index_default = acpClient_default;
|
|
|
2372
3251
|
ACP_ABI,
|
|
2373
3252
|
AcpAgentSort,
|
|
2374
3253
|
AcpContractClient,
|
|
3254
|
+
AcpGraduationStatus,
|
|
2375
3255
|
AcpJob,
|
|
2376
3256
|
AcpJobPhases,
|
|
2377
3257
|
AcpMemo,
|
|
3258
|
+
AcpMemoStatus,
|
|
3259
|
+
AcpOnlineStatus,
|
|
2378
3260
|
MemoType,
|
|
3261
|
+
PayloadType,
|
|
2379
3262
|
baseAcpConfig,
|
|
2380
3263
|
baseSepoliaAcpConfig
|
|
2381
3264
|
});
|