@lifi/composer-sdk 0.2.0 → 0.4.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -3
- package/dist/client.cjs +9 -3
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +9 -3
- package/dist/client.js.map +1 -1
- package/dist/errors.cjs +26 -3
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +46 -2
- package/dist/errors.d.ts +46 -2
- package/dist/errors.js +24 -2
- package/dist/errors.js.map +1 -1
- package/dist/generated/config.generated.cjs.map +1 -1
- package/dist/generated/config.generated.d.cts +37 -14
- package/dist/generated/config.generated.d.ts +37 -14
- package/dist/generated/materialisers.generated.cjs +8 -2
- 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 +6 -1
- package/dist/generated/materialisers.generated.js.map +1 -1
- package/dist/generated/operations.generated.cjs +39 -1
- package/dist/generated/operations.generated.cjs.map +1 -1
- package/dist/generated/operations.generated.d.cts +111 -2
- package/dist/generated/operations.generated.d.ts +111 -2
- package/dist/generated/operations.generated.js +39 -1
- package/dist/generated/operations.generated.js.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{materialisers.generated-BMkBQgWZ.d.ts → materialisers.generated-BfWJ-g7t.d.ts} +8 -3
- package/dist/{materialisers.generated-BWq5oePO.d.cts → materialisers.generated-DaJRwiRe.d.cts} +8 -3
- package/dist/responseSchemas.cjs +10 -1
- package/dist/responseSchemas.cjs.map +1 -1
- package/dist/responseSchemas.d.cts +15 -1
- package/dist/responseSchemas.d.ts +15 -1
- package/dist/responseSchemas.js +10 -1
- package/dist/responseSchemas.js.map +1 -1
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +5 -5
- package/dist/sdk.d.ts +5 -5
- package/dist/sdk.js.map +1 -1
- package/package.json +4 -5
- package/src/client.ts +10 -5
- package/src/errors.ts +67 -1
- 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/splitAndZap.ts +2 -2
- package/src/examples/splitWithArithmetic.ts +2 -2
- 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/manualRelayContinuation.ts +161 -0
- package/src/examples/staged/morphoBlueBorrow.ts +93 -0
- package/src/examples/staged/morphoBlueRepay.ts +132 -0
- package/src/examples/staged/registry.ts +89 -0
- 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 +42 -14
- package/src/generated/materialisers.generated.ts +12 -0
- package/src/generated/operations.generated.ts +214 -0
- package/src/index.ts +13 -2
- package/src/responseSchemas.ts +29 -0
- package/src/sdk.ts +5 -5
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type {\n ComposeErrorKind,\n FailedPreparedOp,\n GenericComposeErrorKind,\n SimulationRevert,\n} 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 * The prepared ops that failed, attached to `preparation_error` errors.\n * Each entry carries the `callId` of the failing node so callers can drop\n * the unroutable legs and resubmit a smaller flow.\n */\n readonly failedOps?: readonly FailedPreparedOp[];\n /**\n * The `callId`s of the prepared ops that succeeded, attached to\n * `preparation_error` errors alongside {@link ComposeError.failedOps}.\n */\n readonly succeededOps?: readonly string[];\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 failedOps?: readonly FailedPreparedOp[];\n succeededOps?: readonly string[];\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 this.failedOps = options?.failedOps;\n this.succeededOps = options?.succeededOps;\n }\n}\n\n/**\n * The per-op preparation diagnostics carried by `preparation_error` responses,\n * with both arrays known to be present. Produced by narrowing with\n * {@link isComposePreparationError}.\n */\nexport interface ComposePreparationOps {\n readonly failedOps: readonly FailedPreparedOp[];\n readonly succeededOps: readonly string[];\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\n/**\n * Type guard for `preparation_error` failures (HTTP 422): a mixed basket where\n * some prepared ops failed and others succeeded. Narrows both\n * {@link ComposeError.failedOps} and {@link ComposeError.succeededOps} to\n * present, so callers can read them without a cast or a truthiness check.\n *\n * @param e - The value to check.\n * @returns `true` if `e` is a `ComposeError` carrying per-op preparation diagnostics.\n *\n * @example\n * ```ts\n * try {\n * await builder.compile(run);\n * } catch (e) {\n * if (isComposePreparationError(e)) {\n * console.error('Failed ops:', e.failedOps);\n * console.error('Succeeded ops:', e.succeededOps);\n * }\n * }\n * ```\n */\nexport const isComposePreparationError = (\n e: unknown,\n): e is ComposeError & ComposePreparationOps =>\n isComposeError(e) &&\n e.kind === 'preparation_error' &&\n Array.isArray(e.failedOps) &&\n Array.isArray(e.succeededOps);\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 // The wire schema types `kind` as a bare string; the server only ever\n // reports generic kinds for individual ops.\n failedOps: serverError?.failedOps?.map((op) => ({\n ...op,\n kind: op.kind as GenericComposeErrorKind,\n })),\n succeededOps: serverError?.succeededOps,\n },\n );\n};\n"],"mappings":"AAOA;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;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA,EAET,YACE,MACA,SACA,SAUA;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;AACxB,SAAK,YAAY,SAAS;AAC1B,SAAK,eAAe,SAAS;AAAA,EAC/B;AACF;AAiBO,MAAM,iBAAiB,CAAC,MAC7B,aAAa,gBACZ,aAAa,SAAS,EAAE,SAAS,kBAAkB,UAAU;AAuBzD,MAAM,4BAA4B,CACvC,MAEA,eAAe,CAAC,KAChB,EAAE,SAAS,uBACX,MAAM,QAAQ,EAAE,SAAS,KACzB,MAAM,QAAQ,EAAE,YAAY;AAE9B,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;AAAA;AAAA,MAGtB,WAAW,aAAa,WAAW,IAAI,CAAC,QAAQ;AAAA,QAC9C,GAAG;AAAA,QACH,MAAM,GAAG;AAAA,MACX,EAAE;AAAA,MACF,cAAc,aAAa;AAAA,IAC7B;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\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 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;
|
|
@@ -418,6 +426,29 @@ interface LifiFlashloanRepayConfig {
|
|
|
418
426
|
leg: string;
|
|
419
427
|
fee?: string;
|
|
420
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;
|
|
421
452
|
interface LifiZapConfig {
|
|
422
453
|
resourceOut: {
|
|
423
454
|
kind: 'native';
|
|
@@ -428,14 +459,6 @@ interface LifiZapConfig {
|
|
|
428
459
|
chainId: Positive;
|
|
429
460
|
};
|
|
430
461
|
}
|
|
431
|
-
/**
|
|
432
|
-
* a non-negative number
|
|
433
|
-
*/
|
|
434
|
-
type GreaterThanOrEqualTo0 = number;
|
|
435
|
-
/**
|
|
436
|
-
* a number between 0 and 10000
|
|
437
|
-
*/
|
|
438
|
-
type Between010000 = number;
|
|
439
462
|
interface ParaswapBuyConfig {
|
|
440
463
|
resourceOut: {
|
|
441
464
|
kind: 'native';
|
|
@@ -446,8 +469,8 @@ interface ParaswapBuyConfig {
|
|
|
446
469
|
chainId: Positive;
|
|
447
470
|
};
|
|
448
471
|
exactAmountOut: string;
|
|
449
|
-
srcDecimals:
|
|
450
|
-
destDecimals:
|
|
472
|
+
srcDecimals: NonNegative;
|
|
473
|
+
destDecimals: NonNegative;
|
|
451
474
|
maxSlippageBps?: Between010000;
|
|
452
475
|
partner?: string;
|
|
453
476
|
partnerAddress?: string;
|
|
@@ -507,4 +530,4 @@ interface Erc20AllowancePreconditionConfig {
|
|
|
507
530
|
allowance: IntegerStringInput;
|
|
508
531
|
}
|
|
509
532
|
|
|
510
|
-
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;
|
|
@@ -418,6 +426,29 @@ interface LifiFlashloanRepayConfig {
|
|
|
418
426
|
leg: string;
|
|
419
427
|
fee?: string;
|
|
420
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;
|
|
421
452
|
interface LifiZapConfig {
|
|
422
453
|
resourceOut: {
|
|
423
454
|
kind: 'native';
|
|
@@ -428,14 +459,6 @@ interface LifiZapConfig {
|
|
|
428
459
|
chainId: Positive;
|
|
429
460
|
};
|
|
430
461
|
}
|
|
431
|
-
/**
|
|
432
|
-
* a non-negative number
|
|
433
|
-
*/
|
|
434
|
-
type GreaterThanOrEqualTo0 = number;
|
|
435
|
-
/**
|
|
436
|
-
* a number between 0 and 10000
|
|
437
|
-
*/
|
|
438
|
-
type Between010000 = number;
|
|
439
462
|
interface ParaswapBuyConfig {
|
|
440
463
|
resourceOut: {
|
|
441
464
|
kind: 'native';
|
|
@@ -446,8 +469,8 @@ interface ParaswapBuyConfig {
|
|
|
446
469
|
chainId: Positive;
|
|
447
470
|
};
|
|
448
471
|
exactAmountOut: string;
|
|
449
|
-
srcDecimals:
|
|
450
|
-
destDecimals:
|
|
472
|
+
srcDecimals: NonNegative;
|
|
473
|
+
destDecimals: NonNegative;
|
|
451
474
|
maxSlippageBps?: Between010000;
|
|
452
475
|
partner?: string;
|
|
453
476
|
partnerAddress?: string;
|
|
@@ -507,4 +530,4 @@ interface Erc20AllowancePreconditionConfig {
|
|
|
507
530
|
allowance: IntegerStringInput;
|
|
508
531
|
}
|
|
509
532
|
|
|
510
|
-
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,7 +20,8 @@ var materialisers_generated_exports = {};
|
|
|
20
20
|
__export(materialisers_generated_exports, {
|
|
21
21
|
balanceOf: () => balanceOf,
|
|
22
22
|
call: () => call,
|
|
23
|
-
directDeposit: () => directDeposit
|
|
23
|
+
directDeposit: () => directDeposit,
|
|
24
|
+
flashloan: () => flashloan
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(materialisers_generated_exports);
|
|
26
27
|
const balanceOf = (config) => ({
|
|
@@ -35,10 +36,15 @@ const call = (config) => ({
|
|
|
35
36
|
kind: "call",
|
|
36
37
|
...config
|
|
37
38
|
});
|
|
39
|
+
const flashloan = (config) => ({
|
|
40
|
+
kind: "flashloan",
|
|
41
|
+
...config
|
|
42
|
+
});
|
|
38
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
44
|
0 && (module.exports = {
|
|
40
45
|
balanceOf,
|
|
41
46
|
call,
|
|
42
|
-
directDeposit
|
|
47
|
+
directDeposit,
|
|
48
|
+
flashloan
|
|
43
49
|
});
|
|
44
50
|
//# 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} 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;
|
|
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 FlashloanMaterialiserConfig as FlashloanMaterialiserConfigSchema,\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\nexport type FlashloanMaterialiserConfig =\n MaterialiserConfigOf<FlashloanMaterialiserConfigSchema>;\n\n/** Borrow tokens from a flashloan provider; amount becomes a register populated by the proxy at callback time — accepts: resource */\nexport const flashloan = (\n config: FlashloanMaterialiserConfig,\n): MaterialiserInput => ({\n kind: 'flashloan',\n ...config,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,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;AAMO,MAAM,YAAY,CACvB,YACuB;AAAA,EACvB,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, b as balanceOf, c as call, d as directDeposit } from '../materialisers.generated-
|
|
3
|
+
export { B as BalanceOfMaterialiserConfig, C as CallMaterialiserConfig, D as DirectDepositMaterialiserConfig, F as FlashloanMaterialiserConfig, b as balanceOf, c as call, d as directDeposit, f as flashloan } from '../materialisers.generated-DaJRwiRe.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, b as balanceOf, c as call, d as directDeposit } from '../materialisers.generated-
|
|
3
|
+
export { B as BalanceOfMaterialiserConfig, C as CallMaterialiserConfig, D as DirectDepositMaterialiserConfig, F as FlashloanMaterialiserConfig, b as balanceOf, c as call, d as directDeposit, f as flashloan } from '../materialisers.generated-BfWJ-g7t.js';
|
|
4
4
|
import '../types.js';
|
|
@@ -10,9 +10,14 @@ const call = (config) => ({
|
|
|
10
10
|
kind: "call",
|
|
11
11
|
...config
|
|
12
12
|
});
|
|
13
|
+
const flashloan = (config) => ({
|
|
14
|
+
kind: "flashloan",
|
|
15
|
+
...config
|
|
16
|
+
});
|
|
13
17
|
export {
|
|
14
18
|
balanceOf,
|
|
15
19
|
call,
|
|
16
|
-
directDeposit
|
|
20
|
+
directDeposit,
|
|
21
|
+
flashloan
|
|
17
22
|
};
|
|
18
23
|
//# 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} 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":"
|
|
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 FlashloanMaterialiserConfig as FlashloanMaterialiserConfigSchema,\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\nexport type FlashloanMaterialiserConfig =\n MaterialiserConfigOf<FlashloanMaterialiserConfigSchema>;\n\n/** Borrow tokens from a flashloan provider; amount becomes a register populated by the proxy at callback time — accepts: resource */\nexport const flashloan = (\n config: FlashloanMaterialiserConfig,\n): MaterialiserInput => ({\n kind: 'flashloan',\n ...config,\n});\n"],"mappings":"AAmBO,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;AAMO,MAAM,YAAY,CACvB,YACuB;AAAA,EACvB,MAAM;AAAA,EACN,GAAG;AACL;","names":[]}
|
|
@@ -103,6 +103,7 @@ const bindGeneratedOps = (builder) => ({
|
|
|
103
103
|
amountOut: "resource",
|
|
104
104
|
unspentIn: "resource"
|
|
105
105
|
}),
|
|
106
|
+
flashloanRepay: (nodeId, args) => builder.call(nodeId, "lifi.flashloanRepay", args, {}),
|
|
106
107
|
zap: (nodeId, args) => builder.call(nodeId, "lifi.zap", args, {
|
|
107
108
|
amountOut: "resource"
|
|
108
109
|
})
|
|
@@ -182,15 +183,52 @@ const bindGeneratedOps = (builder) => ({
|
|
|
182
183
|
claimed: "resource",
|
|
183
184
|
claimedAmount: "uint256"
|
|
184
185
|
}),
|
|
185
|
-
setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {})
|
|
186
|
+
setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {}),
|
|
187
|
+
getHealthFactor: (nodeId, args) => builder.call(nodeId, "aave.getHealthFactor", args, {
|
|
188
|
+
healthFactor: "uint256"
|
|
189
|
+
})
|
|
186
190
|
},
|
|
187
191
|
morphoBlue: {
|
|
188
192
|
supplyCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.supplyCollateral", args, {}),
|
|
189
193
|
withdrawCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdrawCollateral", args, {
|
|
190
194
|
withdrawn: "resource",
|
|
191
195
|
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"
|
|
192
221
|
})
|
|
193
222
|
},
|
|
223
|
+
continuation: {
|
|
224
|
+
assertReady: (nodeId, args) => builder.call(nodeId, "continuation.assertReady", args, {}),
|
|
225
|
+
commitment: (nodeId, args) => builder.call(
|
|
226
|
+
nodeId,
|
|
227
|
+
"continuation.commitment",
|
|
228
|
+
{ ...args, config: {} },
|
|
229
|
+
{}
|
|
230
|
+
)
|
|
231
|
+
},
|
|
194
232
|
paraswap: {
|
|
195
233
|
buy: (nodeId, args) => builder.call(nodeId, "paraswap.buy", args, {
|
|
196
234
|
amountOut: "resource",
|