@lifi/composer-sdk 0.2.0-staging.3 → 0.2.0-staging.4

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.
@@ -0,0 +1,78 @@
1
+ // Registry of staged (not-yet-prod) examples for the live runner. This is data,
2
+ // not a runner: src/examples/run.ts imports it via a non-literal dynamic import
3
+ // when invoked with `--staged`, so this file (which references staged definitions)
4
+ // is never pulled into the production type-check. It IS type-checked under
5
+ // tsconfig.staged.json (see verify:staged).
6
+ //
7
+ // Running these requires the SDK regenerated with `--staged`; the example:staged
8
+ // wrapper does that and restores production afterward.
9
+ import type { ComposeCompileRequest } from '@lifi/compose-spec';
10
+
11
+ import { OWNER, RECIPIENT } from '../config.js';
12
+
13
+ import { buildAaveBorrow } from './aaveBorrow.js';
14
+ import { buildAaveDebtRebalanceExactOut } from './aaveDebtRebalanceExactOut.js';
15
+ import { buildAaveHealthFactorExplode } from './aaveHealthFactorExplode.js';
16
+ import { buildAaveToMorphoDebtMigration } from './aaveToMorphoDebtMigration.js';
17
+ import { buildAaveToMorphoDebtMigrationWithSwap } from './aaveToMorphoDebtMigrationWithSwap.js';
18
+ import { buildAaveToMorphoDebtMigrationWithSwapExactOut } from './aaveToMorphoDebtMigrationWithSwapExactOut.js';
19
+ import { buildTrivialFlashloanRepay } from './flashloanRepay.js';
20
+ import { buildMorphoBlueBorrow } from './morphoBlueBorrow.js';
21
+ import { buildMorphoBlueRepay } from './morphoBlueRepay.js';
22
+
23
+ export const STAGED_EXAMPLES: Record<string, () => ComposeCompileRequest> = {
24
+ 'aave-borrow': () =>
25
+ buildAaveBorrow({
26
+ owner: OWNER,
27
+ recipient: RECIPIENT,
28
+ amount: '1000000000',
29
+ }).request,
30
+ 'aave-hf-explode': () =>
31
+ buildAaveHealthFactorExplode({ signer: OWNER }).request,
32
+ 'morpho-borrow': () =>
33
+ buildMorphoBlueBorrow({
34
+ owner: OWNER,
35
+ collateralAmount: '1000000000000000000',
36
+ borrowAmount: '1500000000',
37
+ }).request,
38
+ 'morpho-repay': () =>
39
+ buildMorphoBlueRepay({
40
+ owner: OWNER,
41
+ repayAmount: '1505000000',
42
+ collateralAmount: '1000000000000000000',
43
+ }).request,
44
+ 'debt-rebalance': () =>
45
+ buildAaveDebtRebalanceExactOut({
46
+ owner: OWNER,
47
+ collateralAmount: '1000000000000000000',
48
+ debtAmount: '1000000000',
49
+ newDebtBorrowAmount: '965000000',
50
+ }).request,
51
+ 'debt-migration-swap-exact-out': () =>
52
+ buildAaveToMorphoDebtMigrationWithSwapExactOut({
53
+ owner: OWNER,
54
+ collateralAmount: '1000000000000000000',
55
+ debtAmount: '2000000000',
56
+ morphoBorrowAmount: '1950000000',
57
+ }).request,
58
+ 'flashloan-repay': () =>
59
+ buildTrivialFlashloanRepay({
60
+ owner: OWNER,
61
+ amount: '10000000000',
62
+ fee: '5000000',
63
+ }).request,
64
+ 'debt-migration': () =>
65
+ buildAaveToMorphoDebtMigration({
66
+ owner: OWNER,
67
+ collateralAmount: '1000000000000000000',
68
+ debtAmount: '1000000000',
69
+ debtFlashloanFee: '500000',
70
+ }).request,
71
+ 'debt-migration-swap': () =>
72
+ buildAaveToMorphoDebtMigrationWithSwap({
73
+ owner: OWNER,
74
+ collateralAmount: '1000000000000000000',
75
+ debtAmount: '1000000000',
76
+ morphoBorrowAmount: '1100000000',
77
+ }).request,
78
+ };