@lifi/compose-spec 0.13.0 → 0.14.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 +5 -0
- package/dist/index.d.cts +28 -21
- package/dist/index.d.ts +28 -21
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/src/flow.ts +5 -1
- package/src/index.ts +2 -0
- package/src/zodSchemas.ts +11 -0
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
|
@@ -589,16 +589,16 @@ 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: "
|
|
592
|
+
readonly kind: "nativeBalanceGte";
|
|
593
593
|
readonly chainId: number;
|
|
594
|
-
readonly token: string;
|
|
595
|
-
readonly owner: string;
|
|
596
594
|
readonly minAmount: string;
|
|
595
|
+
readonly owner: string;
|
|
597
596
|
} | {
|
|
598
|
-
readonly kind: "
|
|
597
|
+
readonly kind: "erc20BalanceGte";
|
|
599
598
|
readonly chainId: number;
|
|
600
|
-
readonly
|
|
599
|
+
readonly token: string;
|
|
601
600
|
readonly minAmount: string;
|
|
601
|
+
readonly owner: string;
|
|
602
602
|
} | {
|
|
603
603
|
readonly kind: "call";
|
|
604
604
|
readonly chainId: number;
|
|
@@ -608,16 +608,16 @@ export declare const AssertedPredicateSchema: Schema.transformOrFail<Schema.Unio
|
|
|
608
608
|
readonly comparator: "gte" | "eq" | "lte";
|
|
609
609
|
readonly threshold: string;
|
|
610
610
|
}, {
|
|
611
|
-
readonly kind: "
|
|
611
|
+
readonly kind: "nativeBalanceGte";
|
|
612
612
|
readonly chainId: number;
|
|
613
|
-
readonly token: string;
|
|
614
|
-
readonly owner: string;
|
|
615
613
|
readonly minAmount: string;
|
|
614
|
+
readonly owner: string;
|
|
616
615
|
} | {
|
|
617
|
-
readonly kind: "
|
|
616
|
+
readonly kind: "erc20BalanceGte";
|
|
618
617
|
readonly chainId: number;
|
|
619
|
-
readonly
|
|
618
|
+
readonly token: string;
|
|
620
619
|
readonly minAmount: string;
|
|
620
|
+
readonly owner: string;
|
|
621
621
|
} | {
|
|
622
622
|
readonly kind: "call";
|
|
623
623
|
readonly chainId: number;
|
|
@@ -650,16 +650,16 @@ 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: "
|
|
653
|
+
readonly kind: "nativeBalanceGte";
|
|
654
654
|
readonly chainId: number;
|
|
655
|
-
readonly token: string;
|
|
656
|
-
readonly owner: string;
|
|
657
655
|
readonly minAmount: string;
|
|
656
|
+
readonly owner: string;
|
|
658
657
|
} | {
|
|
659
|
-
readonly kind: "
|
|
658
|
+
readonly kind: "erc20BalanceGte";
|
|
660
659
|
readonly chainId: number;
|
|
661
|
-
readonly
|
|
660
|
+
readonly token: string;
|
|
662
661
|
readonly minAmount: string;
|
|
662
|
+
readonly owner: string;
|
|
663
663
|
} | {
|
|
664
664
|
readonly kind: "call";
|
|
665
665
|
readonly chainId: number;
|
|
@@ -669,16 +669,16 @@ export declare const VerificationDescriptorSchema: Schema.Struct<{
|
|
|
669
669
|
readonly comparator: "gte" | "eq" | "lte";
|
|
670
670
|
readonly threshold: string;
|
|
671
671
|
}, {
|
|
672
|
-
readonly kind: "
|
|
672
|
+
readonly kind: "nativeBalanceGte";
|
|
673
673
|
readonly chainId: number;
|
|
674
|
-
readonly token: string;
|
|
675
|
-
readonly owner: string;
|
|
676
674
|
readonly minAmount: string;
|
|
675
|
+
readonly owner: string;
|
|
677
676
|
} | {
|
|
678
|
-
readonly kind: "
|
|
677
|
+
readonly kind: "erc20BalanceGte";
|
|
679
678
|
readonly chainId: number;
|
|
680
|
-
readonly
|
|
679
|
+
readonly token: string;
|
|
681
680
|
readonly minAmount: string;
|
|
681
|
+
readonly owner: string;
|
|
682
682
|
} | {
|
|
683
683
|
readonly kind: "call";
|
|
684
684
|
readonly chainId: number;
|
|
@@ -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
|
@@ -589,16 +589,16 @@ 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: "
|
|
592
|
+
readonly kind: "nativeBalanceGte";
|
|
593
593
|
readonly chainId: number;
|
|
594
|
-
readonly token: string;
|
|
595
|
-
readonly owner: string;
|
|
596
594
|
readonly minAmount: string;
|
|
595
|
+
readonly owner: string;
|
|
597
596
|
} | {
|
|
598
|
-
readonly kind: "
|
|
597
|
+
readonly kind: "erc20BalanceGte";
|
|
599
598
|
readonly chainId: number;
|
|
600
|
-
readonly
|
|
599
|
+
readonly token: string;
|
|
601
600
|
readonly minAmount: string;
|
|
601
|
+
readonly owner: string;
|
|
602
602
|
} | {
|
|
603
603
|
readonly kind: "call";
|
|
604
604
|
readonly chainId: number;
|
|
@@ -608,16 +608,16 @@ export declare const AssertedPredicateSchema: Schema.transformOrFail<Schema.Unio
|
|
|
608
608
|
readonly comparator: "gte" | "eq" | "lte";
|
|
609
609
|
readonly threshold: string;
|
|
610
610
|
}, {
|
|
611
|
-
readonly kind: "
|
|
611
|
+
readonly kind: "nativeBalanceGte";
|
|
612
612
|
readonly chainId: number;
|
|
613
|
-
readonly token: string;
|
|
614
|
-
readonly owner: string;
|
|
615
613
|
readonly minAmount: string;
|
|
614
|
+
readonly owner: string;
|
|
616
615
|
} | {
|
|
617
|
-
readonly kind: "
|
|
616
|
+
readonly kind: "erc20BalanceGte";
|
|
618
617
|
readonly chainId: number;
|
|
619
|
-
readonly
|
|
618
|
+
readonly token: string;
|
|
620
619
|
readonly minAmount: string;
|
|
620
|
+
readonly owner: string;
|
|
621
621
|
} | {
|
|
622
622
|
readonly kind: "call";
|
|
623
623
|
readonly chainId: number;
|
|
@@ -650,16 +650,16 @@ 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: "
|
|
653
|
+
readonly kind: "nativeBalanceGte";
|
|
654
654
|
readonly chainId: number;
|
|
655
|
-
readonly token: string;
|
|
656
|
-
readonly owner: string;
|
|
657
655
|
readonly minAmount: string;
|
|
656
|
+
readonly owner: string;
|
|
658
657
|
} | {
|
|
659
|
-
readonly kind: "
|
|
658
|
+
readonly kind: "erc20BalanceGte";
|
|
660
659
|
readonly chainId: number;
|
|
661
|
-
readonly
|
|
660
|
+
readonly token: string;
|
|
662
661
|
readonly minAmount: string;
|
|
662
|
+
readonly owner: string;
|
|
663
663
|
} | {
|
|
664
664
|
readonly kind: "call";
|
|
665
665
|
readonly chainId: number;
|
|
@@ -669,16 +669,16 @@ export declare const VerificationDescriptorSchema: Schema.Struct<{
|
|
|
669
669
|
readonly comparator: "gte" | "eq" | "lte";
|
|
670
670
|
readonly threshold: string;
|
|
671
671
|
}, {
|
|
672
|
-
readonly kind: "
|
|
672
|
+
readonly kind: "nativeBalanceGte";
|
|
673
673
|
readonly chainId: number;
|
|
674
|
-
readonly token: string;
|
|
675
|
-
readonly owner: string;
|
|
676
674
|
readonly minAmount: string;
|
|
675
|
+
readonly owner: string;
|
|
677
676
|
} | {
|
|
678
|
-
readonly kind: "
|
|
677
|
+
readonly kind: "erc20BalanceGte";
|
|
679
678
|
readonly chainId: number;
|
|
680
|
-
readonly
|
|
679
|
+
readonly token: string;
|
|
681
680
|
readonly minAmount: string;
|
|
681
|
+
readonly owner: string;
|
|
682
682
|
} | {
|
|
683
683
|
readonly kind: "call";
|
|
684
684
|
readonly chainId: number;
|
|
@@ -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
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>;
|