@lifi/composer-sdk 0.0.1-alpha → 0.2.0-staging.3

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 (66) hide show
  1. package/README.md +37 -1
  2. package/dist/authoring/signatureArgs.cjs +2 -2
  3. package/dist/authoring/signatureArgs.cjs.map +1 -1
  4. package/dist/authoring/signatureArgs.js +2 -2
  5. package/dist/authoring/signatureArgs.js.map +1 -1
  6. package/dist/client.cjs +2 -2
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.js +2 -2
  9. package/dist/client.js.map +1 -1
  10. package/dist/generated/config.generated.cjs.map +1 -1
  11. package/dist/generated/config.generated.d.cts +307 -16
  12. package/dist/generated/config.generated.d.ts +307 -16
  13. package/dist/generated/guards.generated.cjs +6 -0
  14. package/dist/generated/guards.generated.cjs.map +1 -1
  15. package/dist/generated/guards.generated.d.cts +1 -1
  16. package/dist/generated/guards.generated.d.ts +1 -1
  17. package/dist/generated/guards.generated.js +5 -0
  18. package/dist/generated/guards.generated.js.map +1 -1
  19. package/dist/generated/materialisers.generated.cjs +8 -2
  20. package/dist/generated/materialisers.generated.cjs.map +1 -1
  21. package/dist/generated/materialisers.generated.d.cts +1 -1
  22. package/dist/generated/materialisers.generated.d.ts +1 -1
  23. package/dist/generated/materialisers.generated.js +6 -1
  24. package/dist/generated/materialisers.generated.js.map +1 -1
  25. package/dist/generated/operations.generated.cjs +84 -14
  26. package/dist/generated/operations.generated.cjs.map +1 -1
  27. package/dist/generated/operations.generated.d.cts +208 -13
  28. package/dist/generated/operations.generated.d.ts +208 -13
  29. package/dist/generated/operations.generated.js +84 -14
  30. package/dist/generated/operations.generated.js.map +1 -1
  31. package/dist/guards.generated-BPLFwe7y.d.ts +19 -0
  32. package/dist/guards.generated-M3VAIevI.d.cts +19 -0
  33. package/dist/index.d.cts +3 -3
  34. package/dist/index.d.ts +3 -3
  35. package/dist/materialisers.generated-BfWJ-g7t.d.ts +29 -0
  36. package/dist/materialisers.generated-DaJRwiRe.d.cts +29 -0
  37. package/dist/run/inputs.cjs +8 -5
  38. package/dist/run/inputs.cjs.map +1 -1
  39. package/dist/run/inputs.d.cts +8 -0
  40. package/dist/run/inputs.d.ts +8 -0
  41. package/dist/run/inputs.js +8 -5
  42. package/dist/run/inputs.js.map +1 -1
  43. package/dist/sdk.cjs +1 -0
  44. package/dist/sdk.cjs.map +1 -1
  45. package/dist/sdk.js +1 -0
  46. package/dist/sdk.js.map +1 -1
  47. package/package.json +16 -7
  48. package/src/authoring/signatureArgs.ts +2 -2
  49. package/src/client.ts +1 -1
  50. package/src/examples/aaveClaimRewards.ts +80 -0
  51. package/src/examples/aaveRepay.ts +69 -0
  52. package/src/examples/aaveRepayWithATokens.ts +81 -0
  53. package/src/examples/aaveSetEMode.ts +68 -0
  54. package/src/examples/run.ts +41 -4
  55. package/src/examples/swapToRecipient.ts +0 -19
  56. package/src/examples/swapWithFee.ts +59 -0
  57. package/src/generated/config.generated.ts +364 -18
  58. package/src/generated/guards.generated.ts +12 -1
  59. package/src/generated/materialisers.generated.ts +24 -12
  60. package/src/generated/operations.generated.ts +373 -13
  61. package/src/run/inputs.ts +16 -5
  62. package/src/sdk.ts +1 -0
  63. package/dist/guards.generated-DKKDKREA.d.ts +0 -14
  64. package/dist/guards.generated-hrQ1KPNv.d.cts +0 -14
  65. package/dist/materialisers.generated-BsA1uDW8.d.ts +0 -24
  66. package/dist/materialisers.generated-nMxTAaVi.d.cts +0 -24
@@ -2,7 +2,7 @@ import { FlowBuilderInternal } from '../authoring/FlowBuilderCore.js';
2
2
  import { Bindable, OutputHandle } from '../authoring/handles.js';
3
3
  import { SignatureBind, CoreCallResult, StaticCallResult } from '../authoring/signatureArgs.js';
4
4
  import { TypedGuard } from '../types.js';
5
- import { CoreSplitConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiZapConfig } from './config.generated.js';
5
+ import { CoreSplitConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiFlashloanRepayConfig, LifiZapConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, AaveGetHealthFactorConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, MorphoBlueBorrowConfig, MorphoBlueRepayConfig, MorphoBlueSupplyConfig, MorphoBlueWithdrawConfig, MorphoBlueGetPositionConfig, ParaswapBuyConfig } from './config.generated.js';
6
6
  import '@lifi/compose-spec';
7
7
  import 'abitype';
8
8
 
@@ -38,14 +38,6 @@ interface InvariantBalanceAtLeastArgs {
38
38
  };
39
39
  readonly guards?: readonly TypedGuard<never>[];
40
40
  }
41
- /** Route tokens into a DeFi protocol position via the edge catalog */
42
- interface LifiZapArgs {
43
- readonly bind: {
44
- readonly amountIn: Bindable<'resource'>;
45
- };
46
- readonly config: LifiZapConfig;
47
- readonly guards?: readonly TypedGuard<'amountOut'>[];
48
- }
49
41
  /** Add two unsigned integers (a + b) */
50
42
  interface CoreAddArgs {
51
43
  readonly bind: {
@@ -213,6 +205,121 @@ interface CoreAsResourceArgs {
213
205
  readonly config: CoreAsResourceConfig;
214
206
  readonly guards?: readonly TypedGuard<'resource'>[];
215
207
  }
208
+ /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource */
209
+ interface AaveBorrowArgs {
210
+ readonly bind: Record<string, never>;
211
+ readonly config: AaveBorrowConfig;
212
+ readonly guards?: readonly TypedGuard<'debtBalance'>[];
213
+ }
214
+ /** 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. */
215
+ interface AaveRepayArgs {
216
+ readonly bind: {
217
+ readonly assetIn: Bindable<'resource'>;
218
+ readonly onBehalfOf: Bindable<'address'>;
219
+ };
220
+ readonly config: AaveRepayConfig;
221
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[];
222
+ }
223
+ /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual */
224
+ interface AaveRepayWithATokensArgs {
225
+ readonly bind: {
226
+ readonly aTokenIn: Bindable<'resource'>;
227
+ };
228
+ readonly config: AaveRepayWithATokensConfig;
229
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[];
230
+ }
231
+ /** Claim a specific Aave v3 incentives reward token against a set of receipt-token positions, exposing the claimed amount as a Resource */
232
+ interface AaveClaimRewardsArgs {
233
+ readonly bind: Record<string, never>;
234
+ readonly config: AaveClaimRewardsConfig;
235
+ readonly guards?: readonly TypedGuard<'claimedAmount'>[];
236
+ }
237
+ /** 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. */
238
+ interface AaveSetEModeArgs {
239
+ readonly bind: Record<string, never>;
240
+ readonly config: AaveSetEModeConfig;
241
+ readonly guards?: readonly TypedGuard<never>[];
242
+ }
243
+ /** 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. */
244
+ interface AaveGetHealthFactorArgs {
245
+ readonly bind: Record<string, never>;
246
+ readonly config: AaveGetHealthFactorConfig;
247
+ readonly guards?: readonly TypedGuard<'healthFactor'>[];
248
+ }
249
+ /** 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). */
250
+ interface MorphoBlueSupplyCollateralArgs {
251
+ readonly bind: {
252
+ readonly assetIn: Bindable<'resource'>;
253
+ };
254
+ readonly config: MorphoBlueSupplyCollateralConfig;
255
+ readonly guards?: readonly TypedGuard<never>[];
256
+ }
257
+ /** Withdraw collateral from a Morpho Blue market position to the receiver address. Exposes the withdrawn ERC20 amount as a Resource output. */
258
+ interface MorphoBlueWithdrawCollateralArgs {
259
+ readonly bind: Record<string, never>;
260
+ readonly config: MorphoBlueWithdrawCollateralConfig;
261
+ readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[];
262
+ }
263
+ /** 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. */
264
+ interface MorphoBlueBorrowArgs {
265
+ readonly bind: Record<string, never>;
266
+ readonly config: MorphoBlueBorrowConfig;
267
+ readonly guards?: readonly TypedGuard<'assetsBorrowed' | 'sharesBorrowed'>[];
268
+ }
269
+ /** 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. */
270
+ interface MorphoBlueRepayArgs {
271
+ readonly bind: {
272
+ readonly assetIn: Bindable<'resource'>;
273
+ readonly onBehalfOf: Bindable<'address'>;
274
+ };
275
+ readonly config: MorphoBlueRepayConfig;
276
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'sharesRepaid' | 'residual'>[];
277
+ }
278
+ /** 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. */
279
+ interface MorphoBlueSupplyArgs {
280
+ readonly bind: {
281
+ readonly assetIn: Bindable<'resource'>;
282
+ };
283
+ readonly config: MorphoBlueSupplyConfig;
284
+ readonly guards?: readonly TypedGuard<'assetsSupplied' | 'sharesSupplied' | 'residual'>[];
285
+ }
286
+ /** 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. */
287
+ interface MorphoBlueWithdrawArgs {
288
+ readonly bind: Record<string, never>;
289
+ readonly config: MorphoBlueWithdrawConfig;
290
+ readonly guards?: readonly TypedGuard<'assetsWithdrawn' | 'sharesWithdrawn'>[];
291
+ }
292
+ /** 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). */
293
+ interface MorphoBlueGetPositionArgs {
294
+ readonly bind: Record<string, never>;
295
+ readonly config: MorphoBlueGetPositionConfig;
296
+ readonly guards?: readonly TypedGuard<'supplyShares' | 'borrowShares' | 'collateral'>[];
297
+ }
298
+ /** Transfer principal + fee back to the LiFi flashloan adapter for one leg */
299
+ interface LifiFlashloanRepayArgs {
300
+ readonly bind: {
301
+ readonly funds: Bindable<'resource'>;
302
+ readonly feeBuffer?: Bindable<'resource'>;
303
+ };
304
+ readonly config: LifiFlashloanRepayConfig;
305
+ readonly guards?: readonly TypedGuard<never>[];
306
+ }
307
+ /** Route tokens into a DeFi protocol position via the edge catalog */
308
+ interface LifiZapArgs {
309
+ readonly bind: {
310
+ readonly amountIn: Bindable<'resource'>;
311
+ };
312
+ readonly config: LifiZapConfig;
313
+ readonly guards?: readonly TypedGuard<'amountOut'>[];
314
+ }
315
+ /** 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`. */
316
+ interface ParaswapBuyArgs {
317
+ readonly bind: {
318
+ readonly amountIn: Bindable<'resource'>;
319
+ };
320
+ readonly config: ParaswapBuyConfig;
321
+ readonly guards?: readonly TypedGuard<'unspentIn'>[];
322
+ }
216
323
  /** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal */
217
324
  interface CorePeekArgs {
218
325
  readonly bind: Record<string, never>;
@@ -230,9 +337,6 @@ interface LifiSwapOutputs {
230
337
  readonly amountOut: OutputHandle<'resource'>;
231
338
  readonly unspentIn: OutputHandle<'resource'>;
232
339
  }
233
- interface LifiZapOutputs {
234
- readonly amountOut: OutputHandle<'resource'>;
235
- }
236
340
  interface CoreAddOutputs {
237
341
  readonly result: OutputHandle<'uint256'>;
238
342
  }
@@ -267,6 +371,61 @@ interface CoreRawCallOutputs {
267
371
  interface CoreAsResourceOutputs {
268
372
  readonly resource: OutputHandle<'resource'>;
269
373
  }
374
+ interface AaveBorrowOutputs {
375
+ readonly borrowed: OutputHandle<'resource'>;
376
+ readonly debtBalance: OutputHandle<'uint256'>;
377
+ }
378
+ interface AaveRepayOutputs {
379
+ readonly actualRepaid: OutputHandle<'uint256'>;
380
+ readonly residual: OutputHandle<'resource'>;
381
+ }
382
+ interface AaveRepayWithATokensOutputs {
383
+ readonly actualRepaid: OutputHandle<'uint256'>;
384
+ readonly residual: OutputHandle<'resource'>;
385
+ }
386
+ interface AaveClaimRewardsOutputs {
387
+ readonly claimed: OutputHandle<'resource'>;
388
+ readonly claimedAmount: OutputHandle<'uint256'>;
389
+ }
390
+ interface AaveGetHealthFactorOutputs {
391
+ readonly healthFactor: OutputHandle<'uint256'>;
392
+ }
393
+ interface MorphoBlueWithdrawCollateralOutputs {
394
+ readonly withdrawn: OutputHandle<'resource'>;
395
+ readonly collateralWithdrawn: OutputHandle<'uint256'>;
396
+ }
397
+ interface MorphoBlueBorrowOutputs {
398
+ readonly borrowed: OutputHandle<'resource'>;
399
+ readonly assetsBorrowed: OutputHandle<'uint256'>;
400
+ readonly sharesBorrowed: OutputHandle<'uint256'>;
401
+ }
402
+ interface MorphoBlueRepayOutputs {
403
+ readonly actualRepaid: OutputHandle<'uint256'>;
404
+ readonly sharesRepaid: OutputHandle<'uint256'>;
405
+ readonly residual: OutputHandle<'resource'>;
406
+ }
407
+ interface MorphoBlueSupplyOutputs {
408
+ readonly assetsSupplied: OutputHandle<'uint256'>;
409
+ readonly sharesSupplied: OutputHandle<'uint256'>;
410
+ readonly residual: OutputHandle<'resource'>;
411
+ }
412
+ interface MorphoBlueWithdrawOutputs {
413
+ readonly withdrawn: OutputHandle<'resource'>;
414
+ readonly assetsWithdrawn: OutputHandle<'uint256'>;
415
+ readonly sharesWithdrawn: OutputHandle<'uint256'>;
416
+ }
417
+ interface MorphoBlueGetPositionOutputs {
418
+ readonly supplyShares: OutputHandle<'uint256'>;
419
+ readonly borrowShares: OutputHandle<'uint128'>;
420
+ readonly collateral: OutputHandle<'uint128'>;
421
+ }
422
+ interface LifiZapOutputs {
423
+ readonly amountOut: OutputHandle<'resource'>;
424
+ }
425
+ interface ParaswapBuyOutputs {
426
+ readonly amountOut: OutputHandle<'resource'>;
427
+ readonly unspentIn: OutputHandle<'resource'>;
428
+ }
270
429
  interface CorePeekOutputs {
271
430
  readonly result: OutputHandle<'uint256'>;
272
431
  }
@@ -324,6 +483,8 @@ type GeneratedOps = {
324
483
  readonly lifi: {
325
484
  /** Swap tokens via the LI.FI aggregator API — original id: "lifi.swap" */
326
485
  readonly swap: (nodeId: string, args: LifiSwapArgs) => LifiSwapOutputs;
486
+ /** Transfer principal + fee back to the LiFi flashloan adapter for one leg — original id: "lifi.flashloanRepay" */
487
+ readonly flashloanRepay: (nodeId: string, args: LifiFlashloanRepayArgs) => void;
327
488
  /** Route tokens into a DeFi protocol position via the edge catalog — original id: "lifi.zap" */
328
489
  readonly zap: (nodeId: string, args: LifiZapArgs) => LifiZapOutputs;
329
490
  };
@@ -331,7 +492,41 @@ type GeneratedOps = {
331
492
  /** Assert that an account holds at least a minimum token balance — original id: "invariant.balanceAtLeast" */
332
493
  readonly balanceAtLeast: (nodeId: string, args: InvariantBalanceAtLeastArgs) => void;
333
494
  };
495
+ readonly aave: {
496
+ /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource — original id: "aave.borrow" */
497
+ readonly borrow: (nodeId: string, args: AaveBorrowArgs) => AaveBorrowOutputs;
498
+ /** 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" */
499
+ readonly repay: (nodeId: string, args: AaveRepayArgs) => AaveRepayOutputs;
500
+ /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual — original id: "aave.repayWithATokens" */
501
+ readonly repayWithATokens: (nodeId: string, args: AaveRepayWithATokensArgs) => AaveRepayWithATokensOutputs;
502
+ /** 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" */
503
+ readonly claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) => AaveClaimRewardsOutputs;
504
+ /** 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" */
505
+ readonly setEMode: (nodeId: string, args: AaveSetEModeArgs) => void;
506
+ /** 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" */
507
+ readonly getHealthFactor: (nodeId: string, args: AaveGetHealthFactorArgs) => AaveGetHealthFactorOutputs;
508
+ };
509
+ readonly morphoBlue: {
510
+ /** 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" */
511
+ readonly supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) => void;
512
+ /** 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" */
513
+ readonly withdrawCollateral: (nodeId: string, args: MorphoBlueWithdrawCollateralArgs) => MorphoBlueWithdrawCollateralOutputs;
514
+ /** 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" */
515
+ readonly borrow: (nodeId: string, args: MorphoBlueBorrowArgs) => MorphoBlueBorrowOutputs;
516
+ /** 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" */
517
+ readonly repay: (nodeId: string, args: MorphoBlueRepayArgs) => MorphoBlueRepayOutputs;
518
+ /** 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" */
519
+ readonly supply: (nodeId: string, args: MorphoBlueSupplyArgs) => MorphoBlueSupplyOutputs;
520
+ /** 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" */
521
+ readonly withdraw: (nodeId: string, args: MorphoBlueWithdrawArgs) => MorphoBlueWithdrawOutputs;
522
+ /** 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" */
523
+ readonly getPosition: (nodeId: string, args: MorphoBlueGetPositionArgs) => MorphoBlueGetPositionOutputs;
524
+ };
525
+ readonly paraswap: {
526
+ /** 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" */
527
+ readonly buy: (nodeId: string, args: ParaswapBuyArgs) => ParaswapBuyOutputs;
528
+ };
334
529
  };
335
530
  declare const bindGeneratedOps: (builder: FlowBuilderInternal) => GeneratedOps;
336
531
 
337
- export { 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 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 InvariantBalanceAtLeastArgs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapOutputs, bindGeneratedOps };
532
+ 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 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 InvariantBalanceAtLeastArgs, type LifiFlashloanRepayArgs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, 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, bindGeneratedOps };
@@ -8,31 +8,35 @@ const bindGeneratedOps = (builder) => ({
8
8
  a: "resource",
9
9
  b: "resource"
10
10
  }),
11
- merge: (nodeId, args) => builder.call(nodeId, "core.merge", args, { merged: "resource" }),
12
- add: (nodeId, args) => builder.call(nodeId, "core.add", args, { result: "uint256" }),
13
- subtract: (nodeId, args) => builder.call(nodeId, "core.subtract", args, {
11
+ merge: (nodeId, args) => builder.call(nodeId, "core.merge", { ...args, config: {} }, {
12
+ merged: "resource"
13
+ }),
14
+ add: (nodeId, args) => builder.call(nodeId, "core.add", { ...args, config: {} }, {
15
+ result: "uint256"
16
+ }),
17
+ subtract: (nodeId, args) => builder.call(nodeId, "core.subtract", { ...args, config: {} }, {
14
18
  result: "uint256"
15
19
  }),
16
- multiply: (nodeId, args) => builder.call(nodeId, "core.multiply", args, {
20
+ multiply: (nodeId, args) => builder.call(nodeId, "core.multiply", { ...args, config: {} }, {
17
21
  result: "uint256"
18
22
  }),
19
- divideDown: (nodeId, args) => builder.call(nodeId, "core.divideDown", args, {
23
+ divideDown: (nodeId, args) => builder.call(nodeId, "core.divideDown", { ...args, config: {} }, {
20
24
  result: "uint256"
21
25
  }),
22
- divideUp: (nodeId, args) => builder.call(nodeId, "core.divideUp", args, {
26
+ divideUp: (nodeId, args) => builder.call(nodeId, "core.divideUp", { ...args, config: {} }, {
23
27
  result: "uint256"
24
28
  }),
25
29
  bpsDown: (nodeId, args) => builder.call(nodeId, "core.bpsDown", args, {
26
30
  result: "uint256"
27
31
  }),
28
32
  bpsUp: (nodeId, args) => builder.call(nodeId, "core.bpsUp", args, { result: "uint256" }),
29
- assertEqual: (nodeId, args) => builder.call(nodeId, "core.assertEqual", args, {}),
30
- assertNotEqual: (nodeId, args) => builder.call(nodeId, "core.assertNotEqual", args, {}),
31
- assertGt: (nodeId, args) => builder.call(nodeId, "core.assertGt", args, {}),
32
- assertGte: (nodeId, args) => builder.call(nodeId, "core.assertGte", args, {}),
33
- assertLt: (nodeId, args) => builder.call(nodeId, "core.assertLt", args, {}),
34
- assertLte: (nodeId, args) => builder.call(nodeId, "core.assertLte", args, {}),
35
- assertInRange: (nodeId, args) => builder.call(nodeId, "core.assertInRange", args, {}),
33
+ assertEqual: (nodeId, args) => builder.call(nodeId, "core.assertEqual", { ...args, config: {} }, {}),
34
+ assertNotEqual: (nodeId, args) => builder.call(nodeId, "core.assertNotEqual", { ...args, config: {} }, {}),
35
+ assertGt: (nodeId, args) => builder.call(nodeId, "core.assertGt", { ...args, config: {} }, {}),
36
+ assertGte: (nodeId, args) => builder.call(nodeId, "core.assertGte", { ...args, config: {} }, {}),
37
+ assertLt: (nodeId, args) => builder.call(nodeId, "core.assertLt", { ...args, config: {} }, {}),
38
+ assertLte: (nodeId, args) => builder.call(nodeId, "core.assertLte", { ...args, config: {} }, {}),
39
+ assertInRange: (nodeId, args) => builder.call(nodeId, "core.assertInRange", { ...args, config: {} }, {}),
36
40
  approve: (nodeId, args) => builder.call(nodeId, "core.approve", args, {}),
37
41
  balanceOf: (nodeId, args) => builder.call(nodeId, "core.balanceOf", args, {
38
42
  balance: "resource"
@@ -75,12 +79,78 @@ const bindGeneratedOps = (builder) => ({
75
79
  amountOut: "resource",
76
80
  unspentIn: "resource"
77
81
  }),
82
+ flashloanRepay: (nodeId, args) => builder.call(nodeId, "lifi.flashloanRepay", args, {}),
78
83
  zap: (nodeId, args) => builder.call(nodeId, "lifi.zap", args, {
79
84
  amountOut: "resource"
80
85
  })
81
86
  },
82
87
  invariant: {
83
- balanceAtLeast: (nodeId, args) => builder.call(nodeId, "invariant.balanceAtLeast", args, {})
88
+ balanceAtLeast: (nodeId, args) => builder.call(
89
+ nodeId,
90
+ "invariant.balanceAtLeast",
91
+ { ...args, config: {} },
92
+ {}
93
+ )
94
+ },
95
+ aave: {
96
+ borrow: (nodeId, args) => builder.call(nodeId, "aave.borrow", args, {
97
+ borrowed: "resource",
98
+ debtBalance: "uint256"
99
+ }),
100
+ repay: (nodeId, args) => builder.call(nodeId, "aave.repay", args, {
101
+ actualRepaid: "uint256",
102
+ residual: "resource"
103
+ }),
104
+ repayWithATokens: (nodeId, args) => builder.call(nodeId, "aave.repayWithATokens", args, {
105
+ actualRepaid: "uint256",
106
+ residual: "resource"
107
+ }),
108
+ claimRewards: (nodeId, args) => builder.call(nodeId, "aave.claimRewards", args, {
109
+ claimed: "resource",
110
+ claimedAmount: "uint256"
111
+ }),
112
+ setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {}),
113
+ getHealthFactor: (nodeId, args) => builder.call(nodeId, "aave.getHealthFactor", args, {
114
+ healthFactor: "uint256"
115
+ })
116
+ },
117
+ morphoBlue: {
118
+ supplyCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.supplyCollateral", args, {}),
119
+ withdrawCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdrawCollateral", args, {
120
+ withdrawn: "resource",
121
+ collateralWithdrawn: "uint256"
122
+ }),
123
+ borrow: (nodeId, args) => builder.call(nodeId, "morphoBlue.borrow", args, {
124
+ borrowed: "resource",
125
+ assetsBorrowed: "uint256",
126
+ sharesBorrowed: "uint256"
127
+ }),
128
+ repay: (nodeId, args) => builder.call(nodeId, "morphoBlue.repay", args, {
129
+ actualRepaid: "uint256",
130
+ sharesRepaid: "uint256",
131
+ residual: "resource"
132
+ }),
133
+ supply: (nodeId, args) => builder.call(nodeId, "morphoBlue.supply", args, {
134
+ assetsSupplied: "uint256",
135
+ sharesSupplied: "uint256",
136
+ residual: "resource"
137
+ }),
138
+ withdraw: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdraw", args, {
139
+ withdrawn: "resource",
140
+ assetsWithdrawn: "uint256",
141
+ sharesWithdrawn: "uint256"
142
+ }),
143
+ getPosition: (nodeId, args) => builder.call(nodeId, "morphoBlue.getPosition", args, {
144
+ supplyShares: "uint256",
145
+ borrowShares: "uint128",
146
+ collateral: "uint128"
147
+ })
148
+ },
149
+ paraswap: {
150
+ buy: (nodeId, args) => builder.call(nodeId, "paraswap.buy", args, {
151
+ amountOut: "resource",
152
+ unspentIn: "resource"
153
+ })
84
154
  }
85
155
  });
86
156
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generated/operations.generated.ts"],"sourcesContent":["// AUTO-GENERATED from manifest.json — do not edit by hand.\n// Regenerate with: yarn workspace @lifi/composer-sdk generate\n\nimport type {\n AnyBindable,\n FlowBuilderInternal,\n} from '../authoring/FlowBuilderCore.js';\nimport type { Bindable, OutputHandle } from '../authoring/handles.js';\nimport type {\n CoreCallResult,\n SignatureBind,\n StaticCallResult,\n} from '../authoring/signatureArgs.js';\nimport {\n buildCallWireFormat,\n buildStaticCallWireFormat,\n} from '../authoring/signatureArgs.js';\nimport type { TypedGuard } from '../types.js';\n\nimport type {\n CoreApproveConfig,\n CoreAsResourceConfig,\n CoreBalanceOfConfig,\n CoreBpsDownConfig,\n CoreBpsUpConfig,\n CoreCallConfig,\n CorePeekConfig,\n CoreRawCallConfig,\n CoreSplitConfig,\n CoreStaticCallConfig,\n CoreTransferConfig,\n LifiSwapConfig,\n LifiZapConfig,\n} from './config.generated.js';\n\n/** Split a resource into two outputs by basis-point ratio */\nexport interface CoreSplitArgs {\n readonly bind: {\n readonly source: Bindable<'resource'>;\n };\n readonly config: CoreSplitConfig;\n readonly guards?: readonly TypedGuard<'a' | 'b'>[];\n}\n\n/** Merge two same-token resources into one by addition */\nexport interface CoreMergeArgs {\n readonly bind: {\n readonly a: Bindable<'resource'>;\n readonly b: Bindable<'resource'>;\n };\n readonly guards?: readonly TypedGuard<'merged'>[];\n}\n\n/** Swap tokens via the LI.FI aggregator API */\nexport interface LifiSwapArgs {\n readonly bind: {\n readonly amountIn: Bindable<'resource'>;\n };\n readonly config: LifiSwapConfig;\n readonly guards?: readonly TypedGuard<'unspentIn'>[];\n}\n\n/** Assert that an account holds at least a minimum token balance */\nexport interface InvariantBalanceAtLeastArgs {\n readonly bind: {\n readonly minimumAmount: Bindable<'resource'>;\n readonly account: Bindable<'address'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Route tokens into a DeFi protocol position via the edge catalog */\nexport interface LifiZapArgs {\n readonly bind: {\n readonly amountIn: Bindable<'resource'>;\n };\n readonly config: LifiZapConfig;\n readonly guards?: readonly TypedGuard<'amountOut'>[];\n}\n\n/** Add two unsigned integers (a + b) */\nexport interface CoreAddArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Subtract b from a (a - b); reverts on underflow */\nexport interface CoreSubtractArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Multiply two unsigned integers (a * b) */\nexport interface CoreMultiplyArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Divide a by b, rounding toward zero */\nexport interface CoreDivideDownArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Divide a by b, rounding away from zero */\nexport interface CoreDivideUpArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Multiply value by basis points and divide by 10000, rounding down */\nexport interface CoreBpsDownArgs {\n readonly bind: {\n readonly value: Bindable<'uint256'>;\n };\n readonly config: CoreBpsDownConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Multiply value by basis points and divide by 10000, rounding up */\nexport interface CoreBpsUpArgs {\n readonly bind: {\n readonly value: Bindable<'uint256'>;\n };\n readonly config: CoreBpsUpConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Assert a == b; reverts if not equal */\nexport interface CoreAssertEqualArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a != b; reverts if equal */\nexport interface CoreAssertNotEqualArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a > b; reverts if a <= b */\nexport interface CoreAssertGtArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a >= b; reverts if a < b */\nexport interface CoreAssertGteArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a < b; reverts if a >= b */\nexport interface CoreAssertLtArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a <= b; reverts if a > b */\nexport interface CoreAssertLteArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert min <= value <= max; reverts if value is outside the range */\nexport interface CoreAssertInRangeArgs {\n readonly bind: {\n readonly value: Bindable<'uint256'>;\n readonly min: Bindable<'uint256'>;\n readonly max: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Approve an ERC20 spender for the given token and amount */\nexport interface CoreApproveArgs {\n readonly bind: {\n readonly amount: Bindable<'resource'>;\n };\n readonly config: CoreApproveConfig;\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Read an ERC20 balance, producing a resource */\nexport interface CoreBalanceOfArgs {\n readonly bind: Record<string, never>;\n readonly config: CoreBalanceOfConfig;\n readonly guards?: readonly TypedGuard<'balance'>[];\n}\n\n/** Transfer tokens to a recipient address, optionally specifying a partial amount */\nexport interface CoreTransferArgs {\n readonly bind: {\n readonly amount: Bindable<'resource'>;\n readonly recipient: Bindable<'address'>;\n };\n readonly config: CoreTransferConfig;\n readonly guards?: readonly TypedGuard<'transferred' | 'remainder'>[];\n}\n\n/** Invoke a smart contract function, optionally spending a token resource */\nexport interface CoreCallArgs<TSig extends string = string> {\n readonly resource?: Bindable<'resource'>;\n readonly bind: SignatureBind<TSig>;\n readonly config: Omit<CoreCallConfig, 'args' | 'functionSignature'> & {\n readonly functionSignature: TSig;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Read from a smart contract at runtime (StaticCall); result is fresh at execution time */\nexport interface CoreStaticCallArgs<TSig extends string = string> {\n readonly bind: SignatureBind<TSig>;\n readonly config: Omit<CoreStaticCallConfig, 'args' | 'functionSignature'> & {\n readonly functionSignature: TSig;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Invoke a contract with pre-encoded calldata */\nexport interface CoreRawCallArgs {\n readonly bind: Record<string, never>;\n readonly config: CoreRawCallConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Graduate a raw handle to a resource, enabling slippage surfacing and linearity tracking */\nexport interface CoreAsResourceArgs {\n readonly bind: {\n readonly handle: Bindable<'uint256'>;\n };\n readonly config: CoreAsResourceConfig;\n readonly guards?: readonly TypedGuard<'resource'>[];\n}\n\n/** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal */\nexport interface CorePeekArgs {\n readonly bind: Record<string, never>;\n readonly config: CorePeekConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\nexport interface CoreSplitOutputs {\n readonly a: OutputHandle<'resource'>;\n readonly b: OutputHandle<'resource'>;\n}\n\nexport interface CoreMergeOutputs {\n readonly merged: OutputHandle<'resource'>;\n}\n\nexport interface LifiSwapOutputs {\n readonly amountOut: OutputHandle<'resource'>;\n readonly unspentIn: OutputHandle<'resource'>;\n}\n\nexport interface LifiZapOutputs {\n readonly amountOut: OutputHandle<'resource'>;\n}\n\nexport interface CoreAddOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreSubtractOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreMultiplyOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreDivideDownOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreDivideUpOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreBpsDownOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreBpsUpOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreBalanceOfOutputs {\n readonly balance: OutputHandle<'resource'>;\n}\n\nexport interface CoreTransferOutputs {\n readonly transferred: OutputHandle<'resource'>;\n readonly remainder: OutputHandle<'resource'>;\n}\n\nexport interface CoreRawCallOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreAsResourceOutputs {\n readonly resource: OutputHandle<'resource'>;\n}\n\nexport interface CorePeekOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport type GeneratedOps = {\n readonly core: {\n /** Split a resource into two outputs by basis-point ratio — original id: \"core.split\" */\n readonly split: (nodeId: string, args: CoreSplitArgs) => CoreSplitOutputs;\n /** Merge two same-token resources into one by addition — original id: \"core.merge\" */\n readonly merge: (nodeId: string, args: CoreMergeArgs) => CoreMergeOutputs;\n /** Add two unsigned integers (a + b) — original id: \"core.add\" */\n readonly add: (nodeId: string, args: CoreAddArgs) => CoreAddOutputs;\n /** Subtract b from a (a - b); reverts on underflow — original id: \"core.subtract\" */\n readonly subtract: (\n nodeId: string,\n args: CoreSubtractArgs,\n ) => CoreSubtractOutputs;\n /** Multiply two unsigned integers (a * b) — original id: \"core.multiply\" */\n readonly multiply: (\n nodeId: string,\n args: CoreMultiplyArgs,\n ) => CoreMultiplyOutputs;\n /** Divide a by b, rounding toward zero — original id: \"core.divideDown\" */\n readonly divideDown: (\n nodeId: string,\n args: CoreDivideDownArgs,\n ) => CoreDivideDownOutputs;\n /** Divide a by b, rounding away from zero — original id: \"core.divideUp\" */\n readonly divideUp: (\n nodeId: string,\n args: CoreDivideUpArgs,\n ) => CoreDivideUpOutputs;\n /** Multiply value by basis points and divide by 10000, rounding down — original id: \"core.bpsDown\" */\n readonly bpsDown: (\n nodeId: string,\n args: CoreBpsDownArgs,\n ) => CoreBpsDownOutputs;\n /** Multiply value by basis points and divide by 10000, rounding up — original id: \"core.bpsUp\" */\n readonly bpsUp: (nodeId: string, args: CoreBpsUpArgs) => CoreBpsUpOutputs;\n /** Assert a == b; reverts if not equal — original id: \"core.assertEqual\" */\n readonly assertEqual: (nodeId: string, args: CoreAssertEqualArgs) => void;\n /** Assert a != b; reverts if equal — original id: \"core.assertNotEqual\" */\n readonly assertNotEqual: (\n nodeId: string,\n args: CoreAssertNotEqualArgs,\n ) => void;\n /** Assert a > b; reverts if a <= b — original id: \"core.assertGt\" */\n readonly assertGt: (nodeId: string, args: CoreAssertGtArgs) => void;\n /** Assert a >= b; reverts if a < b — original id: \"core.assertGte\" */\n readonly assertGte: (nodeId: string, args: CoreAssertGteArgs) => void;\n /** Assert a < b; reverts if a >= b — original id: \"core.assertLt\" */\n readonly assertLt: (nodeId: string, args: CoreAssertLtArgs) => void;\n /** Assert a <= b; reverts if a > b — original id: \"core.assertLte\" */\n readonly assertLte: (nodeId: string, args: CoreAssertLteArgs) => void;\n /** Assert min <= value <= max; reverts if value is outside the range — original id: \"core.assertInRange\" */\n readonly assertInRange: (\n nodeId: string,\n args: CoreAssertInRangeArgs,\n ) => void;\n /** Approve an ERC20 spender for the given token and amount — original id: \"core.approve\" */\n readonly approve: (nodeId: string, args: CoreApproveArgs) => void;\n /** Read an ERC20 balance, producing a resource — original id: \"core.balanceOf\" */\n readonly balanceOf: (\n nodeId: string,\n args: CoreBalanceOfArgs,\n ) => CoreBalanceOfOutputs;\n /** Transfer tokens to a recipient address, optionally specifying a partial amount — original id: \"core.transfer\" */\n readonly transfer: (\n nodeId: string,\n args: CoreTransferArgs,\n ) => CoreTransferOutputs;\n /** Invoke a smart contract function, optionally spending a token resource — original id: \"core.call\" */\n readonly call: <TSig extends string>(\n nodeId: string,\n args: CoreCallArgs<TSig>,\n ) => CoreCallResult<TSig>;\n /** Read from a smart contract at runtime (StaticCall); result is fresh at execution time — original id: \"core.staticCall\" */\n readonly staticCall: <TSig extends string>(\n nodeId: string,\n args: CoreStaticCallArgs<TSig>,\n ) => StaticCallResult<TSig>;\n /** Invoke a contract with pre-encoded calldata — original id: \"core.rawCall\" */\n readonly rawCall: (\n nodeId: string,\n args: CoreRawCallArgs,\n ) => CoreRawCallOutputs;\n /** Graduate a raw handle to a resource, enabling slippage surfacing and linearity tracking — original id: \"core.asResource\" */\n readonly asResource: (\n nodeId: string,\n args: CoreAsResourceArgs,\n ) => CoreAsResourceOutputs;\n /** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal — original id: \"core.peek\" */\n readonly peek: (nodeId: string, args: CorePeekArgs) => CorePeekOutputs;\n };\n readonly lifi: {\n /** Swap tokens via the LI.FI aggregator API — original id: \"lifi.swap\" */\n readonly swap: (nodeId: string, args: LifiSwapArgs) => LifiSwapOutputs;\n /** Route tokens into a DeFi protocol position via the edge catalog — original id: \"lifi.zap\" */\n readonly zap: (nodeId: string, args: LifiZapArgs) => LifiZapOutputs;\n };\n readonly invariant: {\n /** Assert that an account holds at least a minimum token balance — original id: \"invariant.balanceAtLeast\" */\n readonly balanceAtLeast: (\n nodeId: string,\n args: InvariantBalanceAtLeastArgs,\n ) => void;\n };\n};\n\nexport const bindGeneratedOps = (\n builder: FlowBuilderInternal,\n): GeneratedOps => ({\n core: {\n split: (nodeId: string, args: CoreSplitArgs) =>\n builder.call(nodeId, 'core.split', args, {\n a: 'resource',\n b: 'resource',\n } as const),\n merge: (nodeId: string, args: CoreMergeArgs) =>\n builder.call(nodeId, 'core.merge', args, { merged: 'resource' } as const),\n add: (nodeId: string, args: CoreAddArgs) =>\n builder.call(nodeId, 'core.add', args, { result: 'uint256' } as const),\n subtract: (nodeId: string, args: CoreSubtractArgs) =>\n builder.call(nodeId, 'core.subtract', args, {\n result: 'uint256',\n } as const),\n multiply: (nodeId: string, args: CoreMultiplyArgs) =>\n builder.call(nodeId, 'core.multiply', args, {\n result: 'uint256',\n } as const),\n divideDown: (nodeId: string, args: CoreDivideDownArgs) =>\n builder.call(nodeId, 'core.divideDown', args, {\n result: 'uint256',\n } as const),\n divideUp: (nodeId: string, args: CoreDivideUpArgs) =>\n builder.call(nodeId, 'core.divideUp', args, {\n result: 'uint256',\n } as const),\n bpsDown: (nodeId: string, args: CoreBpsDownArgs) =>\n builder.call(nodeId, 'core.bpsDown', args, {\n result: 'uint256',\n } as const),\n bpsUp: (nodeId: string, args: CoreBpsUpArgs) =>\n builder.call(nodeId, 'core.bpsUp', args, { result: 'uint256' } as const),\n assertEqual: (nodeId: string, args: CoreAssertEqualArgs) =>\n builder.call(nodeId, 'core.assertEqual', args, {}),\n assertNotEqual: (nodeId: string, args: CoreAssertNotEqualArgs) =>\n builder.call(nodeId, 'core.assertNotEqual', args, {}),\n assertGt: (nodeId: string, args: CoreAssertGtArgs) =>\n builder.call(nodeId, 'core.assertGt', args, {}),\n assertGte: (nodeId: string, args: CoreAssertGteArgs) =>\n builder.call(nodeId, 'core.assertGte', args, {}),\n assertLt: (nodeId: string, args: CoreAssertLtArgs) =>\n builder.call(nodeId, 'core.assertLt', args, {}),\n assertLte: (nodeId: string, args: CoreAssertLteArgs) =>\n builder.call(nodeId, 'core.assertLte', args, {}),\n assertInRange: (nodeId: string, args: CoreAssertInRangeArgs) =>\n builder.call(nodeId, 'core.assertInRange', args, {}),\n approve: (nodeId: string, args: CoreApproveArgs) =>\n builder.call(nodeId, 'core.approve', args, {}),\n balanceOf: (nodeId: string, args: CoreBalanceOfArgs) =>\n builder.call(nodeId, 'core.balanceOf', args, {\n balance: 'resource',\n } as const),\n transfer: (nodeId: string, args: CoreTransferArgs) =>\n builder.call(nodeId, 'core.transfer', args, {\n transferred: 'resource',\n remainder: 'resource',\n } as const),\n call: <TSig extends string>(nodeId: string, args: CoreCallArgs<TSig>) => {\n const wire = buildCallWireFormat({\n resource: args.resource,\n bind: args.bind as Record<string, AnyBindable>,\n config: args.config as Record<string, unknown>,\n guards: args.guards,\n });\n return builder.call(nodeId, wire.op, wire, {\n result: 'uint256',\n } as const) as unknown as CoreCallResult<TSig>;\n },\n staticCall: <TSig extends string>(\n nodeId: string,\n args: CoreStaticCallArgs<TSig>,\n ) =>\n builder.call(\n nodeId,\n 'core.staticCall',\n buildStaticCallWireFormat({\n bind: args.bind as Record<string, AnyBindable>,\n config: args.config as Record<string, unknown>,\n guards: args.guards,\n }),\n { result: 'uint256' } as const,\n ) as unknown as StaticCallResult<TSig>,\n rawCall: (nodeId: string, args: CoreRawCallArgs) =>\n builder.call(nodeId, 'core.rawCall', args, {\n result: 'uint256',\n } as const),\n asResource: (nodeId: string, args: CoreAsResourceArgs) =>\n builder.call(nodeId, 'core.asResource', args, {\n resource: 'resource',\n } as const),\n peek: (nodeId: string, args: CorePeekArgs) =>\n builder.call(nodeId, 'core.peek', args, { result: 'uint256' } as const),\n },\n lifi: {\n swap: (nodeId: string, args: LifiSwapArgs) =>\n builder.call(nodeId, 'lifi.swap', args, {\n amountOut: 'resource',\n unspentIn: 'resource',\n } as const),\n zap: (nodeId: string, args: LifiZapArgs) =>\n builder.call(nodeId, 'lifi.zap', args, {\n amountOut: 'resource',\n } as const),\n },\n invariant: {\n balanceAtLeast: (nodeId: string, args: InvariantBalanceAtLeastArgs) =>\n builder.call(nodeId, 'invariant.balanceAtLeast', args, {}),\n },\n});\n"],"mappings":"AAaA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA+aA,MAAM,mBAAmB,CAC9B,aACkB;AAAA,EAClB,MAAM;AAAA,IACJ,OAAO,CAAC,QAAgB,SACtB,QAAQ,KAAK,QAAQ,cAAc,MAAM;AAAA,MACvC,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAU;AAAA,IACZ,OAAO,CAAC,QAAgB,SACtB,QAAQ,KAAK,QAAQ,cAAc,MAAM,EAAE,QAAQ,WAAW,CAAU;AAAA,IAC1E,KAAK,CAAC,QAAgB,SACpB,QAAQ,KAAK,QAAQ,YAAY,MAAM,EAAE,QAAQ,UAAU,CAAU;AAAA,IACvE,UAAU,CAAC,QAAgB,SACzB,QAAQ,KAAK,QAAQ,i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,KAAK,CAAC,QAAgB,SACpB,QAAQ,KAAK,QAAQ,YAAY,MAAM;AAAA,MACrC,WAAW;AAAA,IACb,CAAU;AAAA,EACd;AAAA,EACA,WAAW;AAAA,IACT,gBAAgB,CAAC,QAAgB,SAC/B,QAAQ,KAAK,QAAQ,4BAA4B,MAAM,CAAC,CAAC;AAAA,EAC7D;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/generated/operations.generated.ts"],"sourcesContent":["// AUTO-GENERATED from manifest.json — do not edit by hand.\n// Regenerate with: yarn workspace @lifi/composer-sdk generate\n\nimport type {\n AnyBindable,\n FlowBuilderInternal,\n} from '../authoring/FlowBuilderCore.js';\nimport type { Bindable, OutputHandle } from '../authoring/handles.js';\nimport type {\n CoreCallResult,\n SignatureBind,\n StaticCallResult,\n} from '../authoring/signatureArgs.js';\nimport {\n buildCallWireFormat,\n buildStaticCallWireFormat,\n} from '../authoring/signatureArgs.js';\nimport type { TypedGuard } from '../types.js';\n\nimport type {\n AaveBorrowConfig,\n AaveClaimRewardsConfig,\n AaveGetHealthFactorConfig,\n AaveRepayConfig,\n AaveRepayWithATokensConfig,\n AaveSetEModeConfig,\n CoreApproveConfig,\n CoreAsResourceConfig,\n CoreBalanceOfConfig,\n CoreBpsDownConfig,\n CoreBpsUpConfig,\n CoreCallConfig,\n CorePeekConfig,\n CoreRawCallConfig,\n CoreSplitConfig,\n CoreStaticCallConfig,\n CoreTransferConfig,\n LifiFlashloanRepayConfig,\n LifiSwapConfig,\n LifiZapConfig,\n MorphoBlueBorrowConfig,\n MorphoBlueGetPositionConfig,\n MorphoBlueRepayConfig,\n MorphoBlueSupplyCollateralConfig,\n MorphoBlueSupplyConfig,\n MorphoBlueWithdrawCollateralConfig,\n MorphoBlueWithdrawConfig,\n ParaswapBuyConfig,\n} from './config.generated.js';\n\n/** Split a resource into two outputs by basis-point ratio */\nexport interface CoreSplitArgs {\n readonly bind: {\n readonly source: Bindable<'resource'>;\n };\n readonly config: CoreSplitConfig;\n readonly guards?: readonly TypedGuard<'a' | 'b'>[];\n}\n\n/** Merge two same-token resources into one by addition */\nexport interface CoreMergeArgs {\n readonly bind: {\n readonly a: Bindable<'resource'>;\n readonly b: Bindable<'resource'>;\n };\n readonly guards?: readonly TypedGuard<'merged'>[];\n}\n\n/** Swap tokens via the LI.FI aggregator API */\nexport interface LifiSwapArgs {\n readonly bind: {\n readonly amountIn: Bindable<'resource'>;\n };\n readonly config: LifiSwapConfig;\n readonly guards?: readonly TypedGuard<'unspentIn'>[];\n}\n\n/** Assert that an account holds at least a minimum token balance */\nexport interface InvariantBalanceAtLeastArgs {\n readonly bind: {\n readonly minimumAmount: Bindable<'resource'>;\n readonly account: Bindable<'address'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Add two unsigned integers (a + b) */\nexport interface CoreAddArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Subtract b from a (a - b); reverts on underflow */\nexport interface CoreSubtractArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Multiply two unsigned integers (a * b) */\nexport interface CoreMultiplyArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Divide a by b, rounding toward zero */\nexport interface CoreDivideDownArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Divide a by b, rounding away from zero */\nexport interface CoreDivideUpArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Multiply value by basis points and divide by 10000, rounding down */\nexport interface CoreBpsDownArgs {\n readonly bind: {\n readonly value: Bindable<'uint256'>;\n };\n readonly config: CoreBpsDownConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Multiply value by basis points and divide by 10000, rounding up */\nexport interface CoreBpsUpArgs {\n readonly bind: {\n readonly value: Bindable<'uint256'>;\n };\n readonly config: CoreBpsUpConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Assert a == b; reverts if not equal */\nexport interface CoreAssertEqualArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a != b; reverts if equal */\nexport interface CoreAssertNotEqualArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a > b; reverts if a <= b */\nexport interface CoreAssertGtArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a >= b; reverts if a < b */\nexport interface CoreAssertGteArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a < b; reverts if a >= b */\nexport interface CoreAssertLtArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert a <= b; reverts if a > b */\nexport interface CoreAssertLteArgs {\n readonly bind: {\n readonly a: Bindable<'uint256'>;\n readonly b: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Assert min <= value <= max; reverts if value is outside the range */\nexport interface CoreAssertInRangeArgs {\n readonly bind: {\n readonly value: Bindable<'uint256'>;\n readonly min: Bindable<'uint256'>;\n readonly max: Bindable<'uint256'>;\n };\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Approve an ERC20 spender for the given token and amount */\nexport interface CoreApproveArgs {\n readonly bind: {\n readonly amount: Bindable<'resource'>;\n };\n readonly config: CoreApproveConfig;\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Read an ERC20 balance, producing a resource */\nexport interface CoreBalanceOfArgs {\n readonly bind: Record<string, never>;\n readonly config: CoreBalanceOfConfig;\n readonly guards?: readonly TypedGuard<'balance'>[];\n}\n\n/** Transfer tokens to a recipient address, optionally specifying a partial amount */\nexport interface CoreTransferArgs {\n readonly bind: {\n readonly amount: Bindable<'resource'>;\n readonly recipient: Bindable<'address'>;\n };\n readonly config: CoreTransferConfig;\n readonly guards?: readonly TypedGuard<'transferred' | 'remainder'>[];\n}\n\n/** Invoke a smart contract function, optionally spending a token resource */\nexport interface CoreCallArgs<TSig extends string = string> {\n readonly resource?: Bindable<'resource'>;\n readonly bind: SignatureBind<TSig>;\n readonly config: Omit<CoreCallConfig, 'args' | 'functionSignature'> & {\n readonly functionSignature: TSig;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Read from a smart contract at runtime (StaticCall); result is fresh at execution time */\nexport interface CoreStaticCallArgs<TSig extends string = string> {\n readonly bind: SignatureBind<TSig>;\n readonly config: Omit<CoreStaticCallConfig, 'args' | 'functionSignature'> & {\n readonly functionSignature: TSig;\n };\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Invoke a contract with pre-encoded calldata */\nexport interface CoreRawCallArgs {\n readonly bind: Record<string, never>;\n readonly config: CoreRawCallConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\n/** Graduate a raw handle to a resource, enabling slippage surfacing and linearity tracking */\nexport interface CoreAsResourceArgs {\n readonly bind: {\n readonly handle: Bindable<'uint256'>;\n };\n readonly config: CoreAsResourceConfig;\n readonly guards?: readonly TypedGuard<'resource'>[];\n}\n\n/** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource */\nexport interface AaveBorrowArgs {\n readonly bind: Record<string, never>;\n readonly config: AaveBorrowConfig;\n readonly guards?: readonly TypedGuard<'debtBalance'>[];\n}\n\n/** 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. */\nexport interface AaveRepayArgs {\n readonly bind: {\n readonly assetIn: Bindable<'resource'>;\n readonly onBehalfOf: Bindable<'address'>;\n };\n readonly config: AaveRepayConfig;\n readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[];\n}\n\n/** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual */\nexport interface AaveRepayWithATokensArgs {\n readonly bind: {\n readonly aTokenIn: Bindable<'resource'>;\n };\n readonly config: AaveRepayWithATokensConfig;\n readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[];\n}\n\n/** Claim a specific Aave v3 incentives reward token against a set of receipt-token positions, exposing the claimed amount as a Resource */\nexport interface AaveClaimRewardsArgs {\n readonly bind: Record<string, never>;\n readonly config: AaveClaimRewardsConfig;\n readonly guards?: readonly TypedGuard<'claimedAmount'>[];\n}\n\n/** 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. */\nexport interface AaveSetEModeArgs {\n readonly bind: Record<string, never>;\n readonly config: AaveSetEModeConfig;\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** 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. */\nexport interface AaveGetHealthFactorArgs {\n readonly bind: Record<string, never>;\n readonly config: AaveGetHealthFactorConfig;\n readonly guards?: readonly TypedGuard<'healthFactor'>[];\n}\n\n/** 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). */\nexport interface MorphoBlueSupplyCollateralArgs {\n readonly bind: {\n readonly assetIn: Bindable<'resource'>;\n };\n readonly config: MorphoBlueSupplyCollateralConfig;\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Withdraw collateral from a Morpho Blue market position to the receiver address. Exposes the withdrawn ERC20 amount as a Resource output. */\nexport interface MorphoBlueWithdrawCollateralArgs {\n readonly bind: Record<string, never>;\n readonly config: MorphoBlueWithdrawCollateralConfig;\n readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[];\n}\n\n/** 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. */\nexport interface MorphoBlueBorrowArgs {\n readonly bind: Record<string, never>;\n readonly config: MorphoBlueBorrowConfig;\n readonly guards?: readonly TypedGuard<'assetsBorrowed' | 'sharesBorrowed'>[];\n}\n\n/** 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. */\nexport interface MorphoBlueRepayArgs {\n readonly bind: {\n readonly assetIn: Bindable<'resource'>;\n readonly onBehalfOf: Bindable<'address'>;\n };\n readonly config: MorphoBlueRepayConfig;\n readonly guards?: readonly TypedGuard<\n 'actualRepaid' | 'sharesRepaid' | 'residual'\n >[];\n}\n\n/** 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. */\nexport interface MorphoBlueSupplyArgs {\n readonly bind: {\n readonly assetIn: Bindable<'resource'>;\n };\n readonly config: MorphoBlueSupplyConfig;\n readonly guards?: readonly TypedGuard<\n 'assetsSupplied' | 'sharesSupplied' | 'residual'\n >[];\n}\n\n/** 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. */\nexport interface MorphoBlueWithdrawArgs {\n readonly bind: Record<string, never>;\n readonly config: MorphoBlueWithdrawConfig;\n readonly guards?: readonly TypedGuard<\n 'assetsWithdrawn' | 'sharesWithdrawn'\n >[];\n}\n\n/** 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). */\nexport interface MorphoBlueGetPositionArgs {\n readonly bind: Record<string, never>;\n readonly config: MorphoBlueGetPositionConfig;\n readonly guards?: readonly TypedGuard<\n 'supplyShares' | 'borrowShares' | 'collateral'\n >[];\n}\n\n/** Transfer principal + fee back to the LiFi flashloan adapter for one leg */\nexport interface LifiFlashloanRepayArgs {\n readonly bind: {\n readonly funds: Bindable<'resource'>;\n readonly feeBuffer?: Bindable<'resource'>;\n };\n readonly config: LifiFlashloanRepayConfig;\n readonly guards?: readonly TypedGuard<never>[];\n}\n\n/** Route tokens into a DeFi protocol position via the edge catalog */\nexport interface LifiZapArgs {\n readonly bind: {\n readonly amountIn: Bindable<'resource'>;\n };\n readonly config: LifiZapConfig;\n readonly guards?: readonly TypedGuard<'amountOut'>[];\n}\n\n/** 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`. */\nexport interface ParaswapBuyArgs {\n readonly bind: {\n readonly amountIn: Bindable<'resource'>;\n };\n readonly config: ParaswapBuyConfig;\n readonly guards?: readonly TypedGuard<'unspentIn'>[];\n}\n\n/** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal */\nexport interface CorePeekArgs {\n readonly bind: Record<string, never>;\n readonly config: CorePeekConfig;\n readonly guards?: readonly TypedGuard<'result'>[];\n}\n\nexport interface CoreSplitOutputs {\n readonly a: OutputHandle<'resource'>;\n readonly b: OutputHandle<'resource'>;\n}\n\nexport interface CoreMergeOutputs {\n readonly merged: OutputHandle<'resource'>;\n}\n\nexport interface LifiSwapOutputs {\n readonly amountOut: OutputHandle<'resource'>;\n readonly unspentIn: OutputHandle<'resource'>;\n}\n\nexport interface CoreAddOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreSubtractOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreMultiplyOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreDivideDownOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreDivideUpOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreBpsDownOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreBpsUpOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreBalanceOfOutputs {\n readonly balance: OutputHandle<'resource'>;\n}\n\nexport interface CoreTransferOutputs {\n readonly transferred: OutputHandle<'resource'>;\n readonly remainder: OutputHandle<'resource'>;\n}\n\nexport interface CoreRawCallOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport interface CoreAsResourceOutputs {\n readonly resource: OutputHandle<'resource'>;\n}\n\nexport interface AaveBorrowOutputs {\n readonly borrowed: OutputHandle<'resource'>;\n readonly debtBalance: OutputHandle<'uint256'>;\n}\n\nexport interface AaveRepayOutputs {\n readonly actualRepaid: OutputHandle<'uint256'>;\n readonly residual: OutputHandle<'resource'>;\n}\n\nexport interface AaveRepayWithATokensOutputs {\n readonly actualRepaid: OutputHandle<'uint256'>;\n readonly residual: OutputHandle<'resource'>;\n}\n\nexport interface AaveClaimRewardsOutputs {\n readonly claimed: OutputHandle<'resource'>;\n readonly claimedAmount: OutputHandle<'uint256'>;\n}\n\nexport interface AaveGetHealthFactorOutputs {\n readonly healthFactor: OutputHandle<'uint256'>;\n}\n\nexport interface MorphoBlueWithdrawCollateralOutputs {\n readonly withdrawn: OutputHandle<'resource'>;\n readonly collateralWithdrawn: OutputHandle<'uint256'>;\n}\n\nexport interface MorphoBlueBorrowOutputs {\n readonly borrowed: OutputHandle<'resource'>;\n readonly assetsBorrowed: OutputHandle<'uint256'>;\n readonly sharesBorrowed: OutputHandle<'uint256'>;\n}\n\nexport interface MorphoBlueRepayOutputs {\n readonly actualRepaid: OutputHandle<'uint256'>;\n readonly sharesRepaid: OutputHandle<'uint256'>;\n readonly residual: OutputHandle<'resource'>;\n}\n\nexport interface MorphoBlueSupplyOutputs {\n readonly assetsSupplied: OutputHandle<'uint256'>;\n readonly sharesSupplied: OutputHandle<'uint256'>;\n readonly residual: OutputHandle<'resource'>;\n}\n\nexport interface MorphoBlueWithdrawOutputs {\n readonly withdrawn: OutputHandle<'resource'>;\n readonly assetsWithdrawn: OutputHandle<'uint256'>;\n readonly sharesWithdrawn: OutputHandle<'uint256'>;\n}\n\nexport interface MorphoBlueGetPositionOutputs {\n readonly supplyShares: OutputHandle<'uint256'>;\n readonly borrowShares: OutputHandle<'uint128'>;\n readonly collateral: OutputHandle<'uint128'>;\n}\n\nexport interface LifiZapOutputs {\n readonly amountOut: OutputHandle<'resource'>;\n}\n\nexport interface ParaswapBuyOutputs {\n readonly amountOut: OutputHandle<'resource'>;\n readonly unspentIn: OutputHandle<'resource'>;\n}\n\nexport interface CorePeekOutputs {\n readonly result: OutputHandle<'uint256'>;\n}\n\nexport type GeneratedOps = {\n readonly core: {\n /** Split a resource into two outputs by basis-point ratio — original id: \"core.split\" */\n readonly split: (nodeId: string, args: CoreSplitArgs) => CoreSplitOutputs;\n /** Merge two same-token resources into one by addition — original id: \"core.merge\" */\n readonly merge: (nodeId: string, args: CoreMergeArgs) => CoreMergeOutputs;\n /** Add two unsigned integers (a + b) — original id: \"core.add\" */\n readonly add: (nodeId: string, args: CoreAddArgs) => CoreAddOutputs;\n /** Subtract b from a (a - b); reverts on underflow — original id: \"core.subtract\" */\n readonly subtract: (\n nodeId: string,\n args: CoreSubtractArgs,\n ) => CoreSubtractOutputs;\n /** Multiply two unsigned integers (a * b) — original id: \"core.multiply\" */\n readonly multiply: (\n nodeId: string,\n args: CoreMultiplyArgs,\n ) => CoreMultiplyOutputs;\n /** Divide a by b, rounding toward zero — original id: \"core.divideDown\" */\n readonly divideDown: (\n nodeId: string,\n args: CoreDivideDownArgs,\n ) => CoreDivideDownOutputs;\n /** Divide a by b, rounding away from zero — original id: \"core.divideUp\" */\n readonly divideUp: (\n nodeId: string,\n args: CoreDivideUpArgs,\n ) => CoreDivideUpOutputs;\n /** Multiply value by basis points and divide by 10000, rounding down — original id: \"core.bpsDown\" */\n readonly bpsDown: (\n nodeId: string,\n args: CoreBpsDownArgs,\n ) => CoreBpsDownOutputs;\n /** Multiply value by basis points and divide by 10000, rounding up — original id: \"core.bpsUp\" */\n readonly bpsUp: (nodeId: string, args: CoreBpsUpArgs) => CoreBpsUpOutputs;\n /** Assert a == b; reverts if not equal — original id: \"core.assertEqual\" */\n readonly assertEqual: (nodeId: string, args: CoreAssertEqualArgs) => void;\n /** Assert a != b; reverts if equal — original id: \"core.assertNotEqual\" */\n readonly assertNotEqual: (\n nodeId: string,\n args: CoreAssertNotEqualArgs,\n ) => void;\n /** Assert a > b; reverts if a <= b — original id: \"core.assertGt\" */\n readonly assertGt: (nodeId: string, args: CoreAssertGtArgs) => void;\n /** Assert a >= b; reverts if a < b — original id: \"core.assertGte\" */\n readonly assertGte: (nodeId: string, args: CoreAssertGteArgs) => void;\n /** Assert a < b; reverts if a >= b — original id: \"core.assertLt\" */\n readonly assertLt: (nodeId: string, args: CoreAssertLtArgs) => void;\n /** Assert a <= b; reverts if a > b — original id: \"core.assertLte\" */\n readonly assertLte: (nodeId: string, args: CoreAssertLteArgs) => void;\n /** Assert min <= value <= max; reverts if value is outside the range — original id: \"core.assertInRange\" */\n readonly assertInRange: (\n nodeId: string,\n args: CoreAssertInRangeArgs,\n ) => void;\n /** Approve an ERC20 spender for the given token and amount — original id: \"core.approve\" */\n readonly approve: (nodeId: string, args: CoreApproveArgs) => void;\n /** Read an ERC20 balance, producing a resource — original id: \"core.balanceOf\" */\n readonly balanceOf: (\n nodeId: string,\n args: CoreBalanceOfArgs,\n ) => CoreBalanceOfOutputs;\n /** Transfer tokens to a recipient address, optionally specifying a partial amount — original id: \"core.transfer\" */\n readonly transfer: (\n nodeId: string,\n args: CoreTransferArgs,\n ) => CoreTransferOutputs;\n /** Invoke a smart contract function, optionally spending a token resource — original id: \"core.call\" */\n readonly call: <TSig extends string>(\n nodeId: string,\n args: CoreCallArgs<TSig>,\n ) => CoreCallResult<TSig>;\n /** Read from a smart contract at runtime (StaticCall); result is fresh at execution time — original id: \"core.staticCall\" */\n readonly staticCall: <TSig extends string>(\n nodeId: string,\n args: CoreStaticCallArgs<TSig>,\n ) => StaticCallResult<TSig>;\n /** Invoke a contract with pre-encoded calldata — original id: \"core.rawCall\" */\n readonly rawCall: (\n nodeId: string,\n args: CoreRawCallArgs,\n ) => CoreRawCallOutputs;\n /** Graduate a raw handle to a resource, enabling slippage surfacing and linearity tracking — original id: \"core.asResource\" */\n readonly asResource: (\n nodeId: string,\n args: CoreAsResourceArgs,\n ) => CoreAsResourceOutputs;\n /** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal — original id: \"core.peek\" */\n readonly peek: (nodeId: string, args: CorePeekArgs) => CorePeekOutputs;\n };\n readonly lifi: {\n /** Swap tokens via the LI.FI aggregator API — original id: \"lifi.swap\" */\n readonly swap: (nodeId: string, args: LifiSwapArgs) => LifiSwapOutputs;\n /** Transfer principal + fee back to the LiFi flashloan adapter for one leg — original id: \"lifi.flashloanRepay\" */\n readonly flashloanRepay: (\n nodeId: string,\n args: LifiFlashloanRepayArgs,\n ) => void;\n /** Route tokens into a DeFi protocol position via the edge catalog — original id: \"lifi.zap\" */\n readonly zap: (nodeId: string, args: LifiZapArgs) => LifiZapOutputs;\n };\n readonly invariant: {\n /** Assert that an account holds at least a minimum token balance — original id: \"invariant.balanceAtLeast\" */\n readonly balanceAtLeast: (\n nodeId: string,\n args: InvariantBalanceAtLeastArgs,\n ) => void;\n };\n readonly aave: {\n /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource — original id: \"aave.borrow\" */\n readonly borrow: (\n nodeId: string,\n args: AaveBorrowArgs,\n ) => AaveBorrowOutputs;\n /** 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\" */\n readonly repay: (nodeId: string, args: AaveRepayArgs) => AaveRepayOutputs;\n /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual — original id: \"aave.repayWithATokens\" */\n readonly repayWithATokens: (\n nodeId: string,\n args: AaveRepayWithATokensArgs,\n ) => AaveRepayWithATokensOutputs;\n /** 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\" */\n readonly claimRewards: (\n nodeId: string,\n args: AaveClaimRewardsArgs,\n ) => AaveClaimRewardsOutputs;\n /** 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\" */\n readonly setEMode: (nodeId: string, args: AaveSetEModeArgs) => void;\n /** 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\" */\n readonly getHealthFactor: (\n nodeId: string,\n args: AaveGetHealthFactorArgs,\n ) => AaveGetHealthFactorOutputs;\n };\n readonly morphoBlue: {\n /** 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\" */\n readonly supplyCollateral: (\n nodeId: string,\n args: MorphoBlueSupplyCollateralArgs,\n ) => void;\n /** 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\" */\n readonly withdrawCollateral: (\n nodeId: string,\n args: MorphoBlueWithdrawCollateralArgs,\n ) => MorphoBlueWithdrawCollateralOutputs;\n /** 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\" */\n readonly borrow: (\n nodeId: string,\n args: MorphoBlueBorrowArgs,\n ) => MorphoBlueBorrowOutputs;\n /** 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\" */\n readonly repay: (\n nodeId: string,\n args: MorphoBlueRepayArgs,\n ) => MorphoBlueRepayOutputs;\n /** 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\" */\n readonly supply: (\n nodeId: string,\n args: MorphoBlueSupplyArgs,\n ) => MorphoBlueSupplyOutputs;\n /** 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\" */\n readonly withdraw: (\n nodeId: string,\n args: MorphoBlueWithdrawArgs,\n ) => MorphoBlueWithdrawOutputs;\n /** 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\" */\n readonly getPosition: (\n nodeId: string,\n args: MorphoBlueGetPositionArgs,\n ) => MorphoBlueGetPositionOutputs;\n };\n readonly paraswap: {\n /** 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\" */\n readonly buy: (nodeId: string, args: ParaswapBuyArgs) => ParaswapBuyOutputs;\n };\n};\n\nexport const bindGeneratedOps = (\n builder: FlowBuilderInternal,\n): GeneratedOps => ({\n core: {\n split: (nodeId: string, args: CoreSplitArgs) =>\n builder.call(nodeId, 'core.split', args, {\n a: 'resource',\n b: 'resource',\n } as const),\n merge: (nodeId: string, args: CoreMergeArgs) =>\n builder.call(nodeId, 'core.merge', { ...args, config: {} }, {\n merged: 'resource',\n } as const),\n add: (nodeId: string, args: CoreAddArgs) =>\n builder.call(nodeId, 'core.add', { ...args, config: {} }, {\n result: 'uint256',\n } as const),\n subtract: (nodeId: string, args: CoreSubtractArgs) =>\n builder.call(nodeId, 'core.subtract', { ...args, config: {} }, {\n result: 'uint256',\n } as const),\n multiply: (nodeId: string, args: CoreMultiplyArgs) =>\n builder.call(nodeId, 'core.multiply', { ...args, config: {} }, {\n result: 'uint256',\n } as const),\n divideDown: (nodeId: string, args: CoreDivideDownArgs) =>\n builder.call(nodeId, 'core.divideDown', { ...args, config: {} }, {\n result: 'uint256',\n } as const),\n divideUp: (nodeId: string, args: CoreDivideUpArgs) =>\n builder.call(nodeId, 'core.divideUp', { ...args, config: {} }, {\n result: 'uint256',\n } as const),\n bpsDown: (nodeId: string, args: CoreBpsDownArgs) =>\n builder.call(nodeId, 'core.bpsDown', args, {\n result: 'uint256',\n } as const),\n bpsUp: (nodeId: string, args: CoreBpsUpArgs) =>\n builder.call(nodeId, 'core.bpsUp', args, { result: 'uint256' } as const),\n assertEqual: (nodeId: string, args: CoreAssertEqualArgs) =>\n builder.call(nodeId, 'core.assertEqual', { ...args, config: {} }, {}),\n assertNotEqual: (nodeId: string, args: CoreAssertNotEqualArgs) =>\n builder.call(nodeId, 'core.assertNotEqual', { ...args, config: {} }, {}),\n assertGt: (nodeId: string, args: CoreAssertGtArgs) =>\n builder.call(nodeId, 'core.assertGt', { ...args, config: {} }, {}),\n assertGte: (nodeId: string, args: CoreAssertGteArgs) =>\n builder.call(nodeId, 'core.assertGte', { ...args, config: {} }, {}),\n assertLt: (nodeId: string, args: CoreAssertLtArgs) =>\n builder.call(nodeId, 'core.assertLt', { ...args, config: {} }, {}),\n assertLte: (nodeId: string, args: CoreAssertLteArgs) =>\n builder.call(nodeId, 'core.assertLte', { ...args, config: {} }, {}),\n assertInRange: (nodeId: string, args: CoreAssertInRangeArgs) =>\n builder.call(nodeId, 'core.assertInRange', { ...args, config: {} }, {}),\n approve: (nodeId: string, args: CoreApproveArgs) =>\n builder.call(nodeId, 'core.approve', args, {}),\n balanceOf: (nodeId: string, args: CoreBalanceOfArgs) =>\n builder.call(nodeId, 'core.balanceOf', args, {\n balance: 'resource',\n } as const),\n transfer: (nodeId: string, args: CoreTransferArgs) =>\n builder.call(nodeId, 'core.transfer', args, {\n transferred: 'resource',\n remainder: 'resource',\n } as const),\n call: <TSig extends string>(nodeId: string, args: CoreCallArgs<TSig>) => {\n const wire = buildCallWireFormat({\n resource: args.resource,\n bind: args.bind as Record<string, AnyBindable>,\n config: args.config as Record<string, unknown>,\n guards: args.guards,\n });\n return builder.call(nodeId, wire.op, wire, {\n result: 'uint256',\n } as const) as unknown as CoreCallResult<TSig>;\n },\n staticCall: <TSig extends string>(\n nodeId: string,\n args: CoreStaticCallArgs<TSig>,\n ) =>\n builder.call(\n nodeId,\n 'core.staticCall',\n buildStaticCallWireFormat({\n bind: args.bind as Record<string, AnyBindable>,\n config: args.config as Record<string, unknown>,\n guards: args.guards,\n }),\n { result: 'uint256' } as const,\n ) as unknown as StaticCallResult<TSig>,\n rawCall: (nodeId: string, args: CoreRawCallArgs) =>\n builder.call(nodeId, 'core.rawCall', args, {\n result: 'uint256',\n } as const),\n asResource: (nodeId: string, args: CoreAsResourceArgs) =>\n builder.call(nodeId, 'core.asResource', args, {\n resource: 'resource',\n } as const),\n peek: (nodeId: string, args: CorePeekArgs) =>\n builder.call(nodeId, 'core.peek', args, { result: 'uint256' } as const),\n },\n lifi: {\n swap: (nodeId: string, args: LifiSwapArgs) =>\n builder.call(nodeId, 'lifi.swap', args, {\n amountOut: 'resource',\n unspentIn: 'resource',\n } as const),\n flashloanRepay: (nodeId: string, args: LifiFlashloanRepayArgs) =>\n builder.call(nodeId, 'lifi.flashloanRepay', args, {}),\n zap: (nodeId: string, args: LifiZapArgs) =>\n builder.call(nodeId, 'lifi.zap', args, {\n amountOut: 'resource',\n } as const),\n },\n invariant: {\n balanceAtLeast: (nodeId: string, args: InvariantBalanceAtLeastArgs) =>\n builder.call(\n nodeId,\n 'invariant.balanceAtLeast',\n { ...args, config: {} },\n {},\n ),\n },\n aave: {\n borrow: (nodeId: string, args: AaveBorrowArgs) =>\n builder.call(nodeId, 'aave.borrow', args, {\n borrowed: 'resource',\n debtBalance: 'uint256',\n } as const),\n repay: (nodeId: string, args: AaveRepayArgs) =>\n builder.call(nodeId, 'aave.repay', args, {\n actualRepaid: 'uint256',\n residual: 'resource',\n } as const),\n repayWithATokens: (nodeId: string, args: AaveRepayWithATokensArgs) =>\n builder.call(nodeId, 'aave.repayWithATokens', args, {\n actualRepaid: 'uint256',\n residual: 'resource',\n } as const),\n claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) =>\n builder.call(nodeId, 'aave.claimRewards', args, {\n claimed: 'resource',\n claimedAmount: 'uint256',\n } as const),\n setEMode: (nodeId: string, args: AaveSetEModeArgs) =>\n builder.call(nodeId, 'aave.setEMode', args, {}),\n getHealthFactor: (nodeId: string, args: AaveGetHealthFactorArgs) =>\n builder.call(nodeId, 'aave.getHealthFactor', args, {\n healthFactor: 'uint256',\n } as const),\n },\n morphoBlue: {\n supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) =>\n builder.call(nodeId, 'morphoBlue.supplyCollateral', args, {}),\n withdrawCollateral: (\n nodeId: string,\n args: MorphoBlueWithdrawCollateralArgs,\n ) =>\n builder.call(nodeId, 'morphoBlue.withdrawCollateral', args, {\n withdrawn: 'resource',\n collateralWithdrawn: 'uint256',\n } as const),\n borrow: (nodeId: string, args: MorphoBlueBorrowArgs) =>\n builder.call(nodeId, 'morphoBlue.borrow', args, {\n borrowed: 'resource',\n assetsBorrowed: 'uint256',\n sharesBorrowed: 'uint256',\n } as const),\n repay: (nodeId: string, args: MorphoBlueRepayArgs) =>\n builder.call(nodeId, 'morphoBlue.repay', args, {\n actualRepaid: 'uint256',\n sharesRepaid: 'uint256',\n residual: 'resource',\n } as const),\n supply: (nodeId: string, args: MorphoBlueSupplyArgs) =>\n builder.call(nodeId, 'morphoBlue.supply', args, {\n assetsSupplied: 'uint256',\n sharesSupplied: 'uint256',\n residual: 'resource',\n } as const),\n withdraw: (nodeId: string, args: MorphoBlueWithdrawArgs) =>\n builder.call(nodeId, 'morphoBlue.withdraw', args, {\n withdrawn: 'resource',\n assetsWithdrawn: 'uint256',\n sharesWithdrawn: 'uint256',\n } as const),\n getPosition: (nodeId: string, args: MorphoBlueGetPositionArgs) =>\n builder.call(nodeId, 'morphoBlue.getPosition', args, {\n supplyShares: 'uint256',\n borrowShares: 'uint128',\n collateral: 'uint128',\n } as const),\n },\n paraswap: {\n buy: (nodeId: string, args: ParaswapBuyArgs) =>\n builder.call(nodeId, 'paraswap.buy', args, {\n amountOut: 'resource',\n unspentIn: 'resource',\n } as const),\n },\n});\n"],"mappings":"AAaA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAwsBA,MAAM,mBAAmB,CAC9B,aACkB;AAAA,EAClB,MAAM;AAAA,IACJ,OAAO,CAAC,QA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AAU;AAAA,IACZ,QAAQ,CAAC,QAAgB,SACvB,QAAQ,KAAK,QAAQ,qBAAqB,MAAM;AAAA,MAC9C,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACZ,CAAU;AAAA,IACZ,UAAU,CAAC,QAAgB,SACzB,QAAQ,KAAK,QAAQ,uBAAuB,MAAM;AAAA,MAChD,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,IACnB,CAAU;AAAA,IACZ,aAAa,CAAC,QAAgB,SAC5B,QAAQ,KAAK,QAAQ,0BAA0B,MAAM;AAAA,MACnD,cAAc;AAAA,MACd,cAAc;AAAA,MACd,YAAY;AAAA,IACd,CAAU;AAAA,EACd;AAAA,EACA,UAAU;AAAA,IACR,KAAK,CAAC,QAAgB,SACpB,QAAQ,KAAK,QAAQ,gBAAgB,MAAM;AAAA,MACzC,WAAW;AAAA,MACX,WAAW;AAAA,IACb,CAAU;AAAA,EACd;AACF;","names":[]}
@@ -0,0 +1,19 @@
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 };
@@ -0,0 +1,19 @@
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 };