@lifi/composer-sdk 0.2.0-staging.5 → 0.3.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 +103 -2
- package/dist/client.cjs +46 -8
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +27 -3
- package/dist/client.d.ts +27 -3
- package/dist/client.js +49 -8
- 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 +80 -20
- package/dist/generated/config.generated.d.ts +80 -20
- 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 +1 -30
- package/dist/generated/operations.generated.cjs.map +1 -1
- package/dist/generated/operations.generated.d.cts +2 -94
- package/dist/generated/operations.generated.d.ts +2 -94
- package/dist/generated/operations.generated.js +1 -30
- 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 +18 -6
- package/dist/sdk.d.ts +18 -6
- package/dist/sdk.js +6 -1
- package/dist/sdk.js.map +1 -1
- package/package.json +8 -6
- package/src/client.ts +96 -16
- package/src/errors.ts +8 -10
- package/src/examples/aaveClaimRewards.ts +2 -2
- package/src/examples/aaveRepay.ts +2 -2
- package/src/examples/aaveRepayWithATokens.ts +2 -2
- package/src/examples/aaveSetEMode.ts +2 -2
- package/src/examples/approveAndDeposit.ts +2 -2
- package/src/examples/callContract.ts +4 -4
- package/src/examples/config.ts +4 -1
- package/src/examples/consolidateToEth.ts +2 -2
- package/src/examples/consolidateToUsdc.ts +2 -2
- package/src/examples/depositFromProxy.ts +2 -2
- package/src/examples/dustSweep.ts +2 -2
- package/src/examples/emitCustomEvent.ts +2 -2
- package/src/examples/invariantChecks.ts +2 -2
- package/src/examples/lifiSwap.ts +2 -2
- package/src/examples/lifiZap.ts +2 -2
- package/src/examples/rawCallWithArithmetic.ts +2 -2
- package/src/examples/readContractState.ts +2 -2
- package/src/examples/simulateCompiledSwap.ts +76 -0
- package/src/examples/simulateRawTransaction.ts +39 -0
- package/src/examples/splitAndZap.ts +2 -2
- package/src/examples/splitWithArithmetic.ts +2 -2
- package/src/examples/swapAndZap.ts +2 -2
- package/src/examples/swapToRecipient.ts +2 -2
- package/src/examples/swapWithAllowRevert.ts +3 -3
- package/src/examples/swapWithBalanceCheck.ts +2 -2
- package/src/examples/swapWithFee.ts +2 -2
- package/src/examples/swapWithOutputValidation.ts +2 -2
- package/src/examples/transferTokens.ts +3 -3
- package/src/examples/untypedOpWithTypedRef.ts +2 -2
- package/src/generated/config.generated.ts +221 -20
- package/src/generated/materialisers.generated.ts +0 -12
- package/src/generated/operations.generated.ts +0 -177
- package/src/index.ts +25 -0
- package/src/responseSchemas.ts +143 -0
- package/src/run/simulate.ts +78 -0
- package/src/sdk.ts +25 -6
- package/src/examples/staged/aaveBorrow.ts +0 -128
- package/src/examples/staged/aaveDebtRebalanceExactOut.ts +0 -301
- package/src/examples/staged/aaveHealthFactorExplode.ts +0 -70
- package/src/examples/staged/aaveToMorphoDebtMigration.ts +0 -200
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwap.ts +0 -231
- package/src/examples/staged/aaveToMorphoDebtMigrationWithSwapExactOut.ts +0 -307
- package/src/examples/staged/flashloanRepay.ts +0 -142
- package/src/examples/staged/morphoBlueBorrow.ts +0 -93
- package/src/examples/staged/morphoBlueRepay.ts +0 -132
- package/src/examples/staged/registry.ts +0 -80
|
@@ -1,80 +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
|
-
collateralAmount: '1000000000',
|
|
29
|
-
borrowAmount: '500000000',
|
|
30
|
-
}).request,
|
|
31
|
-
'aave-hf-explode': () =>
|
|
32
|
-
buildAaveHealthFactorExplode({ signer: OWNER }).request,
|
|
33
|
-
'morpho-borrow': () =>
|
|
34
|
-
buildMorphoBlueBorrow({
|
|
35
|
-
owner: OWNER,
|
|
36
|
-
collateralAmount: '1000000000000000000',
|
|
37
|
-
borrowAmount: '1200000000',
|
|
38
|
-
}).request,
|
|
39
|
-
'morpho-repay': () =>
|
|
40
|
-
buildMorphoBlueRepay({
|
|
41
|
-
owner: OWNER,
|
|
42
|
-
collateralAmount: '1000000000000000000',
|
|
43
|
-
borrowAmount: '500000000',
|
|
44
|
-
repayAmount: '501000000',
|
|
45
|
-
}).request,
|
|
46
|
-
'debt-rebalance': () =>
|
|
47
|
-
buildAaveDebtRebalanceExactOut({
|
|
48
|
-
owner: OWNER,
|
|
49
|
-
collateralAmount: '1000000000000000000',
|
|
50
|
-
debtAmount: '1000000000',
|
|
51
|
-
newDebtBorrowAmount: '965000000',
|
|
52
|
-
}).request,
|
|
53
|
-
'debt-migration-swap-exact-out': () =>
|
|
54
|
-
buildAaveToMorphoDebtMigrationWithSwapExactOut({
|
|
55
|
-
owner: OWNER,
|
|
56
|
-
collateralAmount: '1000000000000000000',
|
|
57
|
-
debtAmount: '1000000000',
|
|
58
|
-
morphoBorrowAmount: '975000000',
|
|
59
|
-
}).request,
|
|
60
|
-
'flashloan-repay': () =>
|
|
61
|
-
buildTrivialFlashloanRepay({
|
|
62
|
-
owner: OWNER,
|
|
63
|
-
amount: '10000000000',
|
|
64
|
-
fee: '5000000',
|
|
65
|
-
}).request,
|
|
66
|
-
'debt-migration': () =>
|
|
67
|
-
buildAaveToMorphoDebtMigration({
|
|
68
|
-
owner: OWNER,
|
|
69
|
-
collateralAmount: '1000000000000000000',
|
|
70
|
-
debtAmount: '1000000000',
|
|
71
|
-
debtFlashloanFee: '500000',
|
|
72
|
-
}).request,
|
|
73
|
-
'debt-migration-swap': () =>
|
|
74
|
-
buildAaveToMorphoDebtMigrationWithSwap({
|
|
75
|
-
owner: OWNER,
|
|
76
|
-
collateralAmount: '1000000000000000000',
|
|
77
|
-
debtAmount: '1000000000',
|
|
78
|
-
morphoBorrowAmount: '1100000000',
|
|
79
|
-
}).request,
|
|
80
|
-
};
|