@lifi/compose-spec 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -363,61 +363,6 @@ declare const CallCheckSpecSchema: Schema.Struct<{
363
363
  comparator: Schema.Literal<["gte", "eq", "lte"]>;
364
364
  value: Schema.filter<typeof Schema.String>;
365
365
  }>;
366
- declare const CheckSchema: Schema.transformOrFail<Schema.Union<[Schema.Struct<{
367
- kind: Schema.Literal<["erc20BalanceGte"]>;
368
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
369
- token: Schema.refine<string, typeof Schema.String>;
370
- owner: Schema.refine<string, typeof Schema.String>;
371
- minAmount: Schema.filter<typeof Schema.String>;
372
- }>, Schema.Struct<{
373
- kind: Schema.Literal<["nativeBalanceGte"]>;
374
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
375
- owner: Schema.refine<string, typeof Schema.String>;
376
- minAmount: Schema.filter<typeof Schema.String>;
377
- }>, Schema.Struct<{
378
- kind: Schema.Literal<["call"]>;
379
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
380
- to: Schema.refine<string, typeof Schema.String>;
381
- calldata: Schema.refine<string, typeof Schema.String>;
382
- comparator: Schema.Literal<["gte", "eq", "lte"]>;
383
- value: Schema.filter<typeof Schema.String>;
384
- }>]>, Schema.SchemaClass<{
385
- readonly token: string;
386
- readonly kind: "erc20BalanceGte";
387
- readonly chainId: number;
388
- readonly minAmount: string;
389
- readonly owner: string;
390
- } | {
391
- readonly kind: "nativeBalanceGte";
392
- readonly chainId: number;
393
- readonly minAmount: string;
394
- readonly owner: string;
395
- } | {
396
- readonly kind: "call";
397
- readonly chainId: number;
398
- readonly value: string;
399
- readonly to: string;
400
- readonly calldata: string;
401
- readonly comparator: "gte" | "eq" | "lte";
402
- }, {
403
- readonly token: string;
404
- readonly kind: "erc20BalanceGte";
405
- readonly chainId: number;
406
- readonly minAmount: string;
407
- readonly owner: string;
408
- } | {
409
- readonly kind: "nativeBalanceGte";
410
- readonly chainId: number;
411
- readonly minAmount: string;
412
- readonly owner: string;
413
- } | {
414
- readonly kind: "call";
415
- readonly chainId: number;
416
- readonly value: string;
417
- readonly to: string;
418
- readonly calldata: string;
419
- readonly comparator: "gte" | "eq" | "lte";
420
- }, never>, never>;
421
366
  declare const Erc20BalanceDeltaGteSpecSchema: Schema.Struct<{
422
367
  kind: Schema.Literal<["erc20BalanceDeltaGte"]>;
423
368
  chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
@@ -461,137 +406,11 @@ declare const AssertionSpecSchema: Schema.Union<[Schema.Struct<{
461
406
  owner: Schema.Union<[Schema.refine<string, typeof Schema.String>, Schema.Literal<["escrow", "delivery"]>]>;
462
407
  minDelta: Schema.filter<typeof Schema.String>;
463
408
  }>]>;
464
- declare const ContinuationPlanSchema: Schema.Struct<{
465
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
466
- nextFlow: Schema.Struct<{
467
- version: Schema.Literal<[1]>;
468
- id: typeof Schema.String;
469
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
470
- inputs: Schema.Array$<Schema.Union<[Schema.Struct<{
471
- name: typeof Schema.String;
472
- resource: Schema.transform<Schema.Union<[Schema.Struct<{
473
- kind: Schema.Literal<["native"]>;
474
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
475
- }>, Schema.Struct<{
476
- kind: Schema.Literal<["erc20"]>;
477
- token: Schema.refine<string, typeof Schema.String>;
478
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
479
- }>]>, Schema.SchemaClass<{
480
- readonly kind: "native";
481
- readonly chainId: number;
482
- } | {
483
- readonly token: string;
484
- readonly kind: "erc20";
485
- readonly chainId: number;
486
- }, {
487
- readonly kind: "native";
488
- readonly chainId: number;
489
- } | {
490
- readonly token: string;
491
- readonly kind: "erc20";
492
- readonly chainId: number;
493
- }, never>>;
494
- }>, Schema.Struct<{
495
- name: typeof Schema.String;
496
- type: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
497
- }>]>>;
498
- nodes: Schema.Array$<Schema.Struct<{
499
- id: Schema.filter<typeof Schema.String>;
500
- op: typeof Schema.String;
501
- bind: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
502
- $ref: Schema.filter<typeof Schema.String>;
503
- }>, Schema.Struct<{
504
- kind: Schema.Literal<["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int128", "int256", "address", "bool", "bytes", "bytes4", "bytes32", "string"]>;
505
- value: typeof Schema.String;
506
- }>]>>, {
507
- default: () => {};
508
- }>;
509
- config: Schema.optionalWith<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>, {
510
- default: () => {};
511
- }>;
512
- guards: Schema.optional<Schema.Array$<Schema.TypeLiteral<{
513
- kind: typeof Schema.String;
514
- }, readonly [{
515
- readonly key: typeof Schema.String;
516
- readonly value: typeof Schema.Unknown;
517
- }]>>>;
518
- }>>;
519
- lineage: Schema.optional<Schema.Struct<{
520
- journeyId: Schema.filter<typeof Schema.String>;
521
- parentRequestId: Schema.filter<typeof Schema.String>;
522
- }>>;
523
- }>;
524
- check: Schema.transformOrFail<Schema.Union<[Schema.Struct<{
525
- kind: Schema.Literal<["erc20BalanceGte"]>;
526
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
527
- token: Schema.refine<string, typeof Schema.String>;
528
- owner: Schema.refine<string, typeof Schema.String>;
529
- minAmount: Schema.filter<typeof Schema.String>;
530
- }>, Schema.Struct<{
531
- kind: Schema.Literal<["nativeBalanceGte"]>;
532
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
533
- owner: Schema.refine<string, typeof Schema.String>;
534
- minAmount: Schema.filter<typeof Schema.String>;
535
- }>, Schema.Struct<{
536
- kind: Schema.Literal<["call"]>;
537
- chainId: Schema.filter<Schema.filter<typeof Schema.Number>>;
538
- to: Schema.refine<string, typeof Schema.String>;
539
- calldata: Schema.refine<string, typeof Schema.String>;
540
- comparator: Schema.Literal<["gte", "eq", "lte"]>;
541
- value: Schema.filter<typeof Schema.String>;
542
- }>]>, Schema.SchemaClass<{
543
- readonly token: string;
544
- readonly kind: "erc20BalanceGte";
545
- readonly chainId: number;
546
- readonly minAmount: string;
547
- readonly owner: string;
548
- } | {
549
- readonly kind: "nativeBalanceGte";
550
- readonly chainId: number;
551
- readonly minAmount: string;
552
- readonly owner: string;
553
- } | {
554
- readonly kind: "call";
555
- readonly chainId: number;
556
- readonly value: string;
557
- readonly to: string;
558
- readonly calldata: string;
559
- readonly comparator: "gte" | "eq" | "lte";
560
- }, {
561
- readonly token: string;
562
- readonly kind: "erc20BalanceGte";
563
- readonly chainId: number;
564
- readonly minAmount: string;
565
- readonly owner: string;
566
- } | {
567
- readonly kind: "nativeBalanceGte";
568
- readonly chainId: number;
569
- readonly minAmount: string;
570
- readonly owner: string;
571
- } | {
572
- readonly kind: "call";
573
- readonly chainId: number;
574
- readonly value: string;
575
- readonly to: string;
576
- readonly calldata: string;
577
- readonly comparator: "gte" | "eq" | "lte";
578
- }, never>, never>;
579
- validity: Schema.Struct<{
580
- expiresAtMs: Schema.filter<Schema.filter<typeof Schema.Number>>;
581
- }>;
582
- correlationId: Schema.optional<typeof Schema.String>;
583
- }>;
584
409
  type ContinuationOutcome = typeof ContinuationOutcomeSchema.Type;
585
410
  type ContinuationIntent = typeof ContinuationIntentSchema.Type;
586
411
  type Phase1Artifact = typeof Phase1ArtifactSchema.Type;
587
- type Check = typeof CheckSchema.Type;
588
412
  type AssertionSpec = typeof AssertionSpecSchema.Type;
589
- type ContinuationPlan = typeof ContinuationPlanSchema.Type;
590
413
  declare const settledOutcome: (intent: ContinuationIntent) => ContinuationOutcome;
591
- type CheckComparator = 'gte' | 'eq' | 'lte';
592
- declare const isGTECheck: (check: Check) => boolean;
593
- declare const isLTECheck: (check: Check) => boolean;
594
- declare const isEQCheck: (check: Check) => boolean;
595
414
 
596
415
  declare const Bytes32HexSchema: Schema.filter<typeof Schema.String>;
597
416
  declare const AssertedErc20BalanceGteSpecSchema: Schema.Struct<{
@@ -1443,29 +1262,6 @@ declare const SettlementEscrowZod: z.ZodObject<{
1443
1262
  refund: z.ZodString;
1444
1263
  expiresAtMs: z.ZodNumber;
1445
1264
  }, z.core.$strip>;
1446
- declare const CheckZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
1447
- kind: z.ZodLiteral<"erc20BalanceGte">;
1448
- chainId: z.ZodNumber;
1449
- token: z.ZodString;
1450
- owner: z.ZodString;
1451
- minAmount: z.ZodString;
1452
- }, z.core.$strip>, z.ZodObject<{
1453
- kind: z.ZodLiteral<"nativeBalanceGte">;
1454
- chainId: z.ZodNumber;
1455
- owner: z.ZodString;
1456
- minAmount: z.ZodString;
1457
- }, z.core.$strip>, z.ZodObject<{
1458
- kind: z.ZodLiteral<"call">;
1459
- chainId: z.ZodNumber;
1460
- to: z.ZodString;
1461
- calldata: z.ZodString;
1462
- comparator: z.ZodEnum<{
1463
- gte: "gte";
1464
- eq: "eq";
1465
- lte: "lte";
1466
- }>;
1467
- value: z.ZodString;
1468
- }, z.core.$strip>], "kind">;
1469
1265
  declare const AssertionSpecZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
1470
1266
  kind: z.ZodLiteral<"erc20BalanceGte">;
1471
1267
  chainId: z.ZodNumber;
@@ -1783,37 +1579,6 @@ declare const VerificationDescriptorZod: z.ZodObject<{
1783
1579
  }, z.core.$strip>;
1784
1580
  type AssertedPredicateWire = z.infer<typeof AssertedPredicateZod>;
1785
1581
  type VerificationDescriptorWire = z.infer<typeof VerificationDescriptorZod>;
1786
- declare const ContinuationPlanZod: z.ZodObject<{
1787
- chainId: z.ZodNumber;
1788
- nextFlow: z.ZodUnknown;
1789
- check: z.ZodDiscriminatedUnion<[z.ZodObject<{
1790
- kind: z.ZodLiteral<"erc20BalanceGte">;
1791
- chainId: z.ZodNumber;
1792
- token: z.ZodString;
1793
- owner: z.ZodString;
1794
- minAmount: z.ZodString;
1795
- }, z.core.$strip>, z.ZodObject<{
1796
- kind: z.ZodLiteral<"nativeBalanceGte">;
1797
- chainId: z.ZodNumber;
1798
- owner: z.ZodString;
1799
- minAmount: z.ZodString;
1800
- }, z.core.$strip>, z.ZodObject<{
1801
- kind: z.ZodLiteral<"call">;
1802
- chainId: z.ZodNumber;
1803
- to: z.ZodString;
1804
- calldata: z.ZodString;
1805
- comparator: z.ZodEnum<{
1806
- gte: "gte";
1807
- eq: "eq";
1808
- lte: "lte";
1809
- }>;
1810
- value: z.ZodString;
1811
- }, z.core.$strip>], "kind">;
1812
- validity: z.ZodObject<{
1813
- expiresAtMs: z.ZodNumber;
1814
- }, z.core.$strip>;
1815
- correlationId: z.ZodOptional<z.ZodString>;
1816
- }, z.core.$strip>;
1817
1582
  declare const SettlementZod: z.ZodObject<{
1818
1583
  escrow: z.ZodOptional<z.ZodObject<{
1819
1584
  chainId: z.ZodNumber;
@@ -1825,37 +1590,6 @@ declare const SettlementZod: z.ZodObject<{
1825
1590
  refund: z.ZodString;
1826
1591
  expiresAtMs: z.ZodNumber;
1827
1592
  }, z.core.$strip>>;
1828
- continuation: z.ZodOptional<z.ZodObject<{
1829
- chainId: z.ZodNumber;
1830
- nextFlow: z.ZodUnknown;
1831
- check: z.ZodDiscriminatedUnion<[z.ZodObject<{
1832
- kind: z.ZodLiteral<"erc20BalanceGte">;
1833
- chainId: z.ZodNumber;
1834
- token: z.ZodString;
1835
- owner: z.ZodString;
1836
- minAmount: z.ZodString;
1837
- }, z.core.$strip>, z.ZodObject<{
1838
- kind: z.ZodLiteral<"nativeBalanceGte">;
1839
- chainId: z.ZodNumber;
1840
- owner: z.ZodString;
1841
- minAmount: z.ZodString;
1842
- }, z.core.$strip>, z.ZodObject<{
1843
- kind: z.ZodLiteral<"call">;
1844
- chainId: z.ZodNumber;
1845
- to: z.ZodString;
1846
- calldata: z.ZodString;
1847
- comparator: z.ZodEnum<{
1848
- gte: "gte";
1849
- eq: "eq";
1850
- lte: "lte";
1851
- }>;
1852
- value: z.ZodString;
1853
- }, z.core.$strip>], "kind">;
1854
- validity: z.ZodObject<{
1855
- expiresAtMs: z.ZodNumber;
1856
- }, z.core.$strip>;
1857
- correlationId: z.ZodOptional<z.ZodString>;
1858
- }, z.core.$strip>>;
1859
1593
  }, z.core.$strip>;
1860
1594
  type ResourcePort = z.infer<typeof ResourcePortZod>;
1861
1595
  type HandlePort = z.infer<typeof HandlePortZod>;
@@ -1873,7 +1607,6 @@ type ManifestPrecondition = z.infer<typeof ManifestPreconditionZod>;
1873
1607
  type ComposeManifest = z.infer<typeof ComposeManifestZod>;
1874
1608
  type SettlementEscrowWire = z.infer<typeof SettlementEscrowZod>;
1875
1609
  type SettlementWire = z.infer<typeof SettlementZod>;
1876
- type ContinuationPlanWire = z.infer<typeof ContinuationPlanZod>;
1877
1610
 
1878
1611
  type SimulationPolicy = 'strict' | 'allow-revert';
1879
1612
  /**
@@ -2312,9 +2045,9 @@ declare const foldChainCapabilities: <R>(caps: ChainCapabilities, cases: {
2312
2045
  * check pass 1e12 too easily. The check must be authored as
2313
2046
  * `erc20BalanceGte` of the facade; `reason` says so.
2314
2047
  *
2315
- * Consumers (the `CheckSchema` / `AssertedPredicateSchema` decodes and
2316
- * compose-core's derive backstop) are adapters over this result, so the unit
2317
- * rule lives in one place and the fold's exhaustiveness reaches every site.
2048
+ * Consumers (the `AssertedPredicateSchema` decode and compose-core's derive
2049
+ * backstop) are adapters over this result, so the unit rule lives in one place
2050
+ * and the fold's exhaustiveness reaches every site.
2318
2051
  */
2319
2052
  type NativeCheckPolicy = {
2320
2053
  readonly kind: 'keep';
@@ -2835,4 +2568,4 @@ declare const foldMaterialiserMetadata: <R>(meta: MaterialiserMetadata, cases: {
2835
2568
  readonly runtime: () => R;
2836
2569
  }) => R;
2837
2570
 
2838
- export { ARC_CHAIN_ID, ARC_NATIVE_ERC20, ARC_NATIVE_SCALE, type Amount, type AppliedGuard, AppliedGuardSchema, type ApprovalEntry, AssertedErc20BalanceGteSpecSchema, AssertedNativeBalanceGteSpecSchema, type AssertedPredicate, AssertedPredicateSchema, type AssertedPredicateWire, AssertedPredicateZod, type AssertionOwner, AssertionOwnerSchema, type AssertionSpec, AssertionSpecSchema, type AssertionSpecWire, AssertionSpecZod, type Availability, type BindValue, BindValueSchema, Bytes32HexSchema, COMPOSER_SDK_VERSION_HEADER, COMPOSE_VERSION_HEADER, CONTINUATION_COMMITMENT_OP_ID, type Call, CallCheckSpecSchema, CallSchema, type ChainCapabilities, type Check, type CheckComparator, CheckSchema, CheckZod, type ComposeAction, type ComposeCompilePartialData, type ComposeCompileRequest, type ComposeCompileResult, type ComposeCompileSuccessData, type ComposeError, type ComposeErrorKind, type ComposeFee, type ComposeFill, type ComposeManifest, ComposeManifestZod, type ComposeRouteErrorKind, type ComposeRouteRequest, type ComposeRun, type ComposeTransactionRequest, type ComposeUserProgramSimulation, type ComposeVersion, type ConsumedOutput, type ContextKey, type ContinuationIntent, ContinuationIntentSchema, type ContinuationOutcome, ContinuationOutcomeSchema, type ContinuationPlan, ContinuationPlanSchema, type ContinuationPlanWire, ContinuationPlanZod, type Delivery, EVMAddressString, EVM_NATIVE_SENTINEL, type Erc20AllowancePrecondition, type Erc20AllowanceRequirement, Erc20BalanceDeltaGteSpecSchema, Erc20BalanceGteSpecSchema, type Erc20BalancePrecondition, type Erc20BalanceRequirement, type Estimate, type EstimateBasis, type FailedPreparedOp, type FlashloanMaterialiserInput, type Flow, type FlowInput, FlowInputSchema, FlowSchema, type GenericComposeError, type GenericComposeErrorKind, type GuardCompatibility, GuardCompatibilityZod, type GuardSelector, GuardSelectorZod, HANDLE_UNITS, type HandleInput, HandleInputSchema, type HandlePort, HandlePortZod, type HandleUnits, HandleUnitsZod, HexStringSchema, InputPortZod, type InputSpec, IntegerString, type Lineage, LineageSchema, type LiteralBinding, LiteralBindingSchema, type ManifestGuard, ManifestGuardZod, type ManifestMaterialiser, ManifestMaterialiserZod, type ManifestOperation, ManifestOperationZod, type ManifestPrecondition, ManifestPreconditionZod, type MaterialiserConfigOf, type MaterialiserInput, type MaterialiserInputBase, type MaterialiserInputOf, type MaterialiserMetadata, type MaterialiserResolution, type Minimum, type MinimumBasis, NativeBalanceDeltaGteSpecSchema, NativeBalanceGteSpecSchema, type NativeBalancePrecondition, type NativeBalanceRequirement, type NativeCheckPolicy, type NativeErc20, type OpInputPort, type OpOutputPort, type Output, type OutputAmount, type OutputFamilyPort, OutputPortZod, type Outputs, PROVIDER_KIND, type ParsedRef, type Phase1Artifact, Phase1ArtifactSchema, type Port, type Precondition, type PreconditionBase, type PreconditionConfigOf, type PreconditionOf, type PreparationComposeError, type PriceImpact, type ProviderKindName, RESERVED_REF_SCOPES, type Ref, type RefBuilder, type RefPath, RefSchema, type RefScope, type Resource, type ResourceInput, ResourceInputSchema, type ResourceOutputPort, ResourceOutputPortZod, type ResourcePort, ResourcePortZod, ResourceSchema, type RouteAmount, type RouteAmountAll, type RouteAmountExact, SIMULATE_MAX_REQUIREMENTS, SIMULATE_MAX_TRACKED_BALANCES, STATIC_SOL_TYPES, type SettlementEscrowWire, type SettlementWire, SettlementZod, type SimulateBalanceEntry, type SimulateOkResult, type SimulateRequest, type SimulateResult, type SimulateRevertDecodeResult, type SimulateRevertResult, type SimulateSetupErrorResult, type SimulationPolicy, type SimulationRevert, type SimulationRevertComposeError, type SlotFinderRequirement, type SolType, SolTypeSchema, type SpendEntry, type StaticSolType, StaticSolTypeZod, type SweepTo, TEMPO_CHAIN_ID, TEMPO_NATIVE_ERC20, type TerminalOutput, type TrackedBalance, UuidSchema, type VerificationDescriptor, VerificationDescriptorSchema, type VerificationDescriptorWire, VerificationDescriptorZod, type VersionCompatibility, canonicalAssertedPredicate, canonicalNativeAddress, checkCompatibility, copy, erc20, erc20Allowance, erc20Balance, erc20Resource, erc20Token, expandOutputPorts, familySize, flowInputMode, flowInputResource, flowInputType, foldChainCapabilities, foldMaterialiserMetadata, foldRef, foldResource, getChainCapabilities, handle, hasErc20CanonicalNative, instancePortName, isAsErc20Chain, isContextKey, isEQCheck, isERC20Resource, isErc20AllowancePrecondition, isErc20BalancePrecondition, isFutureResourceOutput, isGTECheck, isHandlePort, isLTECheck, 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 };
2571
+ export { ARC_CHAIN_ID, ARC_NATIVE_ERC20, ARC_NATIVE_SCALE, type Amount, type AppliedGuard, AppliedGuardSchema, type ApprovalEntry, AssertedErc20BalanceGteSpecSchema, AssertedNativeBalanceGteSpecSchema, type AssertedPredicate, AssertedPredicateSchema, type AssertedPredicateWire, AssertedPredicateZod, type AssertionOwner, AssertionOwnerSchema, type AssertionSpec, AssertionSpecSchema, type AssertionSpecWire, AssertionSpecZod, type Availability, type BindValue, BindValueSchema, Bytes32HexSchema, COMPOSER_SDK_VERSION_HEADER, COMPOSE_VERSION_HEADER, CONTINUATION_COMMITMENT_OP_ID, type Call, CallCheckSpecSchema, CallSchema, type ChainCapabilities, type ComposeAction, type ComposeCompilePartialData, type ComposeCompileRequest, type ComposeCompileResult, type ComposeCompileSuccessData, type ComposeError, type ComposeErrorKind, type ComposeFee, type ComposeFill, type ComposeManifest, ComposeManifestZod, type ComposeRouteErrorKind, type ComposeRouteRequest, type ComposeRun, type ComposeTransactionRequest, type ComposeUserProgramSimulation, type ComposeVersion, type ConsumedOutput, type ContextKey, type ContinuationIntent, ContinuationIntentSchema, type ContinuationOutcome, ContinuationOutcomeSchema, type Delivery, EVMAddressString, EVM_NATIVE_SENTINEL, type Erc20AllowancePrecondition, type Erc20AllowanceRequirement, Erc20BalanceDeltaGteSpecSchema, Erc20BalanceGteSpecSchema, type Erc20BalancePrecondition, type Erc20BalanceRequirement, type Estimate, type EstimateBasis, type FailedPreparedOp, type FlashloanMaterialiserInput, type Flow, type FlowInput, FlowInputSchema, FlowSchema, type GenericComposeError, type GenericComposeErrorKind, type GuardCompatibility, GuardCompatibilityZod, type GuardSelector, GuardSelectorZod, HANDLE_UNITS, type HandleInput, HandleInputSchema, type HandlePort, HandlePortZod, type HandleUnits, HandleUnitsZod, HexStringSchema, InputPortZod, type InputSpec, IntegerString, type Lineage, LineageSchema, type LiteralBinding, LiteralBindingSchema, type ManifestGuard, ManifestGuardZod, type ManifestMaterialiser, ManifestMaterialiserZod, type ManifestOperation, ManifestOperationZod, type ManifestPrecondition, ManifestPreconditionZod, type MaterialiserConfigOf, type MaterialiserInput, type MaterialiserInputBase, type MaterialiserInputOf, type MaterialiserMetadata, type MaterialiserResolution, type Minimum, type MinimumBasis, NativeBalanceDeltaGteSpecSchema, NativeBalanceGteSpecSchema, type NativeBalancePrecondition, type NativeBalanceRequirement, type NativeCheckPolicy, type NativeErc20, type OpInputPort, type OpOutputPort, type Output, type OutputAmount, type OutputFamilyPort, OutputPortZod, type Outputs, PROVIDER_KIND, type ParsedRef, type Phase1Artifact, Phase1ArtifactSchema, type Port, type Precondition, type PreconditionBase, type PreconditionConfigOf, type PreconditionOf, type PreparationComposeError, type PriceImpact, type ProviderKindName, RESERVED_REF_SCOPES, type Ref, type RefBuilder, type RefPath, RefSchema, type RefScope, type Resource, type ResourceInput, ResourceInputSchema, type ResourceOutputPort, ResourceOutputPortZod, type ResourcePort, ResourcePortZod, ResourceSchema, type RouteAmount, type RouteAmountAll, type RouteAmountExact, SIMULATE_MAX_REQUIREMENTS, SIMULATE_MAX_TRACKED_BALANCES, STATIC_SOL_TYPES, type SettlementEscrowWire, type SettlementWire, SettlementZod, type SimulateBalanceEntry, type SimulateOkResult, type SimulateRequest, type SimulateResult, type SimulateRevertDecodeResult, type SimulateRevertResult, type SimulateSetupErrorResult, type SimulationPolicy, type SimulationRevert, type SimulationRevertComposeError, type SlotFinderRequirement, type SolType, SolTypeSchema, type SpendEntry, type StaticSolType, StaticSolTypeZod, type SweepTo, TEMPO_CHAIN_ID, TEMPO_NATIVE_ERC20, type TerminalOutput, type TrackedBalance, UuidSchema, type VerificationDescriptor, VerificationDescriptorSchema, type VerificationDescriptorWire, VerificationDescriptorZod, type VersionCompatibility, 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/dist/index.js CHANGED
@@ -329,20 +329,6 @@ var decodeNativeBalanceGte = (check, ast) => {
329
329
  return ParseResult.fail(new ParseResult.Type(ast, check, policy.reason));
330
330
  }
331
331
  };
332
- var RawCheckSchema = Schema2.Union(
333
- Erc20BalanceGteSpecSchema,
334
- NativeBalanceGteSpecSchema,
335
- CallCheckSpecSchema
336
- );
337
- var CheckSchema = Schema2.transformOrFail(
338
- RawCheckSchema,
339
- Schema2.typeSchema(RawCheckSchema),
340
- {
341
- strict: true,
342
- decode: (check, _options, ast) => check.kind === "nativeBalanceGte" ? decodeNativeBalanceGte(check, ast) : ParseResult.succeed(check),
343
- encode: (check) => ParseResult.succeed(check)
344
- }
345
- );
346
332
  var Erc20BalanceDeltaGteSpecSchema = Schema2.Struct({
347
333
  kind: Schema2.Literal("erc20BalanceDeltaGte"),
348
334
  chainId: ChainIdSchema,
@@ -363,17 +349,7 @@ var AssertionSpecSchema = Schema2.Union(
363
349
  Erc20BalanceDeltaGteSpecSchema,
364
350
  NativeBalanceDeltaGteSpecSchema
365
351
  );
366
- var ContinuationPlanSchema = Schema2.Struct({
367
- chainId: ChainIdSchema,
368
- nextFlow: FlowSchema,
369
- check: CheckSchema,
370
- validity: Schema2.Struct({ expiresAtMs: EpochMsSchema }),
371
- correlationId: Schema2.optional(Schema2.String)
372
- });
373
352
  var settledOutcome = (intent) => intent.outcomes[0];
374
- var isGTECheck = (check) => check.kind === "call" && check.comparator === "gte";
375
- var isLTECheck = (check) => check.kind === "call" && check.comparator === "lte";
376
- var isEQCheck = (check) => check.kind === "call" && check.comparator === "eq";
377
353
 
378
354
  // src/descriptor.ts
379
355
  import { ParseResult as ParseResult2, Schema as Schema3 } from "effect";
@@ -688,7 +664,6 @@ var hexBytesZod = z.string().regex(HEX_BYTES);
688
664
  var uintStringZod = z.string().refine((value) => DECIMAL_UINT.test(value) && BigInt(value) <= MAX_UINT256, {
689
665
  message: "expected a uint256 decimal integer string"
690
666
  });
691
- var epochMsZod = z.number().int().min(-MAX_DATE_MS).max(MAX_DATE_MS);
692
667
  var SolTypeZod = z.enum([
693
668
  "uint8",
694
669
  "uint16",
@@ -841,7 +816,7 @@ var assertionOwnerZod = z.union([
841
816
  evmAddressZod,
842
817
  z.enum(["escrow", "delivery"])
843
818
  ]);
844
- var CheckZod = z.discriminatedUnion("kind", [
819
+ var AssertionSpecZod = z.discriminatedUnion("kind", [
845
820
  z.object({
846
821
  kind: z.literal("erc20BalanceGte"),
847
822
  chainId: chainIdZod,
@@ -862,10 +837,7 @@ var CheckZod = z.discriminatedUnion("kind", [
862
837
  calldata: hexBytesZod,
863
838
  comparator: z.enum(["gte", "eq", "lte"]),
864
839
  value: uintStringZod
865
- })
866
- ]);
867
- var AssertionSpecZod = z.discriminatedUnion("kind", [
868
- ...CheckZod.options,
840
+ }),
869
841
  z.object({
870
842
  kind: z.literal("erc20BalanceDeltaGte"),
871
843
  chainId: z.number().int().positive(),
@@ -915,16 +887,8 @@ var VerificationDescriptorZod = z.object({
915
887
  paramsHash: z.string().regex(BYTES32_LOWER_HEX),
916
888
  assertedPredicate: z.array(AssertedPredicateZod)
917
889
  });
918
- var ContinuationPlanZod = z.object({
919
- chainId: chainIdZod,
920
- nextFlow: z.unknown(),
921
- check: CheckZod,
922
- validity: z.object({ expiresAtMs: epochMsZod }),
923
- correlationId: z.string().optional()
924
- });
925
890
  var SettlementZod = z.object({
926
- escrow: SettlementEscrowZod.optional(),
927
- continuation: ContinuationPlanZod.optional()
891
+ escrow: SettlementEscrowZod.optional()
928
892
  });
929
893
  export {
930
894
  ARC_CHAIN_ID,
@@ -945,13 +909,9 @@ export {
945
909
  CONTINUATION_COMMITMENT_OP_ID,
946
910
  CallCheckSpecSchema,
947
911
  CallSchema,
948
- CheckSchema,
949
- CheckZod,
950
912
  ComposeManifestZod,
951
913
  ContinuationIntentSchema,
952
914
  ContinuationOutcomeSchema,
953
- ContinuationPlanSchema,
954
- ContinuationPlanZod,
955
915
  EVMAddressString,
956
916
  EVM_NATIVE_SENTINEL,
957
917
  Erc20BalanceDeltaGteSpecSchema,
@@ -1019,14 +979,11 @@ export {
1019
979
  instancePortName,
1020
980
  isAsErc20Chain,
1021
981
  isContextKey,
1022
- isEQCheck,
1023
982
  isERC20Resource,
1024
983
  isErc20AllowancePrecondition,
1025
984
  isErc20BalancePrecondition,
1026
985
  isFutureResourceOutput,
1027
- isGTECheck,
1028
986
  isHandlePort,
1029
- isLTECheck,
1030
987
  isMaterialiserInput,
1031
988
  isMsgValueNative,
1032
989
  isNativeAddressForChain,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/compose-spec",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "Public wire-format types and schemas for Compose flows",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -190,9 +190,9 @@ export const foldChainCapabilities = <R>(
190
190
  * check pass 1e12 too easily. The check must be authored as
191
191
  * `erc20BalanceGte` of the facade; `reason` says so.
192
192
  *
193
- * Consumers (the `CheckSchema` / `AssertedPredicateSchema` decodes and
194
- * compose-core's derive backstop) are adapters over this result, so the unit
195
- * rule lives in one place and the fold's exhaustiveness reaches every site.
193
+ * Consumers (the `AssertedPredicateSchema` decode and compose-core's derive
194
+ * backstop) are adapters over this result, so the unit rule lives in one place
195
+ * and the fold's exhaustiveness reaches every site.
196
196
  */
197
197
  export type NativeCheckPolicy =
198
198
  | { readonly kind: 'keep' }
package/src/compile.ts CHANGED
@@ -187,10 +187,10 @@ export interface ComposeCompileSuccessData extends ComposeContinuationData {
187
187
  readonly fill?: ComposeFill;
188
188
  // The C4 verification echo, keyed by the flow node that carried the
189
189
  // commitment (the `continuation.commitment` node on a settlement
190
- // re-submission, the `continuation.settle` node on authoring-time provider
191
- // verification). Present only when the compile committed a validation
192
- // program; today at most one entry (the compiler rejects multi-node
193
- // committed verification).
190
+ // re-submission, each committing `continuation.settle` node on
191
+ // authoring-time provider verification). Present only when the compile
192
+ // committed a validation program; one entry per committing node, so a
193
+ // fan-out across committed settles carries several.
194
194
  readonly verificationByNode?: Record<string, VerificationDescriptor>;
195
195
  }
196
196
 
@@ -94,7 +94,9 @@ export const HexStringSchema = Schema.String.pipe(Schema.startsWith('0x'));
94
94
  // the funding user, so the pair identifies that user's escrow on the chain,
95
95
  // not one settlement.
96
96
  // - `token` + `amount` — the funding asset (native → `EVM_NATIVE_SENTINEL`)
97
- // and the raw amount the phase-1 funding transfer sends.
97
+ // and the raw amount the escrow was sized from. The program transfers the
98
+ // amount realised at execution, which can differ when an upstream op
99
+ // supplies the funding.
98
100
  // - `cap` — the committed funding allocation: the most a fill may spend from
99
101
  // the escrow. A balance above it stays in the escrow.
100
102
  // - `owner` — the account that controls the escrow and can sweep it.
@@ -140,10 +142,9 @@ export const Phase1ArtifactSchema = Schema.Union(
140
142
  Schema.Struct({ kind: Schema.Literal('none') }),
141
143
  );
142
144
 
143
- // A readiness predicate evaluated against on-chain state. It is both a
144
- // client-pollable check ("is the second leg ready yet?") and an on-chain
145
- // assertion compiled into the second leg, so a premature re-submission reverts
146
- // safely. Amounts are decimal strings on the wire because JSON has no bigint.
145
+ // The absolute assertion members of `AssertionSpec` below: each is a predicate
146
+ // over on-chain state that a derived validation program enforces. Amounts are
147
+ // decimal strings on the wire because JSON has no bigint.
147
148
  //
148
149
  // - `erc20BalanceGte` — `owner`'s balance of `token` on `chainId` is at least
149
150
  // `minAmount`.
@@ -162,21 +163,18 @@ export const Phase1ArtifactSchema = Schema.Union(
162
163
  // hex; the two symbolic owners `"escrow"` / `"delivery"` are resolved to
163
164
  // validator-injected register handles at settlement time (see the
164
165
  // verified-continuations derivation). This widening applies ONLY to the
165
- // derivation-only delta members below — never to the wire `Check` members. A
166
- // readiness `Check` is authored/re-submitted through `/compose` and its owner
167
- // has no injected slot, so a symbolic owner there cannot be resolved (it would
168
- // throw at lowering); keeping `Check` owners hex-only rejects such a value
169
- // cleanly at validation instead.
166
+ // derivation-only delta members below — never to the three absolute members,
167
+ // whose owner is always a concrete address once an invariant is captured.
170
168
  export const AssertionOwnerSchema = Schema.Union(
171
169
  EVMAddressString,
172
170
  Schema.Literal('escrow', 'delivery'),
173
171
  );
174
172
  export type AssertionOwner = typeof AssertionOwnerSchema.Type;
175
173
 
176
- // The three `CheckSchema` members are exported by name so the derivation
177
- // (`AssertionSpec`) can reuse them without re-declaring their shape. Their
178
- // `owner` is hex-only: a captured invariant always resolves to a concrete
179
- // address, and a readiness `Check` never carries a symbolic owner.
174
+ // The three absolute members are exported by name so `AssertionSpecSchema` and
175
+ // the descriptor's predicate union can reuse them without re-declaring their
176
+ // shape. Their `owner` is hex-only: a captured invariant always resolves to a
177
+ // concrete address.
180
178
  export const Erc20BalanceGteSpecSchema = Schema.Struct({
181
179
  kind: Schema.Literal('erc20BalanceGte'),
182
180
  chainId: ChainIdSchema,
@@ -201,9 +199,9 @@ export const CallCheckSpecSchema = Schema.Struct({
201
199
  value: IntegerString,
202
200
  });
203
201
 
204
- // The shape shared by the wire `nativeBalanceGte` check and the descriptor's
205
- // symbolic-owner variant. `owner` is `string` for both (`AssertionOwnerSchema.Type`
206
- // collapses to `string`).
202
+ // The shape shared by the hex-owner `nativeBalanceGte` spec and the
203
+ // descriptor's symbolic-owner variant. `owner` is `string` for both
204
+ // (`AssertionOwnerSchema.Type` collapses to `string`).
207
205
  interface NativeBalanceGteLike {
208
206
  readonly kind: 'nativeBalanceGte';
209
207
  readonly chainId: number;
@@ -228,10 +226,9 @@ const asErc20BalanceGteCheck = (
228
226
  // Decode adapter over `nativeCheckPolicy` (`chainCapabilities.ts` holds the
229
227
  // unit reasoning): a `nativeBalanceGte` check is kept on an evm-native chain,
230
228
  // rewritten to `erc20BalanceGte` of the stand-in ERC-20 on an `as-erc20`
231
- // chain, and rejected on a `native-mirrored-erc20` chain. Shared by
232
- // `CheckSchema` and the descriptor's `AssertedPredicateSchema` so the
233
- // readiness capture and the committed re-assertion derive the same program
234
- // (authoring↔settlement hash parity).
229
+ // chain, and rejected on a `native-mirrored-erc20` chain. Used by the
230
+ // descriptor's `AssertedPredicateSchema` so the disclosed and the committed
231
+ // predicate derive the same program (authoring↔settlement hash parity).
235
232
  export const decodeNativeBalanceGte = <C extends NativeBalanceGteLike>(
236
233
  check: C,
237
234
  ast: SchemaAST.AST,
@@ -250,34 +247,11 @@ export const decodeNativeBalanceGte = <C extends NativeBalanceGteLike>(
250
247
  }
251
248
  };
252
249
 
253
- // The pre-transform union of the three named members.
254
- const RawCheckSchema = Schema.Union(
255
- Erc20BalanceGteSpecSchema,
256
- NativeBalanceGteSpecSchema,
257
- CallCheckSpecSchema,
258
- );
259
-
260
- // Only `nativeBalanceGte` is touched (via `decodeNativeBalanceGte`); every
261
- // other member decodes unchanged. Encode is the identity.
262
- export const CheckSchema = Schema.transformOrFail(
263
- RawCheckSchema,
264
- Schema.typeSchema(RawCheckSchema),
265
- {
266
- strict: true,
267
- decode: (check, _options, ast) =>
268
- check.kind === 'nativeBalanceGte'
269
- ? decodeNativeBalanceGte(check, ast)
270
- : ParseResult.succeed(check),
271
- encode: (check) => ParseResult.succeed(check),
272
- },
273
- );
274
-
275
250
  // The derivation vocabulary (verified continuations, plan GD-1). An
276
251
  // `AssertionSpec` is the structured, backend-neutral form of one invariant a
277
252
  // derived validation program must enforce against the executor's re-quoted
278
- // fill. It extends the three `Check` members (reused verbatim) with two
279
- // derivation-only members. Amounts stay decimal strings on the wire, mirroring
280
- // `Check`.
253
+ // fill. It extends the three absolute members above (reused verbatim) with two
254
+ // derivation-only members. Amounts stay decimal strings on the wire.
281
255
  //
282
256
  // - `erc20BalanceDeltaGte` / `nativeBalanceDeltaGte` — `owner`'s post-fill
283
257
  // balance of `token` (native) on `chainId` must exceed its pre-fill balance
@@ -307,27 +281,10 @@ export const AssertionSpecSchema = Schema.Union(
307
281
  NativeBalanceDeltaGteSpecSchema,
308
282
  );
309
283
 
310
- // The continuation plan returned to the caller for a self-serve (manual-relay)
311
- // settle node: the next Flow to run plus a readiness `check`. The caller polls
312
- // the `check`, then re-submits `nextFlow` through the normal `/compose`
313
- // pipeline once it passes. The `check` is also embedded into `nextFlow` as an
314
- // on-chain assertion, so a premature re-submission reverts instead of executing
315
- // on stale balances. `FlowSchema` lives in the same package, so importing it
316
- // here keeps `compose-spec` dependency-free.
317
- export const ContinuationPlanSchema = Schema.Struct({
318
- chainId: ChainIdSchema,
319
- nextFlow: FlowSchema,
320
- check: CheckSchema,
321
- validity: Schema.Struct({ expiresAtMs: EpochMsSchema }),
322
- correlationId: Schema.optional(Schema.String),
323
- });
324
-
325
284
  export type ContinuationOutcome = typeof ContinuationOutcomeSchema.Type;
326
285
  export type ContinuationIntent = typeof ContinuationIntentSchema.Type;
327
286
  export type Phase1Artifact = typeof Phase1ArtifactSchema.Type;
328
- export type Check = typeof CheckSchema.Type;
329
287
  export type AssertionSpec = typeof AssertionSpecSchema.Type;
330
- export type ContinuationPlan = typeof ContinuationPlanSchema.Type;
331
288
 
332
289
  // The outcome a `continuation.settle` node's single `output` port stands for.
333
290
  // The wire format admits several outcomes, but the op produces one resource,
@@ -338,17 +295,3 @@ export type ContinuationPlan = typeof ContinuationPlanSchema.Type;
338
295
  export const settledOutcome = (
339
296
  intent: ContinuationIntent,
340
297
  ): ContinuationOutcome => intent.outcomes[0];
341
-
342
- // The comparison operator carried by a `call` check. Mirrors the inline
343
- // `comparator` literal on the `call` member of `RawCheckSchema` above.
344
- export type CheckComparator = 'gte' | 'eq' | 'lte';
345
-
346
- // Comparator predicates for `call` checks, matching the package's `is*`
347
- // convention (see `flow.ts`). Each is only true for a `call` check with the
348
- // corresponding comparator; the other check kinds carry no comparator.
349
- export const isGTECheck = (check: Check): boolean =>
350
- check.kind === 'call' && check.comparator === 'gte';
351
- export const isLTECheck = (check: Check): boolean =>
352
- check.kind === 'call' && check.comparator === 'lte';
353
- export const isEQCheck = (check: Check): boolean =>
354
- check.kind === 'call' && check.comparator === 'eq';