@lifi/compose-spec 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -972,6 +972,10 @@ const SettlementZod = zod.default.object({
972
972
  escrow: SettlementEscrowZod.optional(),
973
973
  binding: SettlementBindingZod.optional()
974
974
  });
975
+ const ShortfallZod = zod.default.object({
976
+ required: zod.default.string(),
977
+ available: zod.default.string()
978
+ });
975
979
  //#endregion
976
980
  exports.ARC_CHAIN_ID = ARC_CHAIN_ID;
977
981
  exports.ARC_NATIVE_ERC20 = ARC_NATIVE_ERC20;
@@ -1030,6 +1034,7 @@ exports.SIMULATE_MAX_REQUIREMENTS = SIMULATE_MAX_REQUIREMENTS;
1030
1034
  exports.SIMULATE_MAX_TRACKED_BALANCES = SIMULATE_MAX_TRACKED_BALANCES;
1031
1035
  exports.STATIC_SOL_TYPES = STATIC_SOL_TYPES;
1032
1036
  exports.SettlementZod = SettlementZod;
1037
+ exports.ShortfallZod = ShortfallZod;
1033
1038
  exports.SolTypeSchema = SolTypeSchema;
1034
1039
  exports.StaticSolTypeZod = StaticSolTypeZod;
1035
1040
  exports.TEMPO_CHAIN_ID = TEMPO_CHAIN_ID;
package/dist/index.d.cts CHANGED
@@ -29,19 +29,19 @@ export declare const ResourceSchema: Schema.transform<Schema.Union<[Schema.Struc
29
29
  token: Schema.refine<string, typeof Schema.String>;
30
30
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
31
31
  }>]>, Schema.SchemaClass<{
32
- readonly kind: "native";
33
32
  readonly chainId: number;
33
+ readonly kind: "native";
34
34
  } | {
35
- readonly kind: "erc20";
36
- readonly chainId: number;
37
35
  readonly token: string;
38
- }, {
39
- readonly kind: "native";
40
36
  readonly chainId: number;
41
- } | {
42
37
  readonly kind: "erc20";
38
+ }, {
43
39
  readonly chainId: number;
40
+ readonly kind: "native";
41
+ } | {
44
42
  readonly token: string;
43
+ readonly chainId: number;
44
+ readonly kind: "erc20";
45
45
  }, never>>;
46
46
  export declare const ResourceInputSchema: Schema.Struct<{
47
47
  name: typeof Schema.String;
@@ -53,19 +53,19 @@ export declare const ResourceInputSchema: Schema.Struct<{
53
53
  token: Schema.refine<string, typeof Schema.String>;
54
54
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
55
55
  }>]>, Schema.SchemaClass<{
56
- readonly kind: "native";
57
56
  readonly chainId: number;
57
+ readonly kind: "native";
58
58
  } | {
59
- readonly kind: "erc20";
60
- readonly chainId: number;
61
59
  readonly token: string;
62
- }, {
63
- readonly kind: "native";
64
60
  readonly chainId: number;
65
- } | {
66
61
  readonly kind: "erc20";
62
+ }, {
67
63
  readonly chainId: number;
64
+ readonly kind: "native";
65
+ } | {
68
66
  readonly token: string;
67
+ readonly chainId: number;
68
+ readonly kind: "erc20";
69
69
  }, never>>;
70
70
  }>;
71
71
  export declare const HandleInputSchema: Schema.Struct<{
@@ -82,19 +82,19 @@ export declare const FlowInputSchema: Schema.Union<[Schema.Struct<{
82
82
  token: Schema.refine<string, typeof Schema.String>;
83
83
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
84
84
  }>]>, Schema.SchemaClass<{
85
- readonly kind: "native";
86
85
  readonly chainId: number;
86
+ readonly kind: "native";
87
87
  } | {
88
- readonly kind: "erc20";
89
- readonly chainId: number;
90
88
  readonly token: string;
91
- }, {
92
- readonly kind: "native";
93
89
  readonly chainId: number;
94
- } | {
95
90
  readonly kind: "erc20";
91
+ }, {
96
92
  readonly chainId: number;
93
+ readonly kind: "native";
94
+ } | {
97
95
  readonly token: string;
96
+ readonly chainId: number;
97
+ readonly kind: "erc20";
98
98
  }, never>>;
99
99
  }>, Schema.Struct<{
100
100
  name: typeof Schema.String;
@@ -157,19 +157,19 @@ export declare const EpilogueForwardSchema: Schema.Struct<{
157
157
  token: Schema.refine<string, typeof Schema.String>;
158
158
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
159
159
  }>]>, Schema.SchemaClass<{
160
- readonly kind: "native";
161
160
  readonly chainId: number;
161
+ readonly kind: "native";
162
162
  } | {
163
- readonly kind: "erc20";
164
- readonly chainId: number;
165
163
  readonly token: string;
166
- }, {
167
- readonly kind: "native";
168
164
  readonly chainId: number;
169
- } | {
170
165
  readonly kind: "erc20";
166
+ }, {
171
167
  readonly chainId: number;
168
+ readonly kind: "native";
169
+ } | {
172
170
  readonly token: string;
171
+ readonly chainId: number;
172
+ readonly kind: "erc20";
173
173
  }, never>>;
174
174
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
175
175
  $ref: Schema.filter<typeof Schema.String>;
@@ -185,19 +185,19 @@ export declare const EpilogueSchema: Schema.filter<Schema.Struct<{
185
185
  token: Schema.refine<string, typeof Schema.String>;
186
186
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
187
187
  }>]>, Schema.SchemaClass<{
188
- readonly kind: "native";
189
188
  readonly chainId: number;
189
+ readonly kind: "native";
190
190
  } | {
191
- readonly kind: "erc20";
192
- readonly chainId: number;
193
191
  readonly token: string;
194
- }, {
195
- readonly kind: "native";
196
192
  readonly chainId: number;
197
- } | {
198
193
  readonly kind: "erc20";
194
+ }, {
199
195
  readonly chainId: number;
196
+ readonly kind: "native";
197
+ } | {
200
198
  readonly token: string;
199
+ readonly chainId: number;
200
+ readonly kind: "erc20";
201
201
  }, never>>;
202
202
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
203
203
  $ref: Schema.filter<typeof Schema.String>;
@@ -221,19 +221,19 @@ export declare const FlowSchema: Schema.Struct<{
221
221
  token: Schema.refine<string, typeof Schema.String>;
222
222
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
223
223
  }>]>, Schema.SchemaClass<{
224
- readonly kind: "native";
225
224
  readonly chainId: number;
225
+ readonly kind: "native";
226
226
  } | {
227
- readonly kind: "erc20";
228
- readonly chainId: number;
229
227
  readonly token: string;
230
- }, {
231
- readonly kind: "native";
232
228
  readonly chainId: number;
233
- } | {
234
229
  readonly kind: "erc20";
230
+ }, {
235
231
  readonly chainId: number;
232
+ readonly kind: "native";
233
+ } | {
236
234
  readonly token: string;
235
+ readonly chainId: number;
236
+ readonly kind: "erc20";
237
237
  }, never>>;
238
238
  }>, Schema.Struct<{
239
239
  name: typeof Schema.String;
@@ -274,19 +274,19 @@ export declare const FlowSchema: Schema.Struct<{
274
274
  token: Schema.refine<string, typeof Schema.String>;
275
275
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
276
276
  }>]>, Schema.SchemaClass<{
277
- readonly kind: "native";
278
277
  readonly chainId: number;
278
+ readonly kind: "native";
279
279
  } | {
280
- readonly kind: "erc20";
281
- readonly chainId: number;
282
280
  readonly token: string;
283
- }, {
284
- readonly kind: "native";
285
281
  readonly chainId: number;
286
- } | {
287
282
  readonly kind: "erc20";
283
+ }, {
288
284
  readonly chainId: number;
285
+ readonly kind: "native";
286
+ } | {
289
287
  readonly token: string;
288
+ readonly chainId: number;
289
+ readonly kind: "erc20";
290
290
  }, never>>;
291
291
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
292
292
  $ref: Schema.filter<typeof Schema.String>;
@@ -315,68 +315,68 @@ type Flow = typeof FlowSchema.Type;
315
315
  //#region src/continuation.d.ts
316
316
  export declare const CONTINUATION_COMMITMENT_OP_ID = "continuation.commitment";
317
317
  export declare const ContinuationOutcomeSchema: Schema.transform<Schema.Schema<{
318
- readonly chainId: number;
319
318
  readonly token: string;
320
319
  readonly minAmount?: string | undefined;
321
320
  readonly destination: string;
322
- }, {
323
321
  readonly chainId: number;
322
+ }, {
324
323
  readonly token: string;
325
324
  readonly destination: string;
325
+ readonly chainId: number;
326
326
  readonly minAmount?: string | undefined;
327
327
  }, never>, Schema.SchemaClass<{
328
- readonly chainId: number;
329
328
  readonly token: string;
330
329
  readonly minAmount?: string | undefined;
331
330
  readonly destination: string;
332
- }, {
333
331
  readonly chainId: number;
332
+ }, {
334
333
  readonly token: string;
335
334
  readonly minAmount?: string | undefined;
336
335
  readonly destination: string;
336
+ readonly chainId: number;
337
337
  }, never>>;
338
338
  export declare const CommittedOutcomeSchema: Schema.transform<Schema.Schema<{
339
- readonly chainId: number;
340
339
  readonly token: string;
341
340
  readonly minAmount: string;
342
341
  readonly destination: string;
343
- }, {
344
342
  readonly chainId: number;
343
+ }, {
345
344
  readonly token: string;
346
345
  readonly minAmount: string;
347
346
  readonly destination: string;
348
- }, never>, Schema.SchemaClass<{
349
347
  readonly chainId: number;
348
+ }, never>, Schema.SchemaClass<{
350
349
  readonly token: string;
351
350
  readonly minAmount: string;
352
351
  readonly destination: string;
353
- }, {
354
352
  readonly chainId: number;
353
+ }, {
355
354
  readonly token: string;
356
355
  readonly minAmount: string;
357
356
  readonly destination: string;
357
+ readonly chainId: number;
358
358
  }, never>>;
359
359
  export declare const ContinuationIntentSchema: Schema.Struct<{
360
360
  outcomes: Schema.Array$<Schema.transform<Schema.Schema<{
361
- readonly chainId: number;
362
361
  readonly token: string;
363
362
  readonly minAmount?: string | undefined;
364
363
  readonly destination: string;
365
- }, {
366
364
  readonly chainId: number;
365
+ }, {
367
366
  readonly token: string;
368
367
  readonly destination: string;
368
+ readonly chainId: number;
369
369
  readonly minAmount?: string | undefined;
370
370
  }, never>, Schema.SchemaClass<{
371
- readonly chainId: number;
372
371
  readonly token: string;
373
372
  readonly minAmount?: string | undefined;
374
373
  readonly destination: string;
375
- }, {
376
374
  readonly chainId: number;
375
+ }, {
377
376
  readonly token: string;
378
377
  readonly minAmount?: string | undefined;
379
378
  readonly destination: string;
379
+ readonly chainId: number;
380
380
  }, never>>>;
381
381
  continuationFlow: Schema.optional<Schema.Struct<{
382
382
  version: Schema.Literal<[1]>;
@@ -392,19 +392,19 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
392
392
  token: Schema.refine<string, typeof Schema.String>;
393
393
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
394
394
  }>]>, Schema.SchemaClass<{
395
- readonly kind: "native";
396
395
  readonly chainId: number;
396
+ readonly kind: "native";
397
397
  } | {
398
- readonly kind: "erc20";
399
- readonly chainId: number;
400
398
  readonly token: string;
401
- }, {
402
- readonly kind: "native";
403
399
  readonly chainId: number;
404
- } | {
405
400
  readonly kind: "erc20";
401
+ }, {
406
402
  readonly chainId: number;
403
+ readonly kind: "native";
404
+ } | {
407
405
  readonly token: string;
406
+ readonly chainId: number;
407
+ readonly kind: "erc20";
408
408
  }, never>>;
409
409
  }>, Schema.Struct<{
410
410
  name: typeof Schema.String;
@@ -445,19 +445,19 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
445
445
  token: Schema.refine<string, typeof Schema.String>;
446
446
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
447
447
  }>]>, Schema.SchemaClass<{
448
- readonly kind: "native";
449
448
  readonly chainId: number;
449
+ readonly kind: "native";
450
450
  } | {
451
- readonly kind: "erc20";
452
- readonly chainId: number;
453
451
  readonly token: string;
454
- }, {
455
- readonly kind: "native";
456
452
  readonly chainId: number;
457
- } | {
458
453
  readonly kind: "erc20";
454
+ }, {
459
455
  readonly chainId: number;
456
+ readonly kind: "native";
457
+ } | {
460
458
  readonly token: string;
459
+ readonly chainId: number;
460
+ readonly kind: "erc20";
461
461
  }, never>>;
462
462
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
463
463
  $ref: Schema.filter<typeof Schema.String>;
@@ -589,38 +589,38 @@ export declare const AssertedPredicateSchema: Schema.transformOrFail<Schema.Unio
589
589
  comparator: Schema.Literal<["gte", "eq", "lte"]>;
590
590
  threshold: Schema.filter<typeof Schema.String>;
591
591
  }>]>, Schema.SchemaClass<{
592
- readonly kind: "erc20BalanceGte";
592
+ readonly minAmount: string;
593
593
  readonly chainId: number;
594
- readonly token: string;
594
+ readonly kind: "nativeBalanceGte";
595
595
  readonly owner: string;
596
- readonly minAmount: string;
597
596
  } | {
598
- readonly kind: "nativeBalanceGte";
597
+ readonly token: string;
598
+ readonly minAmount: string;
599
599
  readonly chainId: number;
600
+ readonly kind: "erc20BalanceGte";
600
601
  readonly owner: string;
601
- readonly minAmount: string;
602
602
  } | {
603
- readonly kind: "call";
604
603
  readonly chainId: number;
604
+ readonly kind: "call";
605
605
  readonly to: string;
606
606
  readonly signature: string;
607
607
  readonly args: readonly string[];
608
608
  readonly comparator: "gte" | "eq" | "lte";
609
609
  readonly threshold: string;
610
610
  }, {
611
- readonly kind: "erc20BalanceGte";
611
+ readonly minAmount: string;
612
612
  readonly chainId: number;
613
- readonly token: string;
613
+ readonly kind: "nativeBalanceGte";
614
614
  readonly owner: string;
615
- readonly minAmount: string;
616
615
  } | {
617
- readonly kind: "nativeBalanceGte";
616
+ readonly token: string;
617
+ readonly minAmount: string;
618
618
  readonly chainId: number;
619
+ readonly kind: "erc20BalanceGte";
619
620
  readonly owner: string;
620
- readonly minAmount: string;
621
621
  } | {
622
- readonly kind: "call";
623
622
  readonly chainId: number;
623
+ readonly kind: "call";
624
624
  readonly to: string;
625
625
  readonly signature: string;
626
626
  readonly args: readonly string[];
@@ -650,38 +650,38 @@ export declare const VerificationDescriptorSchema: Schema.Struct<{
650
650
  comparator: Schema.Literal<["gte", "eq", "lte"]>;
651
651
  threshold: Schema.filter<typeof Schema.String>;
652
652
  }>]>, Schema.SchemaClass<{
653
- readonly kind: "erc20BalanceGte";
653
+ readonly minAmount: string;
654
654
  readonly chainId: number;
655
- readonly token: string;
655
+ readonly kind: "nativeBalanceGte";
656
656
  readonly owner: string;
657
- readonly minAmount: string;
658
657
  } | {
659
- readonly kind: "nativeBalanceGte";
658
+ readonly token: string;
659
+ readonly minAmount: string;
660
660
  readonly chainId: number;
661
+ readonly kind: "erc20BalanceGte";
661
662
  readonly owner: string;
662
- readonly minAmount: string;
663
663
  } | {
664
- readonly kind: "call";
665
664
  readonly chainId: number;
665
+ readonly kind: "call";
666
666
  readonly to: string;
667
667
  readonly signature: string;
668
668
  readonly args: readonly string[];
669
669
  readonly comparator: "gte" | "eq" | "lte";
670
670
  readonly threshold: string;
671
671
  }, {
672
- readonly kind: "erc20BalanceGte";
672
+ readonly minAmount: string;
673
673
  readonly chainId: number;
674
- readonly token: string;
674
+ readonly kind: "nativeBalanceGte";
675
675
  readonly owner: string;
676
- readonly minAmount: string;
677
676
  } | {
678
- readonly kind: "nativeBalanceGte";
677
+ readonly token: string;
678
+ readonly minAmount: string;
679
679
  readonly chainId: number;
680
+ readonly kind: "erc20BalanceGte";
680
681
  readonly owner: string;
681
- readonly minAmount: string;
682
682
  } | {
683
- readonly kind: "call";
684
683
  readonly chainId: number;
684
+ readonly kind: "call";
685
685
  readonly to: string;
686
686
  readonly signature: string;
687
687
  readonly args: readonly string[];
@@ -1461,6 +1461,10 @@ export declare const SettlementZod: z.ZodObject<{
1461
1461
  }, z.core.$strip>>>;
1462
1462
  }, z.core.$strip>>;
1463
1463
  }, z.core.$strip>;
1464
+ export declare const ShortfallZod: z.ZodObject<{
1465
+ required: z.ZodString;
1466
+ available: z.ZodString;
1467
+ }, z.core.$strip>;
1464
1468
  type ResourcePort = z.infer<typeof ResourcePortZod>;
1465
1469
  type HandlePort = z.infer<typeof HandlePortZod>;
1466
1470
  type HandleUnits = z.infer<typeof HandleUnitsZod>;
@@ -1479,6 +1483,7 @@ type ComposeManifest = z.infer<typeof ComposeManifestZod>;
1479
1483
  type SettlementEscrowWire = z.infer<typeof SettlementEscrowZod>;
1480
1484
  type SettlementBindingWire = z.infer<typeof SettlementBindingZod>;
1481
1485
  type SettlementWire = z.infer<typeof SettlementZod>;
1486
+ type Shortfall = z.infer<typeof ShortfallZod>;
1482
1487
  //#endregion
1483
1488
  //#region src/compile.d.ts
1484
1489
  type SimulationPolicy = 'strict' | 'allow-revert';
@@ -1653,12 +1658,14 @@ interface FailedPreparedOp {
1653
1658
  readonly path?: string;
1654
1659
  readonly port?: string;
1655
1660
  readonly fix?: string;
1661
+ readonly shortfall?: Shortfall;
1656
1662
  }
1657
1663
  interface ComposeErrorBase {
1658
1664
  readonly message: string;
1659
1665
  readonly path?: string;
1660
1666
  readonly port?: string;
1661
1667
  readonly fix?: string;
1668
+ readonly shortfall?: Shortfall;
1662
1669
  }
1663
1670
  interface PreparationComposeError extends ComposeErrorBase {
1664
1671
  readonly kind: 'preparation_error';
@@ -2441,4 +2448,4 @@ export declare const foldMaterialiserMetadata: <R>(meta: MaterialiserMetadata, c
2441
2448
  readonly runtime: (min: bigint | undefined) => R;
2442
2449
  }) => R;
2443
2450
  //#endregion
2444
- export type { Amount, AppliedGuard, ApprovalEntry, AssertedPredicate, AssertionOwner, AssertionSpec, AssertionSpecWire, Availability, BindValue, Call, CallCheckSpec, ChainCapabilities, CommittedOutcome, ComposeAction, ComposeCompilePartialData, ComposeCompileRequest, ComposeCompileResult, ComposeCompileSuccessData, ComposeError, ComposeErrorKind, 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, Permit2AllowanceRequirement, Phase1Artifact, Port, Precondition, PreconditionBase, PreconditionConfigOf, PreconditionOf, PreparationComposeError, PriceImpact, ProviderKindName, Ref, RefBuilder, RefPath, RefScope, Resource, ResourceInput, ResourceOutputPort, ResourcePort, RouteAmount, RouteAmountAll, RouteAmountExact, SettlementBindingWire, SettlementEscrowWire, SettlementWire, SimulateBalanceEntry, SimulateOkResult, SimulateRequest, SimulateResult, SimulateRevertDecodeResult, SimulateRevertResult, SimulateSetupErrorResult, SimulationPolicy, SimulationRevert, SimulationRevertComposeError, SlotFinderRequirement, SolType, SpendEntry, StaticSolType, TerminalOutput, TrackedBalance, VerificationDescriptor, VerificationDescriptorWire, VersionCompatibility };
2451
+ export type { Amount, AppliedGuard, ApprovalEntry, AssertedPredicate, AssertionOwner, AssertionSpec, AssertionSpecWire, Availability, BindValue, Call, CallCheckSpec, ChainCapabilities, CommittedOutcome, ComposeAction, ComposeCompilePartialData, ComposeCompileRequest, ComposeCompileResult, ComposeCompileSuccessData, ComposeError, ComposeErrorKind, 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, Permit2AllowanceRequirement, Phase1Artifact, Port, Precondition, PreconditionBase, PreconditionConfigOf, PreconditionOf, PreparationComposeError, PriceImpact, ProviderKindName, Ref, RefBuilder, RefPath, RefScope, Resource, ResourceInput, ResourceOutputPort, ResourcePort, RouteAmount, RouteAmountAll, RouteAmountExact, SettlementBindingWire, SettlementEscrowWire, SettlementWire, Shortfall, SimulateBalanceEntry, SimulateOkResult, SimulateRequest, SimulateResult, SimulateRevertDecodeResult, SimulateRevertResult, SimulateSetupErrorResult, SimulationPolicy, SimulationRevert, SimulationRevertComposeError, SlotFinderRequirement, SolType, SpendEntry, StaticSolType, TerminalOutput, TrackedBalance, VerificationDescriptor, VerificationDescriptorWire, VersionCompatibility };
package/dist/index.d.ts CHANGED
@@ -29,19 +29,19 @@ export declare const ResourceSchema: Schema.transform<Schema.Union<[Schema.Struc
29
29
  token: Schema.refine<string, typeof Schema.String>;
30
30
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
31
31
  }>]>, Schema.SchemaClass<{
32
- readonly kind: "native";
33
32
  readonly chainId: number;
33
+ readonly kind: "native";
34
34
  } | {
35
- readonly kind: "erc20";
36
- readonly chainId: number;
37
35
  readonly token: string;
38
- }, {
39
- readonly kind: "native";
40
36
  readonly chainId: number;
41
- } | {
42
37
  readonly kind: "erc20";
38
+ }, {
43
39
  readonly chainId: number;
40
+ readonly kind: "native";
41
+ } | {
44
42
  readonly token: string;
43
+ readonly chainId: number;
44
+ readonly kind: "erc20";
45
45
  }, never>>;
46
46
  export declare const ResourceInputSchema: Schema.Struct<{
47
47
  name: typeof Schema.String;
@@ -53,19 +53,19 @@ export declare const ResourceInputSchema: Schema.Struct<{
53
53
  token: Schema.refine<string, typeof Schema.String>;
54
54
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
55
55
  }>]>, Schema.SchemaClass<{
56
- readonly kind: "native";
57
56
  readonly chainId: number;
57
+ readonly kind: "native";
58
58
  } | {
59
- readonly kind: "erc20";
60
- readonly chainId: number;
61
59
  readonly token: string;
62
- }, {
63
- readonly kind: "native";
64
60
  readonly chainId: number;
65
- } | {
66
61
  readonly kind: "erc20";
62
+ }, {
67
63
  readonly chainId: number;
64
+ readonly kind: "native";
65
+ } | {
68
66
  readonly token: string;
67
+ readonly chainId: number;
68
+ readonly kind: "erc20";
69
69
  }, never>>;
70
70
  }>;
71
71
  export declare const HandleInputSchema: Schema.Struct<{
@@ -82,19 +82,19 @@ export declare const FlowInputSchema: Schema.Union<[Schema.Struct<{
82
82
  token: Schema.refine<string, typeof Schema.String>;
83
83
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
84
84
  }>]>, Schema.SchemaClass<{
85
- readonly kind: "native";
86
85
  readonly chainId: number;
86
+ readonly kind: "native";
87
87
  } | {
88
- readonly kind: "erc20";
89
- readonly chainId: number;
90
88
  readonly token: string;
91
- }, {
92
- readonly kind: "native";
93
89
  readonly chainId: number;
94
- } | {
95
90
  readonly kind: "erc20";
91
+ }, {
96
92
  readonly chainId: number;
93
+ readonly kind: "native";
94
+ } | {
97
95
  readonly token: string;
96
+ readonly chainId: number;
97
+ readonly kind: "erc20";
98
98
  }, never>>;
99
99
  }>, Schema.Struct<{
100
100
  name: typeof Schema.String;
@@ -157,19 +157,19 @@ export declare const EpilogueForwardSchema: Schema.Struct<{
157
157
  token: Schema.refine<string, typeof Schema.String>;
158
158
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
159
159
  }>]>, Schema.SchemaClass<{
160
- readonly kind: "native";
161
160
  readonly chainId: number;
161
+ readonly kind: "native";
162
162
  } | {
163
- readonly kind: "erc20";
164
- readonly chainId: number;
165
163
  readonly token: string;
166
- }, {
167
- readonly kind: "native";
168
164
  readonly chainId: number;
169
- } | {
170
165
  readonly kind: "erc20";
166
+ }, {
171
167
  readonly chainId: number;
168
+ readonly kind: "native";
169
+ } | {
172
170
  readonly token: string;
171
+ readonly chainId: number;
172
+ readonly kind: "erc20";
173
173
  }, never>>;
174
174
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
175
175
  $ref: Schema.filter<typeof Schema.String>;
@@ -185,19 +185,19 @@ export declare const EpilogueSchema: Schema.filter<Schema.Struct<{
185
185
  token: Schema.refine<string, typeof Schema.String>;
186
186
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
187
187
  }>]>, Schema.SchemaClass<{
188
- readonly kind: "native";
189
188
  readonly chainId: number;
189
+ readonly kind: "native";
190
190
  } | {
191
- readonly kind: "erc20";
192
- readonly chainId: number;
193
191
  readonly token: string;
194
- }, {
195
- readonly kind: "native";
196
192
  readonly chainId: number;
197
- } | {
198
193
  readonly kind: "erc20";
194
+ }, {
199
195
  readonly chainId: number;
196
+ readonly kind: "native";
197
+ } | {
200
198
  readonly token: string;
199
+ readonly chainId: number;
200
+ readonly kind: "erc20";
201
201
  }, never>>;
202
202
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
203
203
  $ref: Schema.filter<typeof Schema.String>;
@@ -221,19 +221,19 @@ export declare const FlowSchema: Schema.Struct<{
221
221
  token: Schema.refine<string, typeof Schema.String>;
222
222
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
223
223
  }>]>, Schema.SchemaClass<{
224
- readonly kind: "native";
225
224
  readonly chainId: number;
225
+ readonly kind: "native";
226
226
  } | {
227
- readonly kind: "erc20";
228
- readonly chainId: number;
229
227
  readonly token: string;
230
- }, {
231
- readonly kind: "native";
232
228
  readonly chainId: number;
233
- } | {
234
229
  readonly kind: "erc20";
230
+ }, {
235
231
  readonly chainId: number;
232
+ readonly kind: "native";
233
+ } | {
236
234
  readonly token: string;
235
+ readonly chainId: number;
236
+ readonly kind: "erc20";
237
237
  }, never>>;
238
238
  }>, Schema.Struct<{
239
239
  name: typeof Schema.String;
@@ -274,19 +274,19 @@ export declare const FlowSchema: Schema.Struct<{
274
274
  token: Schema.refine<string, typeof Schema.String>;
275
275
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
276
276
  }>]>, Schema.SchemaClass<{
277
- readonly kind: "native";
278
277
  readonly chainId: number;
278
+ readonly kind: "native";
279
279
  } | {
280
- readonly kind: "erc20";
281
- readonly chainId: number;
282
280
  readonly token: string;
283
- }, {
284
- readonly kind: "native";
285
281
  readonly chainId: number;
286
- } | {
287
282
  readonly kind: "erc20";
283
+ }, {
288
284
  readonly chainId: number;
285
+ readonly kind: "native";
286
+ } | {
289
287
  readonly token: string;
288
+ readonly chainId: number;
289
+ readonly kind: "erc20";
290
290
  }, never>>;
291
291
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
292
292
  $ref: Schema.filter<typeof Schema.String>;
@@ -315,68 +315,68 @@ type Flow = typeof FlowSchema.Type;
315
315
  //#region src/continuation.d.ts
316
316
  export declare const CONTINUATION_COMMITMENT_OP_ID = "continuation.commitment";
317
317
  export declare const ContinuationOutcomeSchema: Schema.transform<Schema.Schema<{
318
- readonly chainId: number;
319
318
  readonly token: string;
320
319
  readonly minAmount?: string | undefined;
321
320
  readonly destination: string;
322
- }, {
323
321
  readonly chainId: number;
322
+ }, {
324
323
  readonly token: string;
325
324
  readonly destination: string;
325
+ readonly chainId: number;
326
326
  readonly minAmount?: string | undefined;
327
327
  }, never>, Schema.SchemaClass<{
328
- readonly chainId: number;
329
328
  readonly token: string;
330
329
  readonly minAmount?: string | undefined;
331
330
  readonly destination: string;
332
- }, {
333
331
  readonly chainId: number;
332
+ }, {
334
333
  readonly token: string;
335
334
  readonly minAmount?: string | undefined;
336
335
  readonly destination: string;
336
+ readonly chainId: number;
337
337
  }, never>>;
338
338
  export declare const CommittedOutcomeSchema: Schema.transform<Schema.Schema<{
339
- readonly chainId: number;
340
339
  readonly token: string;
341
340
  readonly minAmount: string;
342
341
  readonly destination: string;
343
- }, {
344
342
  readonly chainId: number;
343
+ }, {
345
344
  readonly token: string;
346
345
  readonly minAmount: string;
347
346
  readonly destination: string;
348
- }, never>, Schema.SchemaClass<{
349
347
  readonly chainId: number;
348
+ }, never>, Schema.SchemaClass<{
350
349
  readonly token: string;
351
350
  readonly minAmount: string;
352
351
  readonly destination: string;
353
- }, {
354
352
  readonly chainId: number;
353
+ }, {
355
354
  readonly token: string;
356
355
  readonly minAmount: string;
357
356
  readonly destination: string;
357
+ readonly chainId: number;
358
358
  }, never>>;
359
359
  export declare const ContinuationIntentSchema: Schema.Struct<{
360
360
  outcomes: Schema.Array$<Schema.transform<Schema.Schema<{
361
- readonly chainId: number;
362
361
  readonly token: string;
363
362
  readonly minAmount?: string | undefined;
364
363
  readonly destination: string;
365
- }, {
366
364
  readonly chainId: number;
365
+ }, {
367
366
  readonly token: string;
368
367
  readonly destination: string;
368
+ readonly chainId: number;
369
369
  readonly minAmount?: string | undefined;
370
370
  }, never>, Schema.SchemaClass<{
371
- readonly chainId: number;
372
371
  readonly token: string;
373
372
  readonly minAmount?: string | undefined;
374
373
  readonly destination: string;
375
- }, {
376
374
  readonly chainId: number;
375
+ }, {
377
376
  readonly token: string;
378
377
  readonly minAmount?: string | undefined;
379
378
  readonly destination: string;
379
+ readonly chainId: number;
380
380
  }, never>>>;
381
381
  continuationFlow: Schema.optional<Schema.Struct<{
382
382
  version: Schema.Literal<[1]>;
@@ -392,19 +392,19 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
392
392
  token: Schema.refine<string, typeof Schema.String>;
393
393
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
394
394
  }>]>, Schema.SchemaClass<{
395
- readonly kind: "native";
396
395
  readonly chainId: number;
396
+ readonly kind: "native";
397
397
  } | {
398
- readonly kind: "erc20";
399
- readonly chainId: number;
400
398
  readonly token: string;
401
- }, {
402
- readonly kind: "native";
403
399
  readonly chainId: number;
404
- } | {
405
400
  readonly kind: "erc20";
401
+ }, {
406
402
  readonly chainId: number;
403
+ readonly kind: "native";
404
+ } | {
407
405
  readonly token: string;
406
+ readonly chainId: number;
407
+ readonly kind: "erc20";
408
408
  }, never>>;
409
409
  }>, Schema.Struct<{
410
410
  name: typeof Schema.String;
@@ -445,19 +445,19 @@ export declare const ContinuationIntentSchema: Schema.Struct<{
445
445
  token: Schema.refine<string, typeof Schema.String>;
446
446
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
447
447
  }>]>, Schema.SchemaClass<{
448
- readonly kind: "native";
449
448
  readonly chainId: number;
449
+ readonly kind: "native";
450
450
  } | {
451
- readonly kind: "erc20";
452
- readonly chainId: number;
453
451
  readonly token: string;
454
- }, {
455
- readonly kind: "native";
456
452
  readonly chainId: number;
457
- } | {
458
453
  readonly kind: "erc20";
454
+ }, {
459
455
  readonly chainId: number;
456
+ readonly kind: "native";
457
+ } | {
460
458
  readonly token: string;
459
+ readonly chainId: number;
460
+ readonly kind: "erc20";
461
461
  }, never>>;
462
462
  to: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Struct<{
463
463
  $ref: Schema.filter<typeof Schema.String>;
@@ -589,38 +589,38 @@ export declare const AssertedPredicateSchema: Schema.transformOrFail<Schema.Unio
589
589
  comparator: Schema.Literal<["gte", "eq", "lte"]>;
590
590
  threshold: Schema.filter<typeof Schema.String>;
591
591
  }>]>, Schema.SchemaClass<{
592
- readonly kind: "erc20BalanceGte";
592
+ readonly minAmount: string;
593
593
  readonly chainId: number;
594
- readonly token: string;
594
+ readonly kind: "nativeBalanceGte";
595
595
  readonly owner: string;
596
- readonly minAmount: string;
597
596
  } | {
598
- readonly kind: "nativeBalanceGte";
597
+ readonly token: string;
598
+ readonly minAmount: string;
599
599
  readonly chainId: number;
600
+ readonly kind: "erc20BalanceGte";
600
601
  readonly owner: string;
601
- readonly minAmount: string;
602
602
  } | {
603
- readonly kind: "call";
604
603
  readonly chainId: number;
604
+ readonly kind: "call";
605
605
  readonly to: string;
606
606
  readonly signature: string;
607
607
  readonly args: readonly string[];
608
608
  readonly comparator: "gte" | "eq" | "lte";
609
609
  readonly threshold: string;
610
610
  }, {
611
- readonly kind: "erc20BalanceGte";
611
+ readonly minAmount: string;
612
612
  readonly chainId: number;
613
- readonly token: string;
613
+ readonly kind: "nativeBalanceGte";
614
614
  readonly owner: string;
615
- readonly minAmount: string;
616
615
  } | {
617
- readonly kind: "nativeBalanceGte";
616
+ readonly token: string;
617
+ readonly minAmount: string;
618
618
  readonly chainId: number;
619
+ readonly kind: "erc20BalanceGte";
619
620
  readonly owner: string;
620
- readonly minAmount: string;
621
621
  } | {
622
- readonly kind: "call";
623
622
  readonly chainId: number;
623
+ readonly kind: "call";
624
624
  readonly to: string;
625
625
  readonly signature: string;
626
626
  readonly args: readonly string[];
@@ -650,38 +650,38 @@ export declare const VerificationDescriptorSchema: Schema.Struct<{
650
650
  comparator: Schema.Literal<["gte", "eq", "lte"]>;
651
651
  threshold: Schema.filter<typeof Schema.String>;
652
652
  }>]>, Schema.SchemaClass<{
653
- readonly kind: "erc20BalanceGte";
653
+ readonly minAmount: string;
654
654
  readonly chainId: number;
655
- readonly token: string;
655
+ readonly kind: "nativeBalanceGte";
656
656
  readonly owner: string;
657
- readonly minAmount: string;
658
657
  } | {
659
- readonly kind: "nativeBalanceGte";
658
+ readonly token: string;
659
+ readonly minAmount: string;
660
660
  readonly chainId: number;
661
+ readonly kind: "erc20BalanceGte";
661
662
  readonly owner: string;
662
- readonly minAmount: string;
663
663
  } | {
664
- readonly kind: "call";
665
664
  readonly chainId: number;
665
+ readonly kind: "call";
666
666
  readonly to: string;
667
667
  readonly signature: string;
668
668
  readonly args: readonly string[];
669
669
  readonly comparator: "gte" | "eq" | "lte";
670
670
  readonly threshold: string;
671
671
  }, {
672
- readonly kind: "erc20BalanceGte";
672
+ readonly minAmount: string;
673
673
  readonly chainId: number;
674
- readonly token: string;
674
+ readonly kind: "nativeBalanceGte";
675
675
  readonly owner: string;
676
- readonly minAmount: string;
677
676
  } | {
678
- readonly kind: "nativeBalanceGte";
677
+ readonly token: string;
678
+ readonly minAmount: string;
679
679
  readonly chainId: number;
680
+ readonly kind: "erc20BalanceGte";
680
681
  readonly owner: string;
681
- readonly minAmount: string;
682
682
  } | {
683
- readonly kind: "call";
684
683
  readonly chainId: number;
684
+ readonly kind: "call";
685
685
  readonly to: string;
686
686
  readonly signature: string;
687
687
  readonly args: readonly string[];
@@ -1461,6 +1461,10 @@ export declare const SettlementZod: z.ZodObject<{
1461
1461
  }, z.core.$strip>>>;
1462
1462
  }, z.core.$strip>>;
1463
1463
  }, z.core.$strip>;
1464
+ export declare const ShortfallZod: z.ZodObject<{
1465
+ required: z.ZodString;
1466
+ available: z.ZodString;
1467
+ }, z.core.$strip>;
1464
1468
  type ResourcePort = z.infer<typeof ResourcePortZod>;
1465
1469
  type HandlePort = z.infer<typeof HandlePortZod>;
1466
1470
  type HandleUnits = z.infer<typeof HandleUnitsZod>;
@@ -1479,6 +1483,7 @@ type ComposeManifest = z.infer<typeof ComposeManifestZod>;
1479
1483
  type SettlementEscrowWire = z.infer<typeof SettlementEscrowZod>;
1480
1484
  type SettlementBindingWire = z.infer<typeof SettlementBindingZod>;
1481
1485
  type SettlementWire = z.infer<typeof SettlementZod>;
1486
+ type Shortfall = z.infer<typeof ShortfallZod>;
1482
1487
  //#endregion
1483
1488
  //#region src/compile.d.ts
1484
1489
  type SimulationPolicy = 'strict' | 'allow-revert';
@@ -1653,12 +1658,14 @@ interface FailedPreparedOp {
1653
1658
  readonly path?: string;
1654
1659
  readonly port?: string;
1655
1660
  readonly fix?: string;
1661
+ readonly shortfall?: Shortfall;
1656
1662
  }
1657
1663
  interface ComposeErrorBase {
1658
1664
  readonly message: string;
1659
1665
  readonly path?: string;
1660
1666
  readonly port?: string;
1661
1667
  readonly fix?: string;
1668
+ readonly shortfall?: Shortfall;
1662
1669
  }
1663
1670
  interface PreparationComposeError extends ComposeErrorBase {
1664
1671
  readonly kind: 'preparation_error';
@@ -2441,4 +2448,4 @@ export declare const foldMaterialiserMetadata: <R>(meta: MaterialiserMetadata, c
2441
2448
  readonly runtime: (min: bigint | undefined) => R;
2442
2449
  }) => R;
2443
2450
  //#endregion
2444
- export type { Amount, AppliedGuard, ApprovalEntry, AssertedPredicate, AssertionOwner, AssertionSpec, AssertionSpecWire, Availability, BindValue, Call, CallCheckSpec, ChainCapabilities, CommittedOutcome, ComposeAction, ComposeCompilePartialData, ComposeCompileRequest, ComposeCompileResult, ComposeCompileSuccessData, ComposeError, ComposeErrorKind, 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, Permit2AllowanceRequirement, Phase1Artifact, Port, Precondition, PreconditionBase, PreconditionConfigOf, PreconditionOf, PreparationComposeError, PriceImpact, ProviderKindName, Ref, RefBuilder, RefPath, RefScope, Resource, ResourceInput, ResourceOutputPort, ResourcePort, RouteAmount, RouteAmountAll, RouteAmountExact, SettlementBindingWire, SettlementEscrowWire, SettlementWire, SimulateBalanceEntry, SimulateOkResult, SimulateRequest, SimulateResult, SimulateRevertDecodeResult, SimulateRevertResult, SimulateSetupErrorResult, SimulationPolicy, SimulationRevert, SimulationRevertComposeError, SlotFinderRequirement, SolType, SpendEntry, StaticSolType, TerminalOutput, TrackedBalance, VerificationDescriptor, VerificationDescriptorWire, VersionCompatibility };
2451
+ export type { Amount, AppliedGuard, ApprovalEntry, AssertedPredicate, AssertionOwner, AssertionSpec, AssertionSpecWire, Availability, BindValue, Call, CallCheckSpec, ChainCapabilities, CommittedOutcome, ComposeAction, ComposeCompilePartialData, ComposeCompileRequest, ComposeCompileResult, ComposeCompileSuccessData, ComposeError, ComposeErrorKind, 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, Permit2AllowanceRequirement, Phase1Artifact, Port, Precondition, PreconditionBase, PreconditionConfigOf, PreconditionOf, PreparationComposeError, PriceImpact, ProviderKindName, Ref, RefBuilder, RefPath, RefScope, Resource, ResourceInput, ResourceOutputPort, ResourcePort, RouteAmount, RouteAmountAll, RouteAmountExact, SettlementBindingWire, SettlementEscrowWire, SettlementWire, Shortfall, SimulateBalanceEntry, SimulateOkResult, SimulateRequest, SimulateResult, SimulateRevertDecodeResult, SimulateRevertResult, SimulateSetupErrorResult, SimulationPolicy, SimulationRevert, SimulationRevertComposeError, SlotFinderRequirement, SolType, SpendEntry, StaticSolType, TerminalOutput, TrackedBalance, VerificationDescriptor, VerificationDescriptorWire, VersionCompatibility };
package/dist/index.js CHANGED
@@ -948,5 +948,9 @@ const SettlementZod = z.object({
948
948
  escrow: SettlementEscrowZod.optional(),
949
949
  binding: SettlementBindingZod.optional()
950
950
  });
951
+ const ShortfallZod = z.object({
952
+ required: z.string(),
953
+ available: z.string()
954
+ });
951
955
  //#endregion
952
- export { ARC_CHAIN_ID, ARC_NATIVE_ERC20, ARC_NATIVE_SCALE, AppliedGuardSchema, AssertedPredicateSchema, AssertionOwnerSchema, AssertionSpecSchema, AssertionSpecZod, BindValueSchema, Bytes32HexSchema, COMPOSER_SDK_VERSION_HEADER, COMPOSE_VERSION_HEADER, CONTINUATION_COMMITMENT_OP_ID, CallCheckSpecSchema, CallSchema, CommittedOutcomeSchema, ComposeManifestZod, ContinuationIntentSchema, ContinuationOutcomeSchema, EVMAddressString, EVM_NATIVE_SENTINEL, EpilogueForwardSchema, EpilogueSchema, Erc20BalanceGteSpecSchema, FlowInputSchema, FlowSchema, ForwardToSchema, GuardCompatibilityZod, GuardSelectorZod, HANDLE_UNITS, HandleInputSchema, HandlePortZod, HandleUnitsZod, HexStringSchema, InputPortZod, IntegerString, LineageSchema, LiteralBindingSchema, ManifestGuardZod, ManifestMaterialiserZod, ManifestOperationZod, ManifestPreconditionZod, ManifestRoutingZod, NativeBalanceGteSpecSchema, OutputPortZod, PROVIDER_KIND, Phase1ArtifactSchema, RESERVED_REF_SCOPES, RefSchema, ResourceInputSchema, ResourceOutputPortZod, ResourcePortZod, ResourceSchema, SIMULATE_MAX_REQUIREMENTS, SIMULATE_MAX_TRACKED_BALANCES, STATIC_SOL_TYPES, SettlementZod, SolTypeSchema, StaticSolTypeZod, TEMPO_CHAIN_ID, TEMPO_NATIVE_ERC20, UuidSchema, VerificationDescriptorSchema, VerificationDescriptorZod, canonicalAssertedPredicate, canonicalNativeAddress, checkCompatibility, copy, erc20, erc20Allowance, erc20Balance, erc20Resource, erc20Token, expandOutputPorts, familySize, flowInputMode, flowInputResource, flowInputType, foldChainCapabilities, foldMaterialiserMetadata, foldRef, foldResource, getChainCapabilities, handle, hasErc20CanonicalNative, instancePortName, isAsErc20Chain, isContextKey, isERC20Resource, isErc20AllowancePrecondition, isErc20BalancePrecondition, isFutureResourceOutput, isHandlePort, isMaterialiserInput, isMsgValueNative, isNativeAddressForChain, isNativeBalancePrecondition, isNativeResource, isOutputFamily, isRef, isResourceInput, isResourceOutputPort, isResourcePort, isStaticSolType, linear, native, nativeBalance, nativeCheckPolicy, nativeResource, normalizeNativeTokenAddress, normalizeResource, opHandle, parseRef, parseVersion, providerKindByName, providerKindNames, readResource, ref, refKey, resource, resourceKey, resourceOutput, resourceToken, resourcesEqual, settledOutcome };
956
+ export { ARC_CHAIN_ID, ARC_NATIVE_ERC20, ARC_NATIVE_SCALE, AppliedGuardSchema, AssertedPredicateSchema, AssertionOwnerSchema, AssertionSpecSchema, AssertionSpecZod, BindValueSchema, Bytes32HexSchema, COMPOSER_SDK_VERSION_HEADER, COMPOSE_VERSION_HEADER, CONTINUATION_COMMITMENT_OP_ID, CallCheckSpecSchema, CallSchema, CommittedOutcomeSchema, ComposeManifestZod, ContinuationIntentSchema, ContinuationOutcomeSchema, EVMAddressString, EVM_NATIVE_SENTINEL, EpilogueForwardSchema, EpilogueSchema, Erc20BalanceGteSpecSchema, FlowInputSchema, FlowSchema, ForwardToSchema, GuardCompatibilityZod, GuardSelectorZod, HANDLE_UNITS, HandleInputSchema, HandlePortZod, HandleUnitsZod, HexStringSchema, InputPortZod, IntegerString, LineageSchema, LiteralBindingSchema, ManifestGuardZod, ManifestMaterialiserZod, ManifestOperationZod, ManifestPreconditionZod, ManifestRoutingZod, NativeBalanceGteSpecSchema, OutputPortZod, PROVIDER_KIND, Phase1ArtifactSchema, RESERVED_REF_SCOPES, RefSchema, ResourceInputSchema, ResourceOutputPortZod, ResourcePortZod, ResourceSchema, SIMULATE_MAX_REQUIREMENTS, SIMULATE_MAX_TRACKED_BALANCES, STATIC_SOL_TYPES, SettlementZod, ShortfallZod, SolTypeSchema, StaticSolTypeZod, TEMPO_CHAIN_ID, TEMPO_NATIVE_ERC20, UuidSchema, VerificationDescriptorSchema, VerificationDescriptorZod, canonicalAssertedPredicate, canonicalNativeAddress, checkCompatibility, copy, erc20, erc20Allowance, erc20Balance, erc20Resource, erc20Token, expandOutputPorts, familySize, flowInputMode, flowInputResource, flowInputType, foldChainCapabilities, foldMaterialiserMetadata, foldRef, foldResource, getChainCapabilities, handle, hasErc20CanonicalNative, instancePortName, isAsErc20Chain, isContextKey, isERC20Resource, isErc20AllowancePrecondition, isErc20BalancePrecondition, isFutureResourceOutput, isHandlePort, isMaterialiserInput, isMsgValueNative, isNativeAddressForChain, isNativeBalancePrecondition, isNativeResource, isOutputFamily, isRef, isResourceInput, isResourceOutputPort, isResourcePort, isStaticSolType, linear, native, nativeBalance, nativeCheckPolicy, nativeResource, normalizeNativeTokenAddress, normalizeResource, opHandle, parseRef, parseVersion, providerKindByName, providerKindNames, readResource, ref, refKey, resource, resourceKey, resourceOutput, resourceToken, resourcesEqual, settledOutcome };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/compose-spec",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Public wire-format types and schemas for Compose flows",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/flow.ts CHANGED
@@ -7,6 +7,7 @@ import type {
7
7
  OpOutputPort,
8
8
  ResourceOutputPort,
9
9
  ResourcePort,
10
+ Shortfall,
10
11
  } from './zodSchemas.js';
11
12
 
12
13
  export type {
@@ -114,6 +115,7 @@ export interface FailedPreparedOp {
114
115
  readonly path?: string;
115
116
  readonly port?: string;
116
117
  readonly fix?: string;
118
+ readonly shortfall?: Shortfall;
117
119
  }
118
120
 
119
121
  // `path` names the node the rejection is about, `port` the bound input port
@@ -121,12 +123,14 @@ export interface FailedPreparedOp {
121
123
  // that clears it. A `continuation.settle` authoring rejection carries `path`
122
124
  // and `fix`, plus `port` when it is about a bind; other `validation_error`s may
123
125
  // omit `fix`. A deployment or internal fault carries none of the three, because
124
- // no edit to the flow clears it.
126
+ // no edit to the flow clears it. `shortfall` is present when the cause is an
127
+ // amount that cannot cover what a step needs (see `ShortfallZod`).
125
128
  interface ComposeErrorBase {
126
129
  readonly message: string;
127
130
  readonly path?: string;
128
131
  readonly port?: string;
129
132
  readonly fix?: string;
133
+ readonly shortfall?: Shortfall;
130
134
  }
131
135
 
132
136
  export interface PreparationComposeError extends ComposeErrorBase {
package/src/index.ts CHANGED
@@ -316,6 +316,7 @@ export {
316
316
  GuardSelectorZod,
317
317
  GuardCompatibilityZod,
318
318
  SettlementZod,
319
+ ShortfallZod,
319
320
  AssertionSpecZod,
320
321
  VerificationDescriptorZod,
321
322
  } from './zodSchemas.js';
@@ -325,6 +326,7 @@ export type {
325
326
  SettlementWire,
326
327
  SettlementEscrowWire,
327
328
  SettlementBindingWire,
329
+ Shortfall,
328
330
  AssertionSpecWire,
329
331
  VerificationDescriptorWire,
330
332
  } from './zodSchemas.js';
package/src/zodSchemas.ts CHANGED
@@ -308,6 +308,16 @@ export const SettlementZod = z.object({
308
308
  binding: SettlementBindingZod.optional(),
309
309
  });
310
310
 
311
+ // An amount that cannot cover what a step needs, carried by a compose error
312
+ // whose cause is that gap: `required` is the least amount that would clear
313
+ // the step, `available` the amount the flow had, both decimal strings in the
314
+ // token's units. The one schema for the field: api-schemas declares it on
315
+ // every error body that can carry it, the SDK parses it with it.
316
+ export const ShortfallZod = z.object({
317
+ required: z.string(),
318
+ available: z.string(),
319
+ });
320
+
311
321
  export type ResourcePort = z.infer<typeof ResourcePortZod>;
312
322
  export type HandlePort = z.infer<typeof HandlePortZod>;
313
323
  export type HandleUnits = z.infer<typeof HandleUnitsZod>;
@@ -326,3 +336,4 @@ export type ComposeManifest = z.infer<typeof ComposeManifestZod>;
326
336
  export type SettlementEscrowWire = z.infer<typeof SettlementEscrowZod>;
327
337
  export type SettlementBindingWire = z.infer<typeof SettlementBindingZod>;
328
338
  export type SettlementWire = z.infer<typeof SettlementZod>;
339
+ export type Shortfall = z.infer<typeof ShortfallZod>;