@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
@@ -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
- };