@pushchain/core 6.0.27-alpha.3 → 6.0.27-alpha.5
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/AGW.md +35 -6
- package/CHANGELOG.md +13 -0
- package/MARKETPLACE.md +206 -0
- package/package.json +2 -1
- package/src/lib/agentic/codec/rules.js +74 -69
- package/src/lib/agentic/codec/universal.js +15 -3
- package/src/lib/agentic/constants.d.ts +36 -1
- package/src/lib/agentic/constants.js +14 -1
- package/src/lib/agentic/contracts/reader.d.ts +21 -0
- package/src/lib/agentic/contracts/reader.js +3 -0
- package/src/lib/agentic/error-messages.d.ts +3 -0
- package/src/lib/agentic/error-messages.js +127 -0
- package/src/lib/agentic/errors.d.ts +12 -3
- package/src/lib/agentic/errors.js +76 -0
- package/src/lib/agentic/management/common.js +6 -0
- package/src/lib/agentic/management/destination.d.ts +5 -0
- package/src/lib/agentic/management/destination.js +32 -0
- package/src/lib/agentic/management/prepare.js +80 -55
- package/src/lib/agentic/management/svm-public.js +13 -4
- package/src/lib/agentic/presets/index.js +8 -9
- package/src/lib/agentic/presets/routes.d.ts +1 -1
- package/src/lib/agentic/presets/routes.js +6 -7
- package/src/lib/agentic/presets/types.d.ts +1 -6
- package/src/lib/agentic/public-rule.js +18 -2
- package/src/lib/constants/index.d.ts +35 -0
- package/src/lib/index.d.ts +4 -0
- package/src/lib/index.js +6 -2
- package/src/lib/job/job.d.ts +35 -0
- package/src/lib/job/job.js +382 -0
- package/src/lib/job/types.d.ts +94 -0
- package/src/lib/job/types.js +3 -0
- package/src/lib/job/watch.d.ts +3 -0
- package/src/lib/job/watch.js +169 -0
- package/src/lib/job-spec/codec.d.ts +18 -0
- package/src/lib/job-spec/codec.js +348 -0
- package/src/lib/job-spec/constants.d.ts +32 -0
- package/src/lib/job-spec/constants.js +36 -0
- package/src/lib/job-spec/helpers.d.ts +19 -0
- package/src/lib/job-spec/helpers.js +138 -0
- package/src/lib/job-spec/index.d.ts +14 -0
- package/src/lib/job-spec/index.js +17 -0
- package/src/lib/job-spec/preview.d.ts +8 -0
- package/src/lib/job-spec/preview.js +298 -0
- package/src/lib/job-spec/read.d.ts +20 -0
- package/src/lib/job-spec/read.js +224 -0
- package/src/lib/job-spec/schema.d.ts +290 -0
- package/src/lib/job-spec/schema.js +70 -0
- package/src/lib/job-spec/types.d.ts +139 -0
- package/src/lib/job-spec/types.js +3 -0
- package/src/lib/market/contracts/AgenticCommerce.d.ts +1026 -0
- package/src/lib/market/contracts/AgenticCommerce.js +1317 -0
- package/src/lib/market/contracts/RulesBindingHook.d.ts +235 -0
- package/src/lib/market/contracts/RulesBindingHook.js +314 -0
- package/src/lib/market/contracts/UniversalMarketplace.d.ts +1770 -0
- package/src/lib/market/contracts/UniversalMarketplace.js +2295 -0
- package/src/lib/market/contracts/UniversalMarketplaceErrors.d.ts +309 -0
- package/src/lib/market/contracts/UniversalMarketplaceErrors.js +416 -0
- package/src/lib/market/contracts/UniversalMarketplaceRules.d.ts +241 -0
- package/src/lib/market/contracts/UniversalMarketplaceRules.js +323 -0
- package/src/lib/market/data.d.ts +8 -0
- package/src/lib/market/data.js +60 -0
- package/src/lib/market/deployment.d.ts +14 -0
- package/src/lib/market/deployment.js +23 -0
- package/src/lib/market/deposit.d.ts +24 -0
- package/src/lib/market/deposit.js +271 -0
- package/src/lib/market/errors.d.ts +13 -0
- package/src/lib/market/errors.js +81 -0
- package/src/lib/market/history.d.ts +6 -0
- package/src/lib/market/history.js +83 -0
- package/src/lib/market/index.d.ts +4 -0
- package/src/lib/market/index.js +12 -0
- package/src/lib/market/kernel-wire.d.ts +15 -0
- package/src/lib/market/kernel-wire.js +41 -0
- package/src/lib/market/market.d.ts +55 -0
- package/src/lib/market/market.js +635 -0
- package/src/lib/market/rules.d.ts +106 -0
- package/src/lib/market/rules.js +293 -0
- package/src/lib/market/runtime.d.ts +35 -0
- package/src/lib/market/runtime.js +130 -0
- package/src/lib/market/types.d.ts +180 -0
- package/src/lib/market/types.js +3 -0
- package/src/lib/orchestrator/internals/errors.d.ts +9 -2
- package/src/lib/orchestrator/internals/errors.js +9 -2
- package/src/lib/orchestrator/internals/push-chain-tx.js +17 -3
- package/src/lib/push-chain/push-chain.d.ts +44 -1
- package/src/lib/push-chain/push-chain.js +23 -3
- package/src/lib/read-state/read-params.d.ts +9 -0
- package/src/lib/read-state/read-params.js +5 -1
- package/src/lib/utils.d.ts +15 -0
- package/src/lib/utils.js +4 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
export declare const READ_FIELDS: readonly [{
|
|
2
|
+
readonly name: "chainNamespace";
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
}, {
|
|
5
|
+
readonly name: "chainId";
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "minConfirmations";
|
|
9
|
+
readonly type: "uint16";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "target";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "selector";
|
|
15
|
+
readonly type: "bytes4";
|
|
16
|
+
}, {
|
|
17
|
+
readonly name: "args";
|
|
18
|
+
readonly type: "bytes";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "outputs";
|
|
21
|
+
readonly type: "bytes";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "field";
|
|
24
|
+
readonly type: "uint8[]";
|
|
25
|
+
}];
|
|
26
|
+
export declare const FILL_FIELDS: readonly [{
|
|
27
|
+
readonly name: "word";
|
|
28
|
+
readonly type: "uint8";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "source";
|
|
31
|
+
readonly type: "uint8";
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "param";
|
|
34
|
+
readonly type: "uint8";
|
|
35
|
+
}];
|
|
36
|
+
export declare const TEMPLATE_READ_FIELDS: readonly ({
|
|
37
|
+
readonly name: "chainNamespace";
|
|
38
|
+
readonly type: "string";
|
|
39
|
+
} | {
|
|
40
|
+
readonly name: "chainId";
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
} | {
|
|
43
|
+
readonly name: "minConfirmations";
|
|
44
|
+
readonly type: "uint16";
|
|
45
|
+
} | {
|
|
46
|
+
readonly name: "target";
|
|
47
|
+
readonly type: "address";
|
|
48
|
+
} | {
|
|
49
|
+
readonly name: "selector";
|
|
50
|
+
readonly type: "bytes4";
|
|
51
|
+
} | {
|
|
52
|
+
readonly name: "args";
|
|
53
|
+
readonly type: "bytes";
|
|
54
|
+
} | {
|
|
55
|
+
readonly name: "outputs";
|
|
56
|
+
readonly type: "bytes";
|
|
57
|
+
} | {
|
|
58
|
+
readonly name: "field";
|
|
59
|
+
readonly type: "uint8[]";
|
|
60
|
+
} | {
|
|
61
|
+
readonly name: "fills";
|
|
62
|
+
readonly type: "tuple[]";
|
|
63
|
+
readonly components: readonly [{
|
|
64
|
+
readonly name: "word";
|
|
65
|
+
readonly type: "uint8";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "source";
|
|
68
|
+
readonly type: "uint8";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "param";
|
|
71
|
+
readonly type: "uint8";
|
|
72
|
+
}];
|
|
73
|
+
})[];
|
|
74
|
+
export declare const CHECK_FIELDS: readonly [{
|
|
75
|
+
readonly name: "read";
|
|
76
|
+
readonly type: "uint8";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "evaluation";
|
|
79
|
+
readonly type: "uint8";
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "operation";
|
|
82
|
+
readonly type: "uint8";
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "target";
|
|
85
|
+
readonly type: "int256";
|
|
86
|
+
}];
|
|
87
|
+
export declare const TEMPLATE_CHECK_FIELDS: readonly [...({
|
|
88
|
+
readonly name: "read";
|
|
89
|
+
readonly type: "uint8";
|
|
90
|
+
} | {
|
|
91
|
+
readonly name: "evaluation";
|
|
92
|
+
readonly type: "uint8";
|
|
93
|
+
} | {
|
|
94
|
+
readonly name: "operation";
|
|
95
|
+
readonly type: "uint8";
|
|
96
|
+
} | {
|
|
97
|
+
readonly name: "target";
|
|
98
|
+
readonly type: "int256";
|
|
99
|
+
})[], {
|
|
100
|
+
readonly name: "source";
|
|
101
|
+
readonly type: "uint8";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "value";
|
|
104
|
+
readonly type: "int256";
|
|
105
|
+
}];
|
|
106
|
+
export declare const LOGIC_FIELDS: readonly [{
|
|
107
|
+
readonly name: "kind";
|
|
108
|
+
readonly type: "uint8";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "checks";
|
|
111
|
+
readonly type: "uint8[]";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "children";
|
|
114
|
+
readonly type: "uint8[]";
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "k";
|
|
117
|
+
readonly type: "uint8";
|
|
118
|
+
}];
|
|
119
|
+
export declare const JOB_SPEC_PARAM: {
|
|
120
|
+
readonly type: "tuple";
|
|
121
|
+
readonly components: readonly [{
|
|
122
|
+
readonly name: "reads";
|
|
123
|
+
readonly type: "tuple[]";
|
|
124
|
+
readonly components: readonly [{
|
|
125
|
+
readonly name: "chainNamespace";
|
|
126
|
+
readonly type: "string";
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "chainId";
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
}, {
|
|
131
|
+
readonly name: "minConfirmations";
|
|
132
|
+
readonly type: "uint16";
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "target";
|
|
135
|
+
readonly type: "address";
|
|
136
|
+
}, {
|
|
137
|
+
readonly name: "selector";
|
|
138
|
+
readonly type: "bytes4";
|
|
139
|
+
}, {
|
|
140
|
+
readonly name: "args";
|
|
141
|
+
readonly type: "bytes";
|
|
142
|
+
}, {
|
|
143
|
+
readonly name: "outputs";
|
|
144
|
+
readonly type: "bytes";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "field";
|
|
147
|
+
readonly type: "uint8[]";
|
|
148
|
+
}];
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "checks";
|
|
151
|
+
readonly type: "tuple[]";
|
|
152
|
+
readonly components: readonly [{
|
|
153
|
+
readonly name: "read";
|
|
154
|
+
readonly type: "uint8";
|
|
155
|
+
}, {
|
|
156
|
+
readonly name: "evaluation";
|
|
157
|
+
readonly type: "uint8";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "operation";
|
|
160
|
+
readonly type: "uint8";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "target";
|
|
163
|
+
readonly type: "int256";
|
|
164
|
+
}];
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "logic";
|
|
167
|
+
readonly type: "tuple[]";
|
|
168
|
+
readonly components: readonly [{
|
|
169
|
+
readonly name: "kind";
|
|
170
|
+
readonly type: "uint8";
|
|
171
|
+
}, {
|
|
172
|
+
readonly name: "checks";
|
|
173
|
+
readonly type: "uint8[]";
|
|
174
|
+
}, {
|
|
175
|
+
readonly name: "children";
|
|
176
|
+
readonly type: "uint8[]";
|
|
177
|
+
}, {
|
|
178
|
+
readonly name: "k";
|
|
179
|
+
readonly type: "uint8";
|
|
180
|
+
}];
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "allowedMutability";
|
|
183
|
+
readonly type: "uint8";
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "origin";
|
|
186
|
+
readonly type: "bytes32";
|
|
187
|
+
}, {
|
|
188
|
+
readonly name: "executeBy";
|
|
189
|
+
readonly type: "uint64";
|
|
190
|
+
}, {
|
|
191
|
+
readonly name: "failFinalAt";
|
|
192
|
+
readonly type: "uint64";
|
|
193
|
+
}];
|
|
194
|
+
};
|
|
195
|
+
export declare const JOB_TEMPLATE_PARAM: {
|
|
196
|
+
readonly type: "tuple";
|
|
197
|
+
readonly components: readonly [{
|
|
198
|
+
readonly name: "reads";
|
|
199
|
+
readonly type: "tuple[]";
|
|
200
|
+
readonly components: readonly ({
|
|
201
|
+
readonly name: "chainNamespace";
|
|
202
|
+
readonly type: "string";
|
|
203
|
+
} | {
|
|
204
|
+
readonly name: "chainId";
|
|
205
|
+
readonly type: "string";
|
|
206
|
+
} | {
|
|
207
|
+
readonly name: "minConfirmations";
|
|
208
|
+
readonly type: "uint16";
|
|
209
|
+
} | {
|
|
210
|
+
readonly name: "target";
|
|
211
|
+
readonly type: "address";
|
|
212
|
+
} | {
|
|
213
|
+
readonly name: "selector";
|
|
214
|
+
readonly type: "bytes4";
|
|
215
|
+
} | {
|
|
216
|
+
readonly name: "args";
|
|
217
|
+
readonly type: "bytes";
|
|
218
|
+
} | {
|
|
219
|
+
readonly name: "outputs";
|
|
220
|
+
readonly type: "bytes";
|
|
221
|
+
} | {
|
|
222
|
+
readonly name: "field";
|
|
223
|
+
readonly type: "uint8[]";
|
|
224
|
+
} | {
|
|
225
|
+
readonly name: "fills";
|
|
226
|
+
readonly type: "tuple[]";
|
|
227
|
+
readonly components: readonly [{
|
|
228
|
+
readonly name: "word";
|
|
229
|
+
readonly type: "uint8";
|
|
230
|
+
}, {
|
|
231
|
+
readonly name: "source";
|
|
232
|
+
readonly type: "uint8";
|
|
233
|
+
}, {
|
|
234
|
+
readonly name: "param";
|
|
235
|
+
readonly type: "uint8";
|
|
236
|
+
}];
|
|
237
|
+
})[];
|
|
238
|
+
}, {
|
|
239
|
+
readonly name: "checks";
|
|
240
|
+
readonly type: "tuple[]";
|
|
241
|
+
readonly components: readonly [...({
|
|
242
|
+
readonly name: "read";
|
|
243
|
+
readonly type: "uint8";
|
|
244
|
+
} | {
|
|
245
|
+
readonly name: "evaluation";
|
|
246
|
+
readonly type: "uint8";
|
|
247
|
+
} | {
|
|
248
|
+
readonly name: "operation";
|
|
249
|
+
readonly type: "uint8";
|
|
250
|
+
} | {
|
|
251
|
+
readonly name: "target";
|
|
252
|
+
readonly type: "int256";
|
|
253
|
+
})[], {
|
|
254
|
+
readonly name: "source";
|
|
255
|
+
readonly type: "uint8";
|
|
256
|
+
}, {
|
|
257
|
+
readonly name: "value";
|
|
258
|
+
readonly type: "int256";
|
|
259
|
+
}];
|
|
260
|
+
}, {
|
|
261
|
+
readonly name: "logic";
|
|
262
|
+
readonly type: "tuple[]";
|
|
263
|
+
readonly components: readonly [{
|
|
264
|
+
readonly name: "kind";
|
|
265
|
+
readonly type: "uint8";
|
|
266
|
+
}, {
|
|
267
|
+
readonly name: "checks";
|
|
268
|
+
readonly type: "uint8[]";
|
|
269
|
+
}, {
|
|
270
|
+
readonly name: "children";
|
|
271
|
+
readonly type: "uint8[]";
|
|
272
|
+
}, {
|
|
273
|
+
readonly name: "k";
|
|
274
|
+
readonly type: "uint8";
|
|
275
|
+
}];
|
|
276
|
+
}, {
|
|
277
|
+
readonly name: "allowedMutability";
|
|
278
|
+
readonly type: "uint8";
|
|
279
|
+
}, {
|
|
280
|
+
readonly name: "params";
|
|
281
|
+
readonly type: "tuple[]";
|
|
282
|
+
readonly components: readonly [{
|
|
283
|
+
readonly name: "min";
|
|
284
|
+
readonly type: "int256";
|
|
285
|
+
}, {
|
|
286
|
+
readonly name: "max";
|
|
287
|
+
readonly type: "int256";
|
|
288
|
+
}];
|
|
289
|
+
}];
|
|
290
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JOB_TEMPLATE_PARAM = exports.JOB_SPEC_PARAM = exports.LOGIC_FIELDS = exports.TEMPLATE_CHECK_FIELDS = exports.CHECK_FIELDS = exports.TEMPLATE_READ_FIELDS = exports.FILL_FIELDS = exports.READ_FIELDS = void 0;
|
|
4
|
+
exports.READ_FIELDS = [
|
|
5
|
+
{ name: 'chainNamespace', type: 'string' },
|
|
6
|
+
{ name: 'chainId', type: 'string' },
|
|
7
|
+
{ name: 'minConfirmations', type: 'uint16' },
|
|
8
|
+
{ name: 'target', type: 'address' },
|
|
9
|
+
{ name: 'selector', type: 'bytes4' },
|
|
10
|
+
{ name: 'args', type: 'bytes' },
|
|
11
|
+
{ name: 'outputs', type: 'bytes' },
|
|
12
|
+
{ name: 'field', type: 'uint8[]' },
|
|
13
|
+
];
|
|
14
|
+
exports.FILL_FIELDS = [
|
|
15
|
+
{ name: 'word', type: 'uint8' },
|
|
16
|
+
{ name: 'source', type: 'uint8' },
|
|
17
|
+
{ name: 'param', type: 'uint8' },
|
|
18
|
+
];
|
|
19
|
+
exports.TEMPLATE_READ_FIELDS = [
|
|
20
|
+
...exports.READ_FIELDS.slice(0, 6),
|
|
21
|
+
{ name: 'fills', type: 'tuple[]', components: exports.FILL_FIELDS },
|
|
22
|
+
...exports.READ_FIELDS.slice(6),
|
|
23
|
+
];
|
|
24
|
+
exports.CHECK_FIELDS = [
|
|
25
|
+
{ name: 'read', type: 'uint8' },
|
|
26
|
+
{ name: 'evaluation', type: 'uint8' },
|
|
27
|
+
{ name: 'operation', type: 'uint8' },
|
|
28
|
+
{ name: 'target', type: 'int256' },
|
|
29
|
+
];
|
|
30
|
+
exports.TEMPLATE_CHECK_FIELDS = [
|
|
31
|
+
...exports.CHECK_FIELDS.slice(0, 3),
|
|
32
|
+
{ name: 'source', type: 'uint8' },
|
|
33
|
+
{ name: 'value', type: 'int256' },
|
|
34
|
+
];
|
|
35
|
+
exports.LOGIC_FIELDS = [
|
|
36
|
+
{ name: 'kind', type: 'uint8' },
|
|
37
|
+
{ name: 'checks', type: 'uint8[]' },
|
|
38
|
+
{ name: 'children', type: 'uint8[]' },
|
|
39
|
+
{ name: 'k', type: 'uint8' },
|
|
40
|
+
];
|
|
41
|
+
exports.JOB_SPEC_PARAM = {
|
|
42
|
+
type: 'tuple',
|
|
43
|
+
components: [
|
|
44
|
+
{ name: 'reads', type: 'tuple[]', components: exports.READ_FIELDS },
|
|
45
|
+
{ name: 'checks', type: 'tuple[]', components: exports.CHECK_FIELDS },
|
|
46
|
+
{ name: 'logic', type: 'tuple[]', components: exports.LOGIC_FIELDS },
|
|
47
|
+
{ name: 'allowedMutability', type: 'uint8' },
|
|
48
|
+
{ name: 'origin', type: 'bytes32' },
|
|
49
|
+
{ name: 'executeBy', type: 'uint64' },
|
|
50
|
+
{ name: 'failFinalAt', type: 'uint64' },
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
exports.JOB_TEMPLATE_PARAM = {
|
|
54
|
+
type: 'tuple',
|
|
55
|
+
components: [
|
|
56
|
+
{ name: 'reads', type: 'tuple[]', components: exports.TEMPLATE_READ_FIELDS },
|
|
57
|
+
{ name: 'checks', type: 'tuple[]', components: exports.TEMPLATE_CHECK_FIELDS },
|
|
58
|
+
{ name: 'logic', type: 'tuple[]', components: exports.LOGIC_FIELDS },
|
|
59
|
+
{ name: 'allowedMutability', type: 'uint8' },
|
|
60
|
+
{
|
|
61
|
+
name: 'params',
|
|
62
|
+
type: 'tuple[]',
|
|
63
|
+
components: [
|
|
64
|
+
{ name: 'min', type: 'int256' },
|
|
65
|
+
{ name: 'max', type: 'int256' },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Abi, Address, Hex } from 'viem';
|
|
2
|
+
import type { ArgumentPath, WalletMarker } from '../agentic/agentic.types';
|
|
3
|
+
import type { JOB_VOCABULARY, PRINCIPAL } from './constants';
|
|
4
|
+
import type { PushChain } from '../push-chain/push-chain';
|
|
5
|
+
import type { ReadCallback, UniversalReadResponse } from '../read-state/read-state.types';
|
|
6
|
+
import type { ReadExecuteOptions } from '../read-state/read-params';
|
|
7
|
+
import type { ReadOptions } from '../read-state/read-params';
|
|
8
|
+
export type Evaluation = (typeof JOB_VOCABULARY.EVALUATION)[keyof typeof JOB_VOCABULARY.EVALUATION];
|
|
9
|
+
export type Operation = (typeof JOB_VOCABULARY.OPERATION)[keyof typeof JOB_VOCABULARY.OPERATION];
|
|
10
|
+
export type LogicKind = (typeof JOB_VOCABULARY.LOGIC)[keyof typeof JOB_VOCABULARY.LOGIC];
|
|
11
|
+
export type AllowedMutability = (typeof JOB_VOCABULARY.ALLOWED_MUTABILITY)[keyof typeof JOB_VOCABULARY.ALLOWED_MUTABILITY];
|
|
12
|
+
export type PrincipalMarker = typeof PRINCIPAL;
|
|
13
|
+
export interface JobFill {
|
|
14
|
+
word: number;
|
|
15
|
+
source: 'WALLET' | 'PARAM';
|
|
16
|
+
param?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PreparedJobRead {
|
|
19
|
+
chainNamespace: string;
|
|
20
|
+
chainId: string;
|
|
21
|
+
target: Address;
|
|
22
|
+
selector: Hex;
|
|
23
|
+
args: Hex;
|
|
24
|
+
outputs: Hex;
|
|
25
|
+
/** Placeholder positions are explicit; zero argument values are never treated as holes. */
|
|
26
|
+
fills?: JobFill[];
|
|
27
|
+
}
|
|
28
|
+
export interface JobRead extends PreparedJobRead {
|
|
29
|
+
minConfirmations: number;
|
|
30
|
+
field: number[];
|
|
31
|
+
}
|
|
32
|
+
export interface PrepareJobReadOptions {
|
|
33
|
+
chain: string;
|
|
34
|
+
target: Address;
|
|
35
|
+
abi: Abi;
|
|
36
|
+
functionName: string;
|
|
37
|
+
args?: readonly unknown[];
|
|
38
|
+
}
|
|
39
|
+
export type ExecuteJobReadOptions = Pick<ReadOptions, 'callback' | 'minConfirmations' | 'blockNumber' | 'expiryBlocks' | 'maxFee' | 'refundTo' | 'waitForCompletion' | 'progressHook' | 'advanced'>;
|
|
40
|
+
export interface JobReadInput {
|
|
41
|
+
read: PreparedJobRead;
|
|
42
|
+
minConfirmations?: number;
|
|
43
|
+
field?: number[];
|
|
44
|
+
}
|
|
45
|
+
export interface JobCheck {
|
|
46
|
+
read: number;
|
|
47
|
+
evaluation: Evaluation;
|
|
48
|
+
operation: Operation;
|
|
49
|
+
target: bigint;
|
|
50
|
+
}
|
|
51
|
+
export interface JobCheckTemplate extends Omit<JobCheck, 'target'> {
|
|
52
|
+
target: bigint | PrincipalMarker | WalletMarker | {
|
|
53
|
+
principalBps: bigint;
|
|
54
|
+
} | {
|
|
55
|
+
param: number;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface LogicTree {
|
|
59
|
+
kind: LogicKind;
|
|
60
|
+
of: (number | LogicTree)[];
|
|
61
|
+
k?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface JobSpec {
|
|
64
|
+
reads: JobRead[];
|
|
65
|
+
checks: JobCheck[];
|
|
66
|
+
logic: LogicTree;
|
|
67
|
+
allowedMutability: AllowedMutability;
|
|
68
|
+
origin: Hex;
|
|
69
|
+
executeBy: number;
|
|
70
|
+
failFinalAt: number;
|
|
71
|
+
}
|
|
72
|
+
export interface JobSpecTemplate {
|
|
73
|
+
reads: JobRead[];
|
|
74
|
+
checks: JobCheckTemplate[];
|
|
75
|
+
logic: LogicTree;
|
|
76
|
+
allowedMutability: AllowedMutability;
|
|
77
|
+
params: {
|
|
78
|
+
min: bigint;
|
|
79
|
+
max: bigint;
|
|
80
|
+
}[];
|
|
81
|
+
}
|
|
82
|
+
export interface BuildJobSpecOptions {
|
|
83
|
+
reads: (PreparedJobRead | JobReadInput)[];
|
|
84
|
+
checks: JobCheck[];
|
|
85
|
+
logic: 'ALL' | 'ANY' | LogicTree;
|
|
86
|
+
allowedMutability?: AllowedMutability;
|
|
87
|
+
executeBy: number;
|
|
88
|
+
failFinalAt: number;
|
|
89
|
+
expiredAt?: number;
|
|
90
|
+
origin?: Hex;
|
|
91
|
+
}
|
|
92
|
+
export interface BuildJobSpecTemplateOptions extends Omit<BuildJobSpecOptions, 'checks' | 'executeBy' | 'failFinalAt' | 'expiredAt' | 'origin'> {
|
|
93
|
+
checks: JobCheckTemplate[];
|
|
94
|
+
params?: {
|
|
95
|
+
min: bigint;
|
|
96
|
+
max: bigint;
|
|
97
|
+
}[];
|
|
98
|
+
}
|
|
99
|
+
export interface PreviewJobSpecOptions {
|
|
100
|
+
client: Pick<PushChain, 'universal'>;
|
|
101
|
+
wallet?: Address;
|
|
102
|
+
principal?: bigint;
|
|
103
|
+
params?: bigint[];
|
|
104
|
+
/** Explicit destination accounts override CEA derivation from wallet on a real SDK client. */
|
|
105
|
+
accounts?: Record<string, Address>;
|
|
106
|
+
/** Optional baseline per read for NUMBER/PERCENTAGE. Missing baselines remain unknown. */
|
|
107
|
+
baseline?: readonly (bigint | null)[];
|
|
108
|
+
/** Existing universal-read registry is used by default. */
|
|
109
|
+
callback?: ReadCallback;
|
|
110
|
+
/** Maximum sum of prepared read request values, checked before any payment. */
|
|
111
|
+
maxTotalFee?: bigint;
|
|
112
|
+
expiryBlocks?: bigint;
|
|
113
|
+
refundTo?: Address;
|
|
114
|
+
progressHook?: ReadExecuteOptions['progressHook'];
|
|
115
|
+
advanced?: ReadExecuteOptions['advanced'];
|
|
116
|
+
/** One existing request ID per read, in read order. Validated against the resolved call; no new fees. */
|
|
117
|
+
resume?: readonly Hex[];
|
|
118
|
+
}
|
|
119
|
+
export interface JobSpecPreview {
|
|
120
|
+
/** A preview is a paid observation, never an evaluator verdict. */
|
|
121
|
+
reads: {
|
|
122
|
+
value: Hex | null;
|
|
123
|
+
decoded: bigint | null;
|
|
124
|
+
error?: string;
|
|
125
|
+
response: UniversalReadResponse;
|
|
126
|
+
}[];
|
|
127
|
+
checks: {
|
|
128
|
+
pass: boolean | null;
|
|
129
|
+
value: bigint | null;
|
|
130
|
+
reason?: string;
|
|
131
|
+
}[];
|
|
132
|
+
pass: boolean | null;
|
|
133
|
+
fees: {
|
|
134
|
+
quoted: bigint;
|
|
135
|
+
paid: bigint;
|
|
136
|
+
newlyPaid: bigint;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export type JobArgumentPath = ArgumentPath;
|