@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
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
};
|