@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.
- package/README.md +81 -0
- package/dist/authoring/handles.cjs.map +1 -1
- package/dist/authoring/handles.d.cts +13 -6
- package/dist/authoring/handles.d.ts +13 -6
- package/dist/authoring/handles.js.map +1 -1
- package/dist/client.cjs +38 -6
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +25 -1
- package/dist/client.d.ts +25 -1
- package/dist/client.js +41 -6
- package/dist/client.js.map +1 -1
- package/dist/errors.cjs +4 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +6 -1
- package/dist/errors.js.map +1 -1
- package/dist/generated/config.generated.cjs.map +1 -1
- package/dist/generated/config.generated.d.cts +82 -7
- package/dist/generated/config.generated.d.ts +82 -7
- package/dist/generated/materialisers.generated.cjs +2 -8
- package/dist/generated/materialisers.generated.cjs.map +1 -1
- package/dist/generated/materialisers.generated.d.cts +1 -1
- package/dist/generated/materialisers.generated.d.ts +1 -1
- package/dist/generated/materialisers.generated.js +1 -6
- package/dist/generated/materialisers.generated.js.map +1 -1
- package/dist/generated/operations.generated.cjs +56 -31
- package/dist/generated/operations.generated.cjs.map +1 -1
- package/dist/generated/operations.generated.d.cts +204 -94
- package/dist/generated/operations.generated.d.ts +204 -94
- package/dist/generated/operations.generated.js +56 -31
- package/dist/generated/operations.generated.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/{materialisers.generated-BfWJ-g7t.d.ts → materialisers.generated-BMkBQgWZ.d.ts} +3 -8
- package/dist/{materialisers.generated-DaJRwiRe.d.cts → materialisers.generated-BWq5oePO.d.cts} +3 -8
- package/dist/responseSchemas.cjs +110 -0
- package/dist/responseSchemas.cjs.map +1 -0
- package/dist/responseSchemas.d.cts +36 -0
- package/dist/responseSchemas.d.ts +36 -0
- package/dist/responseSchemas.js +74 -0
- package/dist/responseSchemas.js.map +1 -0
- package/dist/run/simulate.cjs +41 -0
- package/dist/run/simulate.cjs.map +1 -0
- package/dist/run/simulate.d.cts +59 -0
- package/dist/run/simulate.d.ts +59 -0
- package/dist/run/simulate.js +17 -0
- package/dist/run/simulate.js.map +1 -0
- package/dist/sdk.cjs +6 -1
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +13 -1
- package/dist/sdk.d.ts +13 -1
- package/dist/sdk.js +6 -1
- package/dist/sdk.js.map +1 -1
- package/package.json +7 -5
- package/src/authoring/handles.ts +19 -10
- package/src/client.ts +86 -11
- package/src/errors.ts +8 -10
- package/src/examples/aaveRepay.ts +55 -16
- package/src/examples/aaveRepayWithATokens.ts +41 -30
- package/src/examples/aaveRounding.ts +42 -0
- package/src/examples/aaveSetEMode.ts +0 -1
- package/src/examples/config.ts +1 -1
- package/src/examples/emitCustomEvent.ts +75 -0
- package/src/examples/invariantChecks.ts +96 -0
- package/src/examples/run.ts +20 -18
- package/src/examples/simulateCompiledSwap.ts +76 -0
- package/src/examples/simulateRawTransaction.ts +39 -0
- package/src/examples/untypedOpWithTypedRef.ts +26 -20
- package/src/generated/config.generated.ts +229 -6
- package/src/generated/materialisers.generated.ts +0 -12
- package/src/generated/operations.generated.ts +330 -177
- package/src/index.ts +19 -0
- package/src/responseSchemas.ts +143 -0
- package/src/run/simulate.ts +78 -0
- package/src/sdk.ts +20 -1
- package/src/examples/staged/aaveBorrow.ts +0 -104
- package/src/examples/staged/aaveDebtRebalanceExactOut.ts +0 -301
- package/src/examples/staged/aaveHealthFactorExplode.ts +0 -70
- package/src/examples/staged/aaveToMorphoDebtMigration.ts +0 -190
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwap.ts +0 -221
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwapExactOut.ts +0 -302
- package/src/examples/staged/flashloanRepay.ts +0 -138
- package/src/examples/staged/morphoBlueBorrow.ts +0 -89
- package/src/examples/staged/morphoBlueRepay.ts +0 -91
- 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,
|
|
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
|
|
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 };
|