UNPKG

@lifi/composer-sdk

Version:

Public Composer SDK for building and submitting flows

583 lines (580 loc) 32.7 kB
import { FlowBuilderInternal } from '../authoring/FlowBuilderCore.cjs'; import { Bindable, OutputHandle } from '../authoring/handles.cjs'; import { SignatureBind, CoreCallResult, StaticCallResult } from '../authoring/signatureArgs.cjs'; import { TypedGuard } from '../types.cjs'; import { CoreSplitConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiZapConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, ParaswapBuyConfig } from './config.generated.cjs'; import '@lifi/compose-spec'; import 'abitype'; /** Split a resource into two outputs by basis-point ratio */ interface CoreSplitArgs { readonly bind: { readonly source: Bindable<'resource'>; }; readonly config: CoreSplitConfig; readonly guards?: readonly TypedGuard<'a' | 'b'>[]; } /** Merge two same-token resources into one by addition */ interface CoreMergeArgs { readonly bind: { readonly a: Bindable<'resource'>; readonly b: Bindable<'resource'>; }; readonly guards?: readonly TypedGuard<'merged'>[]; } /** Swap tokens via the LI.FI aggregator API */ interface LifiSwapArgs { readonly bind: { readonly amountIn: Bindable<'resource'>; }; readonly config: LifiSwapConfig; readonly guards?: readonly TypedGuard<'unspentIn'>[]; } /** Assert that an account holds at least a minimum token balance */ interface InvariantBalanceAtLeastArgs { readonly bind: { readonly minimumAmount: Bindable<'resource'>; readonly account: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that an account holds exactly an expected token balance */ interface InvariantBalanceEqualsArgs { readonly bind: { readonly expectedAmount: Bindable<'resource'>; readonly account: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that an account holds at most a maximum token balance */ interface InvariantBalanceAtMostArgs { readonly bind: { readonly maximumAmount: Bindable<'resource'>; readonly account: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that an account's token balance is between a minimum and a maximum (inclusive) */ interface InvariantBalanceInRangeArgs { readonly bind: { readonly minimumAmount: Bindable<'resource'>; readonly maximumAmount: Bindable<'uint256'>; readonly account: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that a spender is permitted to move at least a minimum allowance on behalf of an owner */ interface InvariantAllowanceAtLeastArgs { readonly bind: { readonly minimumAmount: Bindable<'resource'>; readonly owner: Bindable<'address'>; readonly spender: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that a spender's allowance on behalf of an owner exactly equals an expected amount */ interface InvariantAllowanceEqualsArgs { readonly bind: { readonly expectedAmount: Bindable<'resource'>; readonly owner: Bindable<'address'>; readonly spender: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that a spender is permitted to move at most a maximum allowance on behalf of an owner */ interface InvariantAllowanceAtMostArgs { readonly bind: { readonly maximumAmount: Bindable<'resource'>; readonly owner: Bindable<'address'>; readonly spender: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert that a spender's allowance on behalf of an owner is between a minimum and a maximum (inclusive) */ interface InvariantAllowanceInRangeArgs { readonly bind: { readonly minimumAmount: Bindable<'resource'>; readonly maximumAmount: Bindable<'uint256'>; readonly owner: Bindable<'address'>; readonly spender: Bindable<'address'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert a uint256 value satisfies a comparison against a constant threshold; reverts on violation */ interface InvariantNumericArgs { readonly bind: { readonly value: Bindable<'uint256'>; }; readonly config: InvariantNumericConfig; readonly guards?: readonly TypedGuard<never>[]; } /** Assert min <= value <= max against constant bounds; reverts if outside the range */ interface InvariantNumericInRangeArgs { readonly bind: { readonly value: Bindable<'uint256'>; }; readonly config: InvariantNumericInRangeConfig; readonly guards?: readonly TypedGuard<never>[]; } /** Add two unsigned integers (a + b) */ interface CoreAddArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Subtract b from a (a - b); reverts on underflow */ interface CoreSubtractArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Multiply two unsigned integers (a * b) */ interface CoreMultiplyArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Divide a by b, rounding toward zero */ interface CoreDivideDownArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Divide a by b, rounding away from zero */ interface CoreDivideUpArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Multiply value by basis points and divide by 10000, rounding down */ interface CoreBpsDownArgs { readonly bind: { readonly value: Bindable<'uint256'>; }; readonly config: CoreBpsDownConfig; readonly guards?: readonly TypedGuard<'result'>[]; } /** Multiply value by basis points and divide by 10000, rounding up */ interface CoreBpsUpArgs { readonly bind: { readonly value: Bindable<'uint256'>; }; readonly config: CoreBpsUpConfig; readonly guards?: readonly TypedGuard<'result'>[]; } /** Assert a == b; reverts if not equal */ interface CoreAssertEqualArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert a != b; reverts if equal */ interface CoreAssertNotEqualArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert a > b; reverts if a <= b */ interface CoreAssertGtArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert a >= b; reverts if a < b */ interface CoreAssertGteArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert a < b; reverts if a >= b */ interface CoreAssertLtArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert a <= b; reverts if a > b */ interface CoreAssertLteArgs { readonly bind: { readonly a: Bindable<'uint256'>; readonly b: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Assert min <= value <= max; reverts if value is outside the range */ interface CoreAssertInRangeArgs { readonly bind: { readonly value: Bindable<'uint256'>; readonly min: Bindable<'uint256'>; readonly max: Bindable<'uint256'>; }; readonly guards?: readonly TypedGuard<never>[]; } /** Approve an ERC20 spender for the given token and amount */ interface CoreApproveArgs { readonly bind: { readonly amount: Bindable<'resource'>; }; readonly config: CoreApproveConfig; readonly guards?: readonly TypedGuard<never>[]; } /** Read an ERC20 balance, producing a resource */ interface CoreBalanceOfArgs { readonly bind: Record<string, never>; readonly config: CoreBalanceOfConfig; readonly guards?: readonly TypedGuard<'balance'>[]; } /** Transfer tokens to a recipient address, optionally specifying a partial amount */ interface CoreTransferArgs { readonly bind: { readonly amount: Bindable<'resource'>; readonly recipient: Bindable<'address'>; }; readonly config: CoreTransferConfig; readonly guards?: readonly TypedGuard<'transferred' | 'remainder'>[]; } /** Emit a custom on-chain event carrying 1 32-byte payload value. The value becomes a non-indexed data word in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */ interface CoreEmitEvent1Args { readonly bind: { readonly value0: Bindable<'bytes32'>; }; readonly config: CoreEmitEvent1Config; readonly guards?: readonly TypedGuard<never>[]; } /** Emit a custom on-chain event carrying 2 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */ interface CoreEmitEvent2Args { readonly bind: { readonly value0: Bindable<'bytes32'>; readonly value1: Bindable<'bytes32'>; }; readonly config: CoreEmitEvent2Config; readonly guards?: readonly TypedGuard<never>[]; } /** Emit a custom on-chain event carrying 3 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */ interface CoreEmitEvent3Args { readonly bind: { readonly value0: Bindable<'bytes32'>; readonly value1: Bindable<'bytes32'>; readonly value2: Bindable<'bytes32'>; }; readonly config: CoreEmitEvent3Config; readonly guards?: readonly TypedGuard<never>[]; } /** Emit a custom on-chain event carrying 4 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */ interface CoreEmitEvent4Args { readonly bind: { readonly value0: Bindable<'bytes32'>; readonly value1: Bindable<'bytes32'>; readonly value2: Bindable<'bytes32'>; readonly value3: Bindable<'bytes32'>; }; readonly config: CoreEmitEvent4Config; readonly guards?: readonly TypedGuard<never>[]; } /** Invoke a smart contract function, optionally spending a token resource */ interface CoreCallArgs<TSig extends string = string> { readonly resource?: Bindable<'resource'>; readonly bind: SignatureBind<TSig>; readonly config: Omit<CoreCallConfig, 'args' | 'functionSignature'> & { readonly functionSignature: TSig; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Read from a smart contract at runtime (StaticCall); result is fresh at execution time */ interface CoreStaticCallArgs<TSig extends string = string> { readonly bind: SignatureBind<TSig>; readonly config: Omit<CoreStaticCallConfig, 'args' | 'functionSignature'> & { readonly functionSignature: TSig; }; readonly guards?: readonly TypedGuard<'result'>[]; } /** Invoke a contract with pre-encoded calldata */ interface CoreRawCallArgs { readonly bind: Record<string, never>; readonly config: CoreRawCallConfig; readonly guards?: readonly TypedGuard<'result'>[]; } /** Graduate a raw handle to a resource, enabling slippage surfacing and linearity tracking */ interface CoreAsResourceArgs { readonly bind: { readonly handle: Bindable<'uint256'>; }; readonly config: CoreAsResourceConfig; readonly guards?: readonly TypedGuard<'resource'>[]; } /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource */ interface AaveBorrowArgs { readonly bind: Record<string, never>; readonly config: AaveBorrowConfig; readonly guards?: readonly TypedGuard<'debtBalance'>[]; } /** Repay an Aave v3 variable-rate debt position with the supplied asset. mode: 'exact' passes the input handle amount; mode: 'max' passes type(uint256).max so Aave's Pool clamps paybackAmount to userVariableDebt exactly. Any unspent input is returned through the residual port. */ interface AaveRepayArgs { readonly bind: { readonly assetIn: Bindable<'resource'>; readonly onBehalfOf: Bindable<'address'>; }; readonly config: AaveRepayConfig; readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[]; } /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual */ interface AaveRepayWithATokensArgs { readonly bind: { readonly aTokenIn: Bindable<'resource'>; }; readonly config: AaveRepayWithATokensConfig; readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[]; } /** Claim a specific Aave v3 incentives reward token against a set of receipt-token positions, exposing the claimed amount as a Resource */ interface AaveClaimRewardsArgs { readonly bind: Record<string, never>; readonly config: AaveClaimRewardsConfig; readonly guards?: readonly TypedGuard<'claimedAmount'>[]; } /** Switch the executionAddress's Aave v3 eMode category. 0 disables eMode. The pool reverts if the switch would make the position unhealthy or if any open borrow is for an asset outside the target category. */ interface AaveSetEModeArgs { readonly bind: Record<string, never>; readonly config: AaveSetEModeConfig; readonly guards?: readonly TypedGuard<never>[]; } /** Deposit the collateral asset of a Morpho Blue market on behalf of the execution proxy. mode: 'exact' pulls the input handle's amount. mode: 'all' reads the proxy's current ERC20 balance of the market's collateral token and pulls that amount, ignoring the input handle's literal value — note this pulls the proxy's total balance (including unrelated upstream residuals), not just the input port's delivery. Credits Position.collateral on the Morpho singleton; emits no return value and exposes no resource output (the collateral is non-transferable accounting state). */ interface MorphoBlueSupplyCollateralArgs { readonly bind: { readonly assetIn: Bindable<'resource'>; }; readonly config: MorphoBlueSupplyCollateralConfig; readonly guards?: readonly TypedGuard<never>[]; } /** Withdraw collateral from a Morpho Blue market position to the receiver address. Exposes the withdrawn ERC20 amount as a Resource output. */ interface MorphoBlueWithdrawCollateralArgs { readonly bind: Record<string, never>; readonly config: MorphoBlueWithdrawCollateralConfig; readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[]; } /** Route tokens into a DeFi protocol position via the edge catalog */ interface LifiZapArgs { readonly bind: { readonly amountIn: Bindable<'resource'>; }; readonly config: LifiZapConfig; readonly guards?: readonly TypedGuard<'amountOut'>[]; } /** Exact-output (BUY) swap via the Paraswap/Velora Market API: produce exactly `exactAmountOut` of the destination token, pulling only the source needed and exposing the genuinely-unspent source as `unspentIn`. */ interface ParaswapBuyArgs { readonly bind: { readonly amountIn: Bindable<'resource'>; }; readonly config: ParaswapBuyConfig; readonly guards?: readonly TypedGuard<'unspentIn'>[]; } /** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal */ interface CorePeekArgs { readonly bind: Record<string, never>; readonly config: CorePeekConfig; readonly guards?: readonly TypedGuard<'result'>[]; } interface CoreSplitOutputs { readonly a: OutputHandle<'resource'>; readonly b: OutputHandle<'resource'>; } interface CoreMergeOutputs { readonly merged: OutputHandle<'resource'>; } interface LifiSwapOutputs { readonly amountOut: OutputHandle<'resource'>; readonly unspentIn: OutputHandle<'resource'>; } interface CoreAddOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreSubtractOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreMultiplyOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreDivideDownOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreDivideUpOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreBpsDownOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreBpsUpOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreBalanceOfOutputs { readonly balance: OutputHandle<'resource'>; } interface CoreTransferOutputs { readonly transferred: OutputHandle<'resource'>; readonly remainder: OutputHandle<'resource'>; } interface CoreRawCallOutputs { readonly result: OutputHandle<'uint256'>; } interface CoreAsResourceOutputs { readonly resource: OutputHandle<'resource'>; } interface AaveBorrowOutputs { readonly borrowed: OutputHandle<'resource'>; readonly debtBalance: OutputHandle<'uint256'>; } interface AaveRepayOutputs { readonly actualRepaid: OutputHandle<'uint256'>; readonly residual: OutputHandle<'resource'>; } interface AaveRepayWithATokensOutputs { readonly actualRepaid: OutputHandle<'uint256'>; readonly residual: OutputHandle<'resource'>; } interface AaveClaimRewardsOutputs { readonly claimed: OutputHandle<'resource'>; readonly claimedAmount: OutputHandle<'uint256'>; } interface MorphoBlueWithdrawCollateralOutputs { readonly withdrawn: OutputHandle<'resource'>; readonly collateralWithdrawn: OutputHandle<'uint256'>; } interface LifiZapOutputs { readonly amountOut: OutputHandle<'resource'>; } interface ParaswapBuyOutputs { readonly amountOut: OutputHandle<'resource'>; readonly unspentIn: OutputHandle<'resource'>; } interface CorePeekOutputs { readonly result: OutputHandle<'uint256'>; } type GeneratedOps = { readonly core: { /** Split a resource into two outputs by basis-point ratio — original id: "core.split" */ readonly split: (nodeId: string, args: CoreSplitArgs) => CoreSplitOutputs; /** Merge two same-token resources into one by addition — original id: "core.merge" */ readonly merge: (nodeId: string, args: CoreMergeArgs) => CoreMergeOutputs; /** Add two unsigned integers (a + b) — original id: "core.add" */ readonly add: (nodeId: string, args: CoreAddArgs) => CoreAddOutputs; /** Subtract b from a (a - b); reverts on underflow — original id: "core.subtract" */ readonly subtract: (nodeId: string, args: CoreSubtractArgs) => CoreSubtractOutputs; /** Multiply two unsigned integers (a * b) — original id: "core.multiply" */ readonly multiply: (nodeId: string, args: CoreMultiplyArgs) => CoreMultiplyOutputs; /** Divide a by b, rounding toward zero — original id: "core.divideDown" */ readonly divideDown: (nodeId: string, args: CoreDivideDownArgs) => CoreDivideDownOutputs; /** Divide a by b, rounding away from zero — original id: "core.divideUp" */ readonly divideUp: (nodeId: string, args: CoreDivideUpArgs) => CoreDivideUpOutputs; /** Multiply value by basis points and divide by 10000, rounding down — original id: "core.bpsDown" */ readonly bpsDown: (nodeId: string, args: CoreBpsDownArgs) => CoreBpsDownOutputs; /** Multiply value by basis points and divide by 10000, rounding up — original id: "core.bpsUp" */ readonly bpsUp: (nodeId: string, args: CoreBpsUpArgs) => CoreBpsUpOutputs; /** Assert a == b; reverts if not equal — original id: "core.assertEqual" */ readonly assertEqual: (nodeId: string, args: CoreAssertEqualArgs) => void; /** Assert a != b; reverts if equal — original id: "core.assertNotEqual" */ readonly assertNotEqual: (nodeId: string, args: CoreAssertNotEqualArgs) => void; /** Assert a > b; reverts if a <= b — original id: "core.assertGt" */ readonly assertGt: (nodeId: string, args: CoreAssertGtArgs) => void; /** Assert a >= b; reverts if a < b — original id: "core.assertGte" */ readonly assertGte: (nodeId: string, args: CoreAssertGteArgs) => void; /** Assert a < b; reverts if a >= b — original id: "core.assertLt" */ readonly assertLt: (nodeId: string, args: CoreAssertLtArgs) => void; /** Assert a <= b; reverts if a > b — original id: "core.assertLte" */ readonly assertLte: (nodeId: string, args: CoreAssertLteArgs) => void; /** Assert min <= value <= max; reverts if value is outside the range — original id: "core.assertInRange" */ readonly assertInRange: (nodeId: string, args: CoreAssertInRangeArgs) => void; /** Approve an ERC20 spender for the given token and amount — original id: "core.approve" */ readonly approve: (nodeId: string, args: CoreApproveArgs) => void; /** Read an ERC20 balance, producing a resource — original id: "core.balanceOf" */ readonly balanceOf: (nodeId: string, args: CoreBalanceOfArgs) => CoreBalanceOfOutputs; /** Transfer tokens to a recipient address, optionally specifying a partial amount — original id: "core.transfer" */ readonly transfer: (nodeId: string, args: CoreTransferArgs) => CoreTransferOutputs; /** Emit a custom on-chain event carrying 1 32-byte payload value. The value becomes a non-indexed data word in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent1" */ readonly emitEvent1: (nodeId: string, args: CoreEmitEvent1Args) => void; /** Emit a custom on-chain event carrying 2 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent2" */ readonly emitEvent2: (nodeId: string, args: CoreEmitEvent2Args) => void; /** Emit a custom on-chain event carrying 3 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent3" */ readonly emitEvent3: (nodeId: string, args: CoreEmitEvent3Args) => void; /** Emit a custom on-chain event carrying 4 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent4" */ readonly emitEvent4: (nodeId: string, args: CoreEmitEvent4Args) => void; /** Invoke a smart contract function, optionally spending a token resource — original id: "core.call" */ readonly call: <TSig extends string>(nodeId: string, args: CoreCallArgs<TSig>) => CoreCallResult<TSig>; /** Read from a smart contract at runtime (StaticCall); result is fresh at execution time — original id: "core.staticCall" */ readonly staticCall: <TSig extends string>(nodeId: string, args: CoreStaticCallArgs<TSig>) => StaticCallResult<TSig>; /** Invoke a contract with pre-encoded calldata — original id: "core.rawCall" */ readonly rawCall: (nodeId: string, args: CoreRawCallArgs) => CoreRawCallOutputs; /** Graduate a raw handle to a resource, enabling slippage surfacing and linearity tracking — original id: "core.asResource" */ readonly asResource: (nodeId: string, args: CoreAsResourceArgs) => CoreAsResourceOutputs; /** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal — original id: "core.peek" */ readonly peek: (nodeId: string, args: CorePeekArgs) => CorePeekOutputs; }; readonly lifi: { /** Swap tokens via the LI.FI aggregator API — original id: "lifi.swap" */ readonly swap: (nodeId: string, args: LifiSwapArgs) => LifiSwapOutputs; /** Route tokens into a DeFi protocol position via the edge catalog — original id: "lifi.zap" */ readonly zap: (nodeId: string, args: LifiZapArgs) => LifiZapOutputs; }; readonly invariant: { /** Assert that an account holds at least a minimum token balance — original id: "invariant.balanceAtLeast" */ readonly balanceAtLeast: (nodeId: string, args: InvariantBalanceAtLeastArgs) => void; /** Assert that an account holds exactly an expected token balance — original id: "invariant.balanceEquals" */ readonly balanceEquals: (nodeId: string, args: InvariantBalanceEqualsArgs) => void; /** Assert that an account holds at most a maximum token balance — original id: "invariant.balanceAtMost" */ readonly balanceAtMost: (nodeId: string, args: InvariantBalanceAtMostArgs) => void; /** Assert that an account's token balance is between a minimum and a maximum (inclusive) — original id: "invariant.balanceInRange" */ readonly balanceInRange: (nodeId: string, args: InvariantBalanceInRangeArgs) => void; /** Assert that a spender is permitted to move at least a minimum allowance on behalf of an owner — original id: "invariant.allowanceAtLeast" */ readonly allowanceAtLeast: (nodeId: string, args: InvariantAllowanceAtLeastArgs) => void; /** Assert that a spender's allowance on behalf of an owner exactly equals an expected amount — original id: "invariant.allowanceEquals" */ readonly allowanceEquals: (nodeId: string, args: InvariantAllowanceEqualsArgs) => void; /** Assert that a spender is permitted to move at most a maximum allowance on behalf of an owner — original id: "invariant.allowanceAtMost" */ readonly allowanceAtMost: (nodeId: string, args: InvariantAllowanceAtMostArgs) => void; /** Assert that a spender's allowance on behalf of an owner is between a minimum and a maximum (inclusive) — original id: "invariant.allowanceInRange" */ readonly allowanceInRange: (nodeId: string, args: InvariantAllowanceInRangeArgs) => void; /** Assert a uint256 value satisfies a comparison against a constant threshold; reverts on violation — original id: "invariant.numeric" */ readonly numeric: (nodeId: string, args: InvariantNumericArgs) => void; /** Assert min <= value <= max against constant bounds; reverts if outside the range — original id: "invariant.numericInRange" */ readonly numericInRange: (nodeId: string, args: InvariantNumericInRangeArgs) => void; }; readonly aave: { /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource — original id: "aave.borrow" */ readonly borrow: (nodeId: string, args: AaveBorrowArgs) => AaveBorrowOutputs; /** Repay an Aave v3 variable-rate debt position with the supplied asset. mode: 'exact' passes the input handle amount; mode: 'max' passes type(uint256).max so Aave's Pool clamps paybackAmount to userVariableDebt exactly. Any unspent input is returned through the residual port. — original id: "aave.repay" */ readonly repay: (nodeId: string, args: AaveRepayArgs) => AaveRepayOutputs; /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual — original id: "aave.repayWithATokens" */ readonly repayWithATokens: (nodeId: string, args: AaveRepayWithATokensArgs) => AaveRepayWithATokensOutputs; /** Claim a specific Aave v3 incentives reward token against a set of receipt-token positions, exposing the claimed amount as a Resource — original id: "aave.claimRewards" */ readonly claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) => AaveClaimRewardsOutputs; /** Switch the executionAddress's Aave v3 eMode category. 0 disables eMode. The pool reverts if the switch would make the position unhealthy or if any open borrow is for an asset outside the target category. — original id: "aave.setEMode" */ readonly setEMode: (nodeId: string, args: AaveSetEModeArgs) => void; }; readonly morphoBlue: { /** Deposit the collateral asset of a Morpho Blue market on behalf of the execution proxy. mode: 'exact' pulls the input handle's amount. mode: 'all' reads the proxy's current ERC20 balance of the market's collateral token and pulls that amount, ignoring the input handle's literal value — note this pulls the proxy's total balance (including unrelated upstream residuals), not just the input port's delivery. Credits Position.collateral on the Morpho singleton; emits no return value and exposes no resource output (the collateral is non-transferable accounting state). — original id: "morphoBlue.supplyCollateral" */ readonly supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) => void; /** Withdraw collateral from a Morpho Blue market position to the receiver address. Exposes the withdrawn ERC20 amount as a Resource output. — original id: "morphoBlue.withdrawCollateral" */ readonly withdrawCollateral: (nodeId: string, args: MorphoBlueWithdrawCollateralArgs) => MorphoBlueWithdrawCollateralOutputs; }; readonly paraswap: { /** Exact-output (BUY) swap via the Paraswap/Velora Market API: produce exactly `exactAmountOut` of the destination token, pulling only the source needed and exposing the genuinely-unspent source as `unspentIn`. — original id: "paraswap.buy" */ readonly buy: (nodeId: string, args: ParaswapBuyArgs) => ParaswapBuyOutputs; }; }; declare const bindGeneratedOps: (builder: FlowBuilderInternal) => GeneratedOps; export { type AaveBorrowArgs, type AaveBorrowOutputs, type AaveClaimRewardsArgs, type AaveClaimRewardsOutputs, type AaveRepayArgs, type AaveRepayOutputs, type AaveRepayWithATokensArgs, type AaveRepayWithATokensOutputs, type AaveSetEModeArgs, type CoreAddArgs, type CoreAddOutputs, type CoreApproveArgs, type CoreAsResourceArgs, type CoreAsResourceOutputs, type CoreAssertEqualArgs, type CoreAssertGtArgs, type CoreAssertGteArgs, type CoreAssertInRangeArgs, type CoreAssertLtArgs, type CoreAssertLteArgs, type CoreAssertNotEqualArgs, type CoreBalanceOfArgs, type CoreBalanceOfOutputs, type CoreBpsDownArgs, type CoreBpsDownOutputs, type CoreBpsUpArgs, type CoreBpsUpOutputs, type CoreCallArgs, type CoreDivideDownArgs, type CoreDivideDownOutputs, type CoreDivideUpArgs, type CoreDivideUpOutputs, type CoreEmitEvent1Args, type CoreEmitEvent2Args, type CoreEmitEvent3Args, type CoreEmitEvent4Args, type CoreMergeArgs, type CoreMergeOutputs, type CoreMultiplyArgs, type CoreMultiplyOutputs, type CorePeekArgs, type CorePeekOutputs, type CoreRawCallArgs, type CoreRawCallOutputs, type CoreSplitArgs, type CoreSplitOutputs, type CoreStaticCallArgs, type CoreSubtractArgs, type CoreSubtractOutputs, type CoreTransferArgs, type CoreTransferOutputs, type GeneratedOps, type InvariantAllowanceAtLeastArgs, type InvariantAllowanceAtMostArgs, type InvariantAllowanceEqualsArgs, type InvariantAllowanceInRangeArgs, type InvariantBalanceAtLeastArgs, type InvariantBalanceAtMostArgs, type InvariantBalanceEqualsArgs, type InvariantBalanceInRangeArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapOutputs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, bindGeneratedOps };