@lifi/composer-sdk 0.7.1 → 0.9.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 +5 -2
- package/dist/_virtual/_rolldown/runtime.cjs +33 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/authoring/FlowBuilderCore.cjs +102 -120
- package/dist/authoring/FlowBuilderCore.cjs.map +1 -1
- package/dist/authoring/FlowBuilderCore.d.cts +58 -61
- package/dist/authoring/FlowBuilderCore.d.ts +58 -61
- package/dist/authoring/FlowBuilderCore.js +99 -97
- package/dist/authoring/FlowBuilderCore.js.map +1 -1
- package/dist/authoring/handles.cjs +25 -40
- package/dist/authoring/handles.cjs.map +1 -1
- package/dist/authoring/handles.d.cts +33 -34
- package/dist/authoring/handles.d.ts +33 -34
- package/dist/authoring/handles.js +21 -13
- package/dist/authoring/handles.js.map +1 -1
- package/dist/authoring/raw.cjs +85 -44
- package/dist/authoring/raw.cjs.map +1 -1
- package/dist/authoring/raw.d.cts +8 -8
- package/dist/authoring/raw.d.ts +8 -8
- package/dist/authoring/raw.js +83 -19
- package/dist/authoring/raw.js.map +1 -1
- package/dist/authoring/signatureArgs.cjs +81 -103
- package/dist/authoring/signatureArgs.cjs.map +1 -1
- package/dist/authoring/signatureArgs.d.cts +63 -64
- package/dist/authoring/signatureArgs.d.ts +63 -64
- package/dist/authoring/signatureArgs.js +76 -75
- package/dist/authoring/signatureArgs.js.map +1 -1
- package/dist/client.cjs +172 -220
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +131 -131
- package/dist/client.d.ts +131 -131
- package/dist/client.js +165 -198
- package/dist/client.js.map +1 -1
- package/dist/discovery.cjs +0 -17
- package/dist/discovery.d.cts +57 -56
- package/dist/discovery.d.ts +57 -56
- package/dist/discovery.js +1 -1
- package/dist/errors.cjs +211 -159
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +84 -84
- package/dist/errors.d.ts +84 -84
- package/dist/errors.js +201 -120
- package/dist/errors.js.map +1 -1
- package/dist/generated/config.generated.cjs +0 -17
- package/dist/generated/config.generated.d.cts +805 -895
- package/dist/generated/config.generated.d.ts +805 -895
- package/dist/generated/config.generated.js +1 -1
- package/dist/generated/guards.generated.cjs +27 -31
- package/dist/generated/guards.generated.cjs.map +1 -1
- package/dist/generated/guards.generated.d.cts +20 -4
- package/dist/generated/guards.generated.d.ts +20 -4
- package/dist/generated/guards.generated.js +21 -8
- package/dist/generated/guards.generated.js.map +1 -1
- package/dist/generated/materialisers.generated.cjs +25 -35
- package/dist/generated/materialisers.generated.cjs.map +1 -1
- package/dist/generated/materialisers.generated.d.cts +17 -4
- package/dist/generated/materialisers.generated.d.ts +17 -4
- package/dist/generated/materialisers.generated.js +19 -11
- package/dist/generated/materialisers.generated.js.map +1 -1
- package/dist/generated/operations.generated.cjs +236 -250
- package/dist/generated/operations.generated.cjs.map +1 -1
- package/dist/generated/operations.generated.d.cts +740 -657
- package/dist/generated/operations.generated.d.ts +740 -657
- package/dist/generated/operations.generated.js +235 -229
- package/dist/generated/operations.generated.js.map +1 -1
- package/dist/generated/preconditions.generated.cjs +25 -35
- package/dist/generated/preconditions.generated.cjs.map +1 -1
- package/dist/generated/preconditions.generated.d.cts +17 -4
- package/dist/generated/preconditions.generated.d.ts +17 -4
- package/dist/generated/preconditions.generated.js +19 -11
- package/dist/generated/preconditions.generated.js.map +1 -1
- package/dist/index.cjs +131 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -43
- package/dist/index.d.ts +29 -43
- package/dist/index.js +96 -45
- package/dist/index.js.map +1 -1
- package/dist/outputs.cjs +11 -32
- package/dist/outputs.cjs.map +1 -1
- package/dist/outputs.d.cts +5 -5
- package/dist/outputs.d.ts +5 -5
- package/dist/outputs.js +10 -8
- package/dist/outputs.js.map +1 -1
- package/dist/raw.cjs +21 -33
- package/dist/raw.cjs.map +1 -1
- package/dist/raw.d.cts +8 -4
- package/dist/raw.d.ts +8 -4
- package/dist/raw.js +12 -7
- package/dist/raw.js.map +1 -1
- package/dist/reachability.cjs +82 -112
- package/dist/reachability.cjs.map +1 -1
- package/dist/reachability.d.cts +33 -59
- package/dist/reachability.d.ts +33 -59
- package/dist/reachability.js +81 -88
- package/dist/reachability.js.map +1 -1
- package/dist/resources.cjs +47 -32
- package/dist/resources.cjs.map +1 -1
- package/dist/resources.d.cts +50 -3
- package/dist/resources.d.ts +50 -3
- package/dist/resources.js +42 -9
- package/dist/resources.js.map +1 -1
- package/dist/responseSchemas.cjs +99 -111
- package/dist/responseSchemas.cjs.map +1 -1
- package/dist/responseSchemas.d.cts +34 -34
- package/dist/responseSchemas.d.ts +34 -34
- package/dist/responseSchemas.js +85 -66
- package/dist/responseSchemas.js.map +1 -1
- package/dist/routeAmount.cjs +61 -31
- package/dist/routeAmount.cjs.map +1 -1
- package/dist/routeAmount.d.cts +52 -2
- package/dist/routeAmount.d.ts +52 -2
- package/dist/routeAmount.js +56 -8
- package/dist/routeAmount.js.map +1 -1
- package/dist/run/inputs.cjs +56 -48
- package/dist/run/inputs.cjs.map +1 -1
- package/dist/run/inputs.d.cts +70 -74
- package/dist/run/inputs.d.ts +70 -74
- package/dist/run/inputs.js +54 -23
- package/dist/run/inputs.js.map +1 -1
- package/dist/run/simulate.cjs +38 -43
- package/dist/run/simulate.cjs.map +1 -1
- package/dist/run/simulate.d.cts +36 -36
- package/dist/run/simulate.d.ts +36 -36
- package/dist/run/simulate.js +37 -19
- package/dist/run/simulate.js.map +1 -1
- package/dist/sdk.cjs +55 -66
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +108 -111
- package/dist/sdk.d.ts +108 -111
- package/dist/sdk.js +52 -44
- package/dist/sdk.js.map +1 -1
- package/dist/types.cjs +0 -17
- package/dist/types.d.cts +22 -22
- package/dist/types.d.ts +22 -22
- package/dist/types.js +1 -1
- package/package.json +4 -4
- package/src/client.ts +2 -2
- package/src/examples/aaveClaimRewards.ts +2 -1
- package/src/examples/emitCustomEvent.ts +1 -2
- package/src/examples/run.ts +14 -1
- package/src/examples/transferTokens.ts +21 -17
- package/src/examples/uniswapV2AddLiquidity.ts +106 -0
- package/src/examples/uniswapV3Mint.ts +95 -0
- package/src/generated/config.generated.ts +102 -47
- package/src/generated/guards.generated.ts +9 -0
- package/src/generated/operations.generated.ts +161 -5
- package/src/index.ts +0 -3
- package/dist/discovery.cjs.map +0 -1
- package/dist/discovery.js.map +0 -1
- package/dist/generated/config.generated.cjs.map +0 -1
- package/dist/generated/config.generated.js.map +0 -1
- package/dist/guards.generated-BPLFwe7y.d.ts +0 -19
- package/dist/guards.generated-M3VAIevI.d.cts +0 -19
- package/dist/materialisers.generated-BMkBQgWZ.d.ts +0 -24
- package/dist/materialisers.generated-BWq5oePO.d.cts +0 -24
- package/dist/preconditions.generated-DblS13Wq.d.cts +0 -24
- package/dist/preconditions.generated-U7YpVh30.d.ts +0 -24
- package/dist/raw-BvRghN3r.d.ts +0 -20
- package/dist/raw-s1rer8X3.d.cts +0 -20
- package/dist/resources-BKlFxjo8.d.cts +0 -56
- package/dist/resources-CYis1_DS.d.ts +0 -56
- package/dist/routeAmount-DdbJYJyM.d.cts +0 -55
- package/dist/routeAmount-DdbJYJyM.d.ts +0 -55
- package/dist/types.cjs.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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 * an array of at most 16 item(s)\n *\n * @minItems 2\n * @maxItems 16\n */\nexport type MaxItems16 =\n | [Between19999, Between19999]\n | [Between19999, Between19999, Between19999]\n | [Between19999, Between19999, Between19999, Between19999]\n | [Between19999, Between19999, Between19999, Between19999, Between19999]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ]\n | [\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n Between19999,\n ];\n/**\n * a number between 1 and 9999\n */\nexport type Between19999 = number;\n\nexport interface CorePartitionConfig {\n bps: MaxItems16;\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\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\n/**\n * a string starting with \"0x\"\n */\nexport type StartsWith0X = string;\n/**\n * a number between 0 and 1\n */\nexport type Between01 = number;\n\nexport interface LifiBridgeConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n chainId: Positive;\n };\n destination: StartsWith0X;\n slippage?: Between01;\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 bridges?: {\n allow?: MaxItems50;\n deny?: MaxItems50;\n prefer?: MaxItems50;\n };\n exchanges?: {\n allow?: MaxItems50;\n deny?: MaxItems50;\n prefer?: MaxItems50;\n };\n order?: 'FASTEST' | 'CHEAPEST';\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n spender: Address;\n}\n\nexport interface CoreBalanceOfConfig {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\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 | {\n spender: Address;\n }\n | {\n from: 'sender';\n }\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n chainId: Positive;\n };\n}\n\nexport interface AaveBorrowConfig {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n pool: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n asset: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n variableDebtToken: string;\n amount: IntegerStringInput;\n referralId?: number;\n}\n\nexport type AaveRepayConfig =\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n pool: string;\n mode: 'exact';\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n pool: string;\n mode: 'max';\n };\n\nexport interface AaveRepayWithATokensConfig {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n pool: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n asset: string;\n}\n\nexport interface AaveClaimRewardsConfig {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n rewardsController: string;\n assets: string[];\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n reward: string;\n amount?: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n to?: string;\n}\n\n/**\n * a number between 0 and 255\n */\nexport type Between0255 = number;\n\nexport interface AaveSetEModeConfig {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n pool: string;\n category: Between0255;\n}\n\nexport interface AaveGetHealthFactorConfig {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n pool: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n user?: string;\n}\n\nexport type MorphoBlueSupplyCollateralConfig =\n | (\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n mode: 'exact';\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n mode: 'all';\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueWithdrawCollateralConfig =\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n amount: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n amount: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueBorrowConfig =\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n amount: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n amount: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueRepayConfig =\n | (\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n mode: 'exact';\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n mode: 'max';\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueSupplyConfig =\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n };\n\nexport type MorphoBlueWithdrawConfig =\n | (\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n mode: 'exact';\n amount: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n mode: 'exact';\n amount: IntegerStringInput;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n }\n )\n | (\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n mode: 'max';\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n mode: 'max';\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n onBehalfOf?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n receiver?: string;\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n irm: string;\n lltv: string;\n };\n }\n );\n\nexport type MorphoBlueGetPositionConfig =\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n user?: string;\n /**\n * a string matching the pattern ^0x[0-9a-fA-F]{64}$\n */\n marketId: string;\n }\n | {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n morpho?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n user?: string;\n marketParams: {\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n loanToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n collateralToken: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n oracle: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n owner: Address;\n minAmount: string;\n }\n | {\n kind: 'nativeBalanceGte';\n chainId: Positive;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n owner: Address;\n minAmount: string;\n }\n | {\n kind: 'call';\n chainId: Positive;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n to: string;\n /**\n * Hex bytes: 0x followed by an even number of hex characters\n */\n calldata: string;\n comparator: 'gte' | 'eq' | 'lte';\n value: string;\n };\n\nexport interface LifiZapConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n chainId: Positive;\n };\n}\n\nexport interface LifiZapAsyncConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n /**\n * EVM address: 0x followed by 40 hex characters\n */\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n chainId: Positive;\n };\n exactAmountOut: string;\n srcDecimals: NonNegative;\n destDecimals: NonNegative;\n maxSlippageBps?: Between010000;\n partner?: string;\n /**\n * EVM address: 0x followed by 40 hex characters\n */\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\n target: Address;\n functionSignature: string;\n args?: string[];\n}\n\n/**\n * a number between 0 and 3318\n */\nexport type Between03318 = number;\n/**\n * a number between 0 and 5000\n */\nexport type Between05000 = number;\n\nexport interface FlySwapConfig {\n resourceOut:\n | {\n kind: 'native';\n chainId: Positive;\n }\n | {\n kind: 'erc20';\n /**\n * EVM address: 0x followed by 40 hex characters\n */\n token: Address;\n chainId: Positive;\n };\n inputVarianceBps?: Between03318;\n maxSlippageBps?: Between05000;\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\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 /**\n * EVM address: 0x followed by 40 hex characters\n */\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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TypedGuard } from './types.js';
|
|
2
|
-
import { CoreNumericInvariantGuardConfig, SlippageGuardConfig } from './generated/config.generated.js';
|
|
3
|
-
|
|
4
|
-
/** Assert that output amounts are within a slippage tolerance in basis points */
|
|
5
|
-
declare const slippage: <P extends string>(config: Omit<SlippageGuardConfig, "port"> & {
|
|
6
|
-
port: P;
|
|
7
|
-
}) => TypedGuard<P>;
|
|
8
|
-
/** Assert a numeric (uint256) handle output of the target op satisfies a comparison against a constant threshold. Emits one IR1 binary invariant; reverts the run on violation. */
|
|
9
|
-
declare const coreNumericInvariant: <P extends string>(config: Omit<CoreNumericInvariantGuardConfig, "port"> & {
|
|
10
|
-
port: P;
|
|
11
|
-
}) => TypedGuard<P>;
|
|
12
|
-
|
|
13
|
-
declare const guardsMod_coreNumericInvariant: typeof coreNumericInvariant;
|
|
14
|
-
declare const guardsMod_slippage: typeof slippage;
|
|
15
|
-
declare namespace guardsMod {
|
|
16
|
-
export { guardsMod_coreNumericInvariant as coreNumericInvariant, guardsMod_slippage as slippage };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { coreNumericInvariant as c, guardsMod as g, slippage as s };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TypedGuard } from './types.cjs';
|
|
2
|
-
import { CoreNumericInvariantGuardConfig, SlippageGuardConfig } from './generated/config.generated.cjs';
|
|
3
|
-
|
|
4
|
-
/** Assert that output amounts are within a slippage tolerance in basis points */
|
|
5
|
-
declare const slippage: <P extends string>(config: Omit<SlippageGuardConfig, "port"> & {
|
|
6
|
-
port: P;
|
|
7
|
-
}) => TypedGuard<P>;
|
|
8
|
-
/** Assert a numeric (uint256) handle output of the target op satisfies a comparison against a constant threshold. Emits one IR1 binary invariant; reverts the run on violation. */
|
|
9
|
-
declare const coreNumericInvariant: <P extends string>(config: Omit<CoreNumericInvariantGuardConfig, "port"> & {
|
|
10
|
-
port: P;
|
|
11
|
-
}) => TypedGuard<P>;
|
|
12
|
-
|
|
13
|
-
declare const guardsMod_coreNumericInvariant: typeof coreNumericInvariant;
|
|
14
|
-
declare const guardsMod_slippage: typeof slippage;
|
|
15
|
-
declare namespace guardsMod {
|
|
16
|
-
export { guardsMod_coreNumericInvariant as coreNumericInvariant, guardsMod_slippage as slippage };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { coreNumericInvariant as c, guardsMod as g, slippage as s };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MaterialiserConfigOf, MaterialiserInput } from '@lifi/compose-spec';
|
|
2
|
-
import { BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfig$1, CallMaterialiserConfig as CallMaterialiserConfig$1, DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfig$1 } from './generated/config.generated.js';
|
|
3
|
-
|
|
4
|
-
type BalanceOfMaterialiserConfig = MaterialiserConfigOf<BalanceOfMaterialiserConfig$1>;
|
|
5
|
-
/** Read the on-chain token balance of an address as the input amount — accepts: resource */
|
|
6
|
-
declare const balanceOf: (config: BalanceOfMaterialiserConfig) => MaterialiserInput;
|
|
7
|
-
type DirectDepositMaterialiserConfig = MaterialiserConfigOf<DirectDepositMaterialiserConfig$1>;
|
|
8
|
-
/** Deposit tokens into the VM — native via msg.value, ERC-20 via transferFrom — accepts: resource */
|
|
9
|
-
declare const directDeposit: (config: DirectDepositMaterialiserConfig) => MaterialiserInput;
|
|
10
|
-
type CallMaterialiserConfig = MaterialiserConfigOf<CallMaterialiserConfig$1>;
|
|
11
|
-
/** Execute an arbitrary contract call and measure the resulting token balance diff — accepts: resource */
|
|
12
|
-
declare const call: (config: CallMaterialiserConfig) => MaterialiserInput;
|
|
13
|
-
|
|
14
|
-
type materialisersMod_BalanceOfMaterialiserConfig = BalanceOfMaterialiserConfig;
|
|
15
|
-
type materialisersMod_CallMaterialiserConfig = CallMaterialiserConfig;
|
|
16
|
-
type materialisersMod_DirectDepositMaterialiserConfig = DirectDepositMaterialiserConfig;
|
|
17
|
-
declare const materialisersMod_balanceOf: typeof balanceOf;
|
|
18
|
-
declare const materialisersMod_call: typeof call;
|
|
19
|
-
declare const materialisersMod_directDeposit: typeof directDeposit;
|
|
20
|
-
declare namespace materialisersMod {
|
|
21
|
-
export { type materialisersMod_BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfig, type materialisersMod_CallMaterialiserConfig as CallMaterialiserConfig, type materialisersMod_DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfig, materialisersMod_balanceOf as balanceOf, materialisersMod_call as call, materialisersMod_directDeposit as directDeposit };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { type BalanceOfMaterialiserConfig as B, type CallMaterialiserConfig as C, type DirectDepositMaterialiserConfig as D, balanceOf as b, call as c, directDeposit as d, materialisersMod as m };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MaterialiserConfigOf, MaterialiserInput } from '@lifi/compose-spec';
|
|
2
|
-
import { BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfig$1, CallMaterialiserConfig as CallMaterialiserConfig$1, DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfig$1 } from './generated/config.generated.cjs';
|
|
3
|
-
|
|
4
|
-
type BalanceOfMaterialiserConfig = MaterialiserConfigOf<BalanceOfMaterialiserConfig$1>;
|
|
5
|
-
/** Read the on-chain token balance of an address as the input amount — accepts: resource */
|
|
6
|
-
declare const balanceOf: (config: BalanceOfMaterialiserConfig) => MaterialiserInput;
|
|
7
|
-
type DirectDepositMaterialiserConfig = MaterialiserConfigOf<DirectDepositMaterialiserConfig$1>;
|
|
8
|
-
/** Deposit tokens into the VM — native via msg.value, ERC-20 via transferFrom — accepts: resource */
|
|
9
|
-
declare const directDeposit: (config: DirectDepositMaterialiserConfig) => MaterialiserInput;
|
|
10
|
-
type CallMaterialiserConfig = MaterialiserConfigOf<CallMaterialiserConfig$1>;
|
|
11
|
-
/** Execute an arbitrary contract call and measure the resulting token balance diff — accepts: resource */
|
|
12
|
-
declare const call: (config: CallMaterialiserConfig) => MaterialiserInput;
|
|
13
|
-
|
|
14
|
-
type materialisersMod_BalanceOfMaterialiserConfig = BalanceOfMaterialiserConfig;
|
|
15
|
-
type materialisersMod_CallMaterialiserConfig = CallMaterialiserConfig;
|
|
16
|
-
type materialisersMod_DirectDepositMaterialiserConfig = DirectDepositMaterialiserConfig;
|
|
17
|
-
declare const materialisersMod_balanceOf: typeof balanceOf;
|
|
18
|
-
declare const materialisersMod_call: typeof call;
|
|
19
|
-
declare const materialisersMod_directDeposit: typeof directDeposit;
|
|
20
|
-
declare namespace materialisersMod {
|
|
21
|
-
export { type materialisersMod_BalanceOfMaterialiserConfig as BalanceOfMaterialiserConfig, type materialisersMod_CallMaterialiserConfig as CallMaterialiserConfig, type materialisersMod_DirectDepositMaterialiserConfig as DirectDepositMaterialiserConfig, materialisersMod_balanceOf as balanceOf, materialisersMod_call as call, materialisersMod_directDeposit as directDeposit };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { type BalanceOfMaterialiserConfig as B, type CallMaterialiserConfig as C, type DirectDepositMaterialiserConfig as D, balanceOf as b, call as c, directDeposit as d, materialisersMod as m };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PreconditionConfigOf, Precondition } from '@lifi/compose-spec';
|
|
2
|
-
import { Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, NativeBalancePreconditionConfig } from './generated/config.generated.cjs';
|
|
3
|
-
|
|
4
|
-
type Erc20BalancePreconditionInput = PreconditionConfigOf<Erc20BalancePreconditionConfig>;
|
|
5
|
-
/** Assert that a wallet holds at least a given ERC-20 token balance */
|
|
6
|
-
declare const erc20Balance: (config: Erc20BalancePreconditionInput) => Precondition;
|
|
7
|
-
type NativeBalancePreconditionInput = PreconditionConfigOf<NativeBalancePreconditionConfig>;
|
|
8
|
-
/** Assert that a wallet holds at least a given native coin balance */
|
|
9
|
-
declare const nativeBalance: (config: NativeBalancePreconditionInput) => Precondition;
|
|
10
|
-
type Erc20AllowancePreconditionInput = PreconditionConfigOf<Erc20AllowancePreconditionConfig>;
|
|
11
|
-
/** Assert that an ERC-20 allowance is at least a given amount */
|
|
12
|
-
declare const erc20Allowance: (config: Erc20AllowancePreconditionInput) => Precondition;
|
|
13
|
-
|
|
14
|
-
type preconditionsMod_Erc20AllowancePreconditionInput = Erc20AllowancePreconditionInput;
|
|
15
|
-
type preconditionsMod_Erc20BalancePreconditionInput = Erc20BalancePreconditionInput;
|
|
16
|
-
type preconditionsMod_NativeBalancePreconditionInput = NativeBalancePreconditionInput;
|
|
17
|
-
declare const preconditionsMod_erc20Allowance: typeof erc20Allowance;
|
|
18
|
-
declare const preconditionsMod_erc20Balance: typeof erc20Balance;
|
|
19
|
-
declare const preconditionsMod_nativeBalance: typeof nativeBalance;
|
|
20
|
-
declare namespace preconditionsMod {
|
|
21
|
-
export { type preconditionsMod_Erc20AllowancePreconditionInput as Erc20AllowancePreconditionInput, type preconditionsMod_Erc20BalancePreconditionInput as Erc20BalancePreconditionInput, type preconditionsMod_NativeBalancePreconditionInput as NativeBalancePreconditionInput, preconditionsMod_erc20Allowance as erc20Allowance, preconditionsMod_erc20Balance as erc20Balance, preconditionsMod_nativeBalance as nativeBalance };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { type Erc20AllowancePreconditionInput as E, type NativeBalancePreconditionInput as N, type Erc20BalancePreconditionInput as a, erc20Balance as b, erc20Allowance as e, nativeBalance as n, preconditionsMod as p };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PreconditionConfigOf, Precondition } from '@lifi/compose-spec';
|
|
2
|
-
import { Erc20AllowancePreconditionConfig, Erc20BalancePreconditionConfig, NativeBalancePreconditionConfig } from './generated/config.generated.js';
|
|
3
|
-
|
|
4
|
-
type Erc20BalancePreconditionInput = PreconditionConfigOf<Erc20BalancePreconditionConfig>;
|
|
5
|
-
/** Assert that a wallet holds at least a given ERC-20 token balance */
|
|
6
|
-
declare const erc20Balance: (config: Erc20BalancePreconditionInput) => Precondition;
|
|
7
|
-
type NativeBalancePreconditionInput = PreconditionConfigOf<NativeBalancePreconditionConfig>;
|
|
8
|
-
/** Assert that a wallet holds at least a given native coin balance */
|
|
9
|
-
declare const nativeBalance: (config: NativeBalancePreconditionInput) => Precondition;
|
|
10
|
-
type Erc20AllowancePreconditionInput = PreconditionConfigOf<Erc20AllowancePreconditionConfig>;
|
|
11
|
-
/** Assert that an ERC-20 allowance is at least a given amount */
|
|
12
|
-
declare const erc20Allowance: (config: Erc20AllowancePreconditionInput) => Precondition;
|
|
13
|
-
|
|
14
|
-
type preconditionsMod_Erc20AllowancePreconditionInput = Erc20AllowancePreconditionInput;
|
|
15
|
-
type preconditionsMod_Erc20BalancePreconditionInput = Erc20BalancePreconditionInput;
|
|
16
|
-
type preconditionsMod_NativeBalancePreconditionInput = NativeBalancePreconditionInput;
|
|
17
|
-
declare const preconditionsMod_erc20Allowance: typeof erc20Allowance;
|
|
18
|
-
declare const preconditionsMod_erc20Balance: typeof erc20Balance;
|
|
19
|
-
declare const preconditionsMod_nativeBalance: typeof nativeBalance;
|
|
20
|
-
declare namespace preconditionsMod {
|
|
21
|
-
export { type preconditionsMod_Erc20AllowancePreconditionInput as Erc20AllowancePreconditionInput, type preconditionsMod_Erc20BalancePreconditionInput as Erc20BalancePreconditionInput, type preconditionsMod_NativeBalancePreconditionInput as NativeBalancePreconditionInput, preconditionsMod_erc20Allowance as erc20Allowance, preconditionsMod_erc20Balance as erc20Balance, preconditionsMod_nativeBalance as nativeBalance };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { type Erc20AllowancePreconditionInput as E, type NativeBalancePreconditionInput as N, type Erc20BalancePreconditionInput as a, erc20Balance as b, erc20Allowance as e, nativeBalance as n, preconditionsMod as p };
|
package/dist/raw-BvRghN3r.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { rawGuard, literal, ref } from './authoring/raw.js';
|
|
2
|
-
import { materialiser } from './run/inputs.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Low-level escape hatch for constructing flow nodes and guards without the
|
|
6
|
-
* typed builder API. Use these when working with operation kinds not covered
|
|
7
|
-
* by the generated methods, or when you need full control over the JSON shape.
|
|
8
|
-
*
|
|
9
|
-
* For most use cases, prefer the generated operation methods on {@link FlowBuilder}
|
|
10
|
-
* (e.g. `builder.lifi.swap(...)`) and the typed guard/materialiser helpers.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
declare const rawMod_literal: typeof literal;
|
|
14
|
-
declare const rawMod_materialiser: typeof materialiser;
|
|
15
|
-
declare const rawMod_ref: typeof ref;
|
|
16
|
-
declare namespace rawMod {
|
|
17
|
-
export { rawGuard as guard, rawMod_literal as literal, rawMod_materialiser as materialiser, rawMod_ref as ref };
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { rawMod as r };
|
package/dist/raw-s1rer8X3.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { rawGuard, literal, ref } from './authoring/raw.cjs';
|
|
2
|
-
import { materialiser } from './run/inputs.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Low-level escape hatch for constructing flow nodes and guards without the
|
|
6
|
-
* typed builder API. Use these when working with operation kinds not covered
|
|
7
|
-
* by the generated methods, or when you need full control over the JSON shape.
|
|
8
|
-
*
|
|
9
|
-
* For most use cases, prefer the generated operation methods on {@link FlowBuilder}
|
|
10
|
-
* (e.g. `builder.lifi.swap(...)`) and the typed guard/materialiser helpers.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
declare const rawMod_literal: typeof literal;
|
|
14
|
-
declare const rawMod_materialiser: typeof materialiser;
|
|
15
|
-
declare const rawMod_ref: typeof ref;
|
|
16
|
-
declare namespace rawMod {
|
|
17
|
-
export { rawGuard as guard, rawMod_literal as literal, rawMod_materialiser as materialiser, rawMod_ref as ref };
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { rawMod as r };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Address } from './types.cjs';
|
|
2
|
-
|
|
3
|
-
/** A resource declaration representing the chain's native token (e.g. ETH, MATIC). */
|
|
4
|
-
interface NativeResource {
|
|
5
|
-
readonly kind: 'native';
|
|
6
|
-
readonly chainId: number;
|
|
7
|
-
}
|
|
8
|
-
/** A resource declaration representing an ERC-20 token at a specific address. */
|
|
9
|
-
interface Erc20Resource {
|
|
10
|
-
readonly kind: 'erc20';
|
|
11
|
-
readonly token: Address;
|
|
12
|
-
readonly chainId: number;
|
|
13
|
-
}
|
|
14
|
-
/** A token resource — either the chain's native token or an ERC-20. */
|
|
15
|
-
type Resource = NativeResource | Erc20Resource;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a native token resource declaration.
|
|
18
|
-
*
|
|
19
|
-
* @param chainId - The EVM chain ID the native token belongs to.
|
|
20
|
-
* @returns A {@link NativeResource} for use in flow input schemas.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const builder = sdk.flow(1, {
|
|
25
|
-
* inputs: { eth: native(1) },
|
|
26
|
-
* });
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const native: (chainId: number) => NativeResource;
|
|
30
|
-
/**
|
|
31
|
-
* Creates an ERC-20 token resource declaration.
|
|
32
|
-
*
|
|
33
|
-
* @param token - The `0x`-prefixed contract address of the ERC-20 token.
|
|
34
|
-
* @param chainId - The EVM chain ID the token is deployed on.
|
|
35
|
-
* @returns An {@link Erc20Resource} for use in flow input schemas.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
|
|
40
|
-
* const builder = sdk.flow(1, {
|
|
41
|
-
* inputs: { usdc: erc20(USDC, 1) },
|
|
42
|
-
* });
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
declare const erc20: (token: Address, chainId: number) => Erc20Resource;
|
|
46
|
-
|
|
47
|
-
type resourcesMod_Erc20Resource = Erc20Resource;
|
|
48
|
-
type resourcesMod_NativeResource = NativeResource;
|
|
49
|
-
type resourcesMod_Resource = Resource;
|
|
50
|
-
declare const resourcesMod_erc20: typeof erc20;
|
|
51
|
-
declare const resourcesMod_native: typeof native;
|
|
52
|
-
declare namespace resourcesMod {
|
|
53
|
-
export { type resourcesMod_Erc20Resource as Erc20Resource, type resourcesMod_NativeResource as NativeResource, type resourcesMod_Resource as Resource, resourcesMod_erc20 as erc20, resourcesMod_native as native };
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { type Erc20Resource as E, type NativeResource as N, type Resource as R, erc20 as e, native as n, resourcesMod as r };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Address } from './types.js';
|
|
2
|
-
|
|
3
|
-
/** A resource declaration representing the chain's native token (e.g. ETH, MATIC). */
|
|
4
|
-
interface NativeResource {
|
|
5
|
-
readonly kind: 'native';
|
|
6
|
-
readonly chainId: number;
|
|
7
|
-
}
|
|
8
|
-
/** A resource declaration representing an ERC-20 token at a specific address. */
|
|
9
|
-
interface Erc20Resource {
|
|
10
|
-
readonly kind: 'erc20';
|
|
11
|
-
readonly token: Address;
|
|
12
|
-
readonly chainId: number;
|
|
13
|
-
}
|
|
14
|
-
/** A token resource — either the chain's native token or an ERC-20. */
|
|
15
|
-
type Resource = NativeResource | Erc20Resource;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a native token resource declaration.
|
|
18
|
-
*
|
|
19
|
-
* @param chainId - The EVM chain ID the native token belongs to.
|
|
20
|
-
* @returns A {@link NativeResource} for use in flow input schemas.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const builder = sdk.flow(1, {
|
|
25
|
-
* inputs: { eth: native(1) },
|
|
26
|
-
* });
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const native: (chainId: number) => NativeResource;
|
|
30
|
-
/**
|
|
31
|
-
* Creates an ERC-20 token resource declaration.
|
|
32
|
-
*
|
|
33
|
-
* @param token - The `0x`-prefixed contract address of the ERC-20 token.
|
|
34
|
-
* @param chainId - The EVM chain ID the token is deployed on.
|
|
35
|
-
* @returns An {@link Erc20Resource} for use in flow input schemas.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* const USDC = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
|
|
40
|
-
* const builder = sdk.flow(1, {
|
|
41
|
-
* inputs: { usdc: erc20(USDC, 1) },
|
|
42
|
-
* });
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
declare const erc20: (token: Address, chainId: number) => Erc20Resource;
|
|
46
|
-
|
|
47
|
-
type resourcesMod_Erc20Resource = Erc20Resource;
|
|
48
|
-
type resourcesMod_NativeResource = NativeResource;
|
|
49
|
-
type resourcesMod_Resource = Resource;
|
|
50
|
-
declare const resourcesMod_erc20: typeof erc20;
|
|
51
|
-
declare const resourcesMod_native: typeof native;
|
|
52
|
-
declare namespace resourcesMod {
|
|
53
|
-
export { type resourcesMod_Erc20Resource as Erc20Resource, type resourcesMod_NativeResource as NativeResource, type resourcesMod_Resource as Resource, resourcesMod_erc20 as erc20, resourcesMod_native as native };
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { type Erc20Resource as E, type NativeResource as N, type Resource as R, erc20 as e, native as n, resourcesMod as r };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { RouteAmountAll, RouteAmountExact } from '@lifi/compose-spec';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Spend an exact amount of the route's `fromToken`.
|
|
5
|
-
*
|
|
6
|
-
* @param amount - Amount in the token's smallest unit. `bigint` is serialised
|
|
7
|
-
* to a decimal string when the request is sent.
|
|
8
|
-
* @returns The `EXACT` member of the route amount union.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const result = await sdk.route({
|
|
13
|
-
* chainId: 1,
|
|
14
|
-
* fromToken: NATIVE_ETH,
|
|
15
|
-
* toToken: WETH,
|
|
16
|
-
* amount: routeAmount.exact(10n ** 17n), // 0.1 ETH, wrapped
|
|
17
|
-
* signer: OWNER,
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
declare const exact: (amount: bigint | string) => RouteAmountExact;
|
|
22
|
-
/**
|
|
23
|
-
* Spend the signer's entire `fromToken` balance, resolved on-chain at execution
|
|
24
|
-
* time.
|
|
25
|
-
*
|
|
26
|
-
* Not supported when `fromToken` is the chain's native sentinel — the server
|
|
27
|
-
* rejects it. A gas coin is sent via `msg.value`, so there is no on-chain
|
|
28
|
-
* balance to sweep; use {@link exact} for native inputs.
|
|
29
|
-
*
|
|
30
|
-
* @param simAmount - A realistic estimate of that balance, in the token's
|
|
31
|
-
* smallest unit. The server quotes and simulates against this value, so it
|
|
32
|
-
* shapes the returned quote and preconditions — but the amount actually moved
|
|
33
|
-
* is whatever the balance turns out to be.
|
|
34
|
-
* @returns The `ALL` member of the route amount union.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const result = await sdk.route({
|
|
39
|
-
* chainId: 1,
|
|
40
|
-
* fromToken: USDC,
|
|
41
|
-
* toToken: A_ETH_USDC,
|
|
42
|
-
* amount: routeAmount.all(1_000_000n), // estimate: ~1 USDC on hand
|
|
43
|
-
* signer: OWNER,
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
declare const all: (simAmount: bigint | string) => RouteAmountAll;
|
|
48
|
-
|
|
49
|
-
declare const routeAmountMod_all: typeof all;
|
|
50
|
-
declare const routeAmountMod_exact: typeof exact;
|
|
51
|
-
declare namespace routeAmountMod {
|
|
52
|
-
export { routeAmountMod_all as all, routeAmountMod_exact as exact };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { all as a, exact as e, routeAmountMod as r };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { RouteAmountAll, RouteAmountExact } from '@lifi/compose-spec';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Spend an exact amount of the route's `fromToken`.
|
|
5
|
-
*
|
|
6
|
-
* @param amount - Amount in the token's smallest unit. `bigint` is serialised
|
|
7
|
-
* to a decimal string when the request is sent.
|
|
8
|
-
* @returns The `EXACT` member of the route amount union.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const result = await sdk.route({
|
|
13
|
-
* chainId: 1,
|
|
14
|
-
* fromToken: NATIVE_ETH,
|
|
15
|
-
* toToken: WETH,
|
|
16
|
-
* amount: routeAmount.exact(10n ** 17n), // 0.1 ETH, wrapped
|
|
17
|
-
* signer: OWNER,
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
declare const exact: (amount: bigint | string) => RouteAmountExact;
|
|
22
|
-
/**
|
|
23
|
-
* Spend the signer's entire `fromToken` balance, resolved on-chain at execution
|
|
24
|
-
* time.
|
|
25
|
-
*
|
|
26
|
-
* Not supported when `fromToken` is the chain's native sentinel — the server
|
|
27
|
-
* rejects it. A gas coin is sent via `msg.value`, so there is no on-chain
|
|
28
|
-
* balance to sweep; use {@link exact} for native inputs.
|
|
29
|
-
*
|
|
30
|
-
* @param simAmount - A realistic estimate of that balance, in the token's
|
|
31
|
-
* smallest unit. The server quotes and simulates against this value, so it
|
|
32
|
-
* shapes the returned quote and preconditions — but the amount actually moved
|
|
33
|
-
* is whatever the balance turns out to be.
|
|
34
|
-
* @returns The `ALL` member of the route amount union.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const result = await sdk.route({
|
|
39
|
-
* chainId: 1,
|
|
40
|
-
* fromToken: USDC,
|
|
41
|
-
* toToken: A_ETH_USDC,
|
|
42
|
-
* amount: routeAmount.all(1_000_000n), // estimate: ~1 USDC on hand
|
|
43
|
-
* signer: OWNER,
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
declare const all: (simAmount: bigint | string) => RouteAmountAll;
|
|
48
|
-
|
|
49
|
-
declare const routeAmountMod_all: typeof all;
|
|
50
|
-
declare const routeAmountMod_exact: typeof exact;
|
|
51
|
-
declare namespace routeAmountMod {
|
|
52
|
-
export { routeAmountMod_all as all, routeAmountMod_exact as exact };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { all as a, exact as e, routeAmountMod as r };
|
package/dist/types.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { LiteralBinding, Ref } from '@lifi/compose-spec';\nimport {\n InputSpec,\n MaterialiserInput,\n Resource,\n SolType,\n} from '@lifi/compose-spec';\n\n/**\n * A string that represents a non-negative integer (e.g. \"1000000000\").\n * Uses a template literal type so that only numeric-looking strings\n * are assignable at compile time.\n */\nexport type IntegerString = `${bigint}`;\n\n/**\n * Accepted input for integer-string config fields.\n * Callers may pass either a numeric string (\"1000000000\") or a native bigint\n * (1000000000n). Bigint values are stringified automatically during JSON\n * serialization via the SDK's `bigintReplacer`.\n */\nexport type IntegerStringInput = IntegerString | bigint;\n\n/**\n * A `0x`-prefixed hex string representing an Ethereum address.\n * Template literal type catches obviously wrong values at compile time.\n */\nexport type Address = `0x${string}`;\n\n/** The universe of output port kinds: Solidity scalar types plus `'resource'`. */\nexport type OutputKind = SolType | 'resource';\n\n/**\n * Maps an ABI parameter type string (from abitype's `ParseAbiItem`) to the\n * closest `OutputKind`. When the ABI type is one of the supported `SolType`\n * scalars, the mapping is exact; for all other Solidity types (e.g. tuples,\n * fixed-point decimals) it falls back to `SolType` — accepting any scalar\n * handle but not `'resource'` handles.\n *\n * The fallback excludes `'resource'` because every Solidity type is a scalar;\n * resource handles carry token-amount semantics that should only flow into\n * slots explicitly declared as resources.\n *\n * Extending `SolType` with new members automatically widens the exact-match\n * branch — no changes needed here.\n */\nexport type AbiTypeToOutputKind<T extends string> = T extends SolType\n ? T\n : SolType;\n\n/**\n * Phantom brand key for {@link TypedRef}.\n *\n * Declared, never assigned: it exists only so the type checker can tell a\n * typed ref from an arbitrary `{ $ref }` object. Keying it on a `unique\n * symbol` means no caller can produce one by writing an object literal.\n */\nexport declare const typedRefKind: unique symbol;\n\n/**\n * A typed `$ref` pointer carrying a phantom type parameter.\n *\n * On the wire, and at run time, this is exactly `{ $ref: string }` — the\n * brand is erased. The brand is *required* in the type so a plain `Ref` does\n * not satisfy `TypedRef` structurally, which is the contract `RefBindable`\n * advertises: an untyped `{ $ref }` never enters a typed bind slot. Build one\n * with `raw.ref<T>()`.\n */\nexport interface TypedRef<T extends OutputKind = OutputKind> extends Ref {\n readonly [typedRefKind]: T;\n}\n\n/**\n * A literal bind value carrying a phantom type parameter.\n *\n * The wire format accepts a constant in a bind slot as\n * `{ kind: <solType>, value: <string> }`, alongside `$ref` pointers. Use it\n * for a value that must be baked into the flow document rather than supplied\n * at run time — the destination of a flow the backend stores and re-runs\n * later (a `continuation.settle` node's `continuationFlow`) has no run to\n * take an input from.\n *\n * @typeParam T - The Solidity type of the literal (e.g. `'address'`).\n */\nexport interface TypedLiteral<\n T extends SolType = SolType,\n> extends LiteralBinding {\n readonly kind: T;\n readonly __outputKind?: T;\n}\n\n/**\n * An input declaration in a flow schema.\n * `Resource` values become resource inputs (token amounts);\n * `SolType` strings become handle inputs (scalars like addresses).\n */\nexport type InputDecl = Resource | SolType;\n\n/**\n * A record mapping input names to their declarations.\n * Used as the type parameter for generic flow builders and requests.\n */\nexport type InputSchema = Record<string, InputDecl>;\n\n/**\n * Maps an input declaration to the allowed runtime value type.\n * Resource inputs accept materialisers or literal amounts.\n * Handle inputs accept the scalar type matching their SolType.\n */\nexport type InputSpecOf<D> = D extends Resource\n ? MaterialiserInput | IntegerStringInput\n : D extends 'address'\n ? Address\n : D extends 'bool'\n ? boolean\n : D extends `${'u' | ''}int${string}`\n ? IntegerStringInput\n : D extends `bytes${string}`\n ? `0x${string}`\n : D extends 'string'\n ? string\n : InputSpec;\n\n/**\n * A guard applied to an operation, with the `port` field constrained\n * to a specific set of output port names.\n */\nexport interface TypedGuard<Port extends string = string> {\n readonly kind: string;\n readonly port: Port;\n readonly [key: string]: unknown;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|