@lifi/composer-sdk 0.0.1-alpha → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +37 -1
  2. package/dist/authoring/handles.cjs.map +1 -1
  3. package/dist/authoring/handles.d.cts +13 -6
  4. package/dist/authoring/handles.d.ts +13 -6
  5. package/dist/authoring/handles.js.map +1 -1
  6. package/dist/authoring/signatureArgs.cjs +2 -2
  7. package/dist/authoring/signatureArgs.cjs.map +1 -1
  8. package/dist/authoring/signatureArgs.js +2 -2
  9. package/dist/authoring/signatureArgs.js.map +1 -1
  10. package/dist/client.cjs +2 -2
  11. package/dist/client.cjs.map +1 -1
  12. package/dist/client.js +2 -2
  13. package/dist/client.js.map +1 -1
  14. package/dist/generated/config.generated.cjs.map +1 -1
  15. package/dist/generated/config.generated.d.cts +327 -16
  16. package/dist/generated/config.generated.d.ts +327 -16
  17. package/dist/generated/guards.generated.cjs +6 -0
  18. package/dist/generated/guards.generated.cjs.map +1 -1
  19. package/dist/generated/guards.generated.d.cts +1 -1
  20. package/dist/generated/guards.generated.d.ts +1 -1
  21. package/dist/generated/guards.generated.js +5 -0
  22. package/dist/generated/guards.generated.js.map +1 -1
  23. package/dist/generated/materialisers.generated.cjs.map +1 -1
  24. package/dist/generated/materialisers.generated.d.cts +1 -1
  25. package/dist/generated/materialisers.generated.d.ts +1 -1
  26. package/dist/generated/materialisers.generated.js.map +1 -1
  27. package/dist/generated/operations.generated.cjs +103 -14
  28. package/dist/generated/operations.generated.cjs.map +1 -1
  29. package/dist/generated/operations.generated.d.cts +255 -10
  30. package/dist/generated/operations.generated.d.ts +255 -10
  31. package/dist/generated/operations.generated.js +103 -14
  32. package/dist/generated/operations.generated.js.map +1 -1
  33. package/dist/guards.generated-BPLFwe7y.d.ts +19 -0
  34. package/dist/guards.generated-M3VAIevI.d.cts +19 -0
  35. package/dist/index.d.cts +3 -3
  36. package/dist/index.d.ts +3 -3
  37. package/dist/materialisers.generated-BMkBQgWZ.d.ts +24 -0
  38. package/dist/materialisers.generated-BWq5oePO.d.cts +24 -0
  39. package/dist/run/inputs.cjs +8 -5
  40. package/dist/run/inputs.cjs.map +1 -1
  41. package/dist/run/inputs.d.cts +8 -0
  42. package/dist/run/inputs.d.ts +8 -0
  43. package/dist/run/inputs.js +8 -5
  44. package/dist/run/inputs.js.map +1 -1
  45. package/dist/sdk.cjs +1 -0
  46. package/dist/sdk.cjs.map +1 -1
  47. package/dist/sdk.js +1 -0
  48. package/dist/sdk.js.map +1 -1
  49. package/package.json +16 -7
  50. package/src/authoring/handles.ts +19 -10
  51. package/src/authoring/signatureArgs.ts +2 -2
  52. package/src/client.ts +1 -1
  53. package/src/examples/aaveClaimRewards.ts +80 -0
  54. package/src/examples/aaveRepay.ts +69 -0
  55. package/src/examples/aaveRepayWithATokens.ts +81 -0
  56. package/src/examples/aaveSetEMode.ts +68 -0
  57. package/src/examples/emitCustomEvent.ts +75 -0
  58. package/src/examples/invariantChecks.ts +95 -0
  59. package/src/examples/run.ts +41 -4
  60. package/src/examples/swapToRecipient.ts +0 -19
  61. package/src/examples/swapWithFee.ts +59 -0
  62. package/src/generated/config.generated.ts +388 -16
  63. package/src/generated/guards.generated.ts +12 -1
  64. package/src/generated/materialisers.generated.ts +12 -12
  65. package/src/generated/operations.generated.ts +438 -9
  66. package/src/run/inputs.ts +16 -5
  67. package/src/sdk.ts +1 -0
  68. package/dist/guards.generated-DKKDKREA.d.ts +0 -14
  69. package/dist/guards.generated-hrQ1KPNv.d.cts +0 -14
  70. package/dist/materialisers.generated-BsA1uDW8.d.ts +0 -24
  71. 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, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiZapConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, ParaswapBuyConfig } from './config.generated.js';
6
6
  import '@lifi/compose-spec';
7
7
  import 'abitype';
8
8
 
@@ -38,13 +38,83 @@ 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 {
41
+ /** Assert that an account holds exactly an expected token balance */
42
+ interface InvariantBalanceEqualsArgs {
43
43
  readonly bind: {
44
- readonly amountIn: Bindable<'resource'>;
44
+ readonly expectedAmount: Bindable<'resource'>;
45
+ readonly account: Bindable<'address'>;
45
46
  };
46
- readonly config: LifiZapConfig;
47
- readonly guards?: readonly TypedGuard<'amountOut'>[];
47
+ readonly guards?: readonly TypedGuard<never>[];
48
+ }
49
+ /** Assert that an account holds at most a maximum token balance */
50
+ interface InvariantBalanceAtMostArgs {
51
+ readonly bind: {
52
+ readonly maximumAmount: Bindable<'resource'>;
53
+ readonly account: Bindable<'address'>;
54
+ };
55
+ readonly guards?: readonly TypedGuard<never>[];
56
+ }
57
+ /** Assert that an account's token balance is between a minimum and a maximum (inclusive) */
58
+ interface InvariantBalanceInRangeArgs {
59
+ readonly bind: {
60
+ readonly minimumAmount: Bindable<'resource'>;
61
+ readonly maximumAmount: Bindable<'uint256'>;
62
+ readonly account: Bindable<'address'>;
63
+ };
64
+ readonly guards?: readonly TypedGuard<never>[];
65
+ }
66
+ /** Assert that a spender is permitted to move at least a minimum allowance on behalf of an owner */
67
+ interface InvariantAllowanceAtLeastArgs {
68
+ readonly bind: {
69
+ readonly minimumAmount: Bindable<'resource'>;
70
+ readonly owner: Bindable<'address'>;
71
+ readonly spender: Bindable<'address'>;
72
+ };
73
+ readonly guards?: readonly TypedGuard<never>[];
74
+ }
75
+ /** Assert that a spender's allowance on behalf of an owner exactly equals an expected amount */
76
+ interface InvariantAllowanceEqualsArgs {
77
+ readonly bind: {
78
+ readonly expectedAmount: Bindable<'resource'>;
79
+ readonly owner: Bindable<'address'>;
80
+ readonly spender: Bindable<'address'>;
81
+ };
82
+ readonly guards?: readonly TypedGuard<never>[];
83
+ }
84
+ /** Assert that a spender is permitted to move at most a maximum allowance on behalf of an owner */
85
+ interface InvariantAllowanceAtMostArgs {
86
+ readonly bind: {
87
+ readonly maximumAmount: Bindable<'resource'>;
88
+ readonly owner: Bindable<'address'>;
89
+ readonly spender: Bindable<'address'>;
90
+ };
91
+ readonly guards?: readonly TypedGuard<never>[];
92
+ }
93
+ /** Assert that a spender's allowance on behalf of an owner is between a minimum and a maximum (inclusive) */
94
+ interface InvariantAllowanceInRangeArgs {
95
+ readonly bind: {
96
+ readonly minimumAmount: Bindable<'resource'>;
97
+ readonly maximumAmount: Bindable<'uint256'>;
98
+ readonly owner: Bindable<'address'>;
99
+ readonly spender: Bindable<'address'>;
100
+ };
101
+ readonly guards?: readonly TypedGuard<never>[];
102
+ }
103
+ /** Assert a uint256 value satisfies a comparison against a constant threshold; reverts on violation */
104
+ interface InvariantNumericArgs {
105
+ readonly bind: {
106
+ readonly value: Bindable<'uint256'>;
107
+ };
108
+ readonly config: InvariantNumericConfig;
109
+ readonly guards?: readonly TypedGuard<never>[];
110
+ }
111
+ /** Assert min <= value <= max against constant bounds; reverts if outside the range */
112
+ interface InvariantNumericInRangeArgs {
113
+ readonly bind: {
114
+ readonly value: Bindable<'uint256'>;
115
+ };
116
+ readonly config: InvariantNumericInRangeConfig;
117
+ readonly guards?: readonly TypedGuard<never>[];
48
118
  }
49
119
  /** Add two unsigned integers (a + b) */
50
120
  interface CoreAddArgs {
@@ -182,6 +252,44 @@ interface CoreTransferArgs {
182
252
  readonly config: CoreTransferConfig;
183
253
  readonly guards?: readonly TypedGuard<'transferred' | 'remainder'>[];
184
254
  }
255
+ /** Emit a custom on-chain event carrying 1 32-byte payload value. The value becomes a non-indexed data word in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */
256
+ interface CoreEmitEvent1Args {
257
+ readonly bind: {
258
+ readonly value0: Bindable<'bytes32'>;
259
+ };
260
+ readonly config: CoreEmitEvent1Config;
261
+ readonly guards?: readonly TypedGuard<never>[];
262
+ }
263
+ /** Emit a custom on-chain event carrying 2 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */
264
+ interface CoreEmitEvent2Args {
265
+ readonly bind: {
266
+ readonly value0: Bindable<'bytes32'>;
267
+ readonly value1: Bindable<'bytes32'>;
268
+ };
269
+ readonly config: CoreEmitEvent2Config;
270
+ readonly guards?: readonly TypedGuard<never>[];
271
+ }
272
+ /** Emit a custom on-chain event carrying 3 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */
273
+ interface CoreEmitEvent3Args {
274
+ readonly bind: {
275
+ readonly value0: Bindable<'bytes32'>;
276
+ readonly value1: Bindable<'bytes32'>;
277
+ readonly value2: Bindable<'bytes32'>;
278
+ };
279
+ readonly config: CoreEmitEvent3Config;
280
+ readonly guards?: readonly TypedGuard<never>[];
281
+ }
282
+ /** Emit a custom on-chain event carrying 4 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). */
283
+ interface CoreEmitEvent4Args {
284
+ readonly bind: {
285
+ readonly value0: Bindable<'bytes32'>;
286
+ readonly value1: Bindable<'bytes32'>;
287
+ readonly value2: Bindable<'bytes32'>;
288
+ readonly value3: Bindable<'bytes32'>;
289
+ };
290
+ readonly config: CoreEmitEvent4Config;
291
+ readonly guards?: readonly TypedGuard<never>[];
292
+ }
185
293
  /** Invoke a smart contract function, optionally spending a token resource */
186
294
  interface CoreCallArgs<TSig extends string = string> {
187
295
  readonly resource?: Bindable<'resource'>;
@@ -213,6 +321,71 @@ interface CoreAsResourceArgs {
213
321
  readonly config: CoreAsResourceConfig;
214
322
  readonly guards?: readonly TypedGuard<'resource'>[];
215
323
  }
324
+ /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource */
325
+ interface AaveBorrowArgs {
326
+ readonly bind: Record<string, never>;
327
+ readonly config: AaveBorrowConfig;
328
+ readonly guards?: readonly TypedGuard<'debtBalance'>[];
329
+ }
330
+ /** 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. */
331
+ interface AaveRepayArgs {
332
+ readonly bind: {
333
+ readonly assetIn: Bindable<'resource'>;
334
+ readonly onBehalfOf: Bindable<'address'>;
335
+ };
336
+ readonly config: AaveRepayConfig;
337
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[];
338
+ }
339
+ /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual */
340
+ interface AaveRepayWithATokensArgs {
341
+ readonly bind: {
342
+ readonly aTokenIn: Bindable<'resource'>;
343
+ };
344
+ readonly config: AaveRepayWithATokensConfig;
345
+ readonly guards?: readonly TypedGuard<'actualRepaid' | 'residual'>[];
346
+ }
347
+ /** Claim a specific Aave v3 incentives reward token against a set of receipt-token positions, exposing the claimed amount as a Resource */
348
+ interface AaveClaimRewardsArgs {
349
+ readonly bind: Record<string, never>;
350
+ readonly config: AaveClaimRewardsConfig;
351
+ readonly guards?: readonly TypedGuard<'claimedAmount'>[];
352
+ }
353
+ /** 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. */
354
+ interface AaveSetEModeArgs {
355
+ readonly bind: Record<string, never>;
356
+ readonly config: AaveSetEModeConfig;
357
+ readonly guards?: readonly TypedGuard<never>[];
358
+ }
359
+ /** 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). */
360
+ interface MorphoBlueSupplyCollateralArgs {
361
+ readonly bind: {
362
+ readonly assetIn: Bindable<'resource'>;
363
+ };
364
+ readonly config: MorphoBlueSupplyCollateralConfig;
365
+ readonly guards?: readonly TypedGuard<never>[];
366
+ }
367
+ /** Withdraw collateral from a Morpho Blue market position to the receiver address. Exposes the withdrawn ERC20 amount as a Resource output. */
368
+ interface MorphoBlueWithdrawCollateralArgs {
369
+ readonly bind: Record<string, never>;
370
+ readonly config: MorphoBlueWithdrawCollateralConfig;
371
+ readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[];
372
+ }
373
+ /** Route tokens into a DeFi protocol position via the edge catalog */
374
+ interface LifiZapArgs {
375
+ readonly bind: {
376
+ readonly amountIn: Bindable<'resource'>;
377
+ };
378
+ readonly config: LifiZapConfig;
379
+ readonly guards?: readonly TypedGuard<'amountOut'>[];
380
+ }
381
+ /** 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`. */
382
+ interface ParaswapBuyArgs {
383
+ readonly bind: {
384
+ readonly amountIn: Bindable<'resource'>;
385
+ };
386
+ readonly config: ParaswapBuyConfig;
387
+ readonly guards?: readonly TypedGuard<'unspentIn'>[];
388
+ }
216
389
  /** Read a smart contract value at compile time (off-chain eth_call); result is baked as a literal */
217
390
  interface CorePeekArgs {
218
391
  readonly bind: Record<string, never>;
@@ -230,9 +403,6 @@ interface LifiSwapOutputs {
230
403
  readonly amountOut: OutputHandle<'resource'>;
231
404
  readonly unspentIn: OutputHandle<'resource'>;
232
405
  }
233
- interface LifiZapOutputs {
234
- readonly amountOut: OutputHandle<'resource'>;
235
- }
236
406
  interface CoreAddOutputs {
237
407
  readonly result: OutputHandle<'uint256'>;
238
408
  }
@@ -267,6 +437,33 @@ interface CoreRawCallOutputs {
267
437
  interface CoreAsResourceOutputs {
268
438
  readonly resource: OutputHandle<'resource'>;
269
439
  }
440
+ interface AaveBorrowOutputs {
441
+ readonly borrowed: OutputHandle<'resource'>;
442
+ readonly debtBalance: OutputHandle<'uint256'>;
443
+ }
444
+ interface AaveRepayOutputs {
445
+ readonly actualRepaid: OutputHandle<'uint256'>;
446
+ readonly residual: OutputHandle<'resource'>;
447
+ }
448
+ interface AaveRepayWithATokensOutputs {
449
+ readonly actualRepaid: OutputHandle<'uint256'>;
450
+ readonly residual: OutputHandle<'resource'>;
451
+ }
452
+ interface AaveClaimRewardsOutputs {
453
+ readonly claimed: OutputHandle<'resource'>;
454
+ readonly claimedAmount: OutputHandle<'uint256'>;
455
+ }
456
+ interface MorphoBlueWithdrawCollateralOutputs {
457
+ readonly withdrawn: OutputHandle<'resource'>;
458
+ readonly collateralWithdrawn: OutputHandle<'uint256'>;
459
+ }
460
+ interface LifiZapOutputs {
461
+ readonly amountOut: OutputHandle<'resource'>;
462
+ }
463
+ interface ParaswapBuyOutputs {
464
+ readonly amountOut: OutputHandle<'resource'>;
465
+ readonly unspentIn: OutputHandle<'resource'>;
466
+ }
270
467
  interface CorePeekOutputs {
271
468
  readonly result: OutputHandle<'uint256'>;
272
469
  }
@@ -310,6 +507,14 @@ type GeneratedOps = {
310
507
  readonly balanceOf: (nodeId: string, args: CoreBalanceOfArgs) => CoreBalanceOfOutputs;
311
508
  /** Transfer tokens to a recipient address, optionally specifying a partial amount — original id: "core.transfer" */
312
509
  readonly transfer: (nodeId: string, args: CoreTransferArgs) => CoreTransferOutputs;
510
+ /** Emit a custom on-chain event carrying 1 32-byte payload value. The value becomes a non-indexed data word in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent1" */
511
+ readonly emitEvent1: (nodeId: string, args: CoreEmitEvent1Args) => void;
512
+ /** Emit a custom on-chain event carrying 2 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent2" */
513
+ readonly emitEvent2: (nodeId: string, args: CoreEmitEvent2Args) => void;
514
+ /** Emit a custom on-chain event carrying 3 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent3" */
515
+ readonly emitEvent3: (nodeId: string, args: CoreEmitEvent3Args) => void;
516
+ /** Emit a custom on-chain event carrying 4 32-byte payload values. The values become non-indexed data words in a fixed VM log event; the signature is hashed into a discriminator word (it is NOT an indexed EVM topic). — original id: "core.emitEvent4" */
517
+ readonly emitEvent4: (nodeId: string, args: CoreEmitEvent4Args) => void;
313
518
  /** Invoke a smart contract function, optionally spending a token resource — original id: "core.call" */
314
519
  readonly call: <TSig extends string>(nodeId: string, args: CoreCallArgs<TSig>) => CoreCallResult<TSig>;
315
520
  /** Read from a smart contract at runtime (StaticCall); result is fresh at execution time — original id: "core.staticCall" */
@@ -330,8 +535,48 @@ type GeneratedOps = {
330
535
  readonly invariant: {
331
536
  /** Assert that an account holds at least a minimum token balance — original id: "invariant.balanceAtLeast" */
332
537
  readonly balanceAtLeast: (nodeId: string, args: InvariantBalanceAtLeastArgs) => void;
538
+ /** Assert that an account holds exactly an expected token balance — original id: "invariant.balanceEquals" */
539
+ readonly balanceEquals: (nodeId: string, args: InvariantBalanceEqualsArgs) => void;
540
+ /** Assert that an account holds at most a maximum token balance — original id: "invariant.balanceAtMost" */
541
+ readonly balanceAtMost: (nodeId: string, args: InvariantBalanceAtMostArgs) => void;
542
+ /** Assert that an account's token balance is between a minimum and a maximum (inclusive) — original id: "invariant.balanceInRange" */
543
+ readonly balanceInRange: (nodeId: string, args: InvariantBalanceInRangeArgs) => void;
544
+ /** Assert that a spender is permitted to move at least a minimum allowance on behalf of an owner — original id: "invariant.allowanceAtLeast" */
545
+ readonly allowanceAtLeast: (nodeId: string, args: InvariantAllowanceAtLeastArgs) => void;
546
+ /** Assert that a spender's allowance on behalf of an owner exactly equals an expected amount — original id: "invariant.allowanceEquals" */
547
+ readonly allowanceEquals: (nodeId: string, args: InvariantAllowanceEqualsArgs) => void;
548
+ /** Assert that a spender is permitted to move at most a maximum allowance on behalf of an owner — original id: "invariant.allowanceAtMost" */
549
+ readonly allowanceAtMost: (nodeId: string, args: InvariantAllowanceAtMostArgs) => void;
550
+ /** Assert that a spender's allowance on behalf of an owner is between a minimum and a maximum (inclusive) — original id: "invariant.allowanceInRange" */
551
+ readonly allowanceInRange: (nodeId: string, args: InvariantAllowanceInRangeArgs) => void;
552
+ /** Assert a uint256 value satisfies a comparison against a constant threshold; reverts on violation — original id: "invariant.numeric" */
553
+ readonly numeric: (nodeId: string, args: InvariantNumericArgs) => void;
554
+ /** Assert min <= value <= max against constant bounds; reverts if outside the range — original id: "invariant.numericInRange" */
555
+ readonly numericInRange: (nodeId: string, args: InvariantNumericInRangeArgs) => void;
556
+ };
557
+ readonly aave: {
558
+ /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource — original id: "aave.borrow" */
559
+ readonly borrow: (nodeId: string, args: AaveBorrowArgs) => AaveBorrowOutputs;
560
+ /** 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" */
561
+ readonly repay: (nodeId: string, args: AaveRepayArgs) => AaveRepayOutputs;
562
+ /** Repay an Aave v3 variable-rate debt by burning the caller's aToken balance, returning any unspent residual — original id: "aave.repayWithATokens" */
563
+ readonly repayWithATokens: (nodeId: string, args: AaveRepayWithATokensArgs) => AaveRepayWithATokensOutputs;
564
+ /** 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" */
565
+ readonly claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) => AaveClaimRewardsOutputs;
566
+ /** 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" */
567
+ readonly setEMode: (nodeId: string, args: AaveSetEModeArgs) => void;
568
+ };
569
+ readonly morphoBlue: {
570
+ /** 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" */
571
+ readonly supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) => void;
572
+ /** 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" */
573
+ readonly withdrawCollateral: (nodeId: string, args: MorphoBlueWithdrawCollateralArgs) => MorphoBlueWithdrawCollateralOutputs;
574
+ };
575
+ readonly paraswap: {
576
+ /** 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" */
577
+ readonly buy: (nodeId: string, args: ParaswapBuyArgs) => ParaswapBuyOutputs;
333
578
  };
334
579
  };
335
580
  declare const bindGeneratedOps: (builder: FlowBuilderInternal) => GeneratedOps;
336
581
 
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 };
582
+ export { type AaveBorrowArgs, type AaveBorrowOutputs, type AaveClaimRewardsArgs, type AaveClaimRewardsOutputs, type AaveRepayArgs, type AaveRepayOutputs, type AaveRepayWithATokensArgs, type AaveRepayWithATokensOutputs, type AaveSetEModeArgs, type CoreAddArgs, type CoreAddOutputs, type CoreApproveArgs, type CoreAsResourceArgs, type CoreAsResourceOutputs, type CoreAssertEqualArgs, type CoreAssertGtArgs, type CoreAssertGteArgs, type CoreAssertInRangeArgs, type CoreAssertLtArgs, type CoreAssertLteArgs, type CoreAssertNotEqualArgs, type CoreBalanceOfArgs, type CoreBalanceOfOutputs, type CoreBpsDownArgs, type CoreBpsDownOutputs, type CoreBpsUpArgs, type CoreBpsUpOutputs, type CoreCallArgs, type CoreDivideDownArgs, type CoreDivideDownOutputs, type CoreDivideUpArgs, type CoreDivideUpOutputs, type CoreEmitEvent1Args, type CoreEmitEvent2Args, type CoreEmitEvent3Args, type CoreEmitEvent4Args, type CoreMergeArgs, type CoreMergeOutputs, type CoreMultiplyArgs, type CoreMultiplyOutputs, type CorePeekArgs, type CorePeekOutputs, type CoreRawCallArgs, type CoreRawCallOutputs, type CoreSplitArgs, type CoreSplitOutputs, type CoreStaticCallArgs, type CoreSubtractArgs, type CoreSubtractOutputs, type CoreTransferArgs, type CoreTransferOutputs, type GeneratedOps, type InvariantAllowanceAtLeastArgs, type InvariantAllowanceAtMostArgs, type InvariantAllowanceEqualsArgs, type InvariantAllowanceInRangeArgs, type InvariantBalanceAtLeastArgs, type InvariantBalanceAtMostArgs, type InvariantBalanceEqualsArgs, type InvariantBalanceInRangeArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapOutputs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, bindGeneratedOps };
@@ -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"
@@ -41,6 +45,10 @@ const bindGeneratedOps = (builder) => ({
41
45
  transferred: "resource",
42
46
  remainder: "resource"
43
47
  }),
48
+ emitEvent1: (nodeId, args) => builder.call(nodeId, "core.emitEvent1", args, {}),
49
+ emitEvent2: (nodeId, args) => builder.call(nodeId, "core.emitEvent2", args, {}),
50
+ emitEvent3: (nodeId, args) => builder.call(nodeId, "core.emitEvent3", args, {}),
51
+ emitEvent4: (nodeId, args) => builder.call(nodeId, "core.emitEvent4", args, {}),
44
52
  call: (nodeId, args) => {
45
53
  const wire = buildCallWireFormat({
46
54
  resource: args.resource,
@@ -80,7 +88,88 @@ const bindGeneratedOps = (builder) => ({
80
88
  })
81
89
  },
82
90
  invariant: {
83
- balanceAtLeast: (nodeId, args) => builder.call(nodeId, "invariant.balanceAtLeast", args, {})
91
+ balanceAtLeast: (nodeId, args) => builder.call(
92
+ nodeId,
93
+ "invariant.balanceAtLeast",
94
+ { ...args, config: {} },
95
+ {}
96
+ ),
97
+ balanceEquals: (nodeId, args) => builder.call(
98
+ nodeId,
99
+ "invariant.balanceEquals",
100
+ { ...args, config: {} },
101
+ {}
102
+ ),
103
+ balanceAtMost: (nodeId, args) => builder.call(
104
+ nodeId,
105
+ "invariant.balanceAtMost",
106
+ { ...args, config: {} },
107
+ {}
108
+ ),
109
+ balanceInRange: (nodeId, args) => builder.call(
110
+ nodeId,
111
+ "invariant.balanceInRange",
112
+ { ...args, config: {} },
113
+ {}
114
+ ),
115
+ allowanceAtLeast: (nodeId, args) => builder.call(
116
+ nodeId,
117
+ "invariant.allowanceAtLeast",
118
+ { ...args, config: {} },
119
+ {}
120
+ ),
121
+ allowanceEquals: (nodeId, args) => builder.call(
122
+ nodeId,
123
+ "invariant.allowanceEquals",
124
+ { ...args, config: {} },
125
+ {}
126
+ ),
127
+ allowanceAtMost: (nodeId, args) => builder.call(
128
+ nodeId,
129
+ "invariant.allowanceAtMost",
130
+ { ...args, config: {} },
131
+ {}
132
+ ),
133
+ allowanceInRange: (nodeId, args) => builder.call(
134
+ nodeId,
135
+ "invariant.allowanceInRange",
136
+ { ...args, config: {} },
137
+ {}
138
+ ),
139
+ numeric: (nodeId, args) => builder.call(nodeId, "invariant.numeric", args, {}),
140
+ numericInRange: (nodeId, args) => builder.call(nodeId, "invariant.numericInRange", args, {})
141
+ },
142
+ aave: {
143
+ borrow: (nodeId, args) => builder.call(nodeId, "aave.borrow", args, {
144
+ borrowed: "resource",
145
+ debtBalance: "uint256"
146
+ }),
147
+ repay: (nodeId, args) => builder.call(nodeId, "aave.repay", args, {
148
+ actualRepaid: "uint256",
149
+ residual: "resource"
150
+ }),
151
+ repayWithATokens: (nodeId, args) => builder.call(nodeId, "aave.repayWithATokens", args, {
152
+ actualRepaid: "uint256",
153
+ residual: "resource"
154
+ }),
155
+ claimRewards: (nodeId, args) => builder.call(nodeId, "aave.claimRewards", args, {
156
+ claimed: "resource",
157
+ claimedAmount: "uint256"
158
+ }),
159
+ setEMode: (nodeId, args) => builder.call(nodeId, "aave.setEMode", args, {})
160
+ },
161
+ morphoBlue: {
162
+ supplyCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.supplyCollateral", args, {}),
163
+ withdrawCollateral: (nodeId, args) => builder.call(nodeId, "morphoBlue.withdrawCollateral", args, {
164
+ withdrawn: "resource",
165
+ collateralWithdrawn: "uint256"
166
+ })
167
+ },
168
+ paraswap: {
169
+ buy: (nodeId, args) => builder.call(nodeId, "paraswap.buy", args, {
170
+ amountOut: "resource",
171
+ unspentIn: "resource"
172
+ })
84
173
  }
85
174
  });
86
175
  export {