@lifi/compose-spec 0.0.1-alpha
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/LICENSE +201 -0
- package/README.md +51 -0
- package/dist/index.cjs +413 -0
- package/dist/index.d.cts +878 -0
- package/dist/index.d.ts +878 -0
- package/dist/index.js +327 -0
- package/package.json +52 -0
- package/src/compile.ts +97 -0
- package/src/constructors.ts +105 -0
- package/src/flow.ts +101 -0
- package/src/flowSchema.ts +105 -0
- package/src/index.ts +133 -0
- package/src/manifest.ts +9 -0
- package/src/materialiserMetadata.ts +24 -0
- package/src/ref.ts +60 -0
- package/src/resource.ts +48 -0
- package/src/zodSchemas.ts +137 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const SolTypeSchema: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
5
|
+
declare const ResourceSchema: Schema.Union<[Schema.Struct<{
|
|
6
|
+
kind: Schema.Literal<["native"]>;
|
|
7
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
8
|
+
}>, Schema.Struct<{
|
|
9
|
+
kind: Schema.Literal<["erc20"]>;
|
|
10
|
+
token: typeof Schema.String;
|
|
11
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
12
|
+
}>]>;
|
|
13
|
+
declare const ResourceInputSchema: Schema.Struct<{
|
|
14
|
+
name: typeof Schema.String;
|
|
15
|
+
resource: Schema.Union<[Schema.Struct<{
|
|
16
|
+
kind: Schema.Literal<["native"]>;
|
|
17
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
18
|
+
}>, Schema.Struct<{
|
|
19
|
+
kind: Schema.Literal<["erc20"]>;
|
|
20
|
+
token: typeof Schema.String;
|
|
21
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
22
|
+
}>]>;
|
|
23
|
+
}>;
|
|
24
|
+
declare const HandleInputSchema: Schema.Struct<{
|
|
25
|
+
name: typeof Schema.String;
|
|
26
|
+
type: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
27
|
+
}>;
|
|
28
|
+
declare const FlowInputSchema: Schema.Union<[Schema.Struct<{
|
|
29
|
+
name: typeof Schema.String;
|
|
30
|
+
resource: Schema.Union<[Schema.Struct<{
|
|
31
|
+
kind: Schema.Literal<["native"]>;
|
|
32
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
kind: Schema.Literal<["erc20"]>;
|
|
35
|
+
token: typeof Schema.String;
|
|
36
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
37
|
+
}>]>;
|
|
38
|
+
}>, Schema.Struct<{
|
|
39
|
+
name: typeof Schema.String;
|
|
40
|
+
type: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
41
|
+
}>]>;
|
|
42
|
+
declare const RefSchema: Schema.Struct<{
|
|
43
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
44
|
+
}>;
|
|
45
|
+
declare const LiteralBindingSchema: Schema.Struct<{
|
|
46
|
+
kind: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
47
|
+
value: typeof Schema.String;
|
|
48
|
+
}>;
|
|
49
|
+
declare const BindValueSchema: Schema.Union<[Schema.Struct<{
|
|
50
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
51
|
+
}>, Schema.Struct<{
|
|
52
|
+
kind: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
53
|
+
value: typeof Schema.String;
|
|
54
|
+
}>]>;
|
|
55
|
+
declare const AppliedGuardSchema: Schema.TypeLiteral<{
|
|
56
|
+
kind: typeof Schema.String;
|
|
57
|
+
}, readonly [{
|
|
58
|
+
readonly key: typeof Schema.String;
|
|
59
|
+
readonly value: typeof Schema.Unknown;
|
|
60
|
+
}]>;
|
|
61
|
+
declare const CallSchema: Schema.Struct<{
|
|
62
|
+
id: typeof Schema.String;
|
|
63
|
+
op: typeof Schema.String;
|
|
64
|
+
bind: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
65
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
kind: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
68
|
+
value: typeof Schema.String;
|
|
69
|
+
}>]>>, {
|
|
70
|
+
default: () => {};
|
|
71
|
+
}>;
|
|
72
|
+
config: Schema.optionalWith<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>, {
|
|
73
|
+
default: () => {};
|
|
74
|
+
}>;
|
|
75
|
+
guards: Schema.optional<Schema.Array$<Schema.TypeLiteral<{
|
|
76
|
+
kind: typeof Schema.String;
|
|
77
|
+
}, readonly [{
|
|
78
|
+
readonly key: typeof Schema.String;
|
|
79
|
+
readonly value: typeof Schema.Unknown;
|
|
80
|
+
}]>>>;
|
|
81
|
+
}>;
|
|
82
|
+
declare const ContinuationSchema: Schema.Struct<{
|
|
83
|
+
awaits: typeof Schema.String;
|
|
84
|
+
flowId: typeof Schema.String;
|
|
85
|
+
}>;
|
|
86
|
+
declare const FlowSchema: Schema.Struct<{
|
|
87
|
+
version: Schema.Literal<[1]>;
|
|
88
|
+
id: typeof Schema.String;
|
|
89
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
90
|
+
inputs: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
91
|
+
name: typeof Schema.String;
|
|
92
|
+
resource: Schema.Union<[Schema.Struct<{
|
|
93
|
+
kind: Schema.Literal<["native"]>;
|
|
94
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
kind: Schema.Literal<["erc20"]>;
|
|
97
|
+
token: typeof Schema.String;
|
|
98
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
99
|
+
}>]>;
|
|
100
|
+
}>, Schema.Struct<{
|
|
101
|
+
name: typeof Schema.String;
|
|
102
|
+
type: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
103
|
+
}>]>>;
|
|
104
|
+
nodes: Schema.Array$<Schema.Struct<{
|
|
105
|
+
id: typeof Schema.String;
|
|
106
|
+
op: typeof Schema.String;
|
|
107
|
+
bind: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
108
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
109
|
+
}>, Schema.Struct<{
|
|
110
|
+
kind: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
111
|
+
value: typeof Schema.String;
|
|
112
|
+
}>]>>, {
|
|
113
|
+
default: () => {};
|
|
114
|
+
}>;
|
|
115
|
+
config: Schema.optionalWith<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>, {
|
|
116
|
+
default: () => {};
|
|
117
|
+
}>;
|
|
118
|
+
guards: Schema.optional<Schema.Array$<Schema.TypeLiteral<{
|
|
119
|
+
kind: typeof Schema.String;
|
|
120
|
+
}, readonly [{
|
|
121
|
+
readonly key: typeof Schema.String;
|
|
122
|
+
readonly value: typeof Schema.Unknown;
|
|
123
|
+
}]>>>;
|
|
124
|
+
}>>;
|
|
125
|
+
continuation: Schema.optional<Schema.Struct<{
|
|
126
|
+
awaits: typeof Schema.String;
|
|
127
|
+
flowId: typeof Schema.String;
|
|
128
|
+
}>>;
|
|
129
|
+
}>;
|
|
130
|
+
type SolType = typeof SolTypeSchema.Type;
|
|
131
|
+
type ResourceInput = typeof ResourceInputSchema.Type;
|
|
132
|
+
type HandleInput = typeof HandleInputSchema.Type;
|
|
133
|
+
type FlowInput = typeof FlowInputSchema.Type;
|
|
134
|
+
type Ref = typeof RefSchema.Type;
|
|
135
|
+
type LiteralBinding = typeof LiteralBindingSchema.Type;
|
|
136
|
+
type BindValue = typeof BindValueSchema.Type;
|
|
137
|
+
type AppliedGuard = typeof AppliedGuardSchema.Type;
|
|
138
|
+
type Call = typeof CallSchema.Type;
|
|
139
|
+
type Continuation = typeof ContinuationSchema.Type;
|
|
140
|
+
type Flow = typeof FlowSchema.Type;
|
|
141
|
+
|
|
142
|
+
type Availability = "now" | "future";
|
|
143
|
+
interface OutputAmount {
|
|
144
|
+
readonly expected: bigint;
|
|
145
|
+
readonly min?: bigint;
|
|
146
|
+
}
|
|
147
|
+
type Resource = {
|
|
148
|
+
readonly kind: "native";
|
|
149
|
+
readonly chainId: number;
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: "erc20";
|
|
152
|
+
readonly token: string;
|
|
153
|
+
readonly chainId: number;
|
|
154
|
+
};
|
|
155
|
+
type SimulatedAmounts = {
|
|
156
|
+
readonly amountOut: bigint;
|
|
157
|
+
readonly amountOutMin: bigint;
|
|
158
|
+
};
|
|
159
|
+
type ProducedResource = Resource & {
|
|
160
|
+
readonly availability: Availability;
|
|
161
|
+
readonly simulated?: SimulatedAmounts;
|
|
162
|
+
readonly owner: string;
|
|
163
|
+
};
|
|
164
|
+
declare const foldResource: <R>(r: Resource, cases: {
|
|
165
|
+
readonly native: (chainId: number) => R;
|
|
166
|
+
readonly erc20: (token: string, chainId: number) => R;
|
|
167
|
+
}) => R;
|
|
168
|
+
declare const resourceKey: (r: Resource) => string;
|
|
169
|
+
declare const erc20Token: (r: Resource) => string;
|
|
170
|
+
|
|
171
|
+
declare const ResourcePortZod: z.ZodObject<{
|
|
172
|
+
kind: z.ZodLiteral<"resource">;
|
|
173
|
+
name: z.ZodString;
|
|
174
|
+
accepts: z.ZodEnum<{
|
|
175
|
+
native: "native";
|
|
176
|
+
erc20: "erc20";
|
|
177
|
+
any: "any";
|
|
178
|
+
}>;
|
|
179
|
+
mode: z.ZodEnum<{
|
|
180
|
+
linear: "linear";
|
|
181
|
+
copy: "copy";
|
|
182
|
+
}>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
declare const HandlePortZod: z.ZodObject<{
|
|
185
|
+
kind: z.ZodLiteral<"handle">;
|
|
186
|
+
name: z.ZodString;
|
|
187
|
+
type: z.ZodEnum<{
|
|
188
|
+
string: "string";
|
|
189
|
+
uint8: "uint8";
|
|
190
|
+
uint16: "uint16";
|
|
191
|
+
uint32: "uint32";
|
|
192
|
+
uint64: "uint64";
|
|
193
|
+
uint128: "uint128";
|
|
194
|
+
uint256: "uint256";
|
|
195
|
+
int128: "int128";
|
|
196
|
+
int256: "int256";
|
|
197
|
+
address: "address";
|
|
198
|
+
bool: "bool";
|
|
199
|
+
bytes: "bytes";
|
|
200
|
+
bytes4: "bytes4";
|
|
201
|
+
bytes32: "bytes32";
|
|
202
|
+
}>;
|
|
203
|
+
mode: z.ZodEnum<{
|
|
204
|
+
linear: "linear";
|
|
205
|
+
copy: "copy";
|
|
206
|
+
}>;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
declare const InputPortZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
209
|
+
kind: z.ZodLiteral<"resource">;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
accepts: z.ZodEnum<{
|
|
212
|
+
native: "native";
|
|
213
|
+
erc20: "erc20";
|
|
214
|
+
any: "any";
|
|
215
|
+
}>;
|
|
216
|
+
mode: z.ZodEnum<{
|
|
217
|
+
linear: "linear";
|
|
218
|
+
copy: "copy";
|
|
219
|
+
}>;
|
|
220
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
221
|
+
kind: z.ZodLiteral<"handle">;
|
|
222
|
+
name: z.ZodString;
|
|
223
|
+
type: z.ZodEnum<{
|
|
224
|
+
string: "string";
|
|
225
|
+
uint8: "uint8";
|
|
226
|
+
uint16: "uint16";
|
|
227
|
+
uint32: "uint32";
|
|
228
|
+
uint64: "uint64";
|
|
229
|
+
uint128: "uint128";
|
|
230
|
+
uint256: "uint256";
|
|
231
|
+
int128: "int128";
|
|
232
|
+
int256: "int256";
|
|
233
|
+
address: "address";
|
|
234
|
+
bool: "bool";
|
|
235
|
+
bytes: "bytes";
|
|
236
|
+
bytes4: "bytes4";
|
|
237
|
+
bytes32: "bytes32";
|
|
238
|
+
}>;
|
|
239
|
+
mode: z.ZodEnum<{
|
|
240
|
+
linear: "linear";
|
|
241
|
+
copy: "copy";
|
|
242
|
+
}>;
|
|
243
|
+
}, z.core.$strip>], "kind">;
|
|
244
|
+
declare const ResourceOutputPortZod: z.ZodObject<{
|
|
245
|
+
kind: z.ZodLiteral<"resource_output">;
|
|
246
|
+
name: z.ZodString;
|
|
247
|
+
mode: z.ZodEnum<{
|
|
248
|
+
linear: "linear";
|
|
249
|
+
copy: "copy";
|
|
250
|
+
}>;
|
|
251
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
252
|
+
now: "now";
|
|
253
|
+
future: "future";
|
|
254
|
+
}>>;
|
|
255
|
+
providesMinimum: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
omitIfZero: z.ZodOptional<z.ZodBoolean>;
|
|
257
|
+
deliveryAddressInput: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
declare const OutputPortZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
260
|
+
kind: z.ZodLiteral<"resource_output">;
|
|
261
|
+
name: z.ZodString;
|
|
262
|
+
mode: z.ZodEnum<{
|
|
263
|
+
linear: "linear";
|
|
264
|
+
copy: "copy";
|
|
265
|
+
}>;
|
|
266
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
267
|
+
now: "now";
|
|
268
|
+
future: "future";
|
|
269
|
+
}>>;
|
|
270
|
+
providesMinimum: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
+
omitIfZero: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
deliveryAddressInput: z.ZodOptional<z.ZodString>;
|
|
273
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
+
kind: z.ZodLiteral<"handle">;
|
|
275
|
+
name: z.ZodString;
|
|
276
|
+
type: z.ZodEnum<{
|
|
277
|
+
string: "string";
|
|
278
|
+
uint8: "uint8";
|
|
279
|
+
uint16: "uint16";
|
|
280
|
+
uint32: "uint32";
|
|
281
|
+
uint64: "uint64";
|
|
282
|
+
uint128: "uint128";
|
|
283
|
+
uint256: "uint256";
|
|
284
|
+
int128: "int128";
|
|
285
|
+
int256: "int256";
|
|
286
|
+
address: "address";
|
|
287
|
+
bool: "bool";
|
|
288
|
+
bytes: "bytes";
|
|
289
|
+
bytes4: "bytes4";
|
|
290
|
+
bytes32: "bytes32";
|
|
291
|
+
}>;
|
|
292
|
+
mode: z.ZodEnum<{
|
|
293
|
+
linear: "linear";
|
|
294
|
+
copy: "copy";
|
|
295
|
+
}>;
|
|
296
|
+
}, z.core.$strip>], "kind">;
|
|
297
|
+
declare const ManifestOperationZod: z.ZodObject<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
description: z.ZodOptional<z.ZodString>;
|
|
300
|
+
inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
301
|
+
kind: z.ZodLiteral<"resource">;
|
|
302
|
+
name: z.ZodString;
|
|
303
|
+
accepts: z.ZodEnum<{
|
|
304
|
+
native: "native";
|
|
305
|
+
erc20: "erc20";
|
|
306
|
+
any: "any";
|
|
307
|
+
}>;
|
|
308
|
+
mode: z.ZodEnum<{
|
|
309
|
+
linear: "linear";
|
|
310
|
+
copy: "copy";
|
|
311
|
+
}>;
|
|
312
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
313
|
+
kind: z.ZodLiteral<"handle">;
|
|
314
|
+
name: z.ZodString;
|
|
315
|
+
type: z.ZodEnum<{
|
|
316
|
+
string: "string";
|
|
317
|
+
uint8: "uint8";
|
|
318
|
+
uint16: "uint16";
|
|
319
|
+
uint32: "uint32";
|
|
320
|
+
uint64: "uint64";
|
|
321
|
+
uint128: "uint128";
|
|
322
|
+
uint256: "uint256";
|
|
323
|
+
int128: "int128";
|
|
324
|
+
int256: "int256";
|
|
325
|
+
address: "address";
|
|
326
|
+
bool: "bool";
|
|
327
|
+
bytes: "bytes";
|
|
328
|
+
bytes4: "bytes4";
|
|
329
|
+
bytes32: "bytes32";
|
|
330
|
+
}>;
|
|
331
|
+
mode: z.ZodEnum<{
|
|
332
|
+
linear: "linear";
|
|
333
|
+
copy: "copy";
|
|
334
|
+
}>;
|
|
335
|
+
}, z.core.$strip>], "kind">>;
|
|
336
|
+
outputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
337
|
+
kind: z.ZodLiteral<"resource_output">;
|
|
338
|
+
name: z.ZodString;
|
|
339
|
+
mode: z.ZodEnum<{
|
|
340
|
+
linear: "linear";
|
|
341
|
+
copy: "copy";
|
|
342
|
+
}>;
|
|
343
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
344
|
+
now: "now";
|
|
345
|
+
future: "future";
|
|
346
|
+
}>>;
|
|
347
|
+
providesMinimum: z.ZodOptional<z.ZodBoolean>;
|
|
348
|
+
omitIfZero: z.ZodOptional<z.ZodBoolean>;
|
|
349
|
+
deliveryAddressInput: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
351
|
+
kind: z.ZodLiteral<"handle">;
|
|
352
|
+
name: z.ZodString;
|
|
353
|
+
type: z.ZodEnum<{
|
|
354
|
+
string: "string";
|
|
355
|
+
uint8: "uint8";
|
|
356
|
+
uint16: "uint16";
|
|
357
|
+
uint32: "uint32";
|
|
358
|
+
uint64: "uint64";
|
|
359
|
+
uint128: "uint128";
|
|
360
|
+
uint256: "uint256";
|
|
361
|
+
int128: "int128";
|
|
362
|
+
int256: "int256";
|
|
363
|
+
address: "address";
|
|
364
|
+
bool: "bool";
|
|
365
|
+
bytes: "bytes";
|
|
366
|
+
bytes4: "bytes4";
|
|
367
|
+
bytes32: "bytes32";
|
|
368
|
+
}>;
|
|
369
|
+
mode: z.ZodEnum<{
|
|
370
|
+
linear: "linear";
|
|
371
|
+
copy: "copy";
|
|
372
|
+
}>;
|
|
373
|
+
}, z.core.$strip>], "kind">>;
|
|
374
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
declare const GuardSelectorZod: z.ZodObject<{
|
|
377
|
+
binding: z.ZodString;
|
|
378
|
+
source: z.ZodEnum<{
|
|
379
|
+
inputs: "inputs";
|
|
380
|
+
outputs: "outputs";
|
|
381
|
+
}>;
|
|
382
|
+
match: z.ZodObject<{
|
|
383
|
+
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
384
|
+
resource: "resource";
|
|
385
|
+
handle: "handle";
|
|
386
|
+
resource_output: "resource_output";
|
|
387
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
388
|
+
resource: "resource";
|
|
389
|
+
handle: "handle";
|
|
390
|
+
resource_output: "resource_output";
|
|
391
|
+
}>>]>;
|
|
392
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
393
|
+
linear: "linear";
|
|
394
|
+
copy: "copy";
|
|
395
|
+
}>>;
|
|
396
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
397
|
+
native: "native";
|
|
398
|
+
erc20: "erc20";
|
|
399
|
+
any: "any";
|
|
400
|
+
}>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
selection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
403
|
+
kind: z.ZodLiteral<"config">;
|
|
404
|
+
configKey: z.ZodString;
|
|
405
|
+
cardinality: z.ZodEnum<{
|
|
406
|
+
one: "one";
|
|
407
|
+
many: "many";
|
|
408
|
+
}>;
|
|
409
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
410
|
+
kind: z.ZodLiteral<"all_matching">;
|
|
411
|
+
}, z.core.$strip>], "kind">;
|
|
412
|
+
}, z.core.$strip>;
|
|
413
|
+
declare const GuardCompatibilityZod: z.ZodObject<{
|
|
414
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
415
|
+
binding: z.ZodString;
|
|
416
|
+
source: z.ZodEnum<{
|
|
417
|
+
inputs: "inputs";
|
|
418
|
+
outputs: "outputs";
|
|
419
|
+
}>;
|
|
420
|
+
match: z.ZodObject<{
|
|
421
|
+
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
422
|
+
resource: "resource";
|
|
423
|
+
handle: "handle";
|
|
424
|
+
resource_output: "resource_output";
|
|
425
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
426
|
+
resource: "resource";
|
|
427
|
+
handle: "handle";
|
|
428
|
+
resource_output: "resource_output";
|
|
429
|
+
}>>]>;
|
|
430
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
431
|
+
linear: "linear";
|
|
432
|
+
copy: "copy";
|
|
433
|
+
}>>;
|
|
434
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
435
|
+
native: "native";
|
|
436
|
+
erc20: "erc20";
|
|
437
|
+
any: "any";
|
|
438
|
+
}>>;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
selection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
441
|
+
kind: z.ZodLiteral<"config">;
|
|
442
|
+
configKey: z.ZodString;
|
|
443
|
+
cardinality: z.ZodEnum<{
|
|
444
|
+
one: "one";
|
|
445
|
+
many: "many";
|
|
446
|
+
}>;
|
|
447
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
448
|
+
kind: z.ZodLiteral<"all_matching">;
|
|
449
|
+
}, z.core.$strip>], "kind">;
|
|
450
|
+
}, z.core.$strip>>;
|
|
451
|
+
}, z.core.$strip>;
|
|
452
|
+
declare const ManifestGuardZod: z.ZodObject<{
|
|
453
|
+
kind: z.ZodString;
|
|
454
|
+
description: z.ZodOptional<z.ZodString>;
|
|
455
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
456
|
+
compatibility: z.ZodOptional<z.ZodObject<{
|
|
457
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
458
|
+
binding: z.ZodString;
|
|
459
|
+
source: z.ZodEnum<{
|
|
460
|
+
inputs: "inputs";
|
|
461
|
+
outputs: "outputs";
|
|
462
|
+
}>;
|
|
463
|
+
match: z.ZodObject<{
|
|
464
|
+
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
465
|
+
resource: "resource";
|
|
466
|
+
handle: "handle";
|
|
467
|
+
resource_output: "resource_output";
|
|
468
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
469
|
+
resource: "resource";
|
|
470
|
+
handle: "handle";
|
|
471
|
+
resource_output: "resource_output";
|
|
472
|
+
}>>]>;
|
|
473
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
474
|
+
linear: "linear";
|
|
475
|
+
copy: "copy";
|
|
476
|
+
}>>;
|
|
477
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
478
|
+
native: "native";
|
|
479
|
+
erc20: "erc20";
|
|
480
|
+
any: "any";
|
|
481
|
+
}>>;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
selection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
484
|
+
kind: z.ZodLiteral<"config">;
|
|
485
|
+
configKey: z.ZodString;
|
|
486
|
+
cardinality: z.ZodEnum<{
|
|
487
|
+
one: "one";
|
|
488
|
+
many: "many";
|
|
489
|
+
}>;
|
|
490
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
491
|
+
kind: z.ZodLiteral<"all_matching">;
|
|
492
|
+
}, z.core.$strip>], "kind">;
|
|
493
|
+
}, z.core.$strip>>;
|
|
494
|
+
}, z.core.$strip>>;
|
|
495
|
+
}, z.core.$strip>;
|
|
496
|
+
declare const ManifestMaterialiserZod: z.ZodObject<{
|
|
497
|
+
kind: z.ZodString;
|
|
498
|
+
description: z.ZodOptional<z.ZodString>;
|
|
499
|
+
accepts: z.ZodEnum<{
|
|
500
|
+
resource: "resource";
|
|
501
|
+
any: "any";
|
|
502
|
+
handle: "handle";
|
|
503
|
+
}>;
|
|
504
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
505
|
+
}, z.core.$strip>;
|
|
506
|
+
declare const ManifestPreconditionZod: z.ZodObject<{
|
|
507
|
+
type: z.ZodString;
|
|
508
|
+
description: z.ZodOptional<z.ZodString>;
|
|
509
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
510
|
+
}, z.core.$strip>;
|
|
511
|
+
declare const ComposeManifestZod: z.ZodObject<{
|
|
512
|
+
manifestVersion: z.ZodNumber;
|
|
513
|
+
manifestHash: z.ZodString;
|
|
514
|
+
flowSchema: z.ZodObject<{}, z.core.$loose>;
|
|
515
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
516
|
+
id: z.ZodString;
|
|
517
|
+
description: z.ZodOptional<z.ZodString>;
|
|
518
|
+
inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
519
|
+
kind: z.ZodLiteral<"resource">;
|
|
520
|
+
name: z.ZodString;
|
|
521
|
+
accepts: z.ZodEnum<{
|
|
522
|
+
native: "native";
|
|
523
|
+
erc20: "erc20";
|
|
524
|
+
any: "any";
|
|
525
|
+
}>;
|
|
526
|
+
mode: z.ZodEnum<{
|
|
527
|
+
linear: "linear";
|
|
528
|
+
copy: "copy";
|
|
529
|
+
}>;
|
|
530
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
531
|
+
kind: z.ZodLiteral<"handle">;
|
|
532
|
+
name: z.ZodString;
|
|
533
|
+
type: z.ZodEnum<{
|
|
534
|
+
string: "string";
|
|
535
|
+
uint8: "uint8";
|
|
536
|
+
uint16: "uint16";
|
|
537
|
+
uint32: "uint32";
|
|
538
|
+
uint64: "uint64";
|
|
539
|
+
uint128: "uint128";
|
|
540
|
+
uint256: "uint256";
|
|
541
|
+
int128: "int128";
|
|
542
|
+
int256: "int256";
|
|
543
|
+
address: "address";
|
|
544
|
+
bool: "bool";
|
|
545
|
+
bytes: "bytes";
|
|
546
|
+
bytes4: "bytes4";
|
|
547
|
+
bytes32: "bytes32";
|
|
548
|
+
}>;
|
|
549
|
+
mode: z.ZodEnum<{
|
|
550
|
+
linear: "linear";
|
|
551
|
+
copy: "copy";
|
|
552
|
+
}>;
|
|
553
|
+
}, z.core.$strip>], "kind">>;
|
|
554
|
+
outputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
555
|
+
kind: z.ZodLiteral<"resource_output">;
|
|
556
|
+
name: z.ZodString;
|
|
557
|
+
mode: z.ZodEnum<{
|
|
558
|
+
linear: "linear";
|
|
559
|
+
copy: "copy";
|
|
560
|
+
}>;
|
|
561
|
+
availability: z.ZodOptional<z.ZodEnum<{
|
|
562
|
+
now: "now";
|
|
563
|
+
future: "future";
|
|
564
|
+
}>>;
|
|
565
|
+
providesMinimum: z.ZodOptional<z.ZodBoolean>;
|
|
566
|
+
omitIfZero: z.ZodOptional<z.ZodBoolean>;
|
|
567
|
+
deliveryAddressInput: z.ZodOptional<z.ZodString>;
|
|
568
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
569
|
+
kind: z.ZodLiteral<"handle">;
|
|
570
|
+
name: z.ZodString;
|
|
571
|
+
type: z.ZodEnum<{
|
|
572
|
+
string: "string";
|
|
573
|
+
uint8: "uint8";
|
|
574
|
+
uint16: "uint16";
|
|
575
|
+
uint32: "uint32";
|
|
576
|
+
uint64: "uint64";
|
|
577
|
+
uint128: "uint128";
|
|
578
|
+
uint256: "uint256";
|
|
579
|
+
int128: "int128";
|
|
580
|
+
int256: "int256";
|
|
581
|
+
address: "address";
|
|
582
|
+
bool: "bool";
|
|
583
|
+
bytes: "bytes";
|
|
584
|
+
bytes4: "bytes4";
|
|
585
|
+
bytes32: "bytes32";
|
|
586
|
+
}>;
|
|
587
|
+
mode: z.ZodEnum<{
|
|
588
|
+
linear: "linear";
|
|
589
|
+
copy: "copy";
|
|
590
|
+
}>;
|
|
591
|
+
}, z.core.$strip>], "kind">>;
|
|
592
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
593
|
+
}, z.core.$strip>>;
|
|
594
|
+
guards: z.ZodArray<z.ZodObject<{
|
|
595
|
+
kind: z.ZodString;
|
|
596
|
+
description: z.ZodOptional<z.ZodString>;
|
|
597
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
598
|
+
compatibility: z.ZodOptional<z.ZodObject<{
|
|
599
|
+
selectors: z.ZodArray<z.ZodObject<{
|
|
600
|
+
binding: z.ZodString;
|
|
601
|
+
source: z.ZodEnum<{
|
|
602
|
+
inputs: "inputs";
|
|
603
|
+
outputs: "outputs";
|
|
604
|
+
}>;
|
|
605
|
+
match: z.ZodObject<{
|
|
606
|
+
kind: z.ZodUnion<readonly [z.ZodEnum<{
|
|
607
|
+
resource: "resource";
|
|
608
|
+
handle: "handle";
|
|
609
|
+
resource_output: "resource_output";
|
|
610
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
611
|
+
resource: "resource";
|
|
612
|
+
handle: "handle";
|
|
613
|
+
resource_output: "resource_output";
|
|
614
|
+
}>>]>;
|
|
615
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
616
|
+
linear: "linear";
|
|
617
|
+
copy: "copy";
|
|
618
|
+
}>>;
|
|
619
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
620
|
+
native: "native";
|
|
621
|
+
erc20: "erc20";
|
|
622
|
+
any: "any";
|
|
623
|
+
}>>;
|
|
624
|
+
}, z.core.$strip>;
|
|
625
|
+
selection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
626
|
+
kind: z.ZodLiteral<"config">;
|
|
627
|
+
configKey: z.ZodString;
|
|
628
|
+
cardinality: z.ZodEnum<{
|
|
629
|
+
one: "one";
|
|
630
|
+
many: "many";
|
|
631
|
+
}>;
|
|
632
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
633
|
+
kind: z.ZodLiteral<"all_matching">;
|
|
634
|
+
}, z.core.$strip>], "kind">;
|
|
635
|
+
}, z.core.$strip>>;
|
|
636
|
+
}, z.core.$strip>>;
|
|
637
|
+
}, z.core.$strip>>;
|
|
638
|
+
materialisers: z.ZodArray<z.ZodObject<{
|
|
639
|
+
kind: z.ZodString;
|
|
640
|
+
description: z.ZodOptional<z.ZodString>;
|
|
641
|
+
accepts: z.ZodEnum<{
|
|
642
|
+
resource: "resource";
|
|
643
|
+
any: "any";
|
|
644
|
+
handle: "handle";
|
|
645
|
+
}>;
|
|
646
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
647
|
+
}, z.core.$strip>>;
|
|
648
|
+
preconditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
649
|
+
type: z.ZodString;
|
|
650
|
+
description: z.ZodOptional<z.ZodString>;
|
|
651
|
+
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
652
|
+
}, z.core.$strip>>>;
|
|
653
|
+
}, z.core.$strip>;
|
|
654
|
+
type ResourcePort = z.infer<typeof ResourcePortZod>;
|
|
655
|
+
type HandlePort = z.infer<typeof HandlePortZod>;
|
|
656
|
+
type OpInputPort = z.infer<typeof InputPortZod>;
|
|
657
|
+
type ResourceOutputPort = z.infer<typeof ResourceOutputPortZod>;
|
|
658
|
+
type OpOutputPort = z.infer<typeof OutputPortZod>;
|
|
659
|
+
type ManifestOperation = z.infer<typeof ManifestOperationZod>;
|
|
660
|
+
type GuardSelector = z.infer<typeof GuardSelectorZod>;
|
|
661
|
+
type GuardCompatibility = z.infer<typeof GuardCompatibilityZod>;
|
|
662
|
+
type ManifestGuard = z.infer<typeof ManifestGuardZod>;
|
|
663
|
+
type ManifestMaterialiser = z.infer<typeof ManifestMaterialiserZod>;
|
|
664
|
+
type ManifestPrecondition = z.infer<typeof ManifestPreconditionZod>;
|
|
665
|
+
type ComposeManifest = z.infer<typeof ComposeManifestZod>;
|
|
666
|
+
|
|
667
|
+
interface Port {
|
|
668
|
+
readonly name: string;
|
|
669
|
+
readonly type: SolType;
|
|
670
|
+
readonly mode: "linear" | "copy";
|
|
671
|
+
readonly availability?: Availability;
|
|
672
|
+
readonly resource?: Resource;
|
|
673
|
+
}
|
|
674
|
+
declare const isResourceInput: (input: FlowInput) => input is ResourceInput;
|
|
675
|
+
declare const flowInputType: (input: FlowInput) => SolType;
|
|
676
|
+
declare const flowInputMode: (input: FlowInput) => "linear" | "copy";
|
|
677
|
+
declare const flowInputResource: (input: FlowInput) => Resource | undefined;
|
|
678
|
+
declare const isResourcePort: (port: OpInputPort) => port is ResourcePort;
|
|
679
|
+
declare const isHandlePort: (port: OpInputPort | OpOutputPort) => port is HandlePort;
|
|
680
|
+
declare const isResourceOutputPort: (port: OpInputPort | OpOutputPort) => port is ResourceOutputPort;
|
|
681
|
+
type ComposeErrorKind = "decode_error" | "validation_error" | "linearity_error" | "resolve_error" | "preparation_error" | "no_route_error" | "lowering_error" | "simulation_error" | "simulation_setup_error" | "simulation_revert" | "guard_error" | "continuation_error" | "compilation_error" | "verification_error" | "price_impact_exceeded";
|
|
682
|
+
interface ComposeError {
|
|
683
|
+
readonly kind: ComposeErrorKind;
|
|
684
|
+
readonly message: string;
|
|
685
|
+
readonly path?: string;
|
|
686
|
+
}
|
|
687
|
+
interface MaterialiserInputBase {
|
|
688
|
+
readonly kind: string;
|
|
689
|
+
}
|
|
690
|
+
type MaterialiserInput = MaterialiserInputBase & Record<string, unknown>;
|
|
691
|
+
type MaterialiserInputOf<C extends object> = MaterialiserInputBase & C;
|
|
692
|
+
type MaterialiserConfigOf<C extends object> = C;
|
|
693
|
+
declare const isMaterialiserInput: (s: InputSpec) => s is MaterialiserInput;
|
|
694
|
+
type InputSpec = bigint | string | MaterialiserInput;
|
|
695
|
+
interface PreconditionBase {
|
|
696
|
+
readonly type: string;
|
|
697
|
+
}
|
|
698
|
+
type Precondition = PreconditionBase & Record<string, unknown>;
|
|
699
|
+
type PreconditionOf<C extends object> = PreconditionBase & C;
|
|
700
|
+
type PreconditionConfigOf<C extends object> = Omit<PreconditionBase, "type"> & C;
|
|
701
|
+
|
|
702
|
+
declare const linear: <N extends string, T extends SolType>(name: N, type: T) => Port & {
|
|
703
|
+
readonly name: N;
|
|
704
|
+
readonly type: T;
|
|
705
|
+
readonly mode: "linear";
|
|
706
|
+
};
|
|
707
|
+
declare const copy: <N extends string, T extends SolType>(name: N, type: T) => Port & {
|
|
708
|
+
readonly name: N;
|
|
709
|
+
readonly type: T;
|
|
710
|
+
readonly mode: "copy";
|
|
711
|
+
};
|
|
712
|
+
declare const handle: <N extends string, T extends SolType>(name: N, type: T) => HandleInput & {
|
|
713
|
+
readonly name: N;
|
|
714
|
+
readonly type: T;
|
|
715
|
+
};
|
|
716
|
+
declare const native: <N extends string>(name: N, chainId: number) => ResourceInput & {
|
|
717
|
+
readonly name: N;
|
|
718
|
+
};
|
|
719
|
+
declare const erc20: <N extends string>(name: N, token: string, chainId: number) => ResourceInput & {
|
|
720
|
+
readonly name: N;
|
|
721
|
+
};
|
|
722
|
+
declare const resource: <N extends string>(name: N, accepts: "erc20" | "native" | "any") => ResourcePort & {
|
|
723
|
+
readonly name: N;
|
|
724
|
+
};
|
|
725
|
+
declare const readResource: <N extends string>(name: N, accepts: "erc20" | "native" | "any") => ResourcePort & {
|
|
726
|
+
readonly name: N;
|
|
727
|
+
readonly mode: "copy";
|
|
728
|
+
};
|
|
729
|
+
declare const opHandle: <N extends string, T extends SolType>(name: N, type: T) => HandlePort & {
|
|
730
|
+
readonly name: N;
|
|
731
|
+
readonly type: T;
|
|
732
|
+
};
|
|
733
|
+
declare const resourceOutput: <N extends string>(name: N, options?: Availability | {
|
|
734
|
+
availability?: Availability;
|
|
735
|
+
providesMinimum?: boolean;
|
|
736
|
+
omitIfZero?: boolean;
|
|
737
|
+
deliveryAddressInput?: string;
|
|
738
|
+
}) => ResourceOutputPort & {
|
|
739
|
+
readonly name: N;
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
type ParsedRef = {
|
|
743
|
+
readonly scope: "input";
|
|
744
|
+
readonly port: string;
|
|
745
|
+
} | {
|
|
746
|
+
readonly scope: "output";
|
|
747
|
+
readonly node: string;
|
|
748
|
+
readonly port: string;
|
|
749
|
+
} | {
|
|
750
|
+
readonly scope: "context";
|
|
751
|
+
readonly key: ContextKey;
|
|
752
|
+
};
|
|
753
|
+
type RefScope = ParsedRef["scope"];
|
|
754
|
+
type ContextKey = "sender" | "executionAddress";
|
|
755
|
+
declare const isContextKey: (key: string) => key is ContextKey;
|
|
756
|
+
/**
|
|
757
|
+
* Ref prefixes that parseRef intercepts before the fallback `output` scope.
|
|
758
|
+
* A node whose id matches one of these would produce ambiguous refs
|
|
759
|
+
* (e.g. `context.sender` could be a context ref or node-output ref).
|
|
760
|
+
* Validation must reject these as node ids.
|
|
761
|
+
*/
|
|
762
|
+
declare const RESERVED_REF_SCOPES: ReadonlySet<string>;
|
|
763
|
+
declare const parseRef: (ref: Ref) => ParsedRef;
|
|
764
|
+
declare const foldRef: <R>(ref: ParsedRef, cases: {
|
|
765
|
+
readonly input: (port: string) => R;
|
|
766
|
+
readonly context: (key: ContextKey) => R;
|
|
767
|
+
readonly output: (node: string, port: string) => R;
|
|
768
|
+
}) => R;
|
|
769
|
+
declare const refKey: (ref: Ref) => string;
|
|
770
|
+
|
|
771
|
+
type SimulationPolicy = "strict" | "allow-revert";
|
|
772
|
+
/**
|
|
773
|
+
* Destination for sweeping proxy-held terminal resources after execution.
|
|
774
|
+
* Either a literal EVM address or a `{ $ref }` context reference
|
|
775
|
+
* (e.g. `{ $ref: "context.sender" }`).
|
|
776
|
+
*/
|
|
777
|
+
type SweepTo = string | {
|
|
778
|
+
readonly $ref: string;
|
|
779
|
+
};
|
|
780
|
+
interface ComposeRun {
|
|
781
|
+
readonly inputs: Record<string, InputSpec>;
|
|
782
|
+
readonly preconditions?: readonly Precondition[];
|
|
783
|
+
readonly signer: string;
|
|
784
|
+
readonly assumptions?: Record<string, bigint>;
|
|
785
|
+
readonly referrer?: string;
|
|
786
|
+
readonly maxPriceImpactBps?: number;
|
|
787
|
+
readonly sweepTo?: SweepTo;
|
|
788
|
+
readonly simulationPolicy?: SimulationPolicy;
|
|
789
|
+
readonly checkOnChainAllowances?: boolean;
|
|
790
|
+
}
|
|
791
|
+
interface ComposeCompileRequest {
|
|
792
|
+
readonly flow: Flow;
|
|
793
|
+
readonly run: ComposeRun;
|
|
794
|
+
}
|
|
795
|
+
interface PriceImpact {
|
|
796
|
+
readonly inputValueUsd: number;
|
|
797
|
+
readonly outputValueUsd: number;
|
|
798
|
+
readonly impactBps: number;
|
|
799
|
+
readonly unpricedInputs: readonly string[];
|
|
800
|
+
readonly unpricedOutputs: readonly string[];
|
|
801
|
+
}
|
|
802
|
+
interface ApprovalEntry {
|
|
803
|
+
readonly token: string;
|
|
804
|
+
readonly spender: string;
|
|
805
|
+
readonly amount: string;
|
|
806
|
+
readonly transactionRequest: {
|
|
807
|
+
readonly to: string;
|
|
808
|
+
readonly data: string;
|
|
809
|
+
readonly value: "0";
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
interface SimulationRevert {
|
|
813
|
+
readonly code: number;
|
|
814
|
+
readonly rawErrorBytes: string;
|
|
815
|
+
readonly decodeResult?: {
|
|
816
|
+
readonly errorCandidates?: readonly {
|
|
817
|
+
readonly decodedErrorSignature: string;
|
|
818
|
+
readonly decodedParams: readonly string[];
|
|
819
|
+
}[];
|
|
820
|
+
readonly error?: string;
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
interface ComposeTransactionRequest {
|
|
824
|
+
readonly to: string;
|
|
825
|
+
readonly data: string;
|
|
826
|
+
readonly value: string;
|
|
827
|
+
readonly gasLimit?: string;
|
|
828
|
+
}
|
|
829
|
+
interface ComposeContinuation {
|
|
830
|
+
readonly awaits: string;
|
|
831
|
+
readonly flowId: string;
|
|
832
|
+
}
|
|
833
|
+
interface ComposeCompileSuccessData {
|
|
834
|
+
readonly producedResources: Record<string, ProducedResource>;
|
|
835
|
+
readonly transactionRequest: ComposeTransactionRequest;
|
|
836
|
+
readonly userProxy: string;
|
|
837
|
+
readonly priceImpact?: PriceImpact;
|
|
838
|
+
readonly approvals?: readonly ApprovalEntry[];
|
|
839
|
+
readonly continuation?: ComposeContinuation;
|
|
840
|
+
}
|
|
841
|
+
interface ComposeCompilePartialData {
|
|
842
|
+
readonly producedResources: Record<string, ProducedResource>;
|
|
843
|
+
readonly transactionRequest: ComposeTransactionRequest;
|
|
844
|
+
readonly userProxy: string;
|
|
845
|
+
readonly simulationRevert: SimulationRevert;
|
|
846
|
+
readonly approvals?: readonly ApprovalEntry[];
|
|
847
|
+
readonly continuation?: ComposeContinuation;
|
|
848
|
+
}
|
|
849
|
+
type ComposeCompileResult = (ComposeCompileSuccessData & {
|
|
850
|
+
readonly status: "success";
|
|
851
|
+
}) | (ComposeCompilePartialData & {
|
|
852
|
+
readonly status: "partial";
|
|
853
|
+
readonly error: {
|
|
854
|
+
readonly kind: string;
|
|
855
|
+
readonly message: string;
|
|
856
|
+
};
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
type MaterialiserMetadata = {
|
|
860
|
+
readonly kind: 'exact';
|
|
861
|
+
readonly amount: bigint;
|
|
862
|
+
} | {
|
|
863
|
+
readonly kind: 'exact-native';
|
|
864
|
+
readonly amount: bigint;
|
|
865
|
+
} | {
|
|
866
|
+
readonly kind: 'runtime';
|
|
867
|
+
};
|
|
868
|
+
interface MaterialiserResolution {
|
|
869
|
+
readonly meta: MaterialiserMetadata;
|
|
870
|
+
readonly preconditions: readonly Precondition[];
|
|
871
|
+
}
|
|
872
|
+
declare const foldMaterialiserMetadata: <R>(meta: MaterialiserMetadata, cases: {
|
|
873
|
+
readonly exact: (amount: bigint) => R;
|
|
874
|
+
readonly exactNative: (amount: bigint) => R;
|
|
875
|
+
readonly runtime: () => R;
|
|
876
|
+
}) => R;
|
|
877
|
+
|
|
878
|
+
export { type AppliedGuard, AppliedGuardSchema, type ApprovalEntry, type Availability, type BindValue, BindValueSchema, type Call, CallSchema, type ComposeCompilePartialData, type ComposeCompileRequest, type ComposeCompileResult, type ComposeCompileSuccessData, type ComposeContinuation, type ComposeError, type ComposeErrorKind, type ComposeManifest, ComposeManifestZod, type ComposeRun, type ComposeTransactionRequest, type ContextKey, type Continuation, ContinuationSchema, type Flow, type FlowInput, FlowInputSchema, FlowSchema, type GuardCompatibility, GuardCompatibilityZod, type GuardSelector, GuardSelectorZod, type HandleInput, HandleInputSchema, type HandlePort, HandlePortZod, InputPortZod, type InputSpec, type LiteralBinding, LiteralBindingSchema, type ManifestGuard, ManifestGuardZod, type ManifestMaterialiser, ManifestMaterialiserZod, type ManifestOperation, ManifestOperationZod, type ManifestPrecondition, ManifestPreconditionZod, type MaterialiserConfigOf, type MaterialiserInput, type MaterialiserInputBase, type MaterialiserInputOf, type MaterialiserMetadata, type MaterialiserResolution, type OpInputPort, type OpOutputPort, type OutputAmount, OutputPortZod, type ParsedRef, type Port, type Precondition, type PreconditionBase, type PreconditionConfigOf, type PreconditionOf, type PriceImpact, type ProducedResource, RESERVED_REF_SCOPES, type Ref, RefSchema, type RefScope, type Resource, type ResourceInput, ResourceInputSchema, type ResourceOutputPort, ResourceOutputPortZod, type ResourcePort, ResourcePortZod, ResourceSchema, type SimulatedAmounts, type SimulationPolicy, type SimulationRevert, type SolType, SolTypeSchema, type SweepTo, copy, erc20, erc20Token, flowInputMode, flowInputResource, flowInputType, foldMaterialiserMetadata, foldRef, foldResource, handle, isContextKey, isHandlePort, isMaterialiserInput, isResourceInput, isResourceOutputPort, isResourcePort, linear, native, opHandle, parseRef, readResource, refKey, resource, resourceKey, resourceOutput };
|