@lifi/composer-sdk 0.2.0-staging.3 → 0.2.0-staging.5
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/authoring/handles.cjs.map +1 -1
- package/dist/authoring/handles.d.cts +13 -6
- package/dist/authoring/handles.d.ts +13 -6
- package/dist/authoring/handles.js.map +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/generated/config.generated.cjs.map +1 -1
- package/dist/generated/config.generated.d.cts +39 -1
- package/dist/generated/config.generated.d.ts +39 -1
- package/dist/generated/operations.generated.cjs +55 -1
- package/dist/generated/operations.generated.cjs.map +1 -1
- package/dist/generated/operations.generated.d.cts +204 -2
- package/dist/generated/operations.generated.d.ts +204 -2
- package/dist/generated/operations.generated.js +55 -1
- package/dist/generated/operations.generated.js.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +3 -4
- package/src/authoring/handles.ts +19 -10
- package/src/examples/aaveRepay.ts +55 -16
- package/src/examples/aaveRepayWithATokens.ts +41 -30
- package/src/examples/aaveRounding.ts +42 -0
- package/src/examples/aaveSetEMode.ts +0 -1
- package/src/examples/config.ts +1 -1
- package/src/examples/emitCustomEvent.ts +75 -0
- package/src/examples/invariantChecks.ts +96 -0
- package/src/examples/run.ts +20 -18
- package/src/examples/staged/aaveBorrow.ts +128 -0
- package/src/examples/staged/aaveDebtRebalanceExactOut.ts +301 -0
- package/src/examples/staged/aaveHealthFactorExplode.ts +70 -0
- package/src/examples/staged/aaveToMorphoDebtMigration.ts +200 -0
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwap.ts +231 -0
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwapExactOut.ts +307 -0
- package/src/examples/staged/flashloanRepay.ts +142 -0
- package/src/examples/staged/morphoBlueBorrow.ts +93 -0
- package/src/examples/staged/morphoBlueRepay.ts +132 -0
- package/src/examples/staged/registry.ts +80 -0
- package/src/examples/untypedOpWithTypedRef.ts +26 -20
- package/src/generated/config.generated.ts +50 -0
- package/src/generated/operations.generated.ts +330 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/authoring/handles.ts"],"sourcesContent":["import type { Resource } from '@lifi/compose-spec';\n\nimport type { OutputKind, TypedRef } from '../types.js';\n\n/**\n * A handle referencing a flow input declared in the flow's input schema.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface InputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'input';\n readonly inputName: string;\n readonly __outputKind?: T;\n}\n\n/**\n * An input handle for a resource (token) input, carrying the resource\n * declaration alongside the reference.\n */\nexport interface ResourceInputHandle extends InputHandle<'resource'> {\n readonly resource: Resource;\n}\n\n/**\n * A handle referencing an output port of a previously declared operation node.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface OutputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'output';\n readonly nodeId: string;\n readonly portName: string;\n readonly __outputKind?: T;\n}\n\n/** Discriminated union of all handle types that can be bound to operation arguments. */\nexport type AnyHandle = InputHandle | OutputHandle;\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link InputHandle}. */\nexport const isInputHandle = (h: AnyHandle): h is InputHandle =>\n h._tag === 'input';\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link OutputHandle}. */\nexport const isOutputHandle = (h: AnyHandle): h is OutputHandle =>\n h._tag === 'output';\n\n/**\n * Converts a handle to a JSON `$ref` pointer used in the flow document.\n * Input handles become `\"input.<name>\"`; output handles become `\"<nodeId>.<port>\"`.\n */\nexport const handleToRef = (h: AnyHandle): { $ref: string } => {\n if (h._tag === 'input') {\n if (!h.inputName) throw new Error('InputHandle has empty inputName');\n return { $ref: `input.${h.inputName}` };\n }\n if (!h.nodeId) throw new Error('OutputHandle has empty nodeId');\n if (!h.portName) throw new Error('OutputHandle has empty portName');\n return { $ref: `${h.nodeId}.${h.portName}` };\n};\n\n/**\n * For a bind slot expecting type T,
|
|
1
|
+
{"version":3,"sources":["../../src/authoring/handles.ts"],"sourcesContent":["import type { Resource, StaticSolType } from '@lifi/compose-spec';\n\nimport type { OutputKind, TypedRef } from '../types.js';\n\n/**\n * A handle referencing a flow input declared in the flow's input schema.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface InputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'input';\n readonly inputName: string;\n readonly __outputKind?: T;\n}\n\n/**\n * An input handle for a resource (token) input, carrying the resource\n * declaration alongside the reference.\n */\nexport interface ResourceInputHandle extends InputHandle<'resource'> {\n readonly resource: Resource;\n}\n\n/**\n * A handle referencing an output port of a previously declared operation node.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface OutputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'output';\n readonly nodeId: string;\n readonly portName: string;\n readonly __outputKind?: T;\n}\n\n/** Discriminated union of all handle types that can be bound to operation arguments. */\nexport type AnyHandle = InputHandle | OutputHandle;\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link InputHandle}. */\nexport const isInputHandle = (h: AnyHandle): h is InputHandle =>\n h._tag === 'input';\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link OutputHandle}. */\nexport const isOutputHandle = (h: AnyHandle): h is OutputHandle =>\n h._tag === 'output';\n\n/**\n * Converts a handle to a JSON `$ref` pointer used in the flow document.\n * Input handles become `\"input.<name>\"`; output handles become `\"<nodeId>.<port>\"`.\n */\nexport const handleToRef = (h: AnyHandle): { $ref: string } => {\n if (h._tag === 'input') {\n if (!h.inputName) throw new Error('InputHandle has empty inputName');\n return { $ref: `input.${h.inputName}` };\n }\n if (!h.nodeId) throw new Error('OutputHandle has empty nodeId');\n if (!h.portName) throw new Error('OutputHandle has empty portName');\n return { $ref: `${h.nodeId}.${h.portName}` };\n};\n\n/**\n * For a bind slot expecting type T, widen the set of accepted handle types:\n * - `'bytes32'` is the raw 32-byte word type: accept any static-32-byte handle\n * (`uint256`/`uintN`/`address`/`bool`/`bytes32`) plus `'resource'` (a uint256\n * amount). At the IR1 boundary every value is a type-erased word, so any\n * static-32-byte handle is a sound bind for a `bytes32` payload port.\n * - `'uint256'` keeps its existing widening to also accept `'resource'`-tagged\n * handles (resources are uint256 amounts).\n * - every other type keeps exact-SolType matching.\n */\ntype SlotAssignable<T extends OutputKind> = T extends 'bytes32'\n ? StaticSolType | 'resource'\n : T extends 'uint256'\n ? T | 'resource'\n : T;\n\n/**\n * The set of values accepted by a typed bind slot.\n * - `OutputHandle<T>` / `InputHandle<T>` (same type)\n * - For `'uint256'` slots, also `'resource'`-tagged handles\n * - For `'bytes32'` slots, any static-32-byte handle (and `'resource'`)\n * - `TypedRef<T>` (typed context refs, subject to `SlotAssignable`)\n *\n * Plain `{ $ref: '...' }` objects are **not** accepted — use `raw.ref<T>()`\n * to create a typed ref when you need to reference a raw path.\n */\nexport type Bindable<T extends OutputKind> =\n | OutputHandle<SlotAssignable<T>>\n | InputHandle<SlotAssignable<T>>\n | TypedRef<SlotAssignable<T>>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCO,MAAM,gBAAgB,CAAC,MAC5B,EAAE,SAAS;AAGN,MAAM,iBAAiB,CAAC,MAC7B,EAAE,SAAS;AAMN,MAAM,cAAc,CAAC,MAAmC;AAC7D,MAAI,EAAE,SAAS,SAAS;AACtB,QAAI,CAAC,EAAE,UAAW,OAAM,IAAI,MAAM,iCAAiC;AACnE,WAAO,EAAE,MAAM,SAAS,EAAE,SAAS,GAAG;AAAA,EACxC;AACA,MAAI,CAAC,EAAE,OAAQ,OAAM,IAAI,MAAM,+BAA+B;AAC9D,MAAI,CAAC,EAAE,SAAU,OAAM,IAAI,MAAM,iCAAiC;AAClE,SAAO,EAAE,MAAM,GAAG,EAAE,MAAM,IAAI,EAAE,QAAQ,GAAG;AAC7C;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Resource } from '@lifi/compose-spec';
|
|
1
|
+
import { StaticSolType, Resource } from '@lifi/compose-spec';
|
|
2
2
|
import { OutputKind, TypedRef } from '../types.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -43,19 +43,26 @@ declare const handleToRef: (h: AnyHandle) => {
|
|
|
43
43
|
$ref: string;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
|
-
* For a bind slot expecting type T,
|
|
47
|
-
*
|
|
46
|
+
* For a bind slot expecting type T, widen the set of accepted handle types:
|
|
47
|
+
* - `'bytes32'` is the raw 32-byte word type: accept any static-32-byte handle
|
|
48
|
+
* (`uint256`/`uintN`/`address`/`bool`/`bytes32`) plus `'resource'` (a uint256
|
|
49
|
+
* amount). At the IR1 boundary every value is a type-erased word, so any
|
|
50
|
+
* static-32-byte handle is a sound bind for a `bytes32` payload port.
|
|
51
|
+
* - `'uint256'` keeps its existing widening to also accept `'resource'`-tagged
|
|
52
|
+
* handles (resources are uint256 amounts).
|
|
53
|
+
* - every other type keeps exact-SolType matching.
|
|
48
54
|
*/
|
|
49
|
-
type
|
|
55
|
+
type SlotAssignable<T extends OutputKind> = T extends 'bytes32' ? StaticSolType | 'resource' : T extends 'uint256' ? T | 'resource' : T;
|
|
50
56
|
/**
|
|
51
57
|
* The set of values accepted by a typed bind slot.
|
|
52
58
|
* - `OutputHandle<T>` / `InputHandle<T>` (same type)
|
|
53
59
|
* - For `'uint256'` slots, also `'resource'`-tagged handles
|
|
54
|
-
* - `
|
|
60
|
+
* - For `'bytes32'` slots, any static-32-byte handle (and `'resource'`)
|
|
61
|
+
* - `TypedRef<T>` (typed context refs, subject to `SlotAssignable`)
|
|
55
62
|
*
|
|
56
63
|
* Plain `{ $ref: '...' }` objects are **not** accepted — use `raw.ref<T>()`
|
|
57
64
|
* to create a typed ref when you need to reference a raw path.
|
|
58
65
|
*/
|
|
59
|
-
type Bindable<T extends OutputKind> = OutputHandle<
|
|
66
|
+
type Bindable<T extends OutputKind> = OutputHandle<SlotAssignable<T>> | InputHandle<SlotAssignable<T>> | TypedRef<SlotAssignable<T>>;
|
|
60
67
|
|
|
61
68
|
export { type AnyHandle, type Bindable, type InputHandle, type OutputHandle, type ResourceInputHandle, handleToRef, isInputHandle, isOutputHandle };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Resource } from '@lifi/compose-spec';
|
|
1
|
+
import { StaticSolType, Resource } from '@lifi/compose-spec';
|
|
2
2
|
import { OutputKind, TypedRef } from '../types.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -43,19 +43,26 @@ declare const handleToRef: (h: AnyHandle) => {
|
|
|
43
43
|
$ref: string;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
|
-
* For a bind slot expecting type T,
|
|
47
|
-
*
|
|
46
|
+
* For a bind slot expecting type T, widen the set of accepted handle types:
|
|
47
|
+
* - `'bytes32'` is the raw 32-byte word type: accept any static-32-byte handle
|
|
48
|
+
* (`uint256`/`uintN`/`address`/`bool`/`bytes32`) plus `'resource'` (a uint256
|
|
49
|
+
* amount). At the IR1 boundary every value is a type-erased word, so any
|
|
50
|
+
* static-32-byte handle is a sound bind for a `bytes32` payload port.
|
|
51
|
+
* - `'uint256'` keeps its existing widening to also accept `'resource'`-tagged
|
|
52
|
+
* handles (resources are uint256 amounts).
|
|
53
|
+
* - every other type keeps exact-SolType matching.
|
|
48
54
|
*/
|
|
49
|
-
type
|
|
55
|
+
type SlotAssignable<T extends OutputKind> = T extends 'bytes32' ? StaticSolType | 'resource' : T extends 'uint256' ? T | 'resource' : T;
|
|
50
56
|
/**
|
|
51
57
|
* The set of values accepted by a typed bind slot.
|
|
52
58
|
* - `OutputHandle<T>` / `InputHandle<T>` (same type)
|
|
53
59
|
* - For `'uint256'` slots, also `'resource'`-tagged handles
|
|
54
|
-
* - `
|
|
60
|
+
* - For `'bytes32'` slots, any static-32-byte handle (and `'resource'`)
|
|
61
|
+
* - `TypedRef<T>` (typed context refs, subject to `SlotAssignable`)
|
|
55
62
|
*
|
|
56
63
|
* Plain `{ $ref: '...' }` objects are **not** accepted — use `raw.ref<T>()`
|
|
57
64
|
* to create a typed ref when you need to reference a raw path.
|
|
58
65
|
*/
|
|
59
|
-
type Bindable<T extends OutputKind> = OutputHandle<
|
|
66
|
+
type Bindable<T extends OutputKind> = OutputHandle<SlotAssignable<T>> | InputHandle<SlotAssignable<T>> | TypedRef<SlotAssignable<T>>;
|
|
60
67
|
|
|
61
68
|
export { type AnyHandle, type Bindable, type InputHandle, type OutputHandle, type ResourceInputHandle, handleToRef, isInputHandle, isOutputHandle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/authoring/handles.ts"],"sourcesContent":["import type { Resource } from '@lifi/compose-spec';\n\nimport type { OutputKind, TypedRef } from '../types.js';\n\n/**\n * A handle referencing a flow input declared in the flow's input schema.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface InputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'input';\n readonly inputName: string;\n readonly __outputKind?: T;\n}\n\n/**\n * An input handle for a resource (token) input, carrying the resource\n * declaration alongside the reference.\n */\nexport interface ResourceInputHandle extends InputHandle<'resource'> {\n readonly resource: Resource;\n}\n\n/**\n * A handle referencing an output port of a previously declared operation node.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface OutputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'output';\n readonly nodeId: string;\n readonly portName: string;\n readonly __outputKind?: T;\n}\n\n/** Discriminated union of all handle types that can be bound to operation arguments. */\nexport type AnyHandle = InputHandle | OutputHandle;\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link InputHandle}. */\nexport const isInputHandle = (h: AnyHandle): h is InputHandle =>\n h._tag === 'input';\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link OutputHandle}. */\nexport const isOutputHandle = (h: AnyHandle): h is OutputHandle =>\n h._tag === 'output';\n\n/**\n * Converts a handle to a JSON `$ref` pointer used in the flow document.\n * Input handles become `\"input.<name>\"`; output handles become `\"<nodeId>.<port>\"`.\n */\nexport const handleToRef = (h: AnyHandle): { $ref: string } => {\n if (h._tag === 'input') {\n if (!h.inputName) throw new Error('InputHandle has empty inputName');\n return { $ref: `input.${h.inputName}` };\n }\n if (!h.nodeId) throw new Error('OutputHandle has empty nodeId');\n if (!h.portName) throw new Error('OutputHandle has empty portName');\n return { $ref: `${h.nodeId}.${h.portName}` };\n};\n\n/**\n * For a bind slot expecting type T,
|
|
1
|
+
{"version":3,"sources":["../../src/authoring/handles.ts"],"sourcesContent":["import type { Resource, StaticSolType } from '@lifi/compose-spec';\n\nimport type { OutputKind, TypedRef } from '../types.js';\n\n/**\n * A handle referencing a flow input declared in the flow's input schema.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface InputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'input';\n readonly inputName: string;\n readonly __outputKind?: T;\n}\n\n/**\n * An input handle for a resource (token) input, carrying the resource\n * declaration alongside the reference.\n */\nexport interface ResourceInputHandle extends InputHandle<'resource'> {\n readonly resource: Resource;\n}\n\n/**\n * A handle referencing an output port of a previously declared operation node.\n * The phantom `__outputKind` field carries the type parameter through\n * TypeScript's structural type system without affecting runtime shape.\n */\nexport interface OutputHandle<T extends OutputKind = OutputKind> {\n readonly _tag: 'output';\n readonly nodeId: string;\n readonly portName: string;\n readonly __outputKind?: T;\n}\n\n/** Discriminated union of all handle types that can be bound to operation arguments. */\nexport type AnyHandle = InputHandle | OutputHandle;\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link InputHandle}. */\nexport const isInputHandle = (h: AnyHandle): h is InputHandle =>\n h._tag === 'input';\n\n/** Type guard that narrows an {@link AnyHandle} to an {@link OutputHandle}. */\nexport const isOutputHandle = (h: AnyHandle): h is OutputHandle =>\n h._tag === 'output';\n\n/**\n * Converts a handle to a JSON `$ref` pointer used in the flow document.\n * Input handles become `\"input.<name>\"`; output handles become `\"<nodeId>.<port>\"`.\n */\nexport const handleToRef = (h: AnyHandle): { $ref: string } => {\n if (h._tag === 'input') {\n if (!h.inputName) throw new Error('InputHandle has empty inputName');\n return { $ref: `input.${h.inputName}` };\n }\n if (!h.nodeId) throw new Error('OutputHandle has empty nodeId');\n if (!h.portName) throw new Error('OutputHandle has empty portName');\n return { $ref: `${h.nodeId}.${h.portName}` };\n};\n\n/**\n * For a bind slot expecting type T, widen the set of accepted handle types:\n * - `'bytes32'` is the raw 32-byte word type: accept any static-32-byte handle\n * (`uint256`/`uintN`/`address`/`bool`/`bytes32`) plus `'resource'` (a uint256\n * amount). At the IR1 boundary every value is a type-erased word, so any\n * static-32-byte handle is a sound bind for a `bytes32` payload port.\n * - `'uint256'` keeps its existing widening to also accept `'resource'`-tagged\n * handles (resources are uint256 amounts).\n * - every other type keeps exact-SolType matching.\n */\ntype SlotAssignable<T extends OutputKind> = T extends 'bytes32'\n ? StaticSolType | 'resource'\n : T extends 'uint256'\n ? T | 'resource'\n : T;\n\n/**\n * The set of values accepted by a typed bind slot.\n * - `OutputHandle<T>` / `InputHandle<T>` (same type)\n * - For `'uint256'` slots, also `'resource'`-tagged handles\n * - For `'bytes32'` slots, any static-32-byte handle (and `'resource'`)\n * - `TypedRef<T>` (typed context refs, subject to `SlotAssignable`)\n *\n * Plain `{ $ref: '...' }` objects are **not** accepted — use `raw.ref<T>()`\n * to create a typed ref when you need to reference a raw path.\n */\nexport type Bindable<T extends OutputKind> =\n | OutputHandle<SlotAssignable<T>>\n | InputHandle<SlotAssignable<T>>\n | TypedRef<SlotAssignable<T>>;\n"],"mappings":"AAuCO,MAAM,gBAAgB,CAAC,MAC5B,EAAE,SAAS;AAGN,MAAM,iBAAiB,CAAC,MAC7B,EAAE,SAAS;AAMN,MAAM,cAAc,CAAC,MAAmC;AAC7D,MAAI,EAAE,SAAS,SAAS;AACtB,QAAI,CAAC,EAAE,UAAW,OAAM,IAAI,MAAM,iCAAiC;AACnE,WAAO,EAAE,MAAM,SAAS,EAAE,SAAS,GAAG;AAAA,EACxC;AACA,MAAI,CAAC,EAAE,OAAQ,OAAM,IAAI,MAAM,+BAA+B;AAC9D,MAAI,CAAC,EAAE,SAAU,OAAM,IAAI,MAAM,iCAAiC;AAClE,SAAO,EAAE,MAAM,GAAG,EAAE,MAAM,IAAI,EAAE,QAAQ,GAAG;AAC7C;","names":[]}
|
package/dist/client.cjs
CHANGED
|
@@ -22,7 +22,7 @@ __export(client_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(client_exports);
|
|
24
24
|
var import_errors = require("./errors.js");
|
|
25
|
-
const SDK_VERSION = true ? "0.2.0-staging.
|
|
25
|
+
const SDK_VERSION = true ? "0.2.0-staging.5" : "dev";
|
|
26
26
|
const bigintReplacer = (_key, value) => typeof value === "bigint" ? value.toString() : value;
|
|
27
27
|
const isNonNullObject = (v) => typeof v === "object" && v !== null;
|
|
28
28
|
const parseBody = async (res, url) => {
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComposeError, errorFromHttpResponse } from "./errors.js";
|
|
2
|
-
const SDK_VERSION = true ? "0.2.0-staging.
|
|
2
|
+
const SDK_VERSION = true ? "0.2.0-staging.5" : "dev";
|
|
3
3
|
const bigintReplacer = (_key, value) => typeof value === "bigint" ? value.toString() : value;
|
|
4
4
|
const isNonNullObject = (v) => typeof v === "object" && v !== null;
|
|
5
5
|
const parseBody = async (res, url) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/generated/config.generated.ts"],"sourcesContent":["// AUTO-GENERATED from manifest.json — do not edit by hand.\n// Regenerate with: yarn workspace @lifi/composer-sdk generate\n\nimport type { Address, IntegerStringInput } from '../types.js';\n\nexport interface CoreSplitConfig {\n bps: number;\n}\n\n/**\n * a positive number\n */\nexport type Positive = number;\n/**\n * a string at most 64 character(s) long\n */\nexport type MaxLength64 = string;\n/**\n * an array of at most 50 item(s)\n *\n * @maxItems 50\n */\nexport type MaxItems50 = MaxLength64[];\n\nexport interface LifiSwapConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n slippage?: number;\n timing?: {\n swapStepTimingStrategies?: {\n strategy: 'minWaitTime';\n minWaitTimeMs: number;\n startingExpectedResults: number;\n reduceEveryMs: number;\n }[];\n routeTimingStrategies?: {\n strategy: 'minWaitTime';\n minWaitTimeMs: number;\n startingExpectedResults: number;\n reduceEveryMs: number;\n }[];\n };\n exchanges?: {\n allow?: MaxItems50;\n deny?: MaxItems50;\n prefer?: MaxItems50;\n };\n}\n\nexport interface CoreBpsDownConfig {\n bps: number;\n}\n\nexport interface CoreBpsUpConfig {\n bps: number;\n}\n\nexport interface CoreApproveConfig {\n spender: Address;\n}\n\nexport interface CoreBalanceOfConfig {\n token: Address;\n owner?: Address;\n}\n\nexport interface CoreTransferConfig {\n amount?: IntegerStringInput;\n}\n\nexport interface CoreCallConfig {\n target: Address;\n functionSignature: string;\n callType?: 'Call' | 'ValueCall';\n args?: Unknown[];\n approvals?: {\n spender: Address;\n }[];\n}\nexport interface Unknown {\n [k: string]: unknown;\n}\n\nexport interface CoreStaticCallConfig {\n target: Address;\n functionSignature: string;\n args?: Unknown[];\n}\n\nexport interface CoreRawCallConfig {\n target: Address;\n calldata: string;\n callType?: 'Call' | 'StaticCall' | 'ValueCall' | 'DelegateCall';\n resultType?: string;\n}\n\nexport interface CoreInvokeConfig {\n target: Address;\n functionSignature: string;\n callType?: 'Call' | 'ValueCall';\n args?: Unknown[];\n}\n\nexport interface CoreAsResourceConfig {\n resource:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n}\n\nexport interface AaveBorrowConfig {\n pool: string;\n asset: string;\n variableDebtToken: string;\n amount: IntegerStringInput;\n referralId?: number;\n}\n\nexport type AaveRepayConfig =\n | {\n pool: string;\n mode: 'exact';\n }\n | {\n pool: string;\n mode: 'max';\n };\n\nexport interface AaveRepayWithATokensConfig {\n pool: string;\n asset: string;\n}\n\nexport interface AaveClaimRewardsConfig {\n rewardsController: string;\n assets: string[];\n reward: string;\n amount?: IntegerStringInput;\n to?: string;\n}\n\n/**\n * a number between 0 and 255\n */\nexport type Between0255 = number;\n\nexport interface AaveSetEModeConfig {\n pool: string;\n category: Between0255;\n}\n\nexport interface AaveGetHealthFactorConfig {\n pool: string;\n user?: string;\n}\n\nexport type MorphoBlueSupplyCollateralConfig =\n | (\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'exact';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'exact';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'all';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'all';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueWithdrawCollateralConfig =\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueBorrowConfig =\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueRepayConfig =\n | (\n | {\n morpho?: string;\n mode: 'exact';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'exact';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n morpho?: string;\n mode: 'max';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'max';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueSupplyConfig =\n | {\n morpho?: string;\n onBehalfOf?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n onBehalfOf?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueWithdrawConfig =\n | (\n | {\n morpho?: string;\n mode: 'exact';\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'exact';\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n morpho?: string;\n mode: 'max';\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'max';\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueGetPositionConfig =\n | {\n morpho?: string;\n user?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n user?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport interface LifiFlashloanRepayConfig {\n leg: string;\n fee?: string;\n}\n\nexport interface LifiZapConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n}\n\n/**\n * a non-negative number\n */\nexport type GreaterThanOrEqualTo0 = number;\n/**\n * a number between 0 and 10000\n */\nexport type Between010000 = number;\n\nexport interface ParaswapBuyConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n exactAmountOut: string;\n srcDecimals: GreaterThanOrEqualTo0;\n destDecimals: GreaterThanOrEqualTo0;\n maxSlippageBps?: Between010000;\n partner?: string;\n partnerAddress?: string;\n /**\n * Integrator fee in basis points; non-negative integer string capped at 9000.\n */\n partnerFeeBps?: string;\n}\n\nexport interface CorePeekConfig {\n target: Address;\n functionSignature: string;\n args?: string[];\n}\n\nexport interface SlippageGuardConfig {\n port: string;\n bps: Between010000;\n}\n\nexport interface CoreNumericInvariantGuardConfig {\n port: string;\n op: 'gte' | 'gt' | 'lte' | 'lt' | 'eq' | 'neq';\n threshold: IntegerStringInput;\n}\n\nexport interface BalanceOfMaterialiserConfig {\n owner: Address;\n}\n\nexport type DirectDepositMaterialiserConfig =\n | {\n amount: IntegerStringInput;\n allowNonExact?: false;\n }\n | {\n amount: IntegerStringInput;\n allowNonExact: true;\n }\n | {\n allowNonExact: true;\n simAmount?: string;\n };\n\nexport interface CallMaterialiserConfig {\n target: Address;\n calldata: string;\n}\n\nexport interface FlashloanMaterialiserConfig {\n providerKind: 'aave-v3' | 'erc3156' | 'balancer-v2' | 'morpho-blue';\n amount: IntegerStringInput;\n}\n\nexport interface Erc20BalancePreconditionConfig {\n wallet: Address;\n token: Address;\n balance: IntegerStringInput;\n}\n\nexport interface NativeBalancePreconditionConfig {\n wallet: Address;\n balance: IntegerStringInput;\n}\n\nexport interface Erc20AllowancePreconditionConfig {\n owner: Address;\n spender: Address;\n token: Address;\n allowance: IntegerStringInput;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/generated/config.generated.ts"],"sourcesContent":["// AUTO-GENERATED from manifest.json — do not edit by hand.\n// Regenerate with: yarn workspace @lifi/composer-sdk generate\n\nimport type { Address, IntegerStringInput } from '../types.js';\n\nexport interface CoreSplitConfig {\n bps: number;\n}\n\n/**\n * a positive number\n */\nexport type Positive = number;\n/**\n * a string at most 64 character(s) long\n */\nexport type MaxLength64 = string;\n/**\n * an array of at most 50 item(s)\n *\n * @maxItems 50\n */\nexport type MaxItems50 = MaxLength64[];\n\nexport interface LifiSwapConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n slippage?: number;\n timing?: {\n swapStepTimingStrategies?: {\n strategy: 'minWaitTime';\n minWaitTimeMs: number;\n startingExpectedResults: number;\n reduceEveryMs: number;\n }[];\n routeTimingStrategies?: {\n strategy: 'minWaitTime';\n minWaitTimeMs: number;\n startingExpectedResults: number;\n reduceEveryMs: number;\n }[];\n };\n exchanges?: {\n allow?: MaxItems50;\n deny?: MaxItems50;\n prefer?: MaxItems50;\n };\n}\n\nexport interface InvariantNumericConfig {\n op: 'gte' | 'gt' | 'lte' | 'lt' | 'eq' | 'neq';\n threshold: IntegerStringInput;\n}\n\nexport interface InvariantNumericInRangeConfig {\n min: IntegerStringInput;\n max: IntegerStringInput;\n}\n\nexport interface InvariantGteConfig {\n threshold: IntegerStringInput;\n}\n\nexport interface InvariantGtConfig {\n threshold: IntegerStringInput;\n}\n\nexport interface InvariantLteConfig {\n threshold: IntegerStringInput;\n}\n\nexport interface InvariantLtConfig {\n threshold: IntegerStringInput;\n}\n\nexport interface InvariantEqConfig {\n threshold: IntegerStringInput;\n}\n\nexport interface InvariantNeqConfig {\n threshold: IntegerStringInput;\n}\n\nexport interface CoreBpsDownConfig {\n bps: number;\n}\n\nexport interface CoreBpsUpConfig {\n bps: number;\n}\n\nexport interface CoreApproveConfig {\n spender: Address;\n}\n\nexport interface CoreBalanceOfConfig {\n token: Address;\n owner?: Address;\n}\n\nexport interface CoreTransferConfig {\n amount?: IntegerStringInput;\n}\n\nexport interface CoreEmitEvent1Config {\n signature: string;\n}\n\nexport interface CoreEmitEvent2Config {\n signature: string;\n}\n\nexport interface CoreEmitEvent3Config {\n signature: string;\n}\n\nexport interface CoreEmitEvent4Config {\n signature: string;\n}\n\nexport interface CoreCallConfig {\n target: Address;\n functionSignature: string;\n callType?: 'Call' | 'ValueCall';\n args?: Unknown[];\n approvals?: {\n spender: Address;\n }[];\n}\nexport interface Unknown {\n [k: string]: unknown;\n}\n\nexport interface CoreStaticCallConfig {\n target: Address;\n functionSignature: string;\n args?: Unknown[];\n}\n\nexport interface CoreRawCallConfig {\n target: Address;\n calldata: string;\n callType?: 'Call' | 'StaticCall' | 'ValueCall' | 'DelegateCall';\n resultType?: string;\n}\n\nexport interface CoreInvokeConfig {\n target: Address;\n functionSignature: string;\n callType?: 'Call' | 'ValueCall';\n args?: Unknown[];\n}\n\nexport interface CoreAsResourceConfig {\n resource:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n}\n\nexport interface AaveBorrowConfig {\n pool: string;\n asset: string;\n variableDebtToken: string;\n amount: IntegerStringInput;\n referralId?: number;\n}\n\nexport type AaveRepayConfig =\n | {\n pool: string;\n mode: 'exact';\n }\n | {\n pool: string;\n mode: 'max';\n };\n\nexport interface AaveRepayWithATokensConfig {\n pool: string;\n asset: string;\n}\n\nexport interface AaveClaimRewardsConfig {\n rewardsController: string;\n assets: string[];\n reward: string;\n amount?: IntegerStringInput;\n to?: string;\n}\n\n/**\n * a number between 0 and 255\n */\nexport type Between0255 = number;\n\nexport interface AaveSetEModeConfig {\n pool: string;\n category: Between0255;\n}\n\nexport interface AaveGetHealthFactorConfig {\n pool: string;\n user?: string;\n}\n\nexport type MorphoBlueSupplyCollateralConfig =\n | (\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'exact';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'exact';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'all';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n onBehalfOf?: string;\n mode: 'all';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueWithdrawCollateralConfig =\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueBorrowConfig =\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueRepayConfig =\n | (\n | {\n morpho?: string;\n mode: 'exact';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'exact';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n morpho?: string;\n mode: 'max';\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'max';\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueSupplyConfig =\n | {\n morpho?: string;\n onBehalfOf?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n onBehalfOf?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueWithdrawConfig =\n | (\n | {\n morpho?: string;\n mode: 'exact';\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'exact';\n amount: IntegerStringInput;\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n morpho?: string;\n mode: 'max';\n onBehalfOf?: string;\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n mode: 'max';\n onBehalfOf?: string;\n receiver?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueGetPositionConfig =\n | {\n morpho?: string;\n user?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n morpho?: string;\n user?: string;\n marketParams: {\n loanToken: string;\n collateralToken: string;\n oracle: string;\n irm: string;\n lltv: string;\n };\n };\n\nexport interface LifiFlashloanRepayConfig {\n leg: string;\n fee?: string;\n}\n\nexport interface LifiZapConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n}\n\n/**\n * a non-negative number\n */\nexport type GreaterThanOrEqualTo0 = number;\n/**\n * a number between 0 and 10000\n */\nexport type Between010000 = number;\n\nexport interface ParaswapBuyConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n token: Address;\n chainId: Positive;\n };\n exactAmountOut: string;\n srcDecimals: GreaterThanOrEqualTo0;\n destDecimals: GreaterThanOrEqualTo0;\n maxSlippageBps?: Between010000;\n partner?: string;\n partnerAddress?: string;\n /**\n * Integrator fee in basis points; non-negative integer string capped at 9000.\n */\n partnerFeeBps?: string;\n}\n\nexport interface CorePeekConfig {\n target: Address;\n functionSignature: string;\n args?: string[];\n}\n\nexport interface SlippageGuardConfig {\n port: string;\n bps: Between010000;\n}\n\nexport interface CoreNumericInvariantGuardConfig {\n port: string;\n op: 'gte' | 'gt' | 'lte' | 'lt' | 'eq' | 'neq';\n threshold: IntegerStringInput;\n}\n\nexport interface BalanceOfMaterialiserConfig {\n owner: Address;\n}\n\nexport type DirectDepositMaterialiserConfig =\n | {\n amount: IntegerStringInput;\n allowNonExact?: false;\n }\n | {\n amount: IntegerStringInput;\n allowNonExact: true;\n }\n | {\n allowNonExact: true;\n simAmount?: string;\n };\n\nexport interface CallMaterialiserConfig {\n target: Address;\n calldata: string;\n}\n\nexport interface FlashloanMaterialiserConfig {\n providerKind: 'aave-v3' | 'erc3156' | 'balancer-v2' | 'morpho-blue';\n amount: IntegerStringInput;\n}\n\nexport interface Erc20BalancePreconditionConfig {\n wallet: Address;\n token: Address;\n balance: IntegerStringInput;\n}\n\nexport interface NativeBalancePreconditionConfig {\n wallet: Address;\n balance: IntegerStringInput;\n}\n\nexport interface Erc20AllowancePreconditionConfig {\n owner: Address;\n spender: Address;\n token: Address;\n allowance: IntegerStringInput;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -48,6 +48,32 @@ interface LifiSwapConfig {
|
|
|
48
48
|
prefer?: MaxItems50;
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
interface InvariantNumericConfig {
|
|
52
|
+
op: 'gte' | 'gt' | 'lte' | 'lt' | 'eq' | 'neq';
|
|
53
|
+
threshold: IntegerStringInput;
|
|
54
|
+
}
|
|
55
|
+
interface InvariantNumericInRangeConfig {
|
|
56
|
+
min: IntegerStringInput;
|
|
57
|
+
max: IntegerStringInput;
|
|
58
|
+
}
|
|
59
|
+
interface InvariantGteConfig {
|
|
60
|
+
threshold: IntegerStringInput;
|
|
61
|
+
}
|
|
62
|
+
interface InvariantGtConfig {
|
|
63
|
+
threshold: IntegerStringInput;
|
|
64
|
+
}
|
|
65
|
+
interface InvariantLteConfig {
|
|
66
|
+
threshold: IntegerStringInput;
|
|
67
|
+
}
|
|
68
|
+
interface InvariantLtConfig {
|
|
69
|
+
threshold: IntegerStringInput;
|
|
70
|
+
}
|
|
71
|
+
interface InvariantEqConfig {
|
|
72
|
+
threshold: IntegerStringInput;
|
|
73
|
+
}
|
|
74
|
+
interface InvariantNeqConfig {
|
|
75
|
+
threshold: IntegerStringInput;
|
|
76
|
+
}
|
|
51
77
|
interface CoreBpsDownConfig {
|
|
52
78
|
bps: number;
|
|
53
79
|
}
|
|
@@ -64,6 +90,18 @@ interface CoreBalanceOfConfig {
|
|
|
64
90
|
interface CoreTransferConfig {
|
|
65
91
|
amount?: IntegerStringInput;
|
|
66
92
|
}
|
|
93
|
+
interface CoreEmitEvent1Config {
|
|
94
|
+
signature: string;
|
|
95
|
+
}
|
|
96
|
+
interface CoreEmitEvent2Config {
|
|
97
|
+
signature: string;
|
|
98
|
+
}
|
|
99
|
+
interface CoreEmitEvent3Config {
|
|
100
|
+
signature: string;
|
|
101
|
+
}
|
|
102
|
+
interface CoreEmitEvent4Config {
|
|
103
|
+
signature: string;
|
|
104
|
+
}
|
|
67
105
|
interface CoreCallConfig {
|
|
68
106
|
target: Address;
|
|
69
107
|
functionSignature: string;
|
|
@@ -432,4 +470,4 @@ interface Erc20AllowancePreconditionConfig {
|
|
|
432
470
|
allowance: IntegerStringInput;
|
|
433
471
|
}
|
|
434
472
|
|
|
435
|
-
export type { AaveBorrowConfig, AaveClaimRewardsConfig, AaveGetHealthFactorConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveSetEModeConfig, BalanceOfMaterialiserConfig, Between010000, Between0255, CallMaterialiserConfig, CoreApproveConfig, CoreAsResourceConfig, CoreBalanceOfConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreCallConfig, CoreInvokeConfig, CoreNumericInvariantGuardConfig, CorePeekConfig, CoreRawCallConfig, CoreSplitConfig, CoreStaticCallConfig, CoreTransferConfig, DirectDepositMaterialiserConfig, Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, FlashloanMaterialiserConfig, GreaterThanOrEqualTo0, LifiFlashloanRepayConfig, LifiSwapConfig, LifiZapConfig, MaxItems50, MaxLength64, MorphoBlueBorrowConfig, MorphoBlueGetPositionConfig, MorphoBlueRepayConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueWithdrawConfig, NativeBalancePreconditionConfig, ParaswapBuyConfig, Positive, SlippageGuardConfig, Unknown };
|
|
473
|
+
export type { AaveBorrowConfig, AaveClaimRewardsConfig, AaveGetHealthFactorConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveSetEModeConfig, BalanceOfMaterialiserConfig, Between010000, Between0255, CallMaterialiserConfig, CoreApproveConfig, CoreAsResourceConfig, CoreBalanceOfConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreCallConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreInvokeConfig, CoreNumericInvariantGuardConfig, CorePeekConfig, CoreRawCallConfig, CoreSplitConfig, CoreStaticCallConfig, CoreTransferConfig, DirectDepositMaterialiserConfig, Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, FlashloanMaterialiserConfig, GreaterThanOrEqualTo0, InvariantEqConfig, InvariantGtConfig, InvariantGteConfig, InvariantLtConfig, InvariantLteConfig, InvariantNeqConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, LifiFlashloanRepayConfig, LifiSwapConfig, LifiZapConfig, MaxItems50, MaxLength64, MorphoBlueBorrowConfig, MorphoBlueGetPositionConfig, MorphoBlueRepayConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueWithdrawConfig, NativeBalancePreconditionConfig, ParaswapBuyConfig, Positive, SlippageGuardConfig, Unknown };
|
|
@@ -48,6 +48,32 @@ interface LifiSwapConfig {
|
|
|
48
48
|
prefer?: MaxItems50;
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
interface InvariantNumericConfig {
|
|
52
|
+
op: 'gte' | 'gt' | 'lte' | 'lt' | 'eq' | 'neq';
|
|
53
|
+
threshold: IntegerStringInput;
|
|
54
|
+
}
|
|
55
|
+
interface InvariantNumericInRangeConfig {
|
|
56
|
+
min: IntegerStringInput;
|
|
57
|
+
max: IntegerStringInput;
|
|
58
|
+
}
|
|
59
|
+
interface InvariantGteConfig {
|
|
60
|
+
threshold: IntegerStringInput;
|
|
61
|
+
}
|
|
62
|
+
interface InvariantGtConfig {
|
|
63
|
+
threshold: IntegerStringInput;
|
|
64
|
+
}
|
|
65
|
+
interface InvariantLteConfig {
|
|
66
|
+
threshold: IntegerStringInput;
|
|
67
|
+
}
|
|
68
|
+
interface InvariantLtConfig {
|
|
69
|
+
threshold: IntegerStringInput;
|
|
70
|
+
}
|
|
71
|
+
interface InvariantEqConfig {
|
|
72
|
+
threshold: IntegerStringInput;
|
|
73
|
+
}
|
|
74
|
+
interface InvariantNeqConfig {
|
|
75
|
+
threshold: IntegerStringInput;
|
|
76
|
+
}
|
|
51
77
|
interface CoreBpsDownConfig {
|
|
52
78
|
bps: number;
|
|
53
79
|
}
|
|
@@ -64,6 +90,18 @@ interface CoreBalanceOfConfig {
|
|
|
64
90
|
interface CoreTransferConfig {
|
|
65
91
|
amount?: IntegerStringInput;
|
|
66
92
|
}
|
|
93
|
+
interface CoreEmitEvent1Config {
|
|
94
|
+
signature: string;
|
|
95
|
+
}
|
|
96
|
+
interface CoreEmitEvent2Config {
|
|
97
|
+
signature: string;
|
|
98
|
+
}
|
|
99
|
+
interface CoreEmitEvent3Config {
|
|
100
|
+
signature: string;
|
|
101
|
+
}
|
|
102
|
+
interface CoreEmitEvent4Config {
|
|
103
|
+
signature: string;
|
|
104
|
+
}
|
|
67
105
|
interface CoreCallConfig {
|
|
68
106
|
target: Address;
|
|
69
107
|
functionSignature: string;
|
|
@@ -432,4 +470,4 @@ interface Erc20AllowancePreconditionConfig {
|
|
|
432
470
|
allowance: IntegerStringInput;
|
|
433
471
|
}
|
|
434
472
|
|
|
435
|
-
export type { AaveBorrowConfig, AaveClaimRewardsConfig, AaveGetHealthFactorConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveSetEModeConfig, BalanceOfMaterialiserConfig, Between010000, Between0255, CallMaterialiserConfig, CoreApproveConfig, CoreAsResourceConfig, CoreBalanceOfConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreCallConfig, CoreInvokeConfig, CoreNumericInvariantGuardConfig, CorePeekConfig, CoreRawCallConfig, CoreSplitConfig, CoreStaticCallConfig, CoreTransferConfig, DirectDepositMaterialiserConfig, Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, FlashloanMaterialiserConfig, GreaterThanOrEqualTo0, LifiFlashloanRepayConfig, LifiSwapConfig, LifiZapConfig, MaxItems50, MaxLength64, MorphoBlueBorrowConfig, MorphoBlueGetPositionConfig, MorphoBlueRepayConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueWithdrawConfig, NativeBalancePreconditionConfig, ParaswapBuyConfig, Positive, SlippageGuardConfig, Unknown };
|
|
473
|
+
export type { AaveBorrowConfig, AaveClaimRewardsConfig, AaveGetHealthFactorConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveSetEModeConfig, BalanceOfMaterialiserConfig, Between010000, Between0255, CallMaterialiserConfig, CoreApproveConfig, CoreAsResourceConfig, CoreBalanceOfConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreCallConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreInvokeConfig, CoreNumericInvariantGuardConfig, CorePeekConfig, CoreRawCallConfig, CoreSplitConfig, CoreStaticCallConfig, CoreTransferConfig, DirectDepositMaterialiserConfig, Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, FlashloanMaterialiserConfig, GreaterThanOrEqualTo0, InvariantEqConfig, InvariantGtConfig, InvariantGteConfig, InvariantLtConfig, InvariantLteConfig, InvariantNeqConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, LifiFlashloanRepayConfig, LifiSwapConfig, LifiZapConfig, MaxItems50, MaxLength64, MorphoBlueBorrowConfig, MorphoBlueGetPositionConfig, MorphoBlueRepayConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueWithdrawConfig, NativeBalancePreconditionConfig, ParaswapBuyConfig, Positive, SlippageGuardConfig, Unknown };
|
|
@@ -65,6 +65,10 @@ const bindGeneratedOps = (builder) => ({
|
|
|
65
65
|
transferred: "resource",
|
|
66
66
|
remainder: "resource"
|
|
67
67
|
}),
|
|
68
|
+
emitEvent1: (nodeId, args) => builder.call(nodeId, "core.emitEvent1", args, {}),
|
|
69
|
+
emitEvent2: (nodeId, args) => builder.call(nodeId, "core.emitEvent2", args, {}),
|
|
70
|
+
emitEvent3: (nodeId, args) => builder.call(nodeId, "core.emitEvent3", args, {}),
|
|
71
|
+
emitEvent4: (nodeId, args) => builder.call(nodeId, "core.emitEvent4", args, {}),
|
|
68
72
|
call: (nodeId, args) => {
|
|
69
73
|
const wire = (0, import_signatureArgs.buildCallWireFormat)({
|
|
70
74
|
resource: args.resource,
|
|
@@ -110,7 +114,57 @@ const bindGeneratedOps = (builder) => ({
|
|
|
110
114
|
"invariant.balanceAtLeast",
|
|
111
115
|
{ ...args, config: {} },
|
|
112
116
|
{}
|
|
113
|
-
)
|
|
117
|
+
),
|
|
118
|
+
balanceEquals: (nodeId, args) => builder.call(
|
|
119
|
+
nodeId,
|
|
120
|
+
"invariant.balanceEquals",
|
|
121
|
+
{ ...args, config: {} },
|
|
122
|
+
{}
|
|
123
|
+
),
|
|
124
|
+
balanceAtMost: (nodeId, args) => builder.call(
|
|
125
|
+
nodeId,
|
|
126
|
+
"invariant.balanceAtMost",
|
|
127
|
+
{ ...args, config: {} },
|
|
128
|
+
{}
|
|
129
|
+
),
|
|
130
|
+
balanceInRange: (nodeId, args) => builder.call(
|
|
131
|
+
nodeId,
|
|
132
|
+
"invariant.balanceInRange",
|
|
133
|
+
{ ...args, config: {} },
|
|
134
|
+
{}
|
|
135
|
+
),
|
|
136
|
+
allowanceAtLeast: (nodeId, args) => builder.call(
|
|
137
|
+
nodeId,
|
|
138
|
+
"invariant.allowanceAtLeast",
|
|
139
|
+
{ ...args, config: {} },
|
|
140
|
+
{}
|
|
141
|
+
),
|
|
142
|
+
allowanceEquals: (nodeId, args) => builder.call(
|
|
143
|
+
nodeId,
|
|
144
|
+
"invariant.allowanceEquals",
|
|
145
|
+
{ ...args, config: {} },
|
|
146
|
+
{}
|
|
147
|
+
),
|
|
148
|
+
allowanceAtMost: (nodeId, args) => builder.call(
|
|
149
|
+
nodeId,
|
|
150
|
+
"invariant.allowanceAtMost",
|
|
151
|
+
{ ...args, config: {} },
|
|
152
|
+
{}
|
|
153
|
+
),
|
|
154
|
+
allowanceInRange: (nodeId, args) => builder.call(
|
|
155
|
+
nodeId,
|
|
156
|
+
"invariant.allowanceInRange",
|
|
157
|
+
{ ...args, config: {} },
|
|
158
|
+
{}
|
|
159
|
+
),
|
|
160
|
+
numeric: (nodeId, args) => builder.call(nodeId, "invariant.numeric", args, {}),
|
|
161
|
+
numericInRange: (nodeId, args) => builder.call(nodeId, "invariant.numericInRange", args, {}),
|
|
162
|
+
gte: (nodeId, args) => builder.call(nodeId, "invariant.gte", args, {}),
|
|
163
|
+
gt: (nodeId, args) => builder.call(nodeId, "invariant.gt", args, {}),
|
|
164
|
+
lte: (nodeId, args) => builder.call(nodeId, "invariant.lte", args, {}),
|
|
165
|
+
lt: (nodeId, args) => builder.call(nodeId, "invariant.lt", args, {}),
|
|
166
|
+
eq: (nodeId, args) => builder.call(nodeId, "invariant.eq", args, {}),
|
|
167
|
+
neq: (nodeId, args) => builder.call(nodeId, "invariant.neq", args, {})
|
|
114
168
|
},
|
|
115
169
|
aave: {
|
|
116
170
|
borrow: (nodeId, args) => builder.call(nodeId, "aave.borrow", args, {
|