@lifi/composer-sdk 0.7.0 → 0.8.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.
Files changed (41) hide show
  1. package/README.md +6 -0
  2. package/dist/authoring/FlowBuilderCore.cjs +1 -1
  3. package/dist/authoring/FlowBuilderCore.cjs.map +1 -1
  4. package/dist/authoring/FlowBuilderCore.js +1 -1
  5. package/dist/authoring/FlowBuilderCore.js.map +1 -1
  6. package/dist/client.cjs +1 -1
  7. package/dist/client.js +1 -1
  8. package/dist/generated/config.generated.cjs.map +1 -1
  9. package/dist/generated/config.generated.d.cts +77 -35
  10. package/dist/generated/config.generated.d.ts +77 -35
  11. package/dist/generated/guards.generated.cjs +6 -0
  12. package/dist/generated/guards.generated.cjs.map +1 -1
  13. package/dist/generated/guards.generated.d.cts +1 -1
  14. package/dist/generated/guards.generated.d.ts +1 -1
  15. package/dist/generated/guards.generated.js +5 -0
  16. package/dist/generated/guards.generated.js.map +1 -1
  17. package/dist/generated/operations.generated.cjs +56 -1
  18. package/dist/generated/operations.generated.cjs.map +1 -1
  19. package/dist/generated/operations.generated.d.cts +155 -2
  20. package/dist/generated/operations.generated.d.ts +155 -2
  21. package/dist/generated/operations.generated.js +56 -1
  22. package/dist/generated/operations.generated.js.map +1 -1
  23. package/dist/{guards.generated-M3VAIevI.d.cts → guards.generated-CDCgYGZo.d.cts} +8 -3
  24. package/dist/{guards.generated-BPLFwe7y.d.ts → guards.generated-CdYcs4h0.d.ts} +8 -3
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +3 -3
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js.map +1 -1
  29. package/package.json +2 -2
  30. package/src/authoring/FlowBuilderCore.ts +4 -1
  31. package/src/examples/aaveBorrow.ts +129 -0
  32. package/src/examples/aaveHealthFactorExplode.ts +63 -0
  33. package/src/examples/morphoBlueBorrow.ts +94 -0
  34. package/src/examples/morphoBlueRepay.ts +133 -0
  35. package/src/examples/run.ts +43 -0
  36. package/src/examples/uniswapV2AddLiquidity.ts +106 -0
  37. package/src/examples/uniswapV3Mint.ts +95 -0
  38. package/src/generated/config.generated.ts +82 -38
  39. package/src/generated/guards.generated.ts +9 -0
  40. package/src/generated/operations.generated.ts +292 -0
  41. package/src/index.ts +0 -3
@@ -2,7 +2,7 @@ import { FlowBuilderInternal } from '../authoring/FlowBuilderCore.cjs';
2
2
  import { Bindable, OutputHandle, FamilySource, FamilyCount, OutputFamilyHandles } from '../authoring/handles.cjs';
3
3
  import { SignatureBind, CoreCallResult, StaticCallResult } from '../authoring/signatureArgs.cjs';
4
4
  import { TypedGuard } from '../types.cjs';
5
- import { CoreSplitConfig, CorePartitionConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiBridgeConfig, LifiZapConfig, LifiZapAsyncConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, InvariantGteConfig, InvariantGtConfig, InvariantLteConfig, InvariantLtConfig, InvariantEqConfig, InvariantNeqConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, ParaswapBuyConfig, FlySwapConfig } from './config.generated.cjs';
5
+ import { CoreSplitConfig, CorePartitionConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiBridgeConfig, LifiZapConfig, LifiZapAsyncConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, InvariantGteConfig, InvariantGtConfig, InvariantLteConfig, InvariantLtConfig, InvariantEqConfig, InvariantNeqConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, AaveGetHealthFactorConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueBorrowConfig, MorphoBlueRepayConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawConfig, MorphoBlueGetPositionConfig, ParaswapBuyConfig, FlySwapConfig, UniswapV2AddLiquidityConfig, UniswapV2RemoveLiquidityConfig, UniswapV3MintConfig, UniswapV3IncreaseLiquidityConfig } from './config.generated.cjs';
6
6
  import '@lifi/compose-spec';
7
7
  import 'abitype';
8
8
 
@@ -422,6 +422,12 @@ interface AaveSetEModeArgs {
422
422
  readonly config: AaveSetEModeConfig;
423
423
  readonly guards?: readonly TypedGuard<never>[];
424
424
  }
425
+ /** Read the current Aave v3 health factor (WAD-scaled, 1e18; type(uint256).max for users with no debt) by static-calling IPool.getUserAccountData and decomposing the returned tuple. Exposes the healthFactor element as a uint256 handle suitable for use with core.numericInvariant. */
426
+ interface AaveGetHealthFactorArgs {
427
+ readonly bind: Record<string, never>;
428
+ readonly config: AaveGetHealthFactorConfig;
429
+ readonly guards?: readonly TypedGuard<'healthFactor'>[];
430
+ }
425
431
  /** 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). */
426
432
  interface MorphoBlueSupplyCollateralArgs {
427
433
  readonly bind: {
@@ -436,6 +442,41 @@ interface MorphoBlueWithdrawCollateralArgs {
436
442
  readonly config: MorphoBlueWithdrawCollateralConfig;
437
443
  readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[];
438
444
  }
445
+ /** Borrow the loan asset from a Morpho Blue market against existing collateral. Exposes the borrowed amount as a Resource and the (assetsBorrowed, sharesBorrowed) tuple as handles. */
446
+ interface MorphoBlueBorrowArgs {
447
+ readonly bind: Record<string, never>;
448
+ readonly config: MorphoBlueBorrowConfig;
449
+ readonly guards?: readonly TypedGuard<'assetsBorrowed' | 'sharesBorrowed'>[];
450
+ }
451
+ /** Repay a Morpho Blue debt position with the supplied asset. mode: 'exact' repays the input handle amount; mode: 'max' reads Position.borrowShares via a precursor static call and repays in shares mode to retire the debt to the wei. Returns any unspent residual as a Resource. */
452
+ interface MorphoBlueRepayArgs {
453
+ readonly bind: {
454
+ readonly assetIn: Bindable<'resource'>;
455
+ readonly onBehalfOf: Bindable<'address'>;
456
+ };
457
+ readonly config: MorphoBlueRepayConfig;
458
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'sharesRepaid' | 'residual'>[];
459
+ }
460
+ /** Supply the loan asset of a Morpho Blue market and receive supplyShares accounting credit. Returns the (assetsSupplied, sharesSupplied) tuple as handles and any unspent residual as a Resource. */
461
+ interface MorphoBlueSupplyArgs {
462
+ readonly bind: {
463
+ readonly assetIn: Bindable<'resource'>;
464
+ };
465
+ readonly config: MorphoBlueSupplyConfig;
466
+ readonly guards?: readonly TypedGuard<'assetsSupplied' | 'sharesSupplied' | 'residual'>[];
467
+ }
468
+ /** Withdraw the loan asset from a Morpho Blue supply position. mode: 'exact' withdraws the configured amount; mode: 'max' reads Position.supplyShares via a precursor static call and burns all shares to retire the supply to the wei. Exposes the withdrawn amount as a Resource. */
469
+ interface MorphoBlueWithdrawArgs {
470
+ readonly bind: Record<string, never>;
471
+ readonly config: MorphoBlueWithdrawConfig;
472
+ readonly guards?: readonly TypedGuard<'assetsWithdrawn' | 'sharesWithdrawn'>[];
473
+ }
474
+ /** Read a Morpho Blue Position struct via a static call on the singleton. Exposes (supplyShares, borrowShares, collateral) as handles whose kinds match the on-chain field types (uint256, uint128, uint128). */
475
+ interface MorphoBlueGetPositionArgs {
476
+ readonly bind: Record<string, never>;
477
+ readonly config: MorphoBlueGetPositionConfig;
478
+ readonly guards?: readonly TypedGuard<'supplyShares' | 'borrowShares' | 'collateral'>[];
479
+ }
439
480
  /** Route tokens into a DeFi protocol position via the edge catalog */
440
481
  interface LifiZapArgs {
441
482
  readonly bind: {
@@ -476,6 +517,43 @@ interface FlySwapArgs {
476
517
  readonly config: FlySwapConfig;
477
518
  readonly guards?: readonly TypedGuard<'unspentIn'>[];
478
519
  }
520
+ /** Deposit two ERC-20 tokens into an existing Uniswap V2 pair (or an ABI-identical fork such as SushiSwap V2) through its Router02 and receive the pair's LP token; unused input returns as residuals. Asserts on chain that the router's factory is `factory`, that the factory's pair for the two tokens is `pair`, and that the pair holds non-zero reserves. Exposes the pool price read before the deposit as `poolPrice`. The deposit is protected only with a `band` guard on `poolPrice` and a `slippage` guard on `liquidity`. Fee-on-transfer tokens are unsupported. */
521
+ interface UniswapV2AddLiquidityArgs {
522
+ readonly bind: {
523
+ readonly tokenA: Bindable<'resource'>;
524
+ readonly tokenB: Bindable<'resource'>;
525
+ };
526
+ readonly config: UniswapV2AddLiquidityConfig;
527
+ readonly guards?: readonly TypedGuard<'liquidity' | 'residualA' | 'residualB' | 'poolPrice'>[];
528
+ }
529
+ /** Burn a Uniswap V2 LP token (or one of an ABI-identical fork such as SushiSwap V2) through its Router02 and receive both underlying tokens. Asserts on chain that the router's factory is `factory` and that the factory's pair for `tokenA`/`tokenB` is the input LP token. The withdrawal is protected only with a `slippage` guard on each of `tokenA` and `tokenB`. Fee-on-transfer tokens are unsupported: the outputs are the amounts the router reports, which would overstate what such a token delivers. */
530
+ interface UniswapV2RemoveLiquidityArgs {
531
+ readonly bind: {
532
+ readonly liquidity: Bindable<'resource'>;
533
+ };
534
+ readonly config: UniswapV2RemoveLiquidityConfig;
535
+ readonly guards?: readonly TypedGuard<'tokenA' | 'tokenB'>[];
536
+ }
537
+ /** Open a Uniswap V3 concentrated-liquidity position (or one on an ABI-identical fork) for a tick range, minting the position NFT straight to `recipient`, which must not be the execution address. Exposes the new `tokenId`; unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. */
538
+ interface UniswapV3MintArgs {
539
+ readonly bind: {
540
+ readonly tokenA: Bindable<'resource'>;
541
+ readonly tokenB: Bindable<'resource'>;
542
+ readonly recipient: Bindable<'address'>;
543
+ };
544
+ readonly config: UniswapV3MintConfig;
545
+ readonly guards?: readonly TypedGuard<'tokenId' | 'liquidity' | 'sqrtPriceX96' | 'residualA' | 'residualB'>[];
546
+ }
547
+ /** Add two tokens to an existing Uniswap V3 position (or one on an ABI-identical fork). `owner` must own `tokenId`, and the position must hold the two input tokens; both are asserted on chain, since the position manager checks neither. Unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. */
548
+ interface UniswapV3IncreaseLiquidityArgs {
549
+ readonly bind: {
550
+ readonly tokenA: Bindable<'resource'>;
551
+ readonly tokenB: Bindable<'resource'>;
552
+ readonly owner: Bindable<'address'>;
553
+ };
554
+ readonly config: UniswapV3IncreaseLiquidityConfig;
555
+ readonly guards?: readonly TypedGuard<'liquidity' | 'sqrtPriceX96' | 'residualA' | 'residualB'>[];
556
+ }
479
557
  interface CoreSplitOutputs {
480
558
  readonly a: OutputHandle<'resource'>;
481
559
  readonly b: OutputHandle<'resource'>;
@@ -544,10 +622,38 @@ interface AaveClaimRewardsOutputs {
544
622
  readonly claimed: OutputHandle<'resource'>;
545
623
  readonly claimedAmount: OutputHandle<'uint256'>;
546
624
  }
625
+ interface AaveGetHealthFactorOutputs {
626
+ readonly healthFactor: OutputHandle<'uint256'>;
627
+ }
547
628
  interface MorphoBlueWithdrawCollateralOutputs {
548
629
  readonly withdrawn: OutputHandle<'resource'>;
549
630
  readonly collateralWithdrawn: OutputHandle<'uint256'>;
550
631
  }
632
+ interface MorphoBlueBorrowOutputs {
633
+ readonly borrowed: OutputHandle<'resource'>;
634
+ readonly assetsBorrowed: OutputHandle<'uint256'>;
635
+ readonly sharesBorrowed: OutputHandle<'uint256'>;
636
+ }
637
+ interface MorphoBlueRepayOutputs {
638
+ readonly actualRepaid: OutputHandle<'uint256'>;
639
+ readonly sharesRepaid: OutputHandle<'uint256'>;
640
+ readonly residual: OutputHandle<'resource'>;
641
+ }
642
+ interface MorphoBlueSupplyOutputs {
643
+ readonly assetsSupplied: OutputHandle<'uint256'>;
644
+ readonly sharesSupplied: OutputHandle<'uint256'>;
645
+ readonly residual: OutputHandle<'resource'>;
646
+ }
647
+ interface MorphoBlueWithdrawOutputs {
648
+ readonly withdrawn: OutputHandle<'resource'>;
649
+ readonly assetsWithdrawn: OutputHandle<'uint256'>;
650
+ readonly sharesWithdrawn: OutputHandle<'uint256'>;
651
+ }
652
+ interface MorphoBlueGetPositionOutputs {
653
+ readonly supplyShares: OutputHandle<'uint256'>;
654
+ readonly borrowShares: OutputHandle<'uint128'>;
655
+ readonly collateral: OutputHandle<'uint128'>;
656
+ }
551
657
  interface LifiZapOutputs {
552
658
  readonly amountOut: OutputHandle<'resource'>;
553
659
  }
@@ -565,6 +671,29 @@ interface FlySwapOutputs {
565
671
  readonly amountOut: OutputHandle<'resource'>;
566
672
  readonly unspentIn: OutputHandle<'resource'>;
567
673
  }
674
+ interface UniswapV2AddLiquidityOutputs {
675
+ readonly liquidity: OutputHandle<'resource'>;
676
+ readonly residualA: OutputHandle<'resource'>;
677
+ readonly residualB: OutputHandle<'resource'>;
678
+ readonly poolPrice: OutputHandle<'uint256'>;
679
+ }
680
+ interface UniswapV2RemoveLiquidityOutputs {
681
+ readonly tokenA: OutputHandle<'resource'>;
682
+ readonly tokenB: OutputHandle<'resource'>;
683
+ }
684
+ interface UniswapV3MintOutputs {
685
+ readonly tokenId: OutputHandle<'uint256'>;
686
+ readonly liquidity: OutputHandle<'uint256'>;
687
+ readonly sqrtPriceX96: OutputHandle<'uint256'>;
688
+ readonly residualA: OutputHandle<'resource'>;
689
+ readonly residualB: OutputHandle<'resource'>;
690
+ }
691
+ interface UniswapV3IncreaseLiquidityOutputs {
692
+ readonly liquidity: OutputHandle<'uint256'>;
693
+ readonly sqrtPriceX96: OutputHandle<'uint256'>;
694
+ readonly residualA: OutputHandle<'resource'>;
695
+ readonly residualB: OutputHandle<'resource'>;
696
+ }
568
697
  type GeneratedOps = {
569
698
  readonly core: {
570
699
  /** Split a resource into two outputs by basis-point ratio. Output `a` receives `bps` of the source, rounded up, and `b` takes the remainder. — original id: "core.split" */
@@ -681,12 +810,24 @@ type GeneratedOps = {
681
810
  readonly claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) => AaveClaimRewardsOutputs;
682
811
  /** 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" */
683
812
  readonly setEMode: (nodeId: string, args: AaveSetEModeArgs) => void;
813
+ /** Read the current Aave v3 health factor (WAD-scaled, 1e18; type(uint256).max for users with no debt) by static-calling IPool.getUserAccountData and decomposing the returned tuple. Exposes the healthFactor element as a uint256 handle suitable for use with core.numericInvariant. — original id: "aave.getHealthFactor" */
814
+ readonly getHealthFactor: (nodeId: string, args: AaveGetHealthFactorArgs) => AaveGetHealthFactorOutputs;
684
815
  };
685
816
  readonly morphoBlue: {
686
817
  /** 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" */
687
818
  readonly supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) => void;
688
819
  /** 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" */
689
820
  readonly withdrawCollateral: (nodeId: string, args: MorphoBlueWithdrawCollateralArgs) => MorphoBlueWithdrawCollateralOutputs;
821
+ /** Borrow the loan asset from a Morpho Blue market against existing collateral. Exposes the borrowed amount as a Resource and the (assetsBorrowed, sharesBorrowed) tuple as handles. — original id: "morphoBlue.borrow" */
822
+ readonly borrow: (nodeId: string, args: MorphoBlueBorrowArgs) => MorphoBlueBorrowOutputs;
823
+ /** Repay a Morpho Blue debt position with the supplied asset. mode: 'exact' repays the input handle amount; mode: 'max' reads Position.borrowShares via a precursor static call and repays in shares mode to retire the debt to the wei. Returns any unspent residual as a Resource. — original id: "morphoBlue.repay" */
824
+ readonly repay: (nodeId: string, args: MorphoBlueRepayArgs) => MorphoBlueRepayOutputs;
825
+ /** Supply the loan asset of a Morpho Blue market and receive supplyShares accounting credit. Returns the (assetsSupplied, sharesSupplied) tuple as handles and any unspent residual as a Resource. — original id: "morphoBlue.supply" */
826
+ readonly supply: (nodeId: string, args: MorphoBlueSupplyArgs) => MorphoBlueSupplyOutputs;
827
+ /** Withdraw the loan asset from a Morpho Blue supply position. mode: 'exact' withdraws the configured amount; mode: 'max' reads Position.supplyShares via a precursor static call and burns all shares to retire the supply to the wei. Exposes the withdrawn amount as a Resource. — original id: "morphoBlue.withdraw" */
828
+ readonly withdraw: (nodeId: string, args: MorphoBlueWithdrawArgs) => MorphoBlueWithdrawOutputs;
829
+ /** Read a Morpho Blue Position struct via a static call on the singleton. Exposes (supplyShares, borrowShares, collateral) as handles whose kinds match the on-chain field types (uint256, uint128, uint128). — original id: "morphoBlue.getPosition" */
830
+ readonly getPosition: (nodeId: string, args: MorphoBlueGetPositionArgs) => MorphoBlueGetPositionOutputs;
690
831
  };
691
832
  readonly paraswap: {
692
833
  /** 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" */
@@ -696,7 +837,19 @@ type GeneratedOps = {
696
837
  /** Swap via Fly's DexAggregator, sized at runtime: the router calldata leaves `amountIn` unset, so an upstream op's output can feed the swap without being known at plan time. Either leg may be the chain-native coin. — original id: "fly.swap" */
697
838
  readonly swap: (nodeId: string, args: FlySwapArgs) => FlySwapOutputs;
698
839
  };
840
+ readonly uniswapV2: {
841
+ /** Deposit two ERC-20 tokens into an existing Uniswap V2 pair (or an ABI-identical fork such as SushiSwap V2) through its Router02 and receive the pair's LP token; unused input returns as residuals. Asserts on chain that the router's factory is `factory`, that the factory's pair for the two tokens is `pair`, and that the pair holds non-zero reserves. Exposes the pool price read before the deposit as `poolPrice`. The deposit is protected only with a `band` guard on `poolPrice` and a `slippage` guard on `liquidity`. Fee-on-transfer tokens are unsupported. — original id: "uniswapV2.addLiquidity" */
842
+ readonly addLiquidity: (nodeId: string, args: UniswapV2AddLiquidityArgs) => UniswapV2AddLiquidityOutputs;
843
+ /** Burn a Uniswap V2 LP token (or one of an ABI-identical fork such as SushiSwap V2) through its Router02 and receive both underlying tokens. Asserts on chain that the router's factory is `factory` and that the factory's pair for `tokenA`/`tokenB` is the input LP token. The withdrawal is protected only with a `slippage` guard on each of `tokenA` and `tokenB`. Fee-on-transfer tokens are unsupported: the outputs are the amounts the router reports, which would overstate what such a token delivers. — original id: "uniswapV2.removeLiquidity" */
844
+ readonly removeLiquidity: (nodeId: string, args: UniswapV2RemoveLiquidityArgs) => UniswapV2RemoveLiquidityOutputs;
845
+ };
846
+ readonly uniswapV3: {
847
+ /** Open a Uniswap V3 concentrated-liquidity position (or one on an ABI-identical fork) for a tick range, minting the position NFT straight to `recipient`, which must not be the execution address. Exposes the new `tokenId`; unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. — original id: "uniswapV3.mint" */
848
+ readonly mint: (nodeId: string, args: UniswapV3MintArgs) => UniswapV3MintOutputs;
849
+ /** Add two tokens to an existing Uniswap V3 position (or one on an ABI-identical fork). `owner` must own `tokenId`, and the position must hold the two input tokens; both are asserted on chain, since the position manager checks neither. Unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. — original id: "uniswapV3.increaseLiquidity" */
850
+ readonly increaseLiquidity: (nodeId: string, args: UniswapV3IncreaseLiquidityArgs) => UniswapV3IncreaseLiquidityOutputs;
851
+ };
699
852
  };
700
853
  declare const bindGeneratedOps: (builder: FlowBuilderInternal) => GeneratedOps;
701
854
 
702
- 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 CorePartitionArgs, type CorePartitionOutputs, type CorePeekArgs, type CorePeekOutputs, type CoreRawCallArgs, type CoreRawCallOutputs, type CoreSplitArgs, type CoreSplitOutputs, type CoreStaticCallArgs, type CoreSubtractArgs, type CoreSubtractOutputs, type CoreTransferArgs, type CoreTransferOutputs, type FlySwapArgs, type FlySwapOutputs, type GeneratedOps, type InvariantAllowanceAtLeastArgs, type InvariantAllowanceAtMostArgs, type InvariantAllowanceEqualsArgs, type InvariantAllowanceInRangeArgs, type InvariantBalanceAtLeastArgs, type InvariantBalanceAtMostArgs, type InvariantBalanceEqualsArgs, type InvariantBalanceInRangeArgs, type InvariantEqArgs, type InvariantGtArgs, type InvariantGteArgs, type InvariantLtArgs, type InvariantLteArgs, type InvariantNeqArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiBridgeArgs, type LifiBridgeOutputs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapAsyncArgs, type LifiZapAsyncOutputs, type LifiZapOutputs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, bindGeneratedOps };
855
+ export { type AaveBorrowArgs, type AaveBorrowOutputs, type AaveClaimRewardsArgs, type AaveClaimRewardsOutputs, type AaveGetHealthFactorArgs, type AaveGetHealthFactorOutputs, 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 CorePartitionArgs, type CorePartitionOutputs, type CorePeekArgs, type CorePeekOutputs, type CoreRawCallArgs, type CoreRawCallOutputs, type CoreSplitArgs, type CoreSplitOutputs, type CoreStaticCallArgs, type CoreSubtractArgs, type CoreSubtractOutputs, type CoreTransferArgs, type CoreTransferOutputs, type FlySwapArgs, type FlySwapOutputs, type GeneratedOps, type InvariantAllowanceAtLeastArgs, type InvariantAllowanceAtMostArgs, type InvariantAllowanceEqualsArgs, type InvariantAllowanceInRangeArgs, type InvariantBalanceAtLeastArgs, type InvariantBalanceAtMostArgs, type InvariantBalanceEqualsArgs, type InvariantBalanceInRangeArgs, type InvariantEqArgs, type InvariantGtArgs, type InvariantGteArgs, type InvariantLtArgs, type InvariantLteArgs, type InvariantNeqArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiBridgeArgs, type LifiBridgeOutputs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapAsyncArgs, type LifiZapAsyncOutputs, type LifiZapOutputs, type MorphoBlueBorrowArgs, type MorphoBlueBorrowOutputs, type MorphoBlueGetPositionArgs, type MorphoBlueGetPositionOutputs, type MorphoBlueRepayArgs, type MorphoBlueRepayOutputs, type MorphoBlueSupplyArgs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueSupplyOutputs, type MorphoBlueWithdrawArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type MorphoBlueWithdrawOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, type UniswapV2AddLiquidityArgs, type UniswapV2AddLiquidityOutputs, type UniswapV2RemoveLiquidityArgs, type UniswapV2RemoveLiquidityOutputs, type UniswapV3IncreaseLiquidityArgs, type UniswapV3IncreaseLiquidityOutputs, type UniswapV3MintArgs, type UniswapV3MintOutputs, bindGeneratedOps };
@@ -2,7 +2,7 @@ import { FlowBuilderInternal } from '../authoring/FlowBuilderCore.js';
2
2
  import { Bindable, OutputHandle, FamilySource, FamilyCount, OutputFamilyHandles } from '../authoring/handles.js';
3
3
  import { SignatureBind, CoreCallResult, StaticCallResult } from '../authoring/signatureArgs.js';
4
4
  import { TypedGuard } from '../types.js';
5
- import { CoreSplitConfig, CorePartitionConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiBridgeConfig, LifiZapConfig, LifiZapAsyncConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, InvariantGteConfig, InvariantGtConfig, InvariantLteConfig, InvariantLtConfig, InvariantEqConfig, InvariantNeqConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, ParaswapBuyConfig, FlySwapConfig } from './config.generated.js';
5
+ import { CoreSplitConfig, CorePartitionConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiBridgeConfig, LifiZapConfig, LifiZapAsyncConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, InvariantGteConfig, InvariantGtConfig, InvariantLteConfig, InvariantLtConfig, InvariantEqConfig, InvariantNeqConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, AaveGetHealthFactorConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueBorrowConfig, MorphoBlueRepayConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawConfig, MorphoBlueGetPositionConfig, ParaswapBuyConfig, FlySwapConfig, UniswapV2AddLiquidityConfig, UniswapV2RemoveLiquidityConfig, UniswapV3MintConfig, UniswapV3IncreaseLiquidityConfig } from './config.generated.js';
6
6
  import '@lifi/compose-spec';
7
7
  import 'abitype';
8
8
 
@@ -422,6 +422,12 @@ interface AaveSetEModeArgs {
422
422
  readonly config: AaveSetEModeConfig;
423
423
  readonly guards?: readonly TypedGuard<never>[];
424
424
  }
425
+ /** Read the current Aave v3 health factor (WAD-scaled, 1e18; type(uint256).max for users with no debt) by static-calling IPool.getUserAccountData and decomposing the returned tuple. Exposes the healthFactor element as a uint256 handle suitable for use with core.numericInvariant. */
426
+ interface AaveGetHealthFactorArgs {
427
+ readonly bind: Record<string, never>;
428
+ readonly config: AaveGetHealthFactorConfig;
429
+ readonly guards?: readonly TypedGuard<'healthFactor'>[];
430
+ }
425
431
  /** 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). */
426
432
  interface MorphoBlueSupplyCollateralArgs {
427
433
  readonly bind: {
@@ -436,6 +442,41 @@ interface MorphoBlueWithdrawCollateralArgs {
436
442
  readonly config: MorphoBlueWithdrawCollateralConfig;
437
443
  readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[];
438
444
  }
445
+ /** Borrow the loan asset from a Morpho Blue market against existing collateral. Exposes the borrowed amount as a Resource and the (assetsBorrowed, sharesBorrowed) tuple as handles. */
446
+ interface MorphoBlueBorrowArgs {
447
+ readonly bind: Record<string, never>;
448
+ readonly config: MorphoBlueBorrowConfig;
449
+ readonly guards?: readonly TypedGuard<'assetsBorrowed' | 'sharesBorrowed'>[];
450
+ }
451
+ /** Repay a Morpho Blue debt position with the supplied asset. mode: 'exact' repays the input handle amount; mode: 'max' reads Position.borrowShares via a precursor static call and repays in shares mode to retire the debt to the wei. Returns any unspent residual as a Resource. */
452
+ interface MorphoBlueRepayArgs {
453
+ readonly bind: {
454
+ readonly assetIn: Bindable<'resource'>;
455
+ readonly onBehalfOf: Bindable<'address'>;
456
+ };
457
+ readonly config: MorphoBlueRepayConfig;
458
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'sharesRepaid' | 'residual'>[];
459
+ }
460
+ /** Supply the loan asset of a Morpho Blue market and receive supplyShares accounting credit. Returns the (assetsSupplied, sharesSupplied) tuple as handles and any unspent residual as a Resource. */
461
+ interface MorphoBlueSupplyArgs {
462
+ readonly bind: {
463
+ readonly assetIn: Bindable<'resource'>;
464
+ };
465
+ readonly config: MorphoBlueSupplyConfig;
466
+ readonly guards?: readonly TypedGuard<'assetsSupplied' | 'sharesSupplied' | 'residual'>[];
467
+ }
468
+ /** Withdraw the loan asset from a Morpho Blue supply position. mode: 'exact' withdraws the configured amount; mode: 'max' reads Position.supplyShares via a precursor static call and burns all shares to retire the supply to the wei. Exposes the withdrawn amount as a Resource. */
469
+ interface MorphoBlueWithdrawArgs {
470
+ readonly bind: Record<string, never>;
471
+ readonly config: MorphoBlueWithdrawConfig;
472
+ readonly guards?: readonly TypedGuard<'assetsWithdrawn' | 'sharesWithdrawn'>[];
473
+ }
474
+ /** Read a Morpho Blue Position struct via a static call on the singleton. Exposes (supplyShares, borrowShares, collateral) as handles whose kinds match the on-chain field types (uint256, uint128, uint128). */
475
+ interface MorphoBlueGetPositionArgs {
476
+ readonly bind: Record<string, never>;
477
+ readonly config: MorphoBlueGetPositionConfig;
478
+ readonly guards?: readonly TypedGuard<'supplyShares' | 'borrowShares' | 'collateral'>[];
479
+ }
439
480
  /** Route tokens into a DeFi protocol position via the edge catalog */
440
481
  interface LifiZapArgs {
441
482
  readonly bind: {
@@ -476,6 +517,43 @@ interface FlySwapArgs {
476
517
  readonly config: FlySwapConfig;
477
518
  readonly guards?: readonly TypedGuard<'unspentIn'>[];
478
519
  }
520
+ /** Deposit two ERC-20 tokens into an existing Uniswap V2 pair (or an ABI-identical fork such as SushiSwap V2) through its Router02 and receive the pair's LP token; unused input returns as residuals. Asserts on chain that the router's factory is `factory`, that the factory's pair for the two tokens is `pair`, and that the pair holds non-zero reserves. Exposes the pool price read before the deposit as `poolPrice`. The deposit is protected only with a `band` guard on `poolPrice` and a `slippage` guard on `liquidity`. Fee-on-transfer tokens are unsupported. */
521
+ interface UniswapV2AddLiquidityArgs {
522
+ readonly bind: {
523
+ readonly tokenA: Bindable<'resource'>;
524
+ readonly tokenB: Bindable<'resource'>;
525
+ };
526
+ readonly config: UniswapV2AddLiquidityConfig;
527
+ readonly guards?: readonly TypedGuard<'liquidity' | 'residualA' | 'residualB' | 'poolPrice'>[];
528
+ }
529
+ /** Burn a Uniswap V2 LP token (or one of an ABI-identical fork such as SushiSwap V2) through its Router02 and receive both underlying tokens. Asserts on chain that the router's factory is `factory` and that the factory's pair for `tokenA`/`tokenB` is the input LP token. The withdrawal is protected only with a `slippage` guard on each of `tokenA` and `tokenB`. Fee-on-transfer tokens are unsupported: the outputs are the amounts the router reports, which would overstate what such a token delivers. */
530
+ interface UniswapV2RemoveLiquidityArgs {
531
+ readonly bind: {
532
+ readonly liquidity: Bindable<'resource'>;
533
+ };
534
+ readonly config: UniswapV2RemoveLiquidityConfig;
535
+ readonly guards?: readonly TypedGuard<'tokenA' | 'tokenB'>[];
536
+ }
537
+ /** Open a Uniswap V3 concentrated-liquidity position (or one on an ABI-identical fork) for a tick range, minting the position NFT straight to `recipient`, which must not be the execution address. Exposes the new `tokenId`; unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. */
538
+ interface UniswapV3MintArgs {
539
+ readonly bind: {
540
+ readonly tokenA: Bindable<'resource'>;
541
+ readonly tokenB: Bindable<'resource'>;
542
+ readonly recipient: Bindable<'address'>;
543
+ };
544
+ readonly config: UniswapV3MintConfig;
545
+ readonly guards?: readonly TypedGuard<'tokenId' | 'liquidity' | 'sqrtPriceX96' | 'residualA' | 'residualB'>[];
546
+ }
547
+ /** Add two tokens to an existing Uniswap V3 position (or one on an ABI-identical fork). `owner` must own `tokenId`, and the position must hold the two input tokens; both are asserted on chain, since the position manager checks neither. Unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. */
548
+ interface UniswapV3IncreaseLiquidityArgs {
549
+ readonly bind: {
550
+ readonly tokenA: Bindable<'resource'>;
551
+ readonly tokenB: Bindable<'resource'>;
552
+ readonly owner: Bindable<'address'>;
553
+ };
554
+ readonly config: UniswapV3IncreaseLiquidityConfig;
555
+ readonly guards?: readonly TypedGuard<'liquidity' | 'sqrtPriceX96' | 'residualA' | 'residualB'>[];
556
+ }
479
557
  interface CoreSplitOutputs {
480
558
  readonly a: OutputHandle<'resource'>;
481
559
  readonly b: OutputHandle<'resource'>;
@@ -544,10 +622,38 @@ interface AaveClaimRewardsOutputs {
544
622
  readonly claimed: OutputHandle<'resource'>;
545
623
  readonly claimedAmount: OutputHandle<'uint256'>;
546
624
  }
625
+ interface AaveGetHealthFactorOutputs {
626
+ readonly healthFactor: OutputHandle<'uint256'>;
627
+ }
547
628
  interface MorphoBlueWithdrawCollateralOutputs {
548
629
  readonly withdrawn: OutputHandle<'resource'>;
549
630
  readonly collateralWithdrawn: OutputHandle<'uint256'>;
550
631
  }
632
+ interface MorphoBlueBorrowOutputs {
633
+ readonly borrowed: OutputHandle<'resource'>;
634
+ readonly assetsBorrowed: OutputHandle<'uint256'>;
635
+ readonly sharesBorrowed: OutputHandle<'uint256'>;
636
+ }
637
+ interface MorphoBlueRepayOutputs {
638
+ readonly actualRepaid: OutputHandle<'uint256'>;
639
+ readonly sharesRepaid: OutputHandle<'uint256'>;
640
+ readonly residual: OutputHandle<'resource'>;
641
+ }
642
+ interface MorphoBlueSupplyOutputs {
643
+ readonly assetsSupplied: OutputHandle<'uint256'>;
644
+ readonly sharesSupplied: OutputHandle<'uint256'>;
645
+ readonly residual: OutputHandle<'resource'>;
646
+ }
647
+ interface MorphoBlueWithdrawOutputs {
648
+ readonly withdrawn: OutputHandle<'resource'>;
649
+ readonly assetsWithdrawn: OutputHandle<'uint256'>;
650
+ readonly sharesWithdrawn: OutputHandle<'uint256'>;
651
+ }
652
+ interface MorphoBlueGetPositionOutputs {
653
+ readonly supplyShares: OutputHandle<'uint256'>;
654
+ readonly borrowShares: OutputHandle<'uint128'>;
655
+ readonly collateral: OutputHandle<'uint128'>;
656
+ }
551
657
  interface LifiZapOutputs {
552
658
  readonly amountOut: OutputHandle<'resource'>;
553
659
  }
@@ -565,6 +671,29 @@ interface FlySwapOutputs {
565
671
  readonly amountOut: OutputHandle<'resource'>;
566
672
  readonly unspentIn: OutputHandle<'resource'>;
567
673
  }
674
+ interface UniswapV2AddLiquidityOutputs {
675
+ readonly liquidity: OutputHandle<'resource'>;
676
+ readonly residualA: OutputHandle<'resource'>;
677
+ readonly residualB: OutputHandle<'resource'>;
678
+ readonly poolPrice: OutputHandle<'uint256'>;
679
+ }
680
+ interface UniswapV2RemoveLiquidityOutputs {
681
+ readonly tokenA: OutputHandle<'resource'>;
682
+ readonly tokenB: OutputHandle<'resource'>;
683
+ }
684
+ interface UniswapV3MintOutputs {
685
+ readonly tokenId: OutputHandle<'uint256'>;
686
+ readonly liquidity: OutputHandle<'uint256'>;
687
+ readonly sqrtPriceX96: OutputHandle<'uint256'>;
688
+ readonly residualA: OutputHandle<'resource'>;
689
+ readonly residualB: OutputHandle<'resource'>;
690
+ }
691
+ interface UniswapV3IncreaseLiquidityOutputs {
692
+ readonly liquidity: OutputHandle<'uint256'>;
693
+ readonly sqrtPriceX96: OutputHandle<'uint256'>;
694
+ readonly residualA: OutputHandle<'resource'>;
695
+ readonly residualB: OutputHandle<'resource'>;
696
+ }
568
697
  type GeneratedOps = {
569
698
  readonly core: {
570
699
  /** Split a resource into two outputs by basis-point ratio. Output `a` receives `bps` of the source, rounded up, and `b` takes the remainder. — original id: "core.split" */
@@ -681,12 +810,24 @@ type GeneratedOps = {
681
810
  readonly claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) => AaveClaimRewardsOutputs;
682
811
  /** 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" */
683
812
  readonly setEMode: (nodeId: string, args: AaveSetEModeArgs) => void;
813
+ /** Read the current Aave v3 health factor (WAD-scaled, 1e18; type(uint256).max for users with no debt) by static-calling IPool.getUserAccountData and decomposing the returned tuple. Exposes the healthFactor element as a uint256 handle suitable for use with core.numericInvariant. — original id: "aave.getHealthFactor" */
814
+ readonly getHealthFactor: (nodeId: string, args: AaveGetHealthFactorArgs) => AaveGetHealthFactorOutputs;
684
815
  };
685
816
  readonly morphoBlue: {
686
817
  /** 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" */
687
818
  readonly supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) => void;
688
819
  /** 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" */
689
820
  readonly withdrawCollateral: (nodeId: string, args: MorphoBlueWithdrawCollateralArgs) => MorphoBlueWithdrawCollateralOutputs;
821
+ /** Borrow the loan asset from a Morpho Blue market against existing collateral. Exposes the borrowed amount as a Resource and the (assetsBorrowed, sharesBorrowed) tuple as handles. — original id: "morphoBlue.borrow" */
822
+ readonly borrow: (nodeId: string, args: MorphoBlueBorrowArgs) => MorphoBlueBorrowOutputs;
823
+ /** Repay a Morpho Blue debt position with the supplied asset. mode: 'exact' repays the input handle amount; mode: 'max' reads Position.borrowShares via a precursor static call and repays in shares mode to retire the debt to the wei. Returns any unspent residual as a Resource. — original id: "morphoBlue.repay" */
824
+ readonly repay: (nodeId: string, args: MorphoBlueRepayArgs) => MorphoBlueRepayOutputs;
825
+ /** Supply the loan asset of a Morpho Blue market and receive supplyShares accounting credit. Returns the (assetsSupplied, sharesSupplied) tuple as handles and any unspent residual as a Resource. — original id: "morphoBlue.supply" */
826
+ readonly supply: (nodeId: string, args: MorphoBlueSupplyArgs) => MorphoBlueSupplyOutputs;
827
+ /** Withdraw the loan asset from a Morpho Blue supply position. mode: 'exact' withdraws the configured amount; mode: 'max' reads Position.supplyShares via a precursor static call and burns all shares to retire the supply to the wei. Exposes the withdrawn amount as a Resource. — original id: "morphoBlue.withdraw" */
828
+ readonly withdraw: (nodeId: string, args: MorphoBlueWithdrawArgs) => MorphoBlueWithdrawOutputs;
829
+ /** Read a Morpho Blue Position struct via a static call on the singleton. Exposes (supplyShares, borrowShares, collateral) as handles whose kinds match the on-chain field types (uint256, uint128, uint128). — original id: "morphoBlue.getPosition" */
830
+ readonly getPosition: (nodeId: string, args: MorphoBlueGetPositionArgs) => MorphoBlueGetPositionOutputs;
690
831
  };
691
832
  readonly paraswap: {
692
833
  /** 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" */
@@ -696,7 +837,19 @@ type GeneratedOps = {
696
837
  /** Swap via Fly's DexAggregator, sized at runtime: the router calldata leaves `amountIn` unset, so an upstream op's output can feed the swap without being known at plan time. Either leg may be the chain-native coin. — original id: "fly.swap" */
697
838
  readonly swap: (nodeId: string, args: FlySwapArgs) => FlySwapOutputs;
698
839
  };
840
+ readonly uniswapV2: {
841
+ /** Deposit two ERC-20 tokens into an existing Uniswap V2 pair (or an ABI-identical fork such as SushiSwap V2) through its Router02 and receive the pair's LP token; unused input returns as residuals. Asserts on chain that the router's factory is `factory`, that the factory's pair for the two tokens is `pair`, and that the pair holds non-zero reserves. Exposes the pool price read before the deposit as `poolPrice`. The deposit is protected only with a `band` guard on `poolPrice` and a `slippage` guard on `liquidity`. Fee-on-transfer tokens are unsupported. — original id: "uniswapV2.addLiquidity" */
842
+ readonly addLiquidity: (nodeId: string, args: UniswapV2AddLiquidityArgs) => UniswapV2AddLiquidityOutputs;
843
+ /** Burn a Uniswap V2 LP token (or one of an ABI-identical fork such as SushiSwap V2) through its Router02 and receive both underlying tokens. Asserts on chain that the router's factory is `factory` and that the factory's pair for `tokenA`/`tokenB` is the input LP token. The withdrawal is protected only with a `slippage` guard on each of `tokenA` and `tokenB`. Fee-on-transfer tokens are unsupported: the outputs are the amounts the router reports, which would overstate what such a token delivers. — original id: "uniswapV2.removeLiquidity" */
844
+ readonly removeLiquidity: (nodeId: string, args: UniswapV2RemoveLiquidityArgs) => UniswapV2RemoveLiquidityOutputs;
845
+ };
846
+ readonly uniswapV3: {
847
+ /** Open a Uniswap V3 concentrated-liquidity position (or one on an ABI-identical fork) for a tick range, minting the position NFT straight to `recipient`, which must not be the execution address. Exposes the new `tokenId`; unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. — original id: "uniswapV3.mint" */
848
+ readonly mint: (nodeId: string, args: UniswapV3MintArgs) => UniswapV3MintOutputs;
849
+ /** Add two tokens to an existing Uniswap V3 position (or one on an ABI-identical fork). `owner` must own `tokenId`, and the position must hold the two input tokens; both are asserted on chain, since the position manager checks neither. Unused input comes back as residuals. The deposit is protected only with a `band` guard on `sqrtPriceX96` (read before the deposit) and a `slippage` guard on `liquidity`; a band of N bps on `sqrtPriceX96` allows about 2N bps of price movement. Fee-on-transfer tokens are unsupported. — original id: "uniswapV3.increaseLiquidity" */
850
+ readonly increaseLiquidity: (nodeId: string, args: UniswapV3IncreaseLiquidityArgs) => UniswapV3IncreaseLiquidityOutputs;
851
+ };
699
852
  };
700
853
  declare const bindGeneratedOps: (builder: FlowBuilderInternal) => GeneratedOps;
701
854
 
702
- 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 CorePartitionArgs, type CorePartitionOutputs, type CorePeekArgs, type CorePeekOutputs, type CoreRawCallArgs, type CoreRawCallOutputs, type CoreSplitArgs, type CoreSplitOutputs, type CoreStaticCallArgs, type CoreSubtractArgs, type CoreSubtractOutputs, type CoreTransferArgs, type CoreTransferOutputs, type FlySwapArgs, type FlySwapOutputs, type GeneratedOps, type InvariantAllowanceAtLeastArgs, type InvariantAllowanceAtMostArgs, type InvariantAllowanceEqualsArgs, type InvariantAllowanceInRangeArgs, type InvariantBalanceAtLeastArgs, type InvariantBalanceAtMostArgs, type InvariantBalanceEqualsArgs, type InvariantBalanceInRangeArgs, type InvariantEqArgs, type InvariantGtArgs, type InvariantGteArgs, type InvariantLtArgs, type InvariantLteArgs, type InvariantNeqArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiBridgeArgs, type LifiBridgeOutputs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapAsyncArgs, type LifiZapAsyncOutputs, type LifiZapOutputs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, bindGeneratedOps };
855
+ export { type AaveBorrowArgs, type AaveBorrowOutputs, type AaveClaimRewardsArgs, type AaveClaimRewardsOutputs, type AaveGetHealthFactorArgs, type AaveGetHealthFactorOutputs, 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 CorePartitionArgs, type CorePartitionOutputs, type CorePeekArgs, type CorePeekOutputs, type CoreRawCallArgs, type CoreRawCallOutputs, type CoreSplitArgs, type CoreSplitOutputs, type CoreStaticCallArgs, type CoreSubtractArgs, type CoreSubtractOutputs, type CoreTransferArgs, type CoreTransferOutputs, type FlySwapArgs, type FlySwapOutputs, type GeneratedOps, type InvariantAllowanceAtLeastArgs, type InvariantAllowanceAtMostArgs, type InvariantAllowanceEqualsArgs, type InvariantAllowanceInRangeArgs, type InvariantBalanceAtLeastArgs, type InvariantBalanceAtMostArgs, type InvariantBalanceEqualsArgs, type InvariantBalanceInRangeArgs, type InvariantEqArgs, type InvariantGtArgs, type InvariantGteArgs, type InvariantLtArgs, type InvariantLteArgs, type InvariantNeqArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiBridgeArgs, type LifiBridgeOutputs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapAsyncArgs, type LifiZapAsyncOutputs, type LifiZapOutputs, type MorphoBlueBorrowArgs, type MorphoBlueBorrowOutputs, type MorphoBlueGetPositionArgs, type MorphoBlueGetPositionOutputs, type MorphoBlueRepayArgs, type MorphoBlueRepayOutputs, type MorphoBlueSupplyArgs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueSupplyOutputs, type MorphoBlueWithdrawArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type MorphoBlueWithdrawOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, type UniswapV2AddLiquidityArgs, type UniswapV2AddLiquidityOutputs, type UniswapV2RemoveLiquidityArgs, type UniswapV2RemoveLiquidityOutputs, type UniswapV3IncreaseLiquidityArgs, type UniswapV3IncreaseLiquidityOutputs, type UniswapV3MintArgs, type UniswapV3MintOutputs, bindGeneratedOps };
@@ -176,13 +176,41 @@ const bindGeneratedOps = (builder) => ({
176
176
  claimed: "resource",
177
177
  claimedAmount: "uint256"
178
178
  }),
179
- setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {})
179
+ setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {}),
180
+ getHealthFactor: (nodeId, args) => builder.call(nodeId, "aave.getHealthFactor", args, {
181
+ healthFactor: "uint256"
182
+ })
180
183
  },
181
184
  morphoBlue: {
182
185
  supplyCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.supplyCollateral", args, {}),
183
186
  withdrawCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdrawCollateral", args, {
184
187
  withdrawn: "resource",
185
188
  collateralWithdrawn: "uint256"
189
+ }),
190
+ borrow: (nodeId, args) => builder.call(nodeId, "morphoBlue.borrow", args, {
191
+ borrowed: "resource",
192
+ assetsBorrowed: "uint256",
193
+ sharesBorrowed: "uint256"
194
+ }),
195
+ repay: (nodeId, args) => builder.call(nodeId, "morphoBlue.repay", args, {
196
+ actualRepaid: "uint256",
197
+ sharesRepaid: "uint256",
198
+ residual: "resource"
199
+ }),
200
+ supply: (nodeId, args) => builder.call(nodeId, "morphoBlue.supply", args, {
201
+ assetsSupplied: "uint256",
202
+ sharesSupplied: "uint256",
203
+ residual: "resource"
204
+ }),
205
+ withdraw: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdraw", args, {
206
+ withdrawn: "resource",
207
+ assetsWithdrawn: "uint256",
208
+ sharesWithdrawn: "uint256"
209
+ }),
210
+ getPosition: (nodeId, args) => builder.call(nodeId, "morphoBlue.getPosition", args, {
211
+ supplyShares: "uint256",
212
+ borrowShares: "uint128",
213
+ collateral: "uint128"
186
214
  })
187
215
  },
188
216
  paraswap: {
@@ -196,6 +224,33 @@ const bindGeneratedOps = (builder) => ({
196
224
  amountOut: "resource",
197
225
  unspentIn: "resource"
198
226
  })
227
+ },
228
+ uniswapV2: {
229
+ addLiquidity: (nodeId, args) => builder.call(nodeId, "uniswapV2.addLiquidity", args, {
230
+ liquidity: "resource",
231
+ residualA: "resource",
232
+ residualB: "resource",
233
+ poolPrice: "uint256"
234
+ }),
235
+ removeLiquidity: (nodeId, args) => builder.call(nodeId, "uniswapV2.removeLiquidity", args, {
236
+ tokenA: "resource",
237
+ tokenB: "resource"
238
+ })
239
+ },
240
+ uniswapV3: {
241
+ mint: (nodeId, args) => builder.call(nodeId, "uniswapV3.mint", args, {
242
+ tokenId: "uint256",
243
+ liquidity: "uint256",
244
+ sqrtPriceX96: "uint256",
245
+ residualA: "resource",
246
+ residualB: "resource"
247
+ }),
248
+ increaseLiquidity: (nodeId, args) => builder.call(nodeId, "uniswapV3.increaseLiquidity", args, {
249
+ liquidity: "uint256",
250
+ sqrtPriceX96: "uint256",
251
+ residualA: "resource",
252
+ residualB: "resource"
253
+ })
199
254
  }
200
255
  });
201
256
  export {