@lifi/compose-spec 0.9.0 → 0.11.3
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 +1 -1
- package/dist/index.cjs +56 -25
- package/dist/index.d.cts +328 -115
- package/dist/index.d.ts +328 -115
- package/dist/index.js +52 -26
- package/package.json +2 -2
- package/src/chainCapabilities.ts +6 -6
- package/src/compile.ts +45 -10
- package/src/continuation.ts +74 -29
- package/src/flow.ts +40 -2
- package/src/flowSchema.ts +34 -0
- package/src/index.ts +23 -2
- package/src/manifest.ts +1 -0
- package/src/materialiserMetadata.ts +5 -4
- package/src/output.ts +20 -13
- package/src/resource.ts +43 -30
- package/src/route.ts +3 -2
- package/src/zodSchemas.ts +17 -0
package/dist/index.d.cts
CHANGED
|
@@ -120,7 +120,7 @@ export declare const AppliedGuardSchema: Schema.TypeLiteral<{
|
|
|
120
120
|
readonly value: typeof Schema.Unknown;
|
|
121
121
|
}]>;
|
|
122
122
|
export declare const CallSchema: Schema.Struct<{
|
|
123
|
-
id: Schema.filter<typeof Schema.String
|
|
123
|
+
id: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
124
124
|
op: typeof Schema.String;
|
|
125
125
|
bind: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
126
126
|
$ref: Schema.filter<typeof Schema.String>;
|
|
@@ -145,6 +145,68 @@ export declare const LineageSchema: Schema.Struct<{
|
|
|
145
145
|
journeyId: Schema.filter<typeof Schema.String>;
|
|
146
146
|
parentRequestId: Schema.filter<typeof Schema.String>;
|
|
147
147
|
}>;
|
|
148
|
+
export declare const ForwardToSchema: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
149
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
150
|
+
}>]>;
|
|
151
|
+
export declare const EpilogueForwardSchema: Schema.Struct<{
|
|
152
|
+
resource: Schema.transform<Schema.Union<[Schema.Struct<{
|
|
153
|
+
kind: Schema.Literal<["native"]>;
|
|
154
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
155
|
+
}>, Schema.Struct<{
|
|
156
|
+
kind: Schema.Literal<["erc20"]>;
|
|
157
|
+
token: Schema.refine<string, typeof Schema.String>;
|
|
158
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
159
|
+
}>]>, Schema.SchemaClass<{
|
|
160
|
+
readonly kind: "native";
|
|
161
|
+
readonly chainId: number;
|
|
162
|
+
} | {
|
|
163
|
+
readonly kind: "erc20";
|
|
164
|
+
readonly chainId: number;
|
|
165
|
+
readonly token: string;
|
|
166
|
+
}, {
|
|
167
|
+
readonly kind: "native";
|
|
168
|
+
readonly chainId: number;
|
|
169
|
+
} | {
|
|
170
|
+
readonly kind: "erc20";
|
|
171
|
+
readonly chainId: number;
|
|
172
|
+
readonly token: string;
|
|
173
|
+
}, never>>;
|
|
174
|
+
to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
175
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
176
|
+
}>]>;
|
|
177
|
+
}>;
|
|
178
|
+
export declare const EpilogueSchema: Schema.filter<Schema.Struct<{
|
|
179
|
+
forwards: Schema.optional<Schema.NonEmptyArray<Schema.Struct<{
|
|
180
|
+
resource: Schema.transform<Schema.Union<[Schema.Struct<{
|
|
181
|
+
kind: Schema.Literal<["native"]>;
|
|
182
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
183
|
+
}>, Schema.Struct<{
|
|
184
|
+
kind: Schema.Literal<["erc20"]>;
|
|
185
|
+
token: Schema.refine<string, typeof Schema.String>;
|
|
186
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
187
|
+
}>]>, Schema.SchemaClass<{
|
|
188
|
+
readonly kind: "native";
|
|
189
|
+
readonly chainId: number;
|
|
190
|
+
} | {
|
|
191
|
+
readonly kind: "erc20";
|
|
192
|
+
readonly chainId: number;
|
|
193
|
+
readonly token: string;
|
|
194
|
+
}, {
|
|
195
|
+
readonly kind: "native";
|
|
196
|
+
readonly chainId: number;
|
|
197
|
+
} | {
|
|
198
|
+
readonly kind: "erc20";
|
|
199
|
+
readonly chainId: number;
|
|
200
|
+
readonly token: string;
|
|
201
|
+
}, never>>;
|
|
202
|
+
to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
203
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
204
|
+
}>]>;
|
|
205
|
+
}>>>;
|
|
206
|
+
remainder: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
207
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
208
|
+
}>]>>;
|
|
209
|
+
}>>;
|
|
148
210
|
export declare const FlowSchema: Schema.Struct<{
|
|
149
211
|
version: Schema.Literal<[1]>;
|
|
150
212
|
id: typeof Schema.String;
|
|
@@ -178,7 +240,7 @@ export declare const FlowSchema: Schema.Struct<{
|
|
|
178
240
|
type: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
179
241
|
}>]>>;
|
|
180
242
|
nodes: Schema.Array$<Schema.Struct<{
|
|
181
|
-
id: Schema.filter<typeof Schema.String
|
|
243
|
+
id: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
182
244
|
op: typeof Schema.String;
|
|
183
245
|
bind: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
184
246
|
$ref: Schema.filter<typeof Schema.String>;
|
|
@@ -202,6 +264,38 @@ export declare const FlowSchema: Schema.Struct<{
|
|
|
202
264
|
journeyId: Schema.filter<typeof Schema.String>;
|
|
203
265
|
parentRequestId: Schema.filter<typeof Schema.String>;
|
|
204
266
|
}>>;
|
|
267
|
+
epilogue: Schema.optional<Schema.filter<Schema.Struct<{
|
|
268
|
+
forwards: Schema.optional<Schema.NonEmptyArray<Schema.Struct<{
|
|
269
|
+
resource: Schema.transform<Schema.Union<[Schema.Struct<{
|
|
270
|
+
kind: Schema.Literal<["native"]>;
|
|
271
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
272
|
+
}>, Schema.Struct<{
|
|
273
|
+
kind: Schema.Literal<["erc20"]>;
|
|
274
|
+
token: Schema.refine<string, typeof Schema.String>;
|
|
275
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
276
|
+
}>]>, Schema.SchemaClass<{
|
|
277
|
+
readonly kind: "native";
|
|
278
|
+
readonly chainId: number;
|
|
279
|
+
} | {
|
|
280
|
+
readonly kind: "erc20";
|
|
281
|
+
readonly chainId: number;
|
|
282
|
+
readonly token: string;
|
|
283
|
+
}, {
|
|
284
|
+
readonly kind: "native";
|
|
285
|
+
readonly chainId: number;
|
|
286
|
+
} | {
|
|
287
|
+
readonly kind: "erc20";
|
|
288
|
+
readonly chainId: number;
|
|
289
|
+
readonly token: string;
|
|
290
|
+
}, never>>;
|
|
291
|
+
to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
292
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
293
|
+
}>]>;
|
|
294
|
+
}>>>;
|
|
295
|
+
remainder: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
296
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
297
|
+
}>]>>;
|
|
298
|
+
}>>>;
|
|
205
299
|
}>;
|
|
206
300
|
type SolType = typeof SolTypeSchema.Type;
|
|
207
301
|
type ResourceInput = typeof ResourceInputSchema.Type;
|
|
@@ -213,16 +307,45 @@ type BindValue = typeof BindValueSchema.Type;
|
|
|
213
307
|
type AppliedGuard = typeof AppliedGuardSchema.Type;
|
|
214
308
|
type Call = typeof CallSchema.Type;
|
|
215
309
|
type Lineage = typeof LineageSchema.Type;
|
|
310
|
+
type ForwardTo = typeof ForwardToSchema.Type;
|
|
311
|
+
type EpilogueForward = typeof EpilogueForwardSchema.Type;
|
|
312
|
+
type Epilogue = typeof EpilogueSchema.Type;
|
|
216
313
|
type Flow = typeof FlowSchema.Type;
|
|
217
314
|
//#endregion
|
|
218
315
|
//#region src/continuation.d.ts
|
|
219
316
|
export declare const CONTINUATION_COMMITMENT_OP_ID = "continuation.commitment";
|
|
220
|
-
export declare const ContinuationOutcomeSchema: Schema.transform<Schema.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
317
|
+
export declare const ContinuationOutcomeSchema: Schema.transform<Schema.Schema<{
|
|
318
|
+
readonly chainId: number;
|
|
319
|
+
readonly token: string;
|
|
320
|
+
readonly minAmount?: string | undefined;
|
|
321
|
+
readonly destination: string;
|
|
322
|
+
}, {
|
|
323
|
+
readonly chainId: number;
|
|
324
|
+
readonly token: string;
|
|
325
|
+
readonly destination: string;
|
|
326
|
+
readonly minAmount?: string | undefined;
|
|
327
|
+
}, never>, Schema.SchemaClass<{
|
|
328
|
+
readonly chainId: number;
|
|
329
|
+
readonly token: string;
|
|
330
|
+
readonly minAmount?: string | undefined;
|
|
331
|
+
readonly destination: string;
|
|
332
|
+
}, {
|
|
333
|
+
readonly chainId: number;
|
|
334
|
+
readonly token: string;
|
|
335
|
+
readonly minAmount?: string | undefined;
|
|
336
|
+
readonly destination: string;
|
|
337
|
+
}, never>>;
|
|
338
|
+
export declare const CommittedOutcomeSchema: Schema.transform<Schema.Schema<{
|
|
339
|
+
readonly chainId: number;
|
|
340
|
+
readonly token: string;
|
|
341
|
+
readonly minAmount: string;
|
|
342
|
+
readonly destination: string;
|
|
343
|
+
}, {
|
|
344
|
+
readonly chainId: number;
|
|
345
|
+
readonly token: string;
|
|
346
|
+
readonly minAmount: string;
|
|
347
|
+
readonly destination: string;
|
|
348
|
+
}, never>, Schema.SchemaClass<{
|
|
226
349
|
readonly chainId: number;
|
|
227
350
|
readonly token: string;
|
|
228
351
|
readonly minAmount: string;
|
|
@@ -234,20 +357,25 @@ export declare const ContinuationOutcomeSchema: Schema.transform<Schema.Struct<{
|
|
|
234
357
|
readonly destination: string;
|
|
235
358
|
}, never>>;
|
|
236
359
|
export declare const ContinuationIntentSchema: Schema.Struct<{
|
|
237
|
-
outcomes: Schema.NonEmptyArray<Schema.transform<Schema.
|
|
238
|
-
token: Schema.refine<string, typeof Schema.String>;
|
|
239
|
-
minAmount: Schema.filter<typeof Schema.String>;
|
|
240
|
-
destination: Schema.refine<string, typeof Schema.String>;
|
|
241
|
-
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
242
|
-
}>, Schema.SchemaClass<{
|
|
360
|
+
outcomes: Schema.NonEmptyArray<Schema.transform<Schema.Schema<{
|
|
243
361
|
readonly chainId: number;
|
|
244
362
|
readonly token: string;
|
|
245
|
-
readonly minAmount
|
|
363
|
+
readonly minAmount?: string | undefined;
|
|
246
364
|
readonly destination: string;
|
|
247
365
|
}, {
|
|
248
366
|
readonly chainId: number;
|
|
249
367
|
readonly token: string;
|
|
250
|
-
readonly
|
|
368
|
+
readonly destination: string;
|
|
369
|
+
readonly minAmount?: string | undefined;
|
|
370
|
+
}, never>, Schema.SchemaClass<{
|
|
371
|
+
readonly chainId: number;
|
|
372
|
+
readonly token: string;
|
|
373
|
+
readonly minAmount?: string | undefined;
|
|
374
|
+
readonly destination: string;
|
|
375
|
+
}, {
|
|
376
|
+
readonly chainId: number;
|
|
377
|
+
readonly token: string;
|
|
378
|
+
readonly minAmount?: string | undefined;
|
|
251
379
|
readonly destination: string;
|
|
252
380
|
}, never>>>;
|
|
253
381
|
continuationFlow: Schema.optional<Schema.Struct<{
|
|
@@ -283,7 +411,7 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
|
|
|
283
411
|
type: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
|
|
284
412
|
}>]>>;
|
|
285
413
|
nodes: Schema.Array$<Schema.Struct<{
|
|
286
|
-
id: Schema.filter<typeof Schema.String
|
|
414
|
+
id: Schema.filter<Schema.filter<typeof Schema.String>>;
|
|
287
415
|
op: typeof Schema.String;
|
|
288
416
|
bind: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
|
|
289
417
|
$ref: Schema.filter<typeof Schema.String>;
|
|
@@ -307,6 +435,38 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
|
|
|
307
435
|
journeyId: Schema.filter<typeof Schema.String>;
|
|
308
436
|
parentRequestId: Schema.filter<typeof Schema.String>;
|
|
309
437
|
}>>;
|
|
438
|
+
epilogue: Schema.optional<Schema.filter<Schema.Struct<{
|
|
439
|
+
forwards: Schema.optional<Schema.NonEmptyArray<Schema.Struct<{
|
|
440
|
+
resource: Schema.transform<Schema.Union<[Schema.Struct<{
|
|
441
|
+
kind: Schema.Literal<["native"]>;
|
|
442
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
443
|
+
}>, Schema.Struct<{
|
|
444
|
+
kind: Schema.Literal<["erc20"]>;
|
|
445
|
+
token: Schema.refine<string, typeof Schema.String>;
|
|
446
|
+
chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
447
|
+
}>]>, Schema.SchemaClass<{
|
|
448
|
+
readonly kind: "native";
|
|
449
|
+
readonly chainId: number;
|
|
450
|
+
} | {
|
|
451
|
+
readonly kind: "erc20";
|
|
452
|
+
readonly chainId: number;
|
|
453
|
+
readonly token: string;
|
|
454
|
+
}, {
|
|
455
|
+
readonly kind: "native";
|
|
456
|
+
readonly chainId: number;
|
|
457
|
+
} | {
|
|
458
|
+
readonly kind: "erc20";
|
|
459
|
+
readonly chainId: number;
|
|
460
|
+
readonly token: string;
|
|
461
|
+
}, never>>;
|
|
462
|
+
to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
463
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
464
|
+
}>]>;
|
|
465
|
+
}>>>;
|
|
466
|
+
remainder: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
|
|
467
|
+
$ref: Schema.filter<typeof Schema.String>;
|
|
468
|
+
}>]>>;
|
|
469
|
+
}>>>;
|
|
310
470
|
}>>;
|
|
311
471
|
validity: Schema.Struct<{
|
|
312
472
|
expiresAtMs: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
@@ -314,11 +474,12 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
|
|
|
314
474
|
perpetual: Schema.optional<typeof Schema.Boolean>;
|
|
315
475
|
provider: Schema.optional<typeof Schema.String>;
|
|
316
476
|
funding: Schema.optional<Schema.Literal<["inline", "external"]>>;
|
|
477
|
+
refund: Schema.optional<Schema.filter<Schema.refine<string, typeof Schema.String>>>;
|
|
317
478
|
}>;
|
|
318
479
|
export declare const HexStringSchema: Schema.filter<typeof Schema.String>;
|
|
319
480
|
export declare const Phase1ArtifactSchema: Schema.Union<[Schema.Struct<{
|
|
320
481
|
kind: Schema.Literal<["transaction"]>;
|
|
321
|
-
funding: Schema.Literal<["inline", "external"]>;
|
|
482
|
+
funding: Schema.Literal<["inline", "external", "delivered"]>;
|
|
322
483
|
transactionRequest: Schema.optional<Schema.Struct<{
|
|
323
484
|
to: typeof Schema.String;
|
|
324
485
|
data: typeof Schema.String;
|
|
@@ -331,6 +492,7 @@ export declare const Phase1ArtifactSchema: Schema.Union<[Schema.Struct<{
|
|
|
331
492
|
token: Schema.filter<typeof Schema.String>;
|
|
332
493
|
amount: typeof Schema.String;
|
|
333
494
|
cap: typeof Schema.String;
|
|
495
|
+
floor: typeof Schema.String;
|
|
334
496
|
owner: Schema.filter<typeof Schema.String>;
|
|
335
497
|
refund: Schema.filter<typeof Schema.String>;
|
|
336
498
|
expiresAtMs: Schema.filter<Schema.filter<typeof Schema.Number>>;
|
|
@@ -408,10 +570,13 @@ export declare const AssertionSpecSchema: Schema.Union<[Schema.Struct<{
|
|
|
408
570
|
minDelta: Schema.filter<typeof Schema.String>;
|
|
409
571
|
}>]>;
|
|
410
572
|
type ContinuationOutcome = typeof ContinuationOutcomeSchema.Type;
|
|
573
|
+
type CommittedOutcome = typeof CommittedOutcomeSchema.Type;
|
|
411
574
|
type ContinuationIntent = typeof ContinuationIntentSchema.Type;
|
|
412
575
|
type Phase1Artifact = typeof Phase1ArtifactSchema.Type;
|
|
413
576
|
type AssertionSpec = typeof AssertionSpecSchema.Type;
|
|
414
|
-
export declare const settledOutcome:
|
|
577
|
+
export declare const settledOutcome: <I extends {
|
|
578
|
+
readonly outcomes: readonly [unknown, ...unknown[]];
|
|
579
|
+
}>(intent: I) => I["outcomes"][0];
|
|
415
580
|
//#endregion
|
|
416
581
|
//#region src/descriptor.d.ts
|
|
417
582
|
export declare const Bytes32HexSchema: Schema.filter<typeof Schema.String>;
|
|
@@ -479,13 +644,13 @@ export declare const AssertedPredicateSchema: Schema.transformOrFail<Schema.Unio
|
|
|
479
644
|
readonly kind: "erc20BalanceGte";
|
|
480
645
|
readonly chainId: number;
|
|
481
646
|
readonly token: string;
|
|
482
|
-
readonly owner: string;
|
|
483
647
|
readonly minAmount: string;
|
|
648
|
+
readonly owner: string;
|
|
484
649
|
} | {
|
|
485
650
|
readonly kind: "nativeBalanceGte";
|
|
486
651
|
readonly chainId: number;
|
|
487
|
-
readonly owner: string;
|
|
488
652
|
readonly minAmount: string;
|
|
653
|
+
readonly owner: string;
|
|
489
654
|
}, {
|
|
490
655
|
readonly value: string;
|
|
491
656
|
readonly kind: "call";
|
|
@@ -508,13 +673,13 @@ export declare const AssertedPredicateSchema: Schema.transformOrFail<Schema.Unio
|
|
|
508
673
|
readonly kind: "erc20BalanceGte";
|
|
509
674
|
readonly chainId: number;
|
|
510
675
|
readonly token: string;
|
|
511
|
-
readonly owner: string;
|
|
512
676
|
readonly minAmount: string;
|
|
677
|
+
readonly owner: string;
|
|
513
678
|
} | {
|
|
514
679
|
readonly kind: "nativeBalanceGte";
|
|
515
680
|
readonly chainId: number;
|
|
516
|
-
readonly owner: string;
|
|
517
681
|
readonly minAmount: string;
|
|
682
|
+
readonly owner: string;
|
|
518
683
|
}, never>, never>;
|
|
519
684
|
export declare const VerificationDescriptorSchema: Schema.Struct<{
|
|
520
685
|
validationProgramHash: Schema.filter<typeof Schema.String>;
|
|
@@ -570,13 +735,13 @@ export declare const VerificationDescriptorSchema: Schema.Struct<{
|
|
|
570
735
|
readonly kind: "erc20BalanceGte";
|
|
571
736
|
readonly chainId: number;
|
|
572
737
|
readonly token: string;
|
|
573
|
-
readonly owner: string;
|
|
574
738
|
readonly minAmount: string;
|
|
739
|
+
readonly owner: string;
|
|
575
740
|
} | {
|
|
576
741
|
readonly kind: "nativeBalanceGte";
|
|
577
742
|
readonly chainId: number;
|
|
578
|
-
readonly owner: string;
|
|
579
743
|
readonly minAmount: string;
|
|
744
|
+
readonly owner: string;
|
|
580
745
|
}, {
|
|
581
746
|
readonly value: string;
|
|
582
747
|
readonly kind: "call";
|
|
@@ -599,13 +764,13 @@ export declare const VerificationDescriptorSchema: Schema.Struct<{
|
|
|
599
764
|
readonly kind: "erc20BalanceGte";
|
|
600
765
|
readonly chainId: number;
|
|
601
766
|
readonly token: string;
|
|
602
|
-
readonly owner: string;
|
|
603
767
|
readonly minAmount: string;
|
|
768
|
+
readonly owner: string;
|
|
604
769
|
} | {
|
|
605
770
|
readonly kind: "nativeBalanceGte";
|
|
606
771
|
readonly chainId: number;
|
|
607
|
-
readonly owner: string;
|
|
608
772
|
readonly minAmount: string;
|
|
773
|
+
readonly owner: string;
|
|
609
774
|
}, never>, never>>;
|
|
610
775
|
}>;
|
|
611
776
|
export declare const canonicalAssertedPredicate: (specs: readonly AssertionSpec[]) => string;
|
|
@@ -618,26 +783,24 @@ interface OutputAmount {
|
|
|
618
783
|
readonly expected: bigint;
|
|
619
784
|
readonly min?: bigint;
|
|
620
785
|
}
|
|
621
|
-
|
|
786
|
+
interface NativeResource {
|
|
622
787
|
readonly kind: 'native';
|
|
623
788
|
readonly chainId: number;
|
|
624
|
-
}
|
|
789
|
+
}
|
|
790
|
+
interface ERC20Resource {
|
|
625
791
|
readonly kind: 'erc20';
|
|
626
792
|
readonly token: string;
|
|
627
793
|
readonly chainId: number;
|
|
628
|
-
}
|
|
794
|
+
}
|
|
795
|
+
type Resource = NativeResource | ERC20Resource;
|
|
629
796
|
export declare const erc20Resource: (token: string, chainId: number) => Resource;
|
|
630
797
|
export declare const nativeResource: (chainId: number) => Resource;
|
|
631
|
-
export declare const isERC20Resource: (r: Resource) => r is
|
|
632
|
-
|
|
633
|
-
}>;
|
|
634
|
-
export declare const isNativeResource: (r: Resource) => r is Extract<Resource, {
|
|
635
|
-
kind: "native";
|
|
636
|
-
}>;
|
|
798
|
+
export declare const isERC20Resource: (r: Resource) => r is ERC20Resource;
|
|
799
|
+
export declare const isNativeResource: (r: Resource) => r is NativeResource;
|
|
637
800
|
export declare const resourcesEqual: (a: Resource, b: Resource) => boolean;
|
|
638
801
|
export declare const foldResource: <R>(r: Resource, cases: {
|
|
639
|
-
readonly native: (
|
|
640
|
-
readonly erc20: (
|
|
802
|
+
readonly native: (r: NativeResource) => R;
|
|
803
|
+
readonly erc20: (r: ERC20Resource) => R;
|
|
641
804
|
}) => R;
|
|
642
805
|
export declare const resourceToken: (r: Resource) => string;
|
|
643
806
|
export declare const resourceKey: (r: Resource) => string;
|
|
@@ -645,7 +808,7 @@ export declare const erc20Token: (r: Resource) => string;
|
|
|
645
808
|
//#endregion
|
|
646
809
|
//#region src/output.d.ts
|
|
647
810
|
type EstimateBasis = 'simulated' | 'quoted';
|
|
648
|
-
type MinimumBasis = 'guard' | 'op' | 'declared';
|
|
811
|
+
type MinimumBasis = 'guard' | 'op' | 'input' | 'declared';
|
|
649
812
|
interface Estimate {
|
|
650
813
|
readonly basis: EstimateBasis;
|
|
651
814
|
readonly value: bigint;
|
|
@@ -664,6 +827,7 @@ type Delivery = {
|
|
|
664
827
|
readonly when: 'future';
|
|
665
828
|
readonly etaSeconds?: number;
|
|
666
829
|
readonly provider?: string;
|
|
830
|
+
readonly trackingId?: string;
|
|
667
831
|
};
|
|
668
832
|
interface OutputBase {
|
|
669
833
|
readonly resource: Resource;
|
|
@@ -686,8 +850,8 @@ export declare const ResourcePortZod: z.ZodObject<{
|
|
|
686
850
|
kind: z.ZodLiteral<"resource">;
|
|
687
851
|
name: z.ZodString;
|
|
688
852
|
accepts: z.ZodEnum<{
|
|
689
|
-
erc20: "erc20";
|
|
690
853
|
native: "native";
|
|
854
|
+
erc20: "erc20";
|
|
691
855
|
any: "any";
|
|
692
856
|
}>;
|
|
693
857
|
mode: z.ZodEnum<{
|
|
@@ -706,12 +870,12 @@ export declare const HandleUnitsZod: z.ZodEnum<{
|
|
|
706
870
|
"token-decimals": "token-decimals";
|
|
707
871
|
}>;
|
|
708
872
|
export declare const StaticSolTypeZod: z.ZodEnum<{
|
|
873
|
+
uint8: "uint8";
|
|
874
|
+
uint16: "uint16";
|
|
709
875
|
uint32: "uint32";
|
|
710
|
-
uint256: "uint256";
|
|
711
|
-
uint128: "uint128";
|
|
712
876
|
uint64: "uint64";
|
|
713
|
-
|
|
714
|
-
|
|
877
|
+
uint128: "uint128";
|
|
878
|
+
uint256: "uint256";
|
|
715
879
|
address: "address";
|
|
716
880
|
bool: "bool";
|
|
717
881
|
bytes32: "bytes32";
|
|
@@ -722,19 +886,19 @@ export declare const HandlePortZod: z.ZodObject<{
|
|
|
722
886
|
name: z.ZodString;
|
|
723
887
|
type: z.ZodEnum<{
|
|
724
888
|
string: "string";
|
|
889
|
+
uint8: "uint8";
|
|
890
|
+
uint16: "uint16";
|
|
725
891
|
uint32: "uint32";
|
|
726
|
-
uint256: "uint256";
|
|
727
|
-
uint128: "uint128";
|
|
728
892
|
uint64: "uint64";
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
address: "address";
|
|
732
|
-
bool: "bool";
|
|
733
|
-
bytes32: "bytes32";
|
|
893
|
+
uint128: "uint128";
|
|
894
|
+
uint256: "uint256";
|
|
734
895
|
int128: "int128";
|
|
735
896
|
int256: "int256";
|
|
897
|
+
address: "address";
|
|
898
|
+
bool: "bool";
|
|
736
899
|
bytes: "bytes";
|
|
737
900
|
bytes4: "bytes4";
|
|
901
|
+
bytes32: "bytes32";
|
|
738
902
|
}>;
|
|
739
903
|
mode: z.ZodEnum<{
|
|
740
904
|
linear: "linear";
|
|
@@ -754,8 +918,8 @@ export declare const InputPortZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
754
918
|
kind: z.ZodLiteral<"resource">;
|
|
755
919
|
name: z.ZodString;
|
|
756
920
|
accepts: z.ZodEnum<{
|
|
757
|
-
erc20: "erc20";
|
|
758
921
|
native: "native";
|
|
922
|
+
erc20: "erc20";
|
|
759
923
|
any: "any";
|
|
760
924
|
}>;
|
|
761
925
|
mode: z.ZodEnum<{
|
|
@@ -768,19 +932,19 @@ export declare const InputPortZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
768
932
|
name: z.ZodString;
|
|
769
933
|
type: z.ZodEnum<{
|
|
770
934
|
string: "string";
|
|
935
|
+
uint8: "uint8";
|
|
936
|
+
uint16: "uint16";
|
|
771
937
|
uint32: "uint32";
|
|
772
|
-
uint256: "uint256";
|
|
773
|
-
uint128: "uint128";
|
|
774
938
|
uint64: "uint64";
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
address: "address";
|
|
778
|
-
bool: "bool";
|
|
779
|
-
bytes32: "bytes32";
|
|
939
|
+
uint128: "uint128";
|
|
940
|
+
uint256: "uint256";
|
|
780
941
|
int128: "int128";
|
|
781
942
|
int256: "int256";
|
|
943
|
+
address: "address";
|
|
944
|
+
bool: "bool";
|
|
782
945
|
bytes: "bytes";
|
|
783
946
|
bytes4: "bytes4";
|
|
947
|
+
bytes32: "bytes32";
|
|
784
948
|
}>;
|
|
785
949
|
mode: z.ZodEnum<{
|
|
786
950
|
linear: "linear";
|
|
@@ -832,19 +996,19 @@ export declare const OutputPortZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
832
996
|
name: z.ZodString;
|
|
833
997
|
type: z.ZodEnum<{
|
|
834
998
|
string: "string";
|
|
999
|
+
uint8: "uint8";
|
|
1000
|
+
uint16: "uint16";
|
|
835
1001
|
uint32: "uint32";
|
|
836
|
-
uint256: "uint256";
|
|
837
|
-
uint128: "uint128";
|
|
838
1002
|
uint64: "uint64";
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
address: "address";
|
|
842
|
-
bool: "bool";
|
|
843
|
-
bytes32: "bytes32";
|
|
1003
|
+
uint128: "uint128";
|
|
1004
|
+
uint256: "uint256";
|
|
844
1005
|
int128: "int128";
|
|
845
1006
|
int256: "int256";
|
|
1007
|
+
address: "address";
|
|
1008
|
+
bool: "bool";
|
|
846
1009
|
bytes: "bytes";
|
|
847
1010
|
bytes4: "bytes4";
|
|
1011
|
+
bytes32: "bytes32";
|
|
848
1012
|
}>;
|
|
849
1013
|
mode: z.ZodEnum<{
|
|
850
1014
|
linear: "linear";
|
|
@@ -867,8 +1031,8 @@ export declare const ManifestOperationZod: z.ZodObject<{
|
|
|
867
1031
|
kind: z.ZodLiteral<"resource">;
|
|
868
1032
|
name: z.ZodString;
|
|
869
1033
|
accepts: z.ZodEnum<{
|
|
870
|
-
erc20: "erc20";
|
|
871
1034
|
native: "native";
|
|
1035
|
+
erc20: "erc20";
|
|
872
1036
|
any: "any";
|
|
873
1037
|
}>;
|
|
874
1038
|
mode: z.ZodEnum<{
|
|
@@ -881,19 +1045,19 @@ export declare const ManifestOperationZod: z.ZodObject<{
|
|
|
881
1045
|
name: z.ZodString;
|
|
882
1046
|
type: z.ZodEnum<{
|
|
883
1047
|
string: "string";
|
|
1048
|
+
uint8: "uint8";
|
|
1049
|
+
uint16: "uint16";
|
|
884
1050
|
uint32: "uint32";
|
|
885
|
-
uint256: "uint256";
|
|
886
|
-
uint128: "uint128";
|
|
887
1051
|
uint64: "uint64";
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
address: "address";
|
|
891
|
-
bool: "bool";
|
|
892
|
-
bytes32: "bytes32";
|
|
1052
|
+
uint128: "uint128";
|
|
1053
|
+
uint256: "uint256";
|
|
893
1054
|
int128: "int128";
|
|
894
1055
|
int256: "int256";
|
|
1056
|
+
address: "address";
|
|
1057
|
+
bool: "bool";
|
|
895
1058
|
bytes: "bytes";
|
|
896
1059
|
bytes4: "bytes4";
|
|
1060
|
+
bytes32: "bytes32";
|
|
897
1061
|
}>;
|
|
898
1062
|
mode: z.ZodEnum<{
|
|
899
1063
|
linear: "linear";
|
|
@@ -929,19 +1093,19 @@ export declare const ManifestOperationZod: z.ZodObject<{
|
|
|
929
1093
|
name: z.ZodString;
|
|
930
1094
|
type: z.ZodEnum<{
|
|
931
1095
|
string: "string";
|
|
1096
|
+
uint8: "uint8";
|
|
1097
|
+
uint16: "uint16";
|
|
932
1098
|
uint32: "uint32";
|
|
933
|
-
uint256: "uint256";
|
|
934
|
-
uint128: "uint128";
|
|
935
1099
|
uint64: "uint64";
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
address: "address";
|
|
939
|
-
bool: "bool";
|
|
940
|
-
bytes32: "bytes32";
|
|
1100
|
+
uint128: "uint128";
|
|
1101
|
+
uint256: "uint256";
|
|
941
1102
|
int128: "int128";
|
|
942
1103
|
int256: "int256";
|
|
1104
|
+
address: "address";
|
|
1105
|
+
bool: "bool";
|
|
943
1106
|
bytes: "bytes";
|
|
944
1107
|
bytes4: "bytes4";
|
|
1108
|
+
bytes32: "bytes32";
|
|
945
1109
|
}>;
|
|
946
1110
|
mode: z.ZodEnum<{
|
|
947
1111
|
linear: "linear";
|
|
@@ -980,8 +1144,8 @@ export declare const GuardSelectorZod: z.ZodObject<{
|
|
|
980
1144
|
copy: "copy";
|
|
981
1145
|
}>>;
|
|
982
1146
|
type: z.ZodOptional<z.ZodEnum<{
|
|
983
|
-
erc20: "erc20";
|
|
984
1147
|
native: "native";
|
|
1148
|
+
erc20: "erc20";
|
|
985
1149
|
any: "any";
|
|
986
1150
|
}>>;
|
|
987
1151
|
}, z.core.$strip>;
|
|
@@ -1018,8 +1182,8 @@ export declare const GuardCompatibilityZod: z.ZodObject<{
|
|
|
1018
1182
|
copy: "copy";
|
|
1019
1183
|
}>>;
|
|
1020
1184
|
type: z.ZodOptional<z.ZodEnum<{
|
|
1021
|
-
erc20: "erc20";
|
|
1022
1185
|
native: "native";
|
|
1186
|
+
erc20: "erc20";
|
|
1023
1187
|
any: "any";
|
|
1024
1188
|
}>>;
|
|
1025
1189
|
}, z.core.$strip>;
|
|
@@ -1061,8 +1225,8 @@ export declare const ManifestGuardZod: z.ZodObject<{
|
|
|
1061
1225
|
copy: "copy";
|
|
1062
1226
|
}>>;
|
|
1063
1227
|
type: z.ZodOptional<z.ZodEnum<{
|
|
1064
|
-
erc20: "erc20";
|
|
1065
1228
|
native: "native";
|
|
1229
|
+
erc20: "erc20";
|
|
1066
1230
|
any: "any";
|
|
1067
1231
|
}>>;
|
|
1068
1232
|
}, z.core.$strip>;
|
|
@@ -1094,6 +1258,13 @@ export declare const ManifestPreconditionZod: z.ZodObject<{
|
|
|
1094
1258
|
description: z.ZodOptional<z.ZodString>;
|
|
1095
1259
|
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
1096
1260
|
}, z.core.$strip>;
|
|
1261
|
+
export declare const ManifestRoutingZod: z.ZodObject<{
|
|
1262
|
+
maxRouteHops: z.ZodNumber;
|
|
1263
|
+
swapHops: z.ZodEnum<{
|
|
1264
|
+
none: "none";
|
|
1265
|
+
head: "head";
|
|
1266
|
+
}>;
|
|
1267
|
+
}, z.core.$strip>;
|
|
1097
1268
|
export declare const ComposeManifestZod: z.ZodObject<{
|
|
1098
1269
|
manifestVersion: z.ZodNumber;
|
|
1099
1270
|
manifestHash: z.ZodString;
|
|
@@ -1105,8 +1276,8 @@ export declare const ComposeManifestZod: z.ZodObject<{
|
|
|
1105
1276
|
kind: z.ZodLiteral<"resource">;
|
|
1106
1277
|
name: z.ZodString;
|
|
1107
1278
|
accepts: z.ZodEnum<{
|
|
1108
|
-
erc20: "erc20";
|
|
1109
1279
|
native: "native";
|
|
1280
|
+
erc20: "erc20";
|
|
1110
1281
|
any: "any";
|
|
1111
1282
|
}>;
|
|
1112
1283
|
mode: z.ZodEnum<{
|
|
@@ -1119,19 +1290,19 @@ export declare const ComposeManifestZod: z.ZodObject<{
|
|
|
1119
1290
|
name: z.ZodString;
|
|
1120
1291
|
type: z.ZodEnum<{
|
|
1121
1292
|
string: "string";
|
|
1293
|
+
uint8: "uint8";
|
|
1294
|
+
uint16: "uint16";
|
|
1122
1295
|
uint32: "uint32";
|
|
1123
|
-
uint256: "uint256";
|
|
1124
|
-
uint128: "uint128";
|
|
1125
1296
|
uint64: "uint64";
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
address: "address";
|
|
1129
|
-
bool: "bool";
|
|
1130
|
-
bytes32: "bytes32";
|
|
1297
|
+
uint128: "uint128";
|
|
1298
|
+
uint256: "uint256";
|
|
1131
1299
|
int128: "int128";
|
|
1132
1300
|
int256: "int256";
|
|
1301
|
+
address: "address";
|
|
1302
|
+
bool: "bool";
|
|
1133
1303
|
bytes: "bytes";
|
|
1134
1304
|
bytes4: "bytes4";
|
|
1305
|
+
bytes32: "bytes32";
|
|
1135
1306
|
}>;
|
|
1136
1307
|
mode: z.ZodEnum<{
|
|
1137
1308
|
linear: "linear";
|
|
@@ -1167,19 +1338,19 @@ export declare const ComposeManifestZod: z.ZodObject<{
|
|
|
1167
1338
|
name: z.ZodString;
|
|
1168
1339
|
type: z.ZodEnum<{
|
|
1169
1340
|
string: "string";
|
|
1341
|
+
uint8: "uint8";
|
|
1342
|
+
uint16: "uint16";
|
|
1170
1343
|
uint32: "uint32";
|
|
1171
|
-
uint256: "uint256";
|
|
1172
|
-
uint128: "uint128";
|
|
1173
1344
|
uint64: "uint64";
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
address: "address";
|
|
1177
|
-
bool: "bool";
|
|
1178
|
-
bytes32: "bytes32";
|
|
1345
|
+
uint128: "uint128";
|
|
1346
|
+
uint256: "uint256";
|
|
1179
1347
|
int128: "int128";
|
|
1180
1348
|
int256: "int256";
|
|
1349
|
+
address: "address";
|
|
1350
|
+
bool: "bool";
|
|
1181
1351
|
bytes: "bytes";
|
|
1182
1352
|
bytes4: "bytes4";
|
|
1353
|
+
bytes32: "bytes32";
|
|
1183
1354
|
}>;
|
|
1184
1355
|
mode: z.ZodEnum<{
|
|
1185
1356
|
linear: "linear";
|
|
@@ -1223,8 +1394,8 @@ export declare const ComposeManifestZod: z.ZodObject<{
|
|
|
1223
1394
|
copy: "copy";
|
|
1224
1395
|
}>>;
|
|
1225
1396
|
type: z.ZodOptional<z.ZodEnum<{
|
|
1226
|
-
erc20: "erc20";
|
|
1227
1397
|
native: "native";
|
|
1398
|
+
erc20: "erc20";
|
|
1228
1399
|
any: "any";
|
|
1229
1400
|
}>>;
|
|
1230
1401
|
}, z.core.$strip>;
|
|
@@ -1256,6 +1427,13 @@ export declare const ComposeManifestZod: z.ZodObject<{
|
|
|
1256
1427
|
description: z.ZodOptional<z.ZodString>;
|
|
1257
1428
|
configSchema: z.ZodOptional<z.ZodUnknown>;
|
|
1258
1429
|
}, z.core.$strip>>>;
|
|
1430
|
+
routing: z.ZodOptional<z.ZodObject<{
|
|
1431
|
+
maxRouteHops: z.ZodNumber;
|
|
1432
|
+
swapHops: z.ZodEnum<{
|
|
1433
|
+
none: "none";
|
|
1434
|
+
head: "head";
|
|
1435
|
+
}>;
|
|
1436
|
+
}, z.core.$strip>>;
|
|
1259
1437
|
}, z.core.$strip>;
|
|
1260
1438
|
declare const SettlementEscrowZod: z.ZodObject<{
|
|
1261
1439
|
chainId: z.ZodNumber;
|
|
@@ -1263,6 +1441,7 @@ declare const SettlementEscrowZod: z.ZodObject<{
|
|
|
1263
1441
|
token: z.ZodString;
|
|
1264
1442
|
amount: z.ZodString;
|
|
1265
1443
|
cap: z.ZodString;
|
|
1444
|
+
floor: z.ZodString;
|
|
1266
1445
|
owner: z.ZodString;
|
|
1267
1446
|
refund: z.ZodString;
|
|
1268
1447
|
expiresAtMs: z.ZodNumber;
|
|
@@ -1591,6 +1770,7 @@ export declare const SettlementZod: z.ZodObject<{
|
|
|
1591
1770
|
token: z.ZodString;
|
|
1592
1771
|
amount: z.ZodString;
|
|
1593
1772
|
cap: z.ZodString;
|
|
1773
|
+
floor: z.ZodString;
|
|
1594
1774
|
owner: z.ZodString;
|
|
1595
1775
|
refund: z.ZodString;
|
|
1596
1776
|
expiresAtMs: z.ZodNumber;
|
|
@@ -1609,20 +1789,13 @@ type GuardCompatibility = z.infer<typeof GuardCompatibilityZod>;
|
|
|
1609
1789
|
type ManifestGuard = z.infer<typeof ManifestGuardZod>;
|
|
1610
1790
|
type ManifestMaterialiser = z.infer<typeof ManifestMaterialiserZod>;
|
|
1611
1791
|
type ManifestPrecondition = z.infer<typeof ManifestPreconditionZod>;
|
|
1792
|
+
type ManifestRouting = z.infer<typeof ManifestRoutingZod>;
|
|
1612
1793
|
type ComposeManifest = z.infer<typeof ComposeManifestZod>;
|
|
1613
1794
|
type SettlementEscrowWire = z.infer<typeof SettlementEscrowZod>;
|
|
1614
1795
|
type SettlementWire = z.infer<typeof SettlementZod>;
|
|
1615
1796
|
//#endregion
|
|
1616
1797
|
//#region src/compile.d.ts
|
|
1617
1798
|
type SimulationPolicy = 'strict' | 'allow-revert';
|
|
1618
|
-
/**
|
|
1619
|
-
* Destination for sweeping proxy-held terminal resources after execution.
|
|
1620
|
-
* Either a literal EVM address or a `{ $ref }` context reference
|
|
1621
|
-
* (e.g. `{ $ref: "context.sender" }`).
|
|
1622
|
-
*/
|
|
1623
|
-
type SweepTo = string | {
|
|
1624
|
-
readonly $ref: string;
|
|
1625
|
-
};
|
|
1626
1799
|
interface ComposeRun {
|
|
1627
1800
|
readonly inputs: Record<string, InputSpec>;
|
|
1628
1801
|
readonly preconditions?: readonly Precondition[];
|
|
@@ -1631,7 +1804,7 @@ interface ComposeRun {
|
|
|
1631
1804
|
readonly referrer?: string;
|
|
1632
1805
|
readonly integratorFeeBps?: number;
|
|
1633
1806
|
readonly maxPriceImpactBps?: number;
|
|
1634
|
-
readonly sweepTo?:
|
|
1807
|
+
readonly sweepTo?: ForwardTo;
|
|
1635
1808
|
readonly simulationPolicy?: SimulationPolicy;
|
|
1636
1809
|
/**
|
|
1637
1810
|
* Also simulate the final user-facing transaction. Defaults to `false`;
|
|
@@ -1720,12 +1893,29 @@ interface ComposeUserProgramSimulation {
|
|
|
1720
1893
|
readonly status: 'ok';
|
|
1721
1894
|
readonly returnData: string;
|
|
1722
1895
|
}
|
|
1896
|
+
interface ComposeWarning {
|
|
1897
|
+
readonly kind: string;
|
|
1898
|
+
readonly message: string;
|
|
1899
|
+
readonly path?: string;
|
|
1900
|
+
readonly port?: string;
|
|
1901
|
+
readonly fix?: string;
|
|
1902
|
+
}
|
|
1723
1903
|
interface ComposeFill {
|
|
1724
1904
|
readonly spends: readonly SpendEntry[];
|
|
1725
1905
|
readonly validUntilMs?: number;
|
|
1726
1906
|
}
|
|
1907
|
+
interface ExecutedForward {
|
|
1908
|
+
readonly resource: Resource;
|
|
1909
|
+
readonly to: string;
|
|
1910
|
+
readonly amount: bigint;
|
|
1911
|
+
}
|
|
1912
|
+
interface ExecutedEpilogue {
|
|
1913
|
+
readonly forwards: readonly ExecutedForward[];
|
|
1914
|
+
readonly remainder?: string;
|
|
1915
|
+
}
|
|
1727
1916
|
interface ComposeCompileSuccessData extends ComposeContinuationData {
|
|
1728
1917
|
readonly outputs: Outputs;
|
|
1918
|
+
readonly epilogue?: ExecutedEpilogue;
|
|
1729
1919
|
readonly transactionRequest?: ComposeTransactionRequest;
|
|
1730
1920
|
readonly actions?: readonly ComposeAction[];
|
|
1731
1921
|
readonly userProxy: string;
|
|
@@ -1735,6 +1925,7 @@ interface ComposeCompileSuccessData extends ComposeContinuationData {
|
|
|
1735
1925
|
readonly userProgramSimulation?: ComposeUserProgramSimulation;
|
|
1736
1926
|
readonly fill?: ComposeFill;
|
|
1737
1927
|
readonly verificationByNode?: Record<string, VerificationDescriptor>;
|
|
1928
|
+
readonly warnings?: readonly ComposeWarning[];
|
|
1738
1929
|
}
|
|
1739
1930
|
interface ComposeCompilePartialData extends ComposeContinuationData {
|
|
1740
1931
|
readonly outputs: Outputs;
|
|
@@ -1745,6 +1936,7 @@ interface ComposeCompilePartialData extends ComposeContinuationData {
|
|
|
1745
1936
|
readonly actions?: readonly ComposeAction[];
|
|
1746
1937
|
readonly fees?: readonly ComposeFee[];
|
|
1747
1938
|
readonly userProgramSimulation?: ComposeUserProgramSimulation;
|
|
1939
|
+
readonly warnings?: readonly ComposeWarning[];
|
|
1748
1940
|
}
|
|
1749
1941
|
type ComposeCompileResult = (ComposeCompileSuccessData & {
|
|
1750
1942
|
readonly status: 'success';
|
|
@@ -1772,12 +1964,12 @@ export declare const isResourcePort: (port: OpInputPort) => port is ResourcePort
|
|
|
1772
1964
|
export declare const isHandlePort: (port: OpInputPort | OpOutputPort) => port is HandlePort;
|
|
1773
1965
|
export declare const isResourceOutputPort: (port: OpInputPort | OpOutputPort) => port is ResourceOutputPort;
|
|
1774
1966
|
export declare const isFutureResourceOutput: (port: OpInputPort | OpOutputPort) => boolean;
|
|
1775
|
-
type ComposeErrorKind = 'decode_error' | 'validation_error' | 'linearity_error' | 'resolve_error' | 'preparation_error' | 'provider_error' | 'no_route_error' | 'resolution_error' | 'resolution_rejected' | 'lowering_error' | 'empty_program' | 'simulation_error' | 'simulation_setup_error' | 'simulation_insufficient_funds' | 'simulation_gas_limit' | 'simulation_rpc_error' | 'simulation_revert' | 'subgraph_simulation_revert' | 'guard_error' | 'continuation_error' | 'compilation_error' | 'verification_error' | 'price_impact_exceeded' | 'fee_resolution_error' | 'fee_resolution_unavailable' | 'flashloan_unauthorized' | 'deadline_exceeded';
|
|
1967
|
+
type ComposeErrorKind = 'decode_error' | 'validation_error' | 'linearity_error' | 'resolve_error' | 'preparation_error' | 'provider_error' | 'no_route_error' | 'resolution_error' | 'resolution_rejected' | 'lowering_error' | 'empty_program' | 'simulation_error' | 'simulation_setup_error' | 'simulation_insufficient_funds' | 'simulation_gas_limit' | 'simulation_rpc_error' | 'simulation_revert' | 'subgraph_simulation_revert' | 'guard_error' | 'continuation_error' | 'compilation_error' | 'verification_error' | 'price_impact_exceeded' | 'fee_resolution_error' | 'fee_resolution_unavailable' | 'flashloan_unauthorized' | 'delivery_error' | 'deadline_exceeded';
|
|
1776
1968
|
/**
|
|
1777
1969
|
* Errors raised by compose routes outside the compile pipeline.
|
|
1778
1970
|
*/
|
|
1779
1971
|
type ComposeRouteErrorKind = 'chain_validation_error' | 'unsupported_token' | 'zero_output' | 'service_unavailable' | 'verification_unavailable' | 'deployment_check_unavailable' | 'manifest_error' | 'sdk_outdated' | 'server_outdated';
|
|
1780
|
-
type GenericComposeErrorKind = Exclude<ComposeErrorKind, 'preparation_error' | 'simulation_revert'>;
|
|
1972
|
+
type GenericComposeErrorKind = Exclude<ComposeErrorKind, 'preparation_error' | 'simulation_revert' | 'delivery_error'>;
|
|
1781
1973
|
interface FailedPreparedOp {
|
|
1782
1974
|
readonly callId: string;
|
|
1783
1975
|
readonly op: string;
|
|
@@ -1802,11 +1994,31 @@ interface SimulationRevertComposeError extends ComposeErrorBase {
|
|
|
1802
1994
|
readonly kind: 'simulation_revert';
|
|
1803
1995
|
readonly details?: SimulationRevert;
|
|
1804
1996
|
}
|
|
1997
|
+
type DeliveryErrorReason = 'floor_drift' | 'eta_exceeds_expiry' | 'quote_failed';
|
|
1998
|
+
interface DeliveryErrorDetails {
|
|
1999
|
+
readonly reason: DeliveryErrorReason;
|
|
2000
|
+
readonly cause?: ComposeErrorKind;
|
|
2001
|
+
readonly quoted: {
|
|
2002
|
+
readonly min: string;
|
|
2003
|
+
readonly expected: string;
|
|
2004
|
+
readonly etaSeconds?: number;
|
|
2005
|
+
};
|
|
2006
|
+
readonly escrow?: {
|
|
2007
|
+
readonly chainId: number;
|
|
2008
|
+
readonly address: string;
|
|
2009
|
+
readonly floor: string;
|
|
2010
|
+
readonly expiresAtMs: number;
|
|
2011
|
+
};
|
|
2012
|
+
}
|
|
2013
|
+
interface DeliveryComposeError extends ComposeErrorBase {
|
|
2014
|
+
readonly kind: 'delivery_error';
|
|
2015
|
+
readonly details: DeliveryErrorDetails;
|
|
2016
|
+
}
|
|
1805
2017
|
interface GenericComposeError extends ComposeErrorBase {
|
|
1806
2018
|
readonly kind: GenericComposeErrorKind;
|
|
1807
2019
|
readonly [key: string]: unknown;
|
|
1808
2020
|
}
|
|
1809
|
-
type ComposeError = PreparationComposeError | SimulationRevertComposeError | GenericComposeError;
|
|
2021
|
+
type ComposeError = PreparationComposeError | SimulationRevertComposeError | DeliveryComposeError | GenericComposeError;
|
|
1810
2022
|
interface MaterialiserInputBase {
|
|
1811
2023
|
readonly kind: string;
|
|
1812
2024
|
}
|
|
@@ -2248,7 +2460,7 @@ interface ComposeRouteRequest {
|
|
|
2248
2460
|
* Accepts an address or `{ $ref: 'context.sender' }` (which counts as
|
|
2249
2461
|
* explicit); `{ $ref: 'context.executionAddress' }` is rejected.
|
|
2250
2462
|
*/
|
|
2251
|
-
readonly sweepTo?:
|
|
2463
|
+
readonly sweepTo?: ForwardTo;
|
|
2252
2464
|
/**
|
|
2253
2465
|
* `'strict'` (the default) fails the request when simulation detects a
|
|
2254
2466
|
* revert; `'allow-revert'` returns a partial result with revert diagnostics
|
|
@@ -2518,6 +2730,7 @@ type MaterialiserMetadata = {
|
|
|
2518
2730
|
} | {
|
|
2519
2731
|
readonly kind: 'capped';
|
|
2520
2732
|
readonly amount: bigint;
|
|
2733
|
+
readonly min?: bigint;
|
|
2521
2734
|
} | {
|
|
2522
2735
|
readonly kind: 'runtime';
|
|
2523
2736
|
};
|
|
@@ -2528,8 +2741,8 @@ interface MaterialiserResolution {
|
|
|
2528
2741
|
export declare const foldMaterialiserMetadata: <R>(meta: MaterialiserMetadata, cases: {
|
|
2529
2742
|
readonly exact: (amount: bigint) => R;
|
|
2530
2743
|
readonly exactNative: (amount: bigint) => R;
|
|
2531
|
-
readonly capped: (amount: bigint) => R;
|
|
2744
|
+
readonly capped: (amount: bigint, min: bigint | undefined) => R;
|
|
2532
2745
|
readonly runtime: () => R;
|
|
2533
2746
|
}) => R;
|
|
2534
2747
|
//#endregion
|
|
2535
|
-
export type { Amount, AppliedGuard, ApprovalEntry, AssertedPredicate, AssertedPredicateWire, AssertionOwner, AssertionSpec, AssertionSpecWire, Availability, BindValue, Call, ChainCapabilities, ComposeAction, ComposeCompilePartialData, ComposeCompileRequest, ComposeCompileResult, ComposeCompileSuccessData, ComposeError, ComposeErrorKind, ComposeFee, ComposeFill, ComposeManifest, ComposeRouteErrorKind, ComposeRouteRequest, ComposeRun, ComposeTransactionRequest, ComposeUserProgramSimulation, ComposeVersion, ConsumedOutput, ContextKey, ContinuationIntent, ContinuationOutcome, Delivery, Erc20AllowancePrecondition, Erc20AllowanceRequirement, Erc20BalancePrecondition, Erc20BalanceRequirement, Estimate, EstimateBasis, FailedPreparedOp, FlashloanMaterialiserInput, Flow, FlowInput, GenericComposeError, GenericComposeErrorKind, GuardCompatibility, GuardSelector, HandleInput, HandlePort, HandleUnits, InputSpec, Lineage, LiteralBinding, ManifestGuard, ManifestMaterialiser, ManifestOperation, ManifestPrecondition, MaterialiserConfigOf, MaterialiserInput, MaterialiserInputBase, MaterialiserInputOf, MaterialiserMetadata, MaterialiserResolution, Minimum, MinimumBasis, NativeBalancePrecondition, NativeBalanceRequirement, NativeCheckPolicy, NativeErc20, OpInputPort, OpOutputPort, Output, OutputAmount, OutputFamilyPort, Outputs, ParsedRef, Phase1Artifact, Port, Precondition, PreconditionBase, PreconditionConfigOf, PreconditionOf, PreparationComposeError, PriceImpact, ProviderKindName, Ref, RefBuilder, RefPath, RefScope, Resource, ResourceInput, ResourceOutputPort, ResourcePort, RouteAmount, RouteAmountAll, RouteAmountExact, SettlementEscrowWire, SettlementWire, SimulateBalanceEntry, SimulateOkResult, SimulateRequest, SimulateResult, SimulateRevertDecodeResult, SimulateRevertResult, SimulateSetupErrorResult, SimulationPolicy, SimulationRevert, SimulationRevertComposeError, SlotFinderRequirement, SolType, SpendEntry, StaticSolType,
|
|
2748
|
+
export type { Amount, AppliedGuard, ApprovalEntry, AssertedPredicate, AssertedPredicateWire, AssertionOwner, AssertionSpec, AssertionSpecWire, Availability, BindValue, Call, ChainCapabilities, CommittedOutcome, ComposeAction, ComposeCompilePartialData, ComposeCompileRequest, ComposeCompileResult, ComposeCompileSuccessData, ComposeError, ComposeErrorKind, ComposeFee, ComposeFill, ComposeManifest, ComposeRouteErrorKind, ComposeRouteRequest, ComposeRun, ComposeTransactionRequest, ComposeUserProgramSimulation, ComposeVersion, ComposeWarning, ConsumedOutput, ContextKey, ContinuationIntent, ContinuationOutcome, Delivery, DeliveryComposeError, DeliveryErrorDetails, DeliveryErrorReason, ERC20Resource, Epilogue, EpilogueForward, Erc20AllowancePrecondition, Erc20AllowanceRequirement, Erc20BalancePrecondition, Erc20BalanceRequirement, Estimate, EstimateBasis, ExecutedEpilogue, ExecutedForward, FailedPreparedOp, FlashloanMaterialiserInput, Flow, FlowInput, ForwardTo, GenericComposeError, GenericComposeErrorKind, GuardCompatibility, GuardSelector, HandleInput, HandlePort, HandleUnits, InputSpec, Lineage, LiteralBinding, ManifestGuard, ManifestMaterialiser, ManifestOperation, ManifestPrecondition, ManifestRouting, MaterialiserConfigOf, MaterialiserInput, MaterialiserInputBase, MaterialiserInputOf, MaterialiserMetadata, MaterialiserResolution, Minimum, MinimumBasis, NativeBalancePrecondition, NativeBalanceRequirement, NativeCheckPolicy, NativeErc20, NativeResource, OpInputPort, OpOutputPort, Output, OutputAmount, OutputFamilyPort, Outputs, ParsedRef, Phase1Artifact, Port, Precondition, PreconditionBase, PreconditionConfigOf, PreconditionOf, PreparationComposeError, PriceImpact, ProviderKindName, Ref, RefBuilder, RefPath, RefScope, Resource, ResourceInput, ResourceOutputPort, ResourcePort, RouteAmount, RouteAmountAll, RouteAmountExact, SettlementEscrowWire, SettlementWire, SimulateBalanceEntry, SimulateOkResult, SimulateRequest, SimulateResult, SimulateRevertDecodeResult, SimulateRevertResult, SimulateSetupErrorResult, SimulationPolicy, SimulationRevert, SimulationRevertComposeError, SlotFinderRequirement, SolType, SpendEntry, StaticSolType, TerminalOutput, TrackedBalance, VerificationDescriptor, VerificationDescriptorWire, VersionCompatibility };
|