@lifi/composer-sdk 0.2.0-staging.5 → 0.3.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/README.md +103 -2
- package/dist/client.cjs +46 -8
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +27 -3
- package/dist/client.d.ts +27 -3
- package/dist/client.js +49 -8
- package/dist/client.js.map +1 -1
- package/dist/errors.cjs +4 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +6 -1
- package/dist/errors.js.map +1 -1
- package/dist/generated/config.generated.cjs.map +1 -1
- package/dist/generated/config.generated.d.cts +80 -20
- package/dist/generated/config.generated.d.ts +80 -20
- package/dist/generated/materialisers.generated.cjs +2 -8
- package/dist/generated/materialisers.generated.cjs.map +1 -1
- package/dist/generated/materialisers.generated.d.cts +1 -1
- package/dist/generated/materialisers.generated.d.ts +1 -1
- package/dist/generated/materialisers.generated.js +1 -6
- package/dist/generated/materialisers.generated.js.map +1 -1
- package/dist/generated/operations.generated.cjs +1 -30
- package/dist/generated/operations.generated.cjs.map +1 -1
- package/dist/generated/operations.generated.d.cts +2 -94
- package/dist/generated/operations.generated.d.ts +2 -94
- package/dist/generated/operations.generated.js +1 -30
- package/dist/generated/operations.generated.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/{materialisers.generated-BfWJ-g7t.d.ts → materialisers.generated-BMkBQgWZ.d.ts} +3 -8
- package/dist/{materialisers.generated-DaJRwiRe.d.cts → materialisers.generated-BWq5oePO.d.cts} +3 -8
- package/dist/responseSchemas.cjs +110 -0
- package/dist/responseSchemas.cjs.map +1 -0
- package/dist/responseSchemas.d.cts +36 -0
- package/dist/responseSchemas.d.ts +36 -0
- package/dist/responseSchemas.js +74 -0
- package/dist/responseSchemas.js.map +1 -0
- package/dist/run/simulate.cjs +41 -0
- package/dist/run/simulate.cjs.map +1 -0
- package/dist/run/simulate.d.cts +59 -0
- package/dist/run/simulate.d.ts +59 -0
- package/dist/run/simulate.js +17 -0
- package/dist/run/simulate.js.map +1 -0
- package/dist/sdk.cjs +6 -1
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +18 -6
- package/dist/sdk.d.ts +18 -6
- package/dist/sdk.js +6 -1
- package/dist/sdk.js.map +1 -1
- package/package.json +8 -6
- package/src/client.ts +96 -16
- package/src/errors.ts +8 -10
- package/src/examples/aaveClaimRewards.ts +2 -2
- package/src/examples/aaveRepay.ts +2 -2
- package/src/examples/aaveRepayWithATokens.ts +2 -2
- package/src/examples/aaveSetEMode.ts +2 -2
- package/src/examples/approveAndDeposit.ts +2 -2
- package/src/examples/callContract.ts +4 -4
- package/src/examples/config.ts +4 -1
- package/src/examples/consolidateToEth.ts +2 -2
- package/src/examples/consolidateToUsdc.ts +2 -2
- package/src/examples/depositFromProxy.ts +2 -2
- package/src/examples/dustSweep.ts +2 -2
- package/src/examples/emitCustomEvent.ts +2 -2
- package/src/examples/invariantChecks.ts +2 -2
- package/src/examples/lifiSwap.ts +2 -2
- package/src/examples/lifiZap.ts +2 -2
- package/src/examples/rawCallWithArithmetic.ts +2 -2
- package/src/examples/readContractState.ts +2 -2
- package/src/examples/simulateCompiledSwap.ts +76 -0
- package/src/examples/simulateRawTransaction.ts +39 -0
- package/src/examples/splitAndZap.ts +2 -2
- package/src/examples/splitWithArithmetic.ts +2 -2
- package/src/examples/swapAndZap.ts +2 -2
- package/src/examples/swapToRecipient.ts +2 -2
- package/src/examples/swapWithAllowRevert.ts +3 -3
- package/src/examples/swapWithBalanceCheck.ts +2 -2
- package/src/examples/swapWithFee.ts +2 -2
- package/src/examples/swapWithOutputValidation.ts +2 -2
- package/src/examples/transferTokens.ts +3 -3
- package/src/examples/untypedOpWithTypedRef.ts +2 -2
- package/src/generated/config.generated.ts +221 -20
- package/src/generated/materialisers.generated.ts +0 -12
- package/src/generated/operations.generated.ts +0 -177
- package/src/index.ts +25 -0
- package/src/responseSchemas.ts +143 -0
- package/src/run/simulate.ts +78 -0
- package/src/sdk.ts +25 -6
- package/src/examples/staged/aaveBorrow.ts +0 -128
- package/src/examples/staged/aaveDebtRebalanceExactOut.ts +0 -301
- package/src/examples/staged/aaveHealthFactorExplode.ts +0 -70
- package/src/examples/staged/aaveToMorphoDebtMigration.ts +0 -200
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwap.ts +0 -231
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwapExactOut.ts +0 -307
- package/src/examples/staged/flashloanRepay.ts +0 -142
- package/src/examples/staged/morphoBlueBorrow.ts +0 -93
- package/src/examples/staged/morphoBlueRepay.ts +0 -132
- package/src/examples/staged/registry.ts +0 -80
package/dist/errors.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseServerErrorBody
|
|
3
|
+
} from "./responseSchemas.js";
|
|
1
4
|
class ComposeError extends Error {
|
|
2
5
|
name = "ComposeError";
|
|
3
6
|
/** Machine-readable error category. */
|
|
@@ -36,11 +39,13 @@ const STATUS_TO_CODE = /* @__PURE__ */ new Map([
|
|
|
36
39
|
[429, "RATE_LIMITED"]
|
|
37
40
|
]);
|
|
38
41
|
const tryParseErrorBody = (body) => {
|
|
42
|
+
let json;
|
|
39
43
|
try {
|
|
40
|
-
|
|
44
|
+
json = JSON.parse(body);
|
|
41
45
|
} catch {
|
|
42
46
|
return null;
|
|
43
47
|
}
|
|
48
|
+
return parseServerErrorBody(json);
|
|
44
49
|
};
|
|
45
50
|
const errorFromHttpResponse = (status, body, url) => {
|
|
46
51
|
const parsed = tryParseErrorBody(body);
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type { ComposeErrorKind, SimulationRevert } from '@lifi/compose-spec';\n\n/**\n * Machine-readable error codes returned by the SDK.\n *\n * - `NETWORK_ERROR` — The HTTP request failed (DNS, timeout, connection refused).\n * - `VALIDATION_ERROR` — The server rejected the request (HTTP 400/422).\n * - `UNAUTHENTICATED` — The request lacks valid authentication credentials (HTTP 401).\n * - `FORBIDDEN` — The server understood the request but refuses to authorise it (HTTP 403).\n * - `SERVER_ERROR` — The server returned a 5xx status.\n * - `RATE_LIMITED` — The server returned HTTP 429.\n * - `NOT_FOUND` — The requested resource does not exist (HTTP 404).\n * - `UNKNOWN_ERROR` — An unexpected error that doesn't fit other categories.\n */\nexport type ComposeErrorCode =\n | 'NETWORK_ERROR'\n | 'VALIDATION_ERROR'\n | 'UNAUTHENTICATED'\n | 'FORBIDDEN'\n | 'SERVER_ERROR'\n | 'RATE_LIMITED'\n | 'NOT_FOUND'\n | 'UNKNOWN_ERROR';\n\n/**\n * Error class for all failures originating from the Compose SDK or API.\n *\n * Includes structured metadata beyond the error message to support\n * programmatic error handling.\n *\n * @example\n * ```ts\n * try {\n * await builder.compile(run);\n * } catch (e) {\n * if (isComposeError(e) && e.code === 'VALIDATION_ERROR') {\n * console.error('Invalid request:', e.message, e.path);\n * }\n * }\n * ```\n */\nexport class ComposeError extends Error {\n override readonly name = 'ComposeError';\n /** Machine-readable error category. */\n readonly code: ComposeErrorCode;\n /** HTTP status code, when the error originated from an HTTP response. */\n readonly status?: number;\n /** The request URL that produced the error. */\n readonly url?: string;\n /** Server-provided error kind for finer-grained classification. */\n readonly kind?: ComposeErrorKind;\n /** JSON-pointer path to the field that caused a validation error. */\n readonly path?: string;\n /**\n * Simulation revert diagnostics attached to `simulation_revert` errors.\n * Contains the raw error bytes and decoded error candidates when the\n * backend can parse the revert reason.\n */\n readonly details?: SimulationRevert;\n\n constructor(\n code: ComposeErrorCode,\n message: string,\n options?: {\n status?: number;\n url?: string;\n cause?: unknown;\n kind?: ComposeErrorKind;\n path?: string;\n details?: SimulationRevert;\n },\n ) {\n super(message, { cause: options?.cause });\n this.code = code;\n this.status = options?.status;\n this.url = options?.url;\n this.kind = options?.kind;\n this.path = options?.path;\n this.details = options?.details;\n }\n}\n\n/**\n * Type guard that narrows an unknown error to {@link ComposeError}.\n * @param e - The value to check.\n * @returns `true` if `e` is an instance of `ComposeError`.\n */\nexport const isComposeError = (e: unknown): e is ComposeError =>\n e instanceof ComposeError ||\n (e instanceof Error && e.name === 'ComposeError' && 'code' in e);\n\nconst STATUS_TO_CODE: ReadonlyMap<number, ComposeErrorCode> = new Map<\n number,\n ComposeErrorCode\n>([\n [400, 'VALIDATION_ERROR'],\n [401, 'UNAUTHENTICATED'],\n [403, 'FORBIDDEN'],\n [404, 'NOT_FOUND'],\n [422, 'VALIDATION_ERROR'],\n [429, 'RATE_LIMITED'],\n]);\n\
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type { ComposeErrorKind, SimulationRevert } from '@lifi/compose-spec';\n\nimport {\n parseServerErrorBody,\n type ServerErrorBody,\n} from './responseSchemas.js';\n\n/**\n * Machine-readable error codes returned by the SDK.\n *\n * - `NETWORK_ERROR` — The HTTP request failed (DNS, timeout, connection refused).\n * - `VALIDATION_ERROR` — The server rejected the request (HTTP 400/422).\n * - `UNAUTHENTICATED` — The request lacks valid authentication credentials (HTTP 401).\n * - `FORBIDDEN` — The server understood the request but refuses to authorise it (HTTP 403).\n * - `SERVER_ERROR` — The server returned a 5xx status.\n * - `RATE_LIMITED` — The server returned HTTP 429.\n * - `NOT_FOUND` — The requested resource does not exist (HTTP 404).\n * - `UNKNOWN_ERROR` — An unexpected error that doesn't fit other categories.\n */\nexport type ComposeErrorCode =\n | 'NETWORK_ERROR'\n | 'VALIDATION_ERROR'\n | 'UNAUTHENTICATED'\n | 'FORBIDDEN'\n | 'SERVER_ERROR'\n | 'RATE_LIMITED'\n | 'NOT_FOUND'\n | 'UNKNOWN_ERROR';\n\n/**\n * Error class for all failures originating from the Compose SDK or API.\n *\n * Includes structured metadata beyond the error message to support\n * programmatic error handling.\n *\n * @example\n * ```ts\n * try {\n * await builder.compile(run);\n * } catch (e) {\n * if (isComposeError(e) && e.code === 'VALIDATION_ERROR') {\n * console.error('Invalid request:', e.message, e.path);\n * }\n * }\n * ```\n */\nexport class ComposeError extends Error {\n override readonly name = 'ComposeError';\n /** Machine-readable error category. */\n readonly code: ComposeErrorCode;\n /** HTTP status code, when the error originated from an HTTP response. */\n readonly status?: number;\n /** The request URL that produced the error. */\n readonly url?: string;\n /** Server-provided error kind for finer-grained classification. */\n readonly kind?: ComposeErrorKind;\n /** JSON-pointer path to the field that caused a validation error. */\n readonly path?: string;\n /**\n * Simulation revert diagnostics attached to `simulation_revert` errors.\n * Contains the raw error bytes and decoded error candidates when the\n * backend can parse the revert reason.\n */\n readonly details?: SimulationRevert;\n\n constructor(\n code: ComposeErrorCode,\n message: string,\n options?: {\n status?: number;\n url?: string;\n cause?: unknown;\n kind?: ComposeErrorKind;\n path?: string;\n details?: SimulationRevert;\n },\n ) {\n super(message, { cause: options?.cause });\n this.code = code;\n this.status = options?.status;\n this.url = options?.url;\n this.kind = options?.kind;\n this.path = options?.path;\n this.details = options?.details;\n }\n}\n\n/**\n * Type guard that narrows an unknown error to {@link ComposeError}.\n * @param e - The value to check.\n * @returns `true` if `e` is an instance of `ComposeError`.\n */\nexport const isComposeError = (e: unknown): e is ComposeError =>\n e instanceof ComposeError ||\n (e instanceof Error && e.name === 'ComposeError' && 'code' in e);\n\nconst STATUS_TO_CODE: ReadonlyMap<number, ComposeErrorCode> = new Map<\n number,\n ComposeErrorCode\n>([\n [400, 'VALIDATION_ERROR'],\n [401, 'UNAUTHENTICATED'],\n [403, 'FORBIDDEN'],\n [404, 'NOT_FOUND'],\n [422, 'VALIDATION_ERROR'],\n [429, 'RATE_LIMITED'],\n]);\n\nconst tryParseErrorBody = (body: string): ServerErrorBody | null => {\n let json: unknown;\n try {\n json = JSON.parse(body);\n } catch {\n return null;\n }\n return parseServerErrorBody(json);\n};\n\n/**\n * Constructs a {@link ComposeError} from an HTTP error response, extracting\n * structured error details from the response body when available.\n *\n * @param status - The HTTP status code.\n * @param body - The raw response body text.\n * @param url - The request URL that produced the error.\n * @returns A `ComposeError` with the appropriate error code and metadata.\n */\nexport const errorFromHttpResponse = (\n status: number,\n body: string,\n url: string,\n): ComposeError => {\n const parsed = tryParseErrorBody(body);\n const serverError = parsed?.error;\n\n return new ComposeError(\n STATUS_TO_CODE.get(status) ??\n (status >= 500 ? 'SERVER_ERROR' : 'UNKNOWN_ERROR'),\n (serverError?.message ?? body) || `HTTP ${status}`,\n {\n status,\n url,\n kind: serverError?.kind as ComposeErrorKind | undefined,\n path: serverError?.path,\n details: serverError?.details,\n },\n );\n};\n"],"mappings":"AAEA;AAAA,EACE;AAAA,OAEK;AAyCA,MAAM,qBAAqB,MAAM;AAAA,EACpB,OAAO;AAAA;AAAA,EAEhB;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AAAA,EAET,YACE,MACA,SACA,SAQA;AACA,UAAM,SAAS,EAAE,OAAO,SAAS,MAAM,CAAC;AACxC,SAAK,OAAO;AACZ,SAAK,SAAS,SAAS;AACvB,SAAK,MAAM,SAAS;AACpB,SAAK,OAAO,SAAS;AACrB,SAAK,OAAO,SAAS;AACrB,SAAK,UAAU,SAAS;AAAA,EAC1B;AACF;AAOO,MAAM,iBAAiB,CAAC,MAC7B,aAAa,gBACZ,aAAa,SAAS,EAAE,SAAS,kBAAkB,UAAU;AAEhE,MAAM,iBAAwD,oBAAI,IAGhE;AAAA,EACA,CAAC,KAAK,kBAAkB;AAAA,EACxB,CAAC,KAAK,iBAAiB;AAAA,EACvB,CAAC,KAAK,WAAW;AAAA,EACjB,CAAC,KAAK,WAAW;AAAA,EACjB,CAAC,KAAK,kBAAkB;AAAA,EACxB,CAAC,KAAK,cAAc;AACtB,CAAC;AAED,MAAM,oBAAoB,CAAC,SAAyC;AAClE,MAAI;AACJ,MAAI;AACF,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,SAAO,qBAAqB,IAAI;AAClC;AAWO,MAAM,wBAAwB,CACnC,QACA,MACA,QACiB;AACjB,QAAM,SAAS,kBAAkB,IAAI;AACrC,QAAM,cAAc,QAAQ;AAE5B,SAAO,IAAI;AAAA,IACT,eAAe,IAAI,MAAM,MACtB,UAAU,MAAM,iBAAiB;AAAA,KACnC,aAAa,WAAW,SAAS,QAAQ,MAAM;AAAA,IAChD;AAAA,MACE;AAAA,MACA;AAAA,MACA,MAAM,aAAa;AAAA,MACnB,MAAM,aAAa;AAAA,MACnB,SAAS,aAAa;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -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 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":[]}
|
|
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\n/**\n * a number between 0 and 10000\n */\nexport type Between010000 = number;\n\nexport interface CoreSplitConfig {\n bps: Between010000;\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\n/**\n * a non-negative number\n */\nexport type NonNegative = number;\n\nexport interface CoreBpsDownConfig {\n bps: NonNegative;\n}\n\nexport interface CoreBpsUpConfig {\n bps: NonNegative;\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\n/**\n * a string at most 65536 character(s) long\n */\nexport type MaxLength65536 = string;\n\nexport interface CoreCallConfig {\n target: Address;\n functionSignature: string;\n callType?: 'Call' | 'ValueCall';\n args?: (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )[]\n )[]\n )[]\n )[]\n )[]\n )[];\n approvals?: {\n spender: Address;\n }[];\n}\n\nexport interface CoreStaticCallConfig {\n target: Address;\n functionSignature: string;\n args?: (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )[]\n )[]\n )[]\n )[]\n )[]\n )[];\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?: (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )\n | (\n | MaxLength65536\n | number\n | boolean\n | {\n $ref: string;\n }\n )[]\n )[]\n )[]\n )[]\n )[]\n )[];\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 type ContinuationAssertReadyConfig =\n | {\n kind: 'erc20BalanceGte';\n chainId: Positive;\n token: StartsWith0X;\n owner: StartsWith0X;\n minAmount: string;\n }\n | {\n kind: 'nativeBalanceGte';\n chainId: Positive;\n owner: StartsWith0X;\n minAmount: string;\n }\n | {\n kind: 'call';\n chainId: Positive;\n to: StartsWith0X;\n calldata: StartsWith0X;\n comparator: 'gte' | 'eq' | 'lte';\n value: string;\n };\n/**\n * a string starting with \"0x\"\n */\nexport type StartsWith0X = string;\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\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: NonNegative;\n destDecimals: NonNegative;\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,8 +1,12 @@
|
|
|
1
1
|
import { IntegerStringInput, Address } from '../types.cjs';
|
|
2
2
|
import '@lifi/compose-spec';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* a number between 0 and 10000
|
|
6
|
+
*/
|
|
7
|
+
type Between010000 = number;
|
|
4
8
|
interface CoreSplitConfig {
|
|
5
|
-
bps:
|
|
9
|
+
bps: Between010000;
|
|
6
10
|
}
|
|
7
11
|
/**
|
|
8
12
|
* a positive number
|
|
@@ -74,11 +78,15 @@ interface InvariantEqConfig {
|
|
|
74
78
|
interface InvariantNeqConfig {
|
|
75
79
|
threshold: IntegerStringInput;
|
|
76
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* a non-negative number
|
|
83
|
+
*/
|
|
84
|
+
type NonNegative = number;
|
|
77
85
|
interface CoreBpsDownConfig {
|
|
78
|
-
bps:
|
|
86
|
+
bps: NonNegative;
|
|
79
87
|
}
|
|
80
88
|
interface CoreBpsUpConfig {
|
|
81
|
-
bps:
|
|
89
|
+
bps: NonNegative;
|
|
82
90
|
}
|
|
83
91
|
interface CoreApproveConfig {
|
|
84
92
|
spender: Address;
|
|
@@ -102,22 +110,47 @@ interface CoreEmitEvent3Config {
|
|
|
102
110
|
interface CoreEmitEvent4Config {
|
|
103
111
|
signature: string;
|
|
104
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* a string at most 65536 character(s) long
|
|
115
|
+
*/
|
|
116
|
+
type MaxLength65536 = string;
|
|
105
117
|
interface CoreCallConfig {
|
|
106
118
|
target: Address;
|
|
107
119
|
functionSignature: string;
|
|
108
120
|
callType?: 'Call' | 'ValueCall';
|
|
109
|
-
args?:
|
|
121
|
+
args?: ((MaxLength65536 | number | boolean | {
|
|
122
|
+
$ref: string;
|
|
123
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
124
|
+
$ref: string;
|
|
125
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
126
|
+
$ref: string;
|
|
127
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
128
|
+
$ref: string;
|
|
129
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
130
|
+
$ref: string;
|
|
131
|
+
}) | (MaxLength65536 | number | boolean | {
|
|
132
|
+
$ref: string;
|
|
133
|
+
})[])[])[])[])[])[];
|
|
110
134
|
approvals?: {
|
|
111
135
|
spender: Address;
|
|
112
136
|
}[];
|
|
113
137
|
}
|
|
114
|
-
interface Unknown {
|
|
115
|
-
[k: string]: unknown;
|
|
116
|
-
}
|
|
117
138
|
interface CoreStaticCallConfig {
|
|
118
139
|
target: Address;
|
|
119
140
|
functionSignature: string;
|
|
120
|
-
args?:
|
|
141
|
+
args?: ((MaxLength65536 | number | boolean | {
|
|
142
|
+
$ref: string;
|
|
143
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
144
|
+
$ref: string;
|
|
145
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
146
|
+
$ref: string;
|
|
147
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
148
|
+
$ref: string;
|
|
149
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
150
|
+
$ref: string;
|
|
151
|
+
}) | (MaxLength65536 | number | boolean | {
|
|
152
|
+
$ref: string;
|
|
153
|
+
})[])[])[])[])[])[];
|
|
121
154
|
}
|
|
122
155
|
interface CoreRawCallConfig {
|
|
123
156
|
target: Address;
|
|
@@ -129,7 +162,19 @@ interface CoreInvokeConfig {
|
|
|
129
162
|
target: Address;
|
|
130
163
|
functionSignature: string;
|
|
131
164
|
callType?: 'Call' | 'ValueCall';
|
|
132
|
-
args?:
|
|
165
|
+
args?: ((MaxLength65536 | number | boolean | {
|
|
166
|
+
$ref: string;
|
|
167
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
168
|
+
$ref: string;
|
|
169
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
170
|
+
$ref: string;
|
|
171
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
172
|
+
$ref: string;
|
|
173
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
174
|
+
$ref: string;
|
|
175
|
+
}) | (MaxLength65536 | number | boolean | {
|
|
176
|
+
$ref: string;
|
|
177
|
+
})[])[])[])[])[])[];
|
|
133
178
|
}
|
|
134
179
|
interface CoreAsResourceConfig {
|
|
135
180
|
resource: {
|
|
@@ -381,6 +426,29 @@ interface LifiFlashloanRepayConfig {
|
|
|
381
426
|
leg: string;
|
|
382
427
|
fee?: string;
|
|
383
428
|
}
|
|
429
|
+
type ContinuationAssertReadyConfig = {
|
|
430
|
+
kind: 'erc20BalanceGte';
|
|
431
|
+
chainId: Positive;
|
|
432
|
+
token: StartsWith0X;
|
|
433
|
+
owner: StartsWith0X;
|
|
434
|
+
minAmount: string;
|
|
435
|
+
} | {
|
|
436
|
+
kind: 'nativeBalanceGte';
|
|
437
|
+
chainId: Positive;
|
|
438
|
+
owner: StartsWith0X;
|
|
439
|
+
minAmount: string;
|
|
440
|
+
} | {
|
|
441
|
+
kind: 'call';
|
|
442
|
+
chainId: Positive;
|
|
443
|
+
to: StartsWith0X;
|
|
444
|
+
calldata: StartsWith0X;
|
|
445
|
+
comparator: 'gte' | 'eq' | 'lte';
|
|
446
|
+
value: string;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* a string starting with "0x"
|
|
450
|
+
*/
|
|
451
|
+
type StartsWith0X = string;
|
|
384
452
|
interface LifiZapConfig {
|
|
385
453
|
resourceOut: {
|
|
386
454
|
kind: 'native';
|
|
@@ -391,14 +459,6 @@ interface LifiZapConfig {
|
|
|
391
459
|
chainId: Positive;
|
|
392
460
|
};
|
|
393
461
|
}
|
|
394
|
-
/**
|
|
395
|
-
* a non-negative number
|
|
396
|
-
*/
|
|
397
|
-
type GreaterThanOrEqualTo0 = number;
|
|
398
|
-
/**
|
|
399
|
-
* a number between 0 and 10000
|
|
400
|
-
*/
|
|
401
|
-
type Between010000 = number;
|
|
402
462
|
interface ParaswapBuyConfig {
|
|
403
463
|
resourceOut: {
|
|
404
464
|
kind: 'native';
|
|
@@ -409,8 +469,8 @@ interface ParaswapBuyConfig {
|
|
|
409
469
|
chainId: Positive;
|
|
410
470
|
};
|
|
411
471
|
exactAmountOut: string;
|
|
412
|
-
srcDecimals:
|
|
413
|
-
destDecimals:
|
|
472
|
+
srcDecimals: NonNegative;
|
|
473
|
+
destDecimals: NonNegative;
|
|
414
474
|
maxSlippageBps?: Between010000;
|
|
415
475
|
partner?: string;
|
|
416
476
|
partnerAddress?: string;
|
|
@@ -470,4 +530,4 @@ interface Erc20AllowancePreconditionConfig {
|
|
|
470
530
|
allowance: IntegerStringInput;
|
|
471
531
|
}
|
|
472
532
|
|
|
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,
|
|
533
|
+
export type { AaveBorrowConfig, AaveClaimRewardsConfig, AaveGetHealthFactorConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveSetEModeConfig, BalanceOfMaterialiserConfig, Between010000, Between0255, CallMaterialiserConfig, ContinuationAssertReadyConfig, CoreApproveConfig, CoreAsResourceConfig, CoreBalanceOfConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreCallConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreInvokeConfig, CoreNumericInvariantGuardConfig, CorePeekConfig, CoreRawCallConfig, CoreSplitConfig, CoreStaticCallConfig, CoreTransferConfig, DirectDepositMaterialiserConfig, Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, FlashloanMaterialiserConfig, InvariantEqConfig, InvariantGtConfig, InvariantGteConfig, InvariantLtConfig, InvariantLteConfig, InvariantNeqConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, LifiFlashloanRepayConfig, LifiSwapConfig, LifiZapConfig, MaxItems50, MaxLength64, MaxLength65536, MorphoBlueBorrowConfig, MorphoBlueGetPositionConfig, MorphoBlueRepayConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueWithdrawConfig, NativeBalancePreconditionConfig, NonNegative, ParaswapBuyConfig, Positive, SlippageGuardConfig, StartsWith0X };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { IntegerStringInput, Address } from '../types.js';
|
|
2
2
|
import '@lifi/compose-spec';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* a number between 0 and 10000
|
|
6
|
+
*/
|
|
7
|
+
type Between010000 = number;
|
|
4
8
|
interface CoreSplitConfig {
|
|
5
|
-
bps:
|
|
9
|
+
bps: Between010000;
|
|
6
10
|
}
|
|
7
11
|
/**
|
|
8
12
|
* a positive number
|
|
@@ -74,11 +78,15 @@ interface InvariantEqConfig {
|
|
|
74
78
|
interface InvariantNeqConfig {
|
|
75
79
|
threshold: IntegerStringInput;
|
|
76
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* a non-negative number
|
|
83
|
+
*/
|
|
84
|
+
type NonNegative = number;
|
|
77
85
|
interface CoreBpsDownConfig {
|
|
78
|
-
bps:
|
|
86
|
+
bps: NonNegative;
|
|
79
87
|
}
|
|
80
88
|
interface CoreBpsUpConfig {
|
|
81
|
-
bps:
|
|
89
|
+
bps: NonNegative;
|
|
82
90
|
}
|
|
83
91
|
interface CoreApproveConfig {
|
|
84
92
|
spender: Address;
|
|
@@ -102,22 +110,47 @@ interface CoreEmitEvent3Config {
|
|
|
102
110
|
interface CoreEmitEvent4Config {
|
|
103
111
|
signature: string;
|
|
104
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* a string at most 65536 character(s) long
|
|
115
|
+
*/
|
|
116
|
+
type MaxLength65536 = string;
|
|
105
117
|
interface CoreCallConfig {
|
|
106
118
|
target: Address;
|
|
107
119
|
functionSignature: string;
|
|
108
120
|
callType?: 'Call' | 'ValueCall';
|
|
109
|
-
args?:
|
|
121
|
+
args?: ((MaxLength65536 | number | boolean | {
|
|
122
|
+
$ref: string;
|
|
123
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
124
|
+
$ref: string;
|
|
125
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
126
|
+
$ref: string;
|
|
127
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
128
|
+
$ref: string;
|
|
129
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
130
|
+
$ref: string;
|
|
131
|
+
}) | (MaxLength65536 | number | boolean | {
|
|
132
|
+
$ref: string;
|
|
133
|
+
})[])[])[])[])[])[];
|
|
110
134
|
approvals?: {
|
|
111
135
|
spender: Address;
|
|
112
136
|
}[];
|
|
113
137
|
}
|
|
114
|
-
interface Unknown {
|
|
115
|
-
[k: string]: unknown;
|
|
116
|
-
}
|
|
117
138
|
interface CoreStaticCallConfig {
|
|
118
139
|
target: Address;
|
|
119
140
|
functionSignature: string;
|
|
120
|
-
args?:
|
|
141
|
+
args?: ((MaxLength65536 | number | boolean | {
|
|
142
|
+
$ref: string;
|
|
143
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
144
|
+
$ref: string;
|
|
145
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
146
|
+
$ref: string;
|
|
147
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
148
|
+
$ref: string;
|
|
149
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
150
|
+
$ref: string;
|
|
151
|
+
}) | (MaxLength65536 | number | boolean | {
|
|
152
|
+
$ref: string;
|
|
153
|
+
})[])[])[])[])[])[];
|
|
121
154
|
}
|
|
122
155
|
interface CoreRawCallConfig {
|
|
123
156
|
target: Address;
|
|
@@ -129,7 +162,19 @@ interface CoreInvokeConfig {
|
|
|
129
162
|
target: Address;
|
|
130
163
|
functionSignature: string;
|
|
131
164
|
callType?: 'Call' | 'ValueCall';
|
|
132
|
-
args?:
|
|
165
|
+
args?: ((MaxLength65536 | number | boolean | {
|
|
166
|
+
$ref: string;
|
|
167
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
168
|
+
$ref: string;
|
|
169
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
170
|
+
$ref: string;
|
|
171
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
172
|
+
$ref: string;
|
|
173
|
+
}) | ((MaxLength65536 | number | boolean | {
|
|
174
|
+
$ref: string;
|
|
175
|
+
}) | (MaxLength65536 | number | boolean | {
|
|
176
|
+
$ref: string;
|
|
177
|
+
})[])[])[])[])[])[];
|
|
133
178
|
}
|
|
134
179
|
interface CoreAsResourceConfig {
|
|
135
180
|
resource: {
|
|
@@ -381,6 +426,29 @@ interface LifiFlashloanRepayConfig {
|
|
|
381
426
|
leg: string;
|
|
382
427
|
fee?: string;
|
|
383
428
|
}
|
|
429
|
+
type ContinuationAssertReadyConfig = {
|
|
430
|
+
kind: 'erc20BalanceGte';
|
|
431
|
+
chainId: Positive;
|
|
432
|
+
token: StartsWith0X;
|
|
433
|
+
owner: StartsWith0X;
|
|
434
|
+
minAmount: string;
|
|
435
|
+
} | {
|
|
436
|
+
kind: 'nativeBalanceGte';
|
|
437
|
+
chainId: Positive;
|
|
438
|
+
owner: StartsWith0X;
|
|
439
|
+
minAmount: string;
|
|
440
|
+
} | {
|
|
441
|
+
kind: 'call';
|
|
442
|
+
chainId: Positive;
|
|
443
|
+
to: StartsWith0X;
|
|
444
|
+
calldata: StartsWith0X;
|
|
445
|
+
comparator: 'gte' | 'eq' | 'lte';
|
|
446
|
+
value: string;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* a string starting with "0x"
|
|
450
|
+
*/
|
|
451
|
+
type StartsWith0X = string;
|
|
384
452
|
interface LifiZapConfig {
|
|
385
453
|
resourceOut: {
|
|
386
454
|
kind: 'native';
|
|
@@ -391,14 +459,6 @@ interface LifiZapConfig {
|
|
|
391
459
|
chainId: Positive;
|
|
392
460
|
};
|
|
393
461
|
}
|
|
394
|
-
/**
|
|
395
|
-
* a non-negative number
|
|
396
|
-
*/
|
|
397
|
-
type GreaterThanOrEqualTo0 = number;
|
|
398
|
-
/**
|
|
399
|
-
* a number between 0 and 10000
|
|
400
|
-
*/
|
|
401
|
-
type Between010000 = number;
|
|
402
462
|
interface ParaswapBuyConfig {
|
|
403
463
|
resourceOut: {
|
|
404
464
|
kind: 'native';
|
|
@@ -409,8 +469,8 @@ interface ParaswapBuyConfig {
|
|
|
409
469
|
chainId: Positive;
|
|
410
470
|
};
|
|
411
471
|
exactAmountOut: string;
|
|
412
|
-
srcDecimals:
|
|
413
|
-
destDecimals:
|
|
472
|
+
srcDecimals: NonNegative;
|
|
473
|
+
destDecimals: NonNegative;
|
|
414
474
|
maxSlippageBps?: Between010000;
|
|
415
475
|
partner?: string;
|
|
416
476
|
partnerAddress?: string;
|
|
@@ -470,4 +530,4 @@ interface Erc20AllowancePreconditionConfig {
|
|
|
470
530
|
allowance: IntegerStringInput;
|
|
471
531
|
}
|
|
472
532
|
|
|
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,
|
|
533
|
+
export type { AaveBorrowConfig, AaveClaimRewardsConfig, AaveGetHealthFactorConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveSetEModeConfig, BalanceOfMaterialiserConfig, Between010000, Between0255, CallMaterialiserConfig, ContinuationAssertReadyConfig, CoreApproveConfig, CoreAsResourceConfig, CoreBalanceOfConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreCallConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreInvokeConfig, CoreNumericInvariantGuardConfig, CorePeekConfig, CoreRawCallConfig, CoreSplitConfig, CoreStaticCallConfig, CoreTransferConfig, DirectDepositMaterialiserConfig, Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, FlashloanMaterialiserConfig, InvariantEqConfig, InvariantGtConfig, InvariantGteConfig, InvariantLtConfig, InvariantLteConfig, InvariantNeqConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, LifiFlashloanRepayConfig, LifiSwapConfig, LifiZapConfig, MaxItems50, MaxLength64, MaxLength65536, MorphoBlueBorrowConfig, MorphoBlueGetPositionConfig, MorphoBlueRepayConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueWithdrawConfig, NativeBalancePreconditionConfig, NonNegative, ParaswapBuyConfig, Positive, SlippageGuardConfig, StartsWith0X };
|
|
@@ -20,8 +20,7 @@ var materialisers_generated_exports = {};
|
|
|
20
20
|
__export(materialisers_generated_exports, {
|
|
21
21
|
balanceOf: () => balanceOf,
|
|
22
22
|
call: () => call,
|
|
23
|
-
directDeposit: () => directDeposit
|
|
24
|
-
flashloan: () => flashloan
|
|
23
|
+
directDeposit: () => directDeposit
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(materialisers_generated_exports);
|
|
27
26
|
const balanceOf = (config) => ({
|
|
@@ -36,15 +35,10 @@ const call = (config) => ({
|
|
|
36
35
|
kind: "call",
|
|
37
36
|
...config
|
|
38
37
|
});
|
|
39
|
-
const flashloan = (config) => ({
|
|
40
|
-
kind: "flashloan",
|
|
41
|
-
...config
|
|
42
|
-
});
|
|
43
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
39
|
0 && (module.exports = {
|
|
45
40
|
balanceOf,
|
|
46
41
|
call,
|
|
47
|
-
directDeposit
|
|
48
|
-
flashloan
|
|
42
|
+
directDeposit
|
|
49
43
|
});
|
|
50
44
|
//# sourceMappingURL=materialisers.generated.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/generated/materialisers.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 {\n MaterialiserConfigOf,\n MaterialiserInput,\n} from '@lifi/compose-spec';\n\nimport type {\n BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfigSchema,\n CallMaterialiserConfig as CallMaterialiserConfigSchema,\n DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfigSchema,\n
|
|
1
|
+
{"version":3,"sources":["../../src/generated/materialisers.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 {\n MaterialiserConfigOf,\n MaterialiserInput,\n} from '@lifi/compose-spec';\n\nimport type {\n BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfigSchema,\n CallMaterialiserConfig as CallMaterialiserConfigSchema,\n DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfigSchema,\n} from './config.generated.js';\n\nexport type BalanceOfMaterialiserConfig =\n MaterialiserConfigOf<BalanceOfMaterialiserConfigSchema>;\n\n/** Read the on-chain token balance of an address as the input amount — accepts: resource */\nexport const balanceOf = (\n config: BalanceOfMaterialiserConfig,\n): MaterialiserInput => ({\n kind: 'balanceOf',\n ...config,\n});\n\nexport type DirectDepositMaterialiserConfig =\n MaterialiserConfigOf<DirectDepositMaterialiserConfigSchema>;\n\n/** Deposit tokens into the VM — native via msg.value, ERC-20 via transferFrom — accepts: resource */\nexport const directDeposit = (\n config: DirectDepositMaterialiserConfig,\n): MaterialiserInput => ({\n kind: 'directDeposit',\n ...config,\n});\n\nexport type CallMaterialiserConfig =\n MaterialiserConfigOf<CallMaterialiserConfigSchema>;\n\n/** Execute an arbitrary contract call and measure the resulting token balance diff — accepts: resource */\nexport const call = (config: CallMaterialiserConfig): MaterialiserInput => ({\n kind: 'call',\n ...config,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,MAAM,YAAY,CACvB,YACuB;AAAA,EACvB,MAAM;AAAA,EACN,GAAG;AACL;AAMO,MAAM,gBAAgB,CAC3B,YACuB;AAAA,EACvB,MAAM;AAAA,EACN,GAAG;AACL;AAMO,MAAM,OAAO,CAAC,YAAuD;AAAA,EAC1E,MAAM;AAAA,EACN,GAAG;AACL;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@lifi/compose-spec';
|
|
2
2
|
import './config.generated.cjs';
|
|
3
|
-
export { B as BalanceOfMaterialiserConfig, C as CallMaterialiserConfig, D as DirectDepositMaterialiserConfig,
|
|
3
|
+
export { B as BalanceOfMaterialiserConfig, C as CallMaterialiserConfig, D as DirectDepositMaterialiserConfig, b as balanceOf, c as call, d as directDeposit } from '../materialisers.generated-BWq5oePO.cjs';
|
|
4
4
|
import '../types.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@lifi/compose-spec';
|
|
2
2
|
import './config.generated.js';
|
|
3
|
-
export { B as BalanceOfMaterialiserConfig, C as CallMaterialiserConfig, D as DirectDepositMaterialiserConfig,
|
|
3
|
+
export { B as BalanceOfMaterialiserConfig, C as CallMaterialiserConfig, D as DirectDepositMaterialiserConfig, b as balanceOf, c as call, d as directDeposit } from '../materialisers.generated-BMkBQgWZ.js';
|
|
4
4
|
import '../types.js';
|
|
@@ -10,14 +10,9 @@ const call = (config) => ({
|
|
|
10
10
|
kind: "call",
|
|
11
11
|
...config
|
|
12
12
|
});
|
|
13
|
-
const flashloan = (config) => ({
|
|
14
|
-
kind: "flashloan",
|
|
15
|
-
...config
|
|
16
|
-
});
|
|
17
13
|
export {
|
|
18
14
|
balanceOf,
|
|
19
15
|
call,
|
|
20
|
-
directDeposit
|
|
21
|
-
flashloan
|
|
16
|
+
directDeposit
|
|
22
17
|
};
|
|
23
18
|
//# sourceMappingURL=materialisers.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/generated/materialisers.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 {\n MaterialiserConfigOf,\n MaterialiserInput,\n} from '@lifi/compose-spec';\n\nimport type {\n BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfigSchema,\n CallMaterialiserConfig as CallMaterialiserConfigSchema,\n DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfigSchema,\n
|
|
1
|
+
{"version":3,"sources":["../../src/generated/materialisers.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 {\n MaterialiserConfigOf,\n MaterialiserInput,\n} from '@lifi/compose-spec';\n\nimport type {\n BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfigSchema,\n CallMaterialiserConfig as CallMaterialiserConfigSchema,\n DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfigSchema,\n} from './config.generated.js';\n\nexport type BalanceOfMaterialiserConfig =\n MaterialiserConfigOf<BalanceOfMaterialiserConfigSchema>;\n\n/** Read the on-chain token balance of an address as the input amount — accepts: resource */\nexport const balanceOf = (\n config: BalanceOfMaterialiserConfig,\n): MaterialiserInput => ({\n kind: 'balanceOf',\n ...config,\n});\n\nexport type DirectDepositMaterialiserConfig =\n MaterialiserConfigOf<DirectDepositMaterialiserConfigSchema>;\n\n/** Deposit tokens into the VM — native via msg.value, ERC-20 via transferFrom — accepts: resource */\nexport const directDeposit = (\n config: DirectDepositMaterialiserConfig,\n): MaterialiserInput => ({\n kind: 'directDeposit',\n ...config,\n});\n\nexport type CallMaterialiserConfig =\n MaterialiserConfigOf<CallMaterialiserConfigSchema>;\n\n/** Execute an arbitrary contract call and measure the resulting token balance diff — accepts: resource */\nexport const call = (config: CallMaterialiserConfig): MaterialiserInput => ({\n kind: 'call',\n ...config,\n});\n"],"mappings":"AAkBO,MAAM,YAAY,CACvB,YACuB;AAAA,EACvB,MAAM;AAAA,EACN,GAAG;AACL;AAMO,MAAM,gBAAgB,CAC3B,YACuB;AAAA,EACvB,MAAM;AAAA,EACN,GAAG;AACL;AAMO,MAAM,OAAO,CAAC,YAAuD;AAAA,EAC1E,MAAM;AAAA,EACN,GAAG;AACL;","names":[]}
|
|
@@ -103,7 +103,6 @@ const bindGeneratedOps = (builder) => ({
|
|
|
103
103
|
amountOut: "resource",
|
|
104
104
|
unspentIn: "resource"
|
|
105
105
|
}),
|
|
106
|
-
flashloanRepay: (nodeId, args) => builder.call(nodeId, "lifi.flashloanRepay", args, {}),
|
|
107
106
|
zap: (nodeId, args) => builder.call(nodeId, "lifi.zap", args, {
|
|
108
107
|
amountOut: "resource"
|
|
109
108
|
})
|
|
@@ -183,41 +182,13 @@ const bindGeneratedOps = (builder) => ({
|
|
|
183
182
|
claimed: "resource",
|
|
184
183
|
claimedAmount: "uint256"
|
|
185
184
|
}),
|
|
186
|
-
setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {})
|
|
187
|
-
getHealthFactor: (nodeId, args) => builder.call(nodeId, "aave.getHealthFactor", args, {
|
|
188
|
-
healthFactor: "uint256"
|
|
189
|
-
})
|
|
185
|
+
setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {})
|
|
190
186
|
},
|
|
191
187
|
morphoBlue: {
|
|
192
188
|
supplyCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.supplyCollateral", args, {}),
|
|
193
189
|
withdrawCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdrawCollateral", args, {
|
|
194
190
|
withdrawn: "resource",
|
|
195
191
|
collateralWithdrawn: "uint256"
|
|
196
|
-
}),
|
|
197
|
-
borrow: (nodeId, args) => builder.call(nodeId, "morphoBlue.borrow", args, {
|
|
198
|
-
borrowed: "resource",
|
|
199
|
-
assetsBorrowed: "uint256",
|
|
200
|
-
sharesBorrowed: "uint256"
|
|
201
|
-
}),
|
|
202
|
-
repay: (nodeId, args) => builder.call(nodeId, "morphoBlue.repay", args, {
|
|
203
|
-
actualRepaid: "uint256",
|
|
204
|
-
sharesRepaid: "uint256",
|
|
205
|
-
residual: "resource"
|
|
206
|
-
}),
|
|
207
|
-
supply: (nodeId, args) => builder.call(nodeId, "morphoBlue.supply", args, {
|
|
208
|
-
assetsSupplied: "uint256",
|
|
209
|
-
sharesSupplied: "uint256",
|
|
210
|
-
residual: "resource"
|
|
211
|
-
}),
|
|
212
|
-
withdraw: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdraw", args, {
|
|
213
|
-
withdrawn: "resource",
|
|
214
|
-
assetsWithdrawn: "uint256",
|
|
215
|
-
sharesWithdrawn: "uint256"
|
|
216
|
-
}),
|
|
217
|
-
getPosition: (nodeId, args) => builder.call(nodeId, "morphoBlue.getPosition", args, {
|
|
218
|
-
supplyShares: "uint256",
|
|
219
|
-
borrowShares: "uint128",
|
|
220
|
-
collateral: "uint128"
|
|
221
192
|
})
|
|
222
193
|
},
|
|
223
194
|
paraswap: {
|