@lifi/composer-sdk 0.2.0-staging.4 → 0.2.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 (88) hide show
  1. package/README.md +81 -0
  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/client.cjs +38 -6
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.d.cts +25 -1
  9. package/dist/client.d.ts +25 -1
  10. package/dist/client.js +41 -6
  11. package/dist/client.js.map +1 -1
  12. package/dist/errors.cjs +4 -1
  13. package/dist/errors.cjs.map +1 -1
  14. package/dist/errors.js +6 -1
  15. package/dist/errors.js.map +1 -1
  16. package/dist/generated/config.generated.cjs.map +1 -1
  17. package/dist/generated/config.generated.d.cts +82 -7
  18. package/dist/generated/config.generated.d.ts +82 -7
  19. package/dist/generated/materialisers.generated.cjs +2 -8
  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 +1 -6
  24. package/dist/generated/materialisers.generated.js.map +1 -1
  25. package/dist/generated/operations.generated.cjs +56 -31
  26. package/dist/generated/operations.generated.cjs.map +1 -1
  27. package/dist/generated/operations.generated.d.cts +204 -94
  28. package/dist/generated/operations.generated.d.ts +204 -94
  29. package/dist/generated/operations.generated.js +56 -31
  30. package/dist/generated/operations.generated.js.map +1 -1
  31. package/dist/index.cjs +8 -0
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +4 -3
  34. package/dist/index.d.ts +4 -3
  35. package/dist/index.js +8 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/{materialisers.generated-BfWJ-g7t.d.ts → materialisers.generated-BMkBQgWZ.d.ts} +3 -8
  38. package/dist/{materialisers.generated-DaJRwiRe.d.cts → materialisers.generated-BWq5oePO.d.cts} +3 -8
  39. package/dist/responseSchemas.cjs +110 -0
  40. package/dist/responseSchemas.cjs.map +1 -0
  41. package/dist/responseSchemas.d.cts +36 -0
  42. package/dist/responseSchemas.d.ts +36 -0
  43. package/dist/responseSchemas.js +74 -0
  44. package/dist/responseSchemas.js.map +1 -0
  45. package/dist/run/simulate.cjs +41 -0
  46. package/dist/run/simulate.cjs.map +1 -0
  47. package/dist/run/simulate.d.cts +59 -0
  48. package/dist/run/simulate.d.ts +59 -0
  49. package/dist/run/simulate.js +17 -0
  50. package/dist/run/simulate.js.map +1 -0
  51. package/dist/sdk.cjs +6 -1
  52. package/dist/sdk.cjs.map +1 -1
  53. package/dist/sdk.d.cts +13 -1
  54. package/dist/sdk.d.ts +13 -1
  55. package/dist/sdk.js +6 -1
  56. package/dist/sdk.js.map +1 -1
  57. package/package.json +7 -5
  58. package/src/authoring/handles.ts +19 -10
  59. package/src/client.ts +86 -11
  60. package/src/errors.ts +8 -10
  61. package/src/examples/aaveRepay.ts +55 -16
  62. package/src/examples/aaveRepayWithATokens.ts +41 -30
  63. package/src/examples/aaveRounding.ts +42 -0
  64. package/src/examples/aaveSetEMode.ts +0 -1
  65. package/src/examples/config.ts +1 -1
  66. package/src/examples/emitCustomEvent.ts +75 -0
  67. package/src/examples/invariantChecks.ts +96 -0
  68. package/src/examples/run.ts +20 -18
  69. package/src/examples/simulateCompiledSwap.ts +76 -0
  70. package/src/examples/simulateRawTransaction.ts +39 -0
  71. package/src/examples/untypedOpWithTypedRef.ts +26 -20
  72. package/src/generated/config.generated.ts +229 -6
  73. package/src/generated/materialisers.generated.ts +0 -12
  74. package/src/generated/operations.generated.ts +330 -177
  75. package/src/index.ts +19 -0
  76. package/src/responseSchemas.ts +143 -0
  77. package/src/run/simulate.ts +78 -0
  78. package/src/sdk.ts +20 -1
  79. package/src/examples/staged/aaveBorrow.ts +0 -104
  80. package/src/examples/staged/aaveDebtRebalanceExactOut.ts +0 -301
  81. package/src/examples/staged/aaveHealthFactorExplode.ts +0 -70
  82. package/src/examples/staged/aaveToMorphoDebtMigration.ts +0 -190
  83. package/src/examples/staged/aaveToMorphoDebtMigrationWithSwap.ts +0 -221
  84. package/src/examples/staged/aaveToMorphoDebtMigrationWithSwapExactOut.ts +0 -302
  85. package/src/examples/staged/flashloanRepay.ts +0 -138
  86. package/src/examples/staged/morphoBlueBorrow.ts +0 -89
  87. package/src/examples/staged/morphoBlueRepay.ts +0 -91
  88. package/src/examples/staged/registry.ts +0 -78
@@ -2,7 +2,7 @@ import { FlowBuilderInternal } from '../authoring/FlowBuilderCore.cjs';
2
2
  import { Bindable, OutputHandle } from '../authoring/handles.cjs';
3
3
  import { SignatureBind, CoreCallResult, StaticCallResult } from '../authoring/signatureArgs.cjs';
4
4
  import { TypedGuard } from '../types.cjs';
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.cjs';
5
+ import { CoreSplitConfig, CoreBpsDownConfig, CoreBpsUpConfig, CoreApproveConfig, CoreBalanceOfConfig, CoreTransferConfig, CoreEmitEvent1Config, CoreEmitEvent2Config, CoreEmitEvent3Config, CoreEmitEvent4Config, CoreCallConfig, CoreStaticCallConfig, CoreRawCallConfig, CoreAsResourceConfig, CorePeekConfig, LifiSwapConfig, LifiZapConfig, InvariantNumericConfig, InvariantNumericInRangeConfig, InvariantGteConfig, InvariantGtConfig, InvariantLteConfig, InvariantLtConfig, InvariantEqConfig, InvariantNeqConfig, AaveBorrowConfig, AaveRepayConfig, AaveRepayWithATokensConfig, AaveClaimRewardsConfig, AaveSetEModeConfig, MorphoBlueSupplyCollateralConfig, MorphoBlueWithdrawCollateralConfig, ParaswapBuyConfig } from './config.generated.cjs';
6
6
  import '@lifi/compose-spec';
7
7
  import 'abitype';
8
8
 
@@ -38,6 +38,132 @@ interface InvariantBalanceAtLeastArgs {
38
38
  };
39
39
  readonly guards?: readonly TypedGuard<never>[];
40
40
  }
41
+ /** Assert that an account holds exactly an expected token balance */
42
+ interface InvariantBalanceEqualsArgs {
43
+ readonly bind: {
44
+ readonly expectedAmount: Bindable<'resource'>;
45
+ readonly account: Bindable<'address'>;
46
+ };
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>[];
118
+ }
119
+ /** Assert a uint256 value is greater than or equal to a constant threshold; reverts on violation */
120
+ interface InvariantGteArgs {
121
+ readonly bind: {
122
+ readonly value: Bindable<'uint256'>;
123
+ };
124
+ readonly config: InvariantGteConfig;
125
+ readonly guards?: readonly TypedGuard<never>[];
126
+ }
127
+ /** Assert a uint256 value is strictly greater than a constant threshold; reverts on violation */
128
+ interface InvariantGtArgs {
129
+ readonly bind: {
130
+ readonly value: Bindable<'uint256'>;
131
+ };
132
+ readonly config: InvariantGtConfig;
133
+ readonly guards?: readonly TypedGuard<never>[];
134
+ }
135
+ /** Assert a uint256 value is less than or equal to a constant threshold; reverts on violation */
136
+ interface InvariantLteArgs {
137
+ readonly bind: {
138
+ readonly value: Bindable<'uint256'>;
139
+ };
140
+ readonly config: InvariantLteConfig;
141
+ readonly guards?: readonly TypedGuard<never>[];
142
+ }
143
+ /** Assert a uint256 value is strictly less than a constant threshold; reverts on violation */
144
+ interface InvariantLtArgs {
145
+ readonly bind: {
146
+ readonly value: Bindable<'uint256'>;
147
+ };
148
+ readonly config: InvariantLtConfig;
149
+ readonly guards?: readonly TypedGuard<never>[];
150
+ }
151
+ /** Assert a uint256 value equals a constant threshold; reverts on violation */
152
+ interface InvariantEqArgs {
153
+ readonly bind: {
154
+ readonly value: Bindable<'uint256'>;
155
+ };
156
+ readonly config: InvariantEqConfig;
157
+ readonly guards?: readonly TypedGuard<never>[];
158
+ }
159
+ /** Assert a uint256 value does not equal a constant threshold; reverts on violation */
160
+ interface InvariantNeqArgs {
161
+ readonly bind: {
162
+ readonly value: Bindable<'uint256'>;
163
+ };
164
+ readonly config: InvariantNeqConfig;
165
+ readonly guards?: readonly TypedGuard<never>[];
166
+ }
41
167
  /** Add two unsigned integers (a + b) */
42
168
  interface CoreAddArgs {
43
169
  readonly bind: {
@@ -174,6 +300,44 @@ interface CoreTransferArgs {
174
300
  readonly config: CoreTransferConfig;
175
301
  readonly guards?: readonly TypedGuard<'transferred' | 'remainder'>[];
176
302
  }
303
+ /** 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). */
304
+ interface CoreEmitEvent1Args {
305
+ readonly bind: {
306
+ readonly value0: Bindable<'bytes32'>;
307
+ };
308
+ readonly config: CoreEmitEvent1Config;
309
+ readonly guards?: readonly TypedGuard<never>[];
310
+ }
311
+ /** 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). */
312
+ interface CoreEmitEvent2Args {
313
+ readonly bind: {
314
+ readonly value0: Bindable<'bytes32'>;
315
+ readonly value1: Bindable<'bytes32'>;
316
+ };
317
+ readonly config: CoreEmitEvent2Config;
318
+ readonly guards?: readonly TypedGuard<never>[];
319
+ }
320
+ /** 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). */
321
+ interface CoreEmitEvent3Args {
322
+ readonly bind: {
323
+ readonly value0: Bindable<'bytes32'>;
324
+ readonly value1: Bindable<'bytes32'>;
325
+ readonly value2: Bindable<'bytes32'>;
326
+ };
327
+ readonly config: CoreEmitEvent3Config;
328
+ readonly guards?: readonly TypedGuard<never>[];
329
+ }
330
+ /** 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). */
331
+ interface CoreEmitEvent4Args {
332
+ readonly bind: {
333
+ readonly value0: Bindable<'bytes32'>;
334
+ readonly value1: Bindable<'bytes32'>;
335
+ readonly value2: Bindable<'bytes32'>;
336
+ readonly value3: Bindable<'bytes32'>;
337
+ };
338
+ readonly config: CoreEmitEvent4Config;
339
+ readonly guards?: readonly TypedGuard<never>[];
340
+ }
177
341
  /** Invoke a smart contract function, optionally spending a token resource */
178
342
  interface CoreCallArgs<TSig extends string = string> {
179
343
  readonly resource?: Bindable<'resource'>;
@@ -240,12 +404,6 @@ interface AaveSetEModeArgs {
240
404
  readonly config: AaveSetEModeConfig;
241
405
  readonly guards?: readonly TypedGuard<never>[];
242
406
  }
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
407
  /** 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
408
  interface MorphoBlueSupplyCollateralArgs {
251
409
  readonly bind: {
@@ -260,50 +418,6 @@ interface MorphoBlueWithdrawCollateralArgs {
260
418
  readonly config: MorphoBlueWithdrawCollateralConfig;
261
419
  readonly guards?: readonly TypedGuard<'collateralWithdrawn'>[];
262
420
  }
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
421
  /** Route tokens into a DeFi protocol position via the edge catalog */
308
422
  interface LifiZapArgs {
309
423
  readonly bind: {
@@ -387,38 +501,10 @@ interface AaveClaimRewardsOutputs {
387
501
  readonly claimed: OutputHandle<'resource'>;
388
502
  readonly claimedAmount: OutputHandle<'uint256'>;
389
503
  }
390
- interface AaveGetHealthFactorOutputs {
391
- readonly healthFactor: OutputHandle<'uint256'>;
392
- }
393
504
  interface MorphoBlueWithdrawCollateralOutputs {
394
505
  readonly withdrawn: OutputHandle<'resource'>;
395
506
  readonly collateralWithdrawn: OutputHandle<'uint256'>;
396
507
  }
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
508
  interface LifiZapOutputs {
423
509
  readonly amountOut: OutputHandle<'resource'>;
424
510
  }
@@ -469,6 +555,14 @@ type GeneratedOps = {
469
555
  readonly balanceOf: (nodeId: string, args: CoreBalanceOfArgs) => CoreBalanceOfOutputs;
470
556
  /** Transfer tokens to a recipient address, optionally specifying a partial amount — original id: "core.transfer" */
471
557
  readonly transfer: (nodeId: string, args: CoreTransferArgs) => CoreTransferOutputs;
558
+ /** 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" */
559
+ readonly emitEvent1: (nodeId: string, args: CoreEmitEvent1Args) => void;
560
+ /** 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" */
561
+ readonly emitEvent2: (nodeId: string, args: CoreEmitEvent2Args) => void;
562
+ /** 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" */
563
+ readonly emitEvent3: (nodeId: string, args: CoreEmitEvent3Args) => void;
564
+ /** 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" */
565
+ readonly emitEvent4: (nodeId: string, args: CoreEmitEvent4Args) => void;
472
566
  /** Invoke a smart contract function, optionally spending a token resource — original id: "core.call" */
473
567
  readonly call: <TSig extends string>(nodeId: string, args: CoreCallArgs<TSig>) => CoreCallResult<TSig>;
474
568
  /** Read from a smart contract at runtime (StaticCall); result is fresh at execution time — original id: "core.staticCall" */
@@ -483,14 +577,42 @@ type GeneratedOps = {
483
577
  readonly lifi: {
484
578
  /** Swap tokens via the LI.FI aggregator API — original id: "lifi.swap" */
485
579
  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;
488
580
  /** Route tokens into a DeFi protocol position via the edge catalog — original id: "lifi.zap" */
489
581
  readonly zap: (nodeId: string, args: LifiZapArgs) => LifiZapOutputs;
490
582
  };
491
583
  readonly invariant: {
492
584
  /** Assert that an account holds at least a minimum token balance — original id: "invariant.balanceAtLeast" */
493
585
  readonly balanceAtLeast: (nodeId: string, args: InvariantBalanceAtLeastArgs) => void;
586
+ /** Assert that an account holds exactly an expected token balance — original id: "invariant.balanceEquals" */
587
+ readonly balanceEquals: (nodeId: string, args: InvariantBalanceEqualsArgs) => void;
588
+ /** Assert that an account holds at most a maximum token balance — original id: "invariant.balanceAtMost" */
589
+ readonly balanceAtMost: (nodeId: string, args: InvariantBalanceAtMostArgs) => void;
590
+ /** Assert that an account's token balance is between a minimum and a maximum (inclusive) — original id: "invariant.balanceInRange" */
591
+ readonly balanceInRange: (nodeId: string, args: InvariantBalanceInRangeArgs) => void;
592
+ /** Assert that a spender is permitted to move at least a minimum allowance on behalf of an owner — original id: "invariant.allowanceAtLeast" */
593
+ readonly allowanceAtLeast: (nodeId: string, args: InvariantAllowanceAtLeastArgs) => void;
594
+ /** Assert that a spender's allowance on behalf of an owner exactly equals an expected amount — original id: "invariant.allowanceEquals" */
595
+ readonly allowanceEquals: (nodeId: string, args: InvariantAllowanceEqualsArgs) => void;
596
+ /** Assert that a spender is permitted to move at most a maximum allowance on behalf of an owner — original id: "invariant.allowanceAtMost" */
597
+ readonly allowanceAtMost: (nodeId: string, args: InvariantAllowanceAtMostArgs) => void;
598
+ /** Assert that a spender's allowance on behalf of an owner is between a minimum and a maximum (inclusive) — original id: "invariant.allowanceInRange" */
599
+ readonly allowanceInRange: (nodeId: string, args: InvariantAllowanceInRangeArgs) => void;
600
+ /** Assert a uint256 value satisfies a comparison against a constant threshold; reverts on violation — original id: "invariant.numeric" */
601
+ readonly numeric: (nodeId: string, args: InvariantNumericArgs) => void;
602
+ /** Assert min <= value <= max against constant bounds; reverts if outside the range — original id: "invariant.numericInRange" */
603
+ readonly numericInRange: (nodeId: string, args: InvariantNumericInRangeArgs) => void;
604
+ /** Assert a uint256 value is greater than or equal to a constant threshold; reverts on violation — original id: "invariant.gte" */
605
+ readonly gte: (nodeId: string, args: InvariantGteArgs) => void;
606
+ /** Assert a uint256 value is strictly greater than a constant threshold; reverts on violation — original id: "invariant.gt" */
607
+ readonly gt: (nodeId: string, args: InvariantGtArgs) => void;
608
+ /** Assert a uint256 value is less than or equal to a constant threshold; reverts on violation — original id: "invariant.lte" */
609
+ readonly lte: (nodeId: string, args: InvariantLteArgs) => void;
610
+ /** Assert a uint256 value is strictly less than a constant threshold; reverts on violation — original id: "invariant.lt" */
611
+ readonly lt: (nodeId: string, args: InvariantLtArgs) => void;
612
+ /** Assert a uint256 value equals a constant threshold; reverts on violation — original id: "invariant.eq" */
613
+ readonly eq: (nodeId: string, args: InvariantEqArgs) => void;
614
+ /** Assert a uint256 value does not equal a constant threshold; reverts on violation — original id: "invariant.neq" */
615
+ readonly neq: (nodeId: string, args: InvariantNeqArgs) => void;
494
616
  };
495
617
  readonly aave: {
496
618
  /** Borrow an asset from an Aave v3 pool against existing collateral, exposing the borrowed asset as a Resource — original id: "aave.borrow" */
@@ -503,24 +625,12 @@ type GeneratedOps = {
503
625
  readonly claimRewards: (nodeId: string, args: AaveClaimRewardsArgs) => AaveClaimRewardsOutputs;
504
626
  /** 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
627
  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
628
  };
509
629
  readonly morphoBlue: {
510
630
  /** 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
631
  readonly supplyCollateral: (nodeId: string, args: MorphoBlueSupplyCollateralArgs) => void;
512
632
  /** 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
633
  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
634
  };
525
635
  readonly paraswap: {
526
636
  /** 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" */
@@ -529,4 +639,4 @@ type GeneratedOps = {
529
639
  };
530
640
  declare const bindGeneratedOps: (builder: FlowBuilderInternal) => GeneratedOps;
531
641
 
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 };
642
+ 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 InvariantEqArgs, type InvariantGtArgs, type InvariantGteArgs, type InvariantLtArgs, type InvariantLteArgs, type InvariantNeqArgs, type InvariantNumericArgs, type InvariantNumericInRangeArgs, type LifiSwapArgs, type LifiSwapOutputs, type LifiZapArgs, type LifiZapOutputs, type MorphoBlueSupplyCollateralArgs, type MorphoBlueWithdrawCollateralArgs, type MorphoBlueWithdrawCollateralOutputs, type ParaswapBuyArgs, type ParaswapBuyOutputs, bindGeneratedOps };