@defisaver/automation-sdk 3.0.4 → 3.0.6

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 (143) hide show
  1. package/.babelrc +3 -3
  2. package/.editorconfig +9 -9
  3. package/.env.dev +4 -4
  4. package/.eslintignore +6 -6
  5. package/.eslintrc.js +41 -41
  6. package/.tests.sh +2 -2
  7. package/README.md +41 -41
  8. package/esm/abis/Erc20.json +223 -223
  9. package/esm/abis/SubStorage.json +17 -17
  10. package/esm/abis/UniMulticall.json +14 -14
  11. package/esm/abis/index.d.ts +9 -9
  12. package/esm/abis/index.js +30 -30
  13. package/esm/abis/legacy_AaveV2Subscriptions.json +8 -8
  14. package/esm/abis/legacy_AuthCheck.json +8 -8
  15. package/esm/abis/legacy_CompoundV2Subscriptions.json +9 -9
  16. package/esm/abis/legacy_MakerSubscriptions.json +9 -9
  17. package/esm/automation/private/Automation.d.ts +12 -12
  18. package/esm/automation/private/Automation.js +42 -42
  19. package/esm/automation/private/LegacyAutomation.d.ts +25 -25
  20. package/esm/automation/private/LegacyAutomation.js +118 -118
  21. package/esm/automation/private/LegacyProtocol.d.ts +22 -22
  22. package/esm/automation/private/LegacyProtocol.js +41 -41
  23. package/esm/automation/private/LegacyProtocol.test.d.ts +1 -1
  24. package/esm/automation/private/LegacyProtocol.test.js +25 -25
  25. package/esm/automation/private/Protocol.d.ts +22 -22
  26. package/esm/automation/private/Protocol.js +41 -41
  27. package/esm/automation/private/Protocol.test.d.ts +1 -1
  28. package/esm/automation/private/Protocol.test.js +25 -25
  29. package/esm/automation/private/StrategiesAutomation.d.ts +33 -33
  30. package/esm/automation/private/StrategiesAutomation.js +181 -181
  31. package/esm/automation/private/StrategiesAutomation.test.d.ts +1 -1
  32. package/esm/automation/private/StrategiesAutomation.test.js +671 -671
  33. package/esm/automation/public/ArbitrumStrategies.d.ts +5 -5
  34. package/esm/automation/public/ArbitrumStrategies.js +13 -13
  35. package/esm/automation/public/EthereumStrategies.d.ts +5 -5
  36. package/esm/automation/public/EthereumStrategies.js +13 -13
  37. package/esm/automation/public/OptimismStrategies.d.ts +5 -5
  38. package/esm/automation/public/OptimismStrategies.js +13 -13
  39. package/esm/automation/public/legacy/LegacyAaveAutomation.d.ts +6 -6
  40. package/esm/automation/public/legacy/LegacyAaveAutomation.js +20 -20
  41. package/esm/automation/public/legacy/LegacyCompoundAutomation.d.ts +6 -6
  42. package/esm/automation/public/legacy/LegacyCompoundAutomation.js +20 -20
  43. package/esm/automation/public/legacy/LegacyMakerAutomation.d.ts +6 -6
  44. package/esm/automation/public/legacy/LegacyMakerAutomation.js +20 -20
  45. package/esm/configuration.d.ts +1 -1
  46. package/esm/configuration.js +12 -12
  47. package/esm/constants/index.d.ts +45 -45
  48. package/esm/constants/index.js +395 -385
  49. package/esm/index.d.ts +22 -22
  50. package/esm/index.js +63 -63
  51. package/esm/services/contractService.d.ts +12 -12
  52. package/esm/services/contractService.js +54 -54
  53. package/esm/services/ethereumService.d.ts +7 -7
  54. package/esm/services/ethereumService.js +49 -49
  55. package/esm/services/ethereumService.test.d.ts +1 -1
  56. package/esm/services/ethereumService.test.js +242 -242
  57. package/esm/services/strategiesService.d.ts +2 -2
  58. package/esm/services/strategiesService.js +701 -698
  59. package/esm/services/strategiesService.test.d.ts +1 -1
  60. package/esm/services/strategiesService.test.js +110 -110
  61. package/esm/services/strategySubService.d.ts +87 -87
  62. package/esm/services/strategySubService.js +257 -252
  63. package/esm/services/strategySubService.test.d.ts +1 -1
  64. package/esm/services/strategySubService.test.js +894 -890
  65. package/esm/services/subDataService.d.ts +181 -181
  66. package/esm/services/subDataService.js +443 -442
  67. package/esm/services/subDataService.test.d.ts +1 -1
  68. package/esm/services/subDataService.test.js +1225 -1223
  69. package/esm/services/triggerService.d.ts +191 -191
  70. package/esm/services/triggerService.js +367 -367
  71. package/esm/services/triggerService.test.d.ts +1 -1
  72. package/esm/services/triggerService.test.js +926 -926
  73. package/esm/services/utils.d.ts +25 -25
  74. package/esm/services/utils.js +131 -131
  75. package/esm/services/utils.test.d.ts +1 -1
  76. package/esm/services/utils.test.js +376 -376
  77. package/esm/types/contracts/generated/Erc20.d.ts +53 -53
  78. package/esm/types/contracts/generated/Erc20.js +5 -5
  79. package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.d.ts +129 -129
  80. package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.js +5 -5
  81. package/esm/types/contracts/generated/Legacy_AuthCheck.d.ts +20 -20
  82. package/esm/types/contracts/generated/Legacy_AuthCheck.js +5 -5
  83. package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.d.ts +128 -128
  84. package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.js +5 -5
  85. package/esm/types/contracts/generated/Legacy_MakerSubscriptions.d.ts +246 -246
  86. package/esm/types/contracts/generated/Legacy_MakerSubscriptions.js +5 -5
  87. package/esm/types/contracts/generated/SubStorage.d.ts +114 -114
  88. package/esm/types/contracts/generated/SubStorage.js +5 -5
  89. package/esm/types/contracts/generated/UniMulticall.d.ts +55 -55
  90. package/esm/types/contracts/generated/UniMulticall.js +5 -5
  91. package/esm/types/contracts/generated/index.d.ts +7 -7
  92. package/esm/types/contracts/generated/index.js +2 -2
  93. package/esm/types/contracts/generated/types.d.ts +54 -54
  94. package/esm/types/contracts/generated/types.js +2 -2
  95. package/esm/types/enums.d.ts +160 -158
  96. package/esm/types/enums.js +180 -178
  97. package/esm/types/index.d.ts +217 -217
  98. package/esm/types/index.js +2 -2
  99. package/package.json +71 -71
  100. package/scripts/generateContractTypes.js +39 -39
  101. package/src/abis/Erc20.json +222 -222
  102. package/src/abis/SubStorage.json +17 -17
  103. package/src/abis/UniMulticall.json +14 -14
  104. package/src/abis/index.ts +28 -28
  105. package/src/abis/legacy_AaveV2Subscriptions.json +7 -7
  106. package/src/abis/legacy_AuthCheck.json +7 -7
  107. package/src/abis/legacy_CompoundV2Subscriptions.json +8 -8
  108. package/src/abis/legacy_MakerSubscriptions.json +8 -8
  109. package/src/automation/private/Automation.ts +44 -44
  110. package/src/automation/private/LegacyAutomation.ts +135 -135
  111. package/src/automation/private/LegacyProtocol.test.ts +23 -23
  112. package/src/automation/private/LegacyProtocol.ts +51 -51
  113. package/src/automation/private/Protocol.test.ts +23 -23
  114. package/src/automation/private/Protocol.ts +51 -51
  115. package/src/automation/private/StrategiesAutomation.test.ts +663 -663
  116. package/src/automation/private/StrategiesAutomation.ts +242 -242
  117. package/src/automation/public/ArbitrumStrategies.ts +10 -10
  118. package/src/automation/public/EthereumStrategies.ts +10 -10
  119. package/src/automation/public/OptimismStrategies.ts +10 -10
  120. package/src/automation/public/legacy/LegacyAaveAutomation.ts +20 -20
  121. package/src/automation/public/legacy/LegacyCompoundAutomation.ts +20 -20
  122. package/src/automation/public/legacy/LegacyMakerAutomation.ts +20 -20
  123. package/src/configuration.ts +8 -8
  124. package/src/constants/index.ts +409 -399
  125. package/src/index.ts +38 -38
  126. package/src/services/contractService.ts +77 -77
  127. package/src/services/ethereumService.test.ts +257 -257
  128. package/src/services/ethereumService.ts +69 -69
  129. package/src/services/strategiesService.test.ts +105 -105
  130. package/src/services/strategiesService.ts +905 -901
  131. package/src/services/strategySubService.test.ts +1065 -1060
  132. package/src/services/strategySubService.ts +496 -492
  133. package/src/services/subDataService.test.ts +1326 -1324
  134. package/src/services/subDataService.ts +595 -593
  135. package/src/services/triggerService.test.ts +1004 -1004
  136. package/src/services/triggerService.ts +449 -449
  137. package/src/services/utils.test.ts +430 -430
  138. package/src/services/utils.ts +103 -103
  139. package/src/types/enums.ts +174 -172
  140. package/src/types/index.ts +262 -262
  141. package/tsconfig.json +79 -79
  142. package/umd/index.js +42 -24
  143. package/webpack.umd.js +52 -52
@@ -1,178 +1,180 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bundles = exports.Strategies = exports.ProtocolIdentifiers = exports.BundleProtocols = exports.OrderType = exports.RatioState = exports.ChainId = void 0;
4
- var ChainId;
5
- (function (ChainId) {
6
- ChainId[ChainId["Ethereum"] = 1] = "Ethereum";
7
- ChainId[ChainId["Optimism"] = 10] = "Optimism";
8
- ChainId[ChainId["Arbitrum"] = 42161] = "Arbitrum";
9
- })(ChainId = exports.ChainId || (exports.ChainId = {}));
10
- var RatioState;
11
- (function (RatioState) {
12
- RatioState[RatioState["OVER"] = 0] = "OVER";
13
- RatioState[RatioState["UNDER"] = 1] = "UNDER";
14
- })(RatioState = exports.RatioState || (exports.RatioState = {}));
15
- var OrderType;
16
- (function (OrderType) {
17
- OrderType[OrderType["TAKE_PROFIT"] = 0] = "TAKE_PROFIT";
18
- OrderType[OrderType["STOP_LOSS"] = 1] = "STOP_LOSS";
19
- })(OrderType = exports.OrderType || (exports.OrderType = {}));
20
- var BundleProtocols;
21
- (function (BundleProtocols) {
22
- BundleProtocols["MStable"] = "mstable";
23
- BundleProtocols["Yearn"] = "yearn";
24
- BundleProtocols["Rari"] = "rari";
25
- })(BundleProtocols = exports.BundleProtocols || (exports.BundleProtocols = {}));
26
- /**
27
- * @dev Follow the naming convention:
28
- * - Enum name consists of two parts, name and version
29
- * - Name should be human-readable name of the protocol, it can include spaces or any characters needed
30
- * - Version should be separated from the name with double underscores `__` (If there is no version leave it out)
31
- * - Example `Name of ThePROTOCOL__v1` (Without version `Name of ThePROTOCOL`)
32
- */
33
- var ProtocolIdentifiers;
34
- (function (ProtocolIdentifiers) {
35
- let StrategiesAutomation;
36
- (function (StrategiesAutomation) {
37
- StrategiesAutomation["MakerDAO"] = "MakerDAO";
38
- StrategiesAutomation["Liquity"] = "Liquity";
39
- StrategiesAutomation["ChickenBonds"] = "Chicken Bonds";
40
- StrategiesAutomation["CompoundV2"] = "Compound__V2";
41
- StrategiesAutomation["CompoundV3"] = "Compound__V3";
42
- StrategiesAutomation["AaveV2"] = "Aave__V2";
43
- StrategiesAutomation["AaveV3"] = "Aave__V3";
44
- StrategiesAutomation["MorphoAaveV2"] = "Morpho-Aave__V2";
45
- StrategiesAutomation["Exchange"] = "Exchange";
46
- StrategiesAutomation["Spark"] = "Spark";
47
- StrategiesAutomation["CrvUSD"] = "CurveUSD";
48
- StrategiesAutomation["MorphoBlue"] = "MorphoBlue";
49
- })(StrategiesAutomation = ProtocolIdentifiers.StrategiesAutomation || (ProtocolIdentifiers.StrategiesAutomation = {}));
50
- let LegacyAutomation;
51
- (function (LegacyAutomation) {
52
- LegacyAutomation["MakerDAO"] = "MakerDAO";
53
- LegacyAutomation["CompoundV2"] = "Compound__V2";
54
- LegacyAutomation["AaveV2"] = "Aave__V2";
55
- })(LegacyAutomation = ProtocolIdentifiers.LegacyAutomation || (ProtocolIdentifiers.LegacyAutomation = {}));
56
- })(ProtocolIdentifiers = exports.ProtocolIdentifiers || (exports.ProtocolIdentifiers = {}));
57
- var Strategies;
58
- (function (Strategies) {
59
- let MainnetIds;
60
- (function (MainnetIds) {
61
- MainnetIds[MainnetIds["MAKER_CLOSE_ON_PRICE_TO_DAI"] = 7] = "MAKER_CLOSE_ON_PRICE_TO_DAI";
62
- MainnetIds[MainnetIds["MAKER_CLOSE_ON_PRICE_TO_COLL"] = 9] = "MAKER_CLOSE_ON_PRICE_TO_COLL";
63
- MainnetIds[MainnetIds["LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED"] = 10] = "LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED";
64
- MainnetIds[MainnetIds["MAKER_TRAILING_STOP_LOSS_TO_COLL"] = 11] = "MAKER_TRAILING_STOP_LOSS_TO_COLL";
65
- MainnetIds[MainnetIds["MAKER_TRAILING_STOP_LOSS_TO_DAI"] = 12] = "MAKER_TRAILING_STOP_LOSS_TO_DAI";
66
- MainnetIds[MainnetIds["LIQUITY_TRAILING_STOP_LOSS_TO_COLL"] = 13] = "LIQUITY_TRAILING_STOP_LOSS_TO_COLL";
67
- MainnetIds[MainnetIds["LIQUITY_CLOSE_ON_PRICE_TO_COLL"] = 14] = "LIQUITY_CLOSE_ON_PRICE_TO_COLL";
68
- MainnetIds[MainnetIds["CHICKEN_BONDS_REBOND"] = 31] = "CHICKEN_BONDS_REBOND";
69
- MainnetIds[MainnetIds["EXCHANGE_DCA"] = 46] = "EXCHANGE_DCA";
70
- MainnetIds[MainnetIds["EXCHANGE_LIMIT_ORDER"] = 51] = "EXCHANGE_LIMIT_ORDER";
71
- MainnetIds[MainnetIds["LIQUITY_DSR_PAYBACK"] = 69] = "LIQUITY_DSR_PAYBACK";
72
- MainnetIds[MainnetIds["LIQUITY_DSR_SUPPLY"] = 70] = "LIQUITY_DSR_SUPPLY";
73
- MainnetIds[MainnetIds["LIQUITY_DEBT_IN_FRONT_REPAY"] = 75] = "LIQUITY_DEBT_IN_FRONT_REPAY";
74
- MainnetIds[MainnetIds["CURVEUSD_PAYBACK"] = 92] = "CURVEUSD_PAYBACK";
75
- })(MainnetIds = Strategies.MainnetIds || (Strategies.MainnetIds = {}));
76
- let OptimismIds;
77
- (function (OptimismIds) {
78
- OptimismIds[OptimismIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
79
- OptimismIds[OptimismIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
80
- })(OptimismIds = Strategies.OptimismIds || (Strategies.OptimismIds = {}));
81
- let ArbitrumIds;
82
- (function (ArbitrumIds) {
83
- ArbitrumIds[ArbitrumIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
84
- ArbitrumIds[ArbitrumIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
85
- })(ArbitrumIds = Strategies.ArbitrumIds || (Strategies.ArbitrumIds = {}));
86
- let Identifiers;
87
- (function (Identifiers) {
88
- Identifiers["SavingsLiqProtection"] = "smart-savings-liquidation-protection";
89
- Identifiers["SavingsDsrPayback"] = "smart-savings-dsr-payback";
90
- Identifiers["SavingsDsrSupply"] = "smart-savings-dsr-supply";
91
- Identifiers["Repay"] = "repay";
92
- Identifiers["EoaRepay"] = "eoa-repay";
93
- Identifiers["Boost"] = "boost";
94
- Identifiers["EoaBoost"] = "eoa-boost";
95
- Identifiers["CloseToDebt"] = "close-to-debt";
96
- Identifiers["CloseToDebtWithGasPrice"] = "close-to-debt-with-gas-price";
97
- Identifiers["CloseToCollateral"] = "close-to-collateral";
98
- Identifiers["CloseToCollateralWithGasPrice"] = "close-to-collateral-with-gas-price";
99
- Identifiers["CloseOnPriceToDebt"] = "close-on-price-to-debt";
100
- Identifiers["CloseOnPriceToColl"] = "close-on-price-to-collateral";
101
- Identifiers["TrailingStopToColl"] = "trailing-stop-to-collateral";
102
- Identifiers["TrailingStopToDebt"] = "trailing-stop-to-debt";
103
- Identifiers["Rebond"] = "rebond";
104
- Identifiers["Payback"] = "payback";
105
- Identifiers["BondProtection"] = "bond-protection";
106
- Identifiers["Dca"] = "dca";
107
- Identifiers["LimitOrder"] = "limit-order";
108
- Identifiers["DebtInFrontRepay"] = "debt-in-front-repay";
109
- })(Identifiers = Strategies.Identifiers || (Strategies.Identifiers = {}));
110
- let IdOverrides;
111
- (function (IdOverrides) {
112
- IdOverrides["TakeProfit"] = "take-profit";
113
- IdOverrides["StopLoss"] = "stop-loss";
114
- IdOverrides["TakeProfitWithGasPrice"] = "take-profit-with-gas-price";
115
- IdOverrides["StopLossWithGasPrice"] = "stop-loss-with-gas-price";
116
- IdOverrides["TrailingStop"] = "trailing-stop";
117
- IdOverrides["LeverageManagement"] = "leverage-management";
118
- IdOverrides["EoaLeverageManagement"] = "leverage-management-eoa";
119
- })(IdOverrides = Strategies.IdOverrides || (Strategies.IdOverrides = {}));
120
- })(Strategies = exports.Strategies || (exports.Strategies = {}));
121
- var Bundles;
122
- (function (Bundles) {
123
- let MainnetIds;
124
- (function (MainnetIds) {
125
- MainnetIds[MainnetIds["MAKER_REPAY_FROM_SMART_SAVINGS_YEARN"] = 0] = "MAKER_REPAY_FROM_SMART_SAVINGS_YEARN";
126
- MainnetIds[MainnetIds["MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE"] = 1] = "MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE";
127
- MainnetIds[MainnetIds["MAKER_REPAY_FROM_SMART_SAVINGS_RARI"] = 2] = "MAKER_REPAY_FROM_SMART_SAVINGS_RARI";
128
- MainnetIds[MainnetIds["COMP_V3_SW_REPAY_BUNDLE"] = 3] = "COMP_V3_SW_REPAY_BUNDLE";
129
- MainnetIds[MainnetIds["COMP_V3_SW_BOOST_BUNDLE"] = 4] = "COMP_V3_SW_BOOST_BUNDLE";
130
- MainnetIds[MainnetIds["COMP_V3_EOA_REPAY_BUNDLE"] = 5] = "COMP_V3_EOA_REPAY_BUNDLE";
131
- MainnetIds[MainnetIds["COMP_V3_EOA_BOOST_BUNDLE"] = 6] = "COMP_V3_EOA_BOOST_BUNDLE";
132
- MainnetIds[MainnetIds["LIQUITY_PAYBACK_USING_CHICKEN_BOND"] = 7] = "LIQUITY_PAYBACK_USING_CHICKEN_BOND";
133
- MainnetIds[MainnetIds["AAVE_V3_REPAY"] = 8] = "AAVE_V3_REPAY";
134
- MainnetIds[MainnetIds["AAVE_V3_BOOST"] = 9] = "AAVE_V3_BOOST";
135
- MainnetIds[MainnetIds["MAKER_REPAY"] = 10] = "MAKER_REPAY";
136
- MainnetIds[MainnetIds["MAKER_BOOST"] = 11] = "MAKER_BOOST";
137
- MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_DEBT"] = 12] = "AAVE_V3_CLOSE_TO_DEBT";
138
- MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_DEBT_WITH_GAS_PRICE"] = 24] = "AAVE_V3_CLOSE_TO_DEBT_WITH_GAS_PRICE";
139
- MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 13] = "AAVE_V3_CLOSE_TO_COLLATERAL";
140
- MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_COLLATERAL_WITH_GAS_PRICE"] = 25] = "AAVE_V3_CLOSE_TO_COLLATERAL_WITH_GAS_PRICE";
141
- MainnetIds[MainnetIds["MORPHO_AAVE_V2_REPAY"] = 14] = "MORPHO_AAVE_V2_REPAY";
142
- MainnetIds[MainnetIds["MORPHO_AAVE_V2_BOOST"] = 15] = "MORPHO_AAVE_V2_BOOST";
143
- MainnetIds[MainnetIds["LIQUITY_REPAY"] = 16] = "LIQUITY_REPAY";
144
- MainnetIds[MainnetIds["LIQUITY_BOOST"] = 17] = "LIQUITY_BOOST";
145
- MainnetIds[MainnetIds["SPARK_REPAY"] = 18] = "SPARK_REPAY";
146
- MainnetIds[MainnetIds["SPARK_BOOST"] = 19] = "SPARK_BOOST";
147
- MainnetIds[MainnetIds["SPARK_CLOSE_TO_DEBT"] = -21231230] = "SPARK_CLOSE_TO_DEBT";
148
- MainnetIds[MainnetIds["SPARK_CLOSE_TO_COLLATERAL"] = -21231231] = "SPARK_CLOSE_TO_COLLATERAL";
149
- MainnetIds[MainnetIds["AAVE_V2_REPAY"] = 22] = "AAVE_V2_REPAY";
150
- MainnetIds[MainnetIds["AAVE_V2_BOOST"] = 23] = "AAVE_V2_BOOST";
151
- MainnetIds[MainnetIds["COMP_V2_REPAY"] = 20] = "COMP_V2_REPAY";
152
- MainnetIds[MainnetIds["COMP_V2_BOOST"] = 21] = "COMP_V2_BOOST";
153
- MainnetIds[MainnetIds["CRVUSD_REPAY"] = 26] = "CRVUSD_REPAY";
154
- MainnetIds[MainnetIds["CRVUSD_BOOST"] = 27] = "CRVUSD_BOOST";
155
- MainnetIds[MainnetIds["COMP_V3_SW_REPAY_V2_BUNDLE"] = 28] = "COMP_V3_SW_REPAY_V2_BUNDLE";
156
- MainnetIds[MainnetIds["COMP_V3_SW_BOOST_V2_BUNDLE"] = 29] = "COMP_V3_SW_BOOST_V2_BUNDLE";
157
- MainnetIds[MainnetIds["COMP_V3_EOA_REPAY_V2_BUNDLE"] = 30] = "COMP_V3_EOA_REPAY_V2_BUNDLE";
158
- MainnetIds[MainnetIds["COMP_V3_EOA_BOOST_V2_BUNDLE"] = 31] = "COMP_V3_EOA_BOOST_V2_BUNDLE";
159
- MainnetIds[MainnetIds["MORPHO_BLUE_REPAY"] = 32] = "MORPHO_BLUE_REPAY";
160
- MainnetIds[MainnetIds["MORPHO_BLUE_BOOST"] = 33] = "MORPHO_BLUE_BOOST";
161
- })(MainnetIds = Bundles.MainnetIds || (Bundles.MainnetIds = {}));
162
- let OptimismIds;
163
- (function (OptimismIds) {
164
- OptimismIds[OptimismIds["AAVE_V3_REPAY"] = 0] = "AAVE_V3_REPAY";
165
- OptimismIds[OptimismIds["AAVE_V3_BOOST"] = 1] = "AAVE_V3_BOOST";
166
- OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_DEBT"] = 2] = "AAVE_V3_CLOSE_TO_DEBT";
167
- OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
168
- })(OptimismIds = Bundles.OptimismIds || (Bundles.OptimismIds = {}));
169
- let ArbitrumIds;
170
- (function (ArbitrumIds) {
171
- ArbitrumIds[ArbitrumIds["AAVE_V3_REPAY"] = 0] = "AAVE_V3_REPAY";
172
- ArbitrumIds[ArbitrumIds["AAVE_V3_BOOST"] = 1] = "AAVE_V3_BOOST";
173
- ArbitrumIds[ArbitrumIds["AAVE_V3_CLOSE_TO_DEBT"] = 2] = "AAVE_V3_CLOSE_TO_DEBT";
174
- ArbitrumIds[ArbitrumIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
175
- ArbitrumIds[ArbitrumIds["COMP_V3_SW_REPAY_BUNDLE"] = 4] = "COMP_V3_SW_REPAY_BUNDLE";
176
- ArbitrumIds[ArbitrumIds["COMP_V3_SW_BOOST_BUNDLE"] = 5] = "COMP_V3_SW_BOOST_BUNDLE";
177
- })(ArbitrumIds = Bundles.ArbitrumIds || (Bundles.ArbitrumIds = {}));
178
- })(Bundles = exports.Bundles || (exports.Bundles = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Bundles = exports.Strategies = exports.ProtocolIdentifiers = exports.BundleProtocols = exports.OrderType = exports.RatioState = exports.ChainId = void 0;
4
+ var ChainId;
5
+ (function (ChainId) {
6
+ ChainId[ChainId["Ethereum"] = 1] = "Ethereum";
7
+ ChainId[ChainId["Optimism"] = 10] = "Optimism";
8
+ ChainId[ChainId["Arbitrum"] = 42161] = "Arbitrum";
9
+ })(ChainId = exports.ChainId || (exports.ChainId = {}));
10
+ var RatioState;
11
+ (function (RatioState) {
12
+ RatioState[RatioState["OVER"] = 0] = "OVER";
13
+ RatioState[RatioState["UNDER"] = 1] = "UNDER";
14
+ })(RatioState = exports.RatioState || (exports.RatioState = {}));
15
+ var OrderType;
16
+ (function (OrderType) {
17
+ OrderType[OrderType["TAKE_PROFIT"] = 0] = "TAKE_PROFIT";
18
+ OrderType[OrderType["STOP_LOSS"] = 1] = "STOP_LOSS";
19
+ })(OrderType = exports.OrderType || (exports.OrderType = {}));
20
+ var BundleProtocols;
21
+ (function (BundleProtocols) {
22
+ BundleProtocols["MStable"] = "mstable";
23
+ BundleProtocols["Yearn"] = "yearn";
24
+ BundleProtocols["Rari"] = "rari";
25
+ })(BundleProtocols = exports.BundleProtocols || (exports.BundleProtocols = {}));
26
+ /**
27
+ * @dev Follow the naming convention:
28
+ * - Enum name consists of two parts, name and version
29
+ * - Name should be human-readable name of the protocol, it can include spaces or any characters needed
30
+ * - Version should be separated from the name with double underscores `__` (If there is no version leave it out)
31
+ * - Example `Name of ThePROTOCOL__v1` (Without version `Name of ThePROTOCOL`)
32
+ */
33
+ var ProtocolIdentifiers;
34
+ (function (ProtocolIdentifiers) {
35
+ let StrategiesAutomation;
36
+ (function (StrategiesAutomation) {
37
+ StrategiesAutomation["MakerDAO"] = "MakerDAO";
38
+ StrategiesAutomation["Liquity"] = "Liquity";
39
+ StrategiesAutomation["ChickenBonds"] = "Chicken Bonds";
40
+ StrategiesAutomation["CompoundV2"] = "Compound__V2";
41
+ StrategiesAutomation["CompoundV3"] = "Compound__V3";
42
+ StrategiesAutomation["AaveV2"] = "Aave__V2";
43
+ StrategiesAutomation["AaveV3"] = "Aave__V3";
44
+ StrategiesAutomation["MorphoAaveV2"] = "Morpho-Aave__V2";
45
+ StrategiesAutomation["Exchange"] = "Exchange";
46
+ StrategiesAutomation["Spark"] = "Spark";
47
+ StrategiesAutomation["CrvUSD"] = "CurveUSD";
48
+ StrategiesAutomation["MorphoBlue"] = "MorphoBlue";
49
+ })(StrategiesAutomation = ProtocolIdentifiers.StrategiesAutomation || (ProtocolIdentifiers.StrategiesAutomation = {}));
50
+ let LegacyAutomation;
51
+ (function (LegacyAutomation) {
52
+ LegacyAutomation["MakerDAO"] = "MakerDAO";
53
+ LegacyAutomation["CompoundV2"] = "Compound__V2";
54
+ LegacyAutomation["AaveV2"] = "Aave__V2";
55
+ })(LegacyAutomation = ProtocolIdentifiers.LegacyAutomation || (ProtocolIdentifiers.LegacyAutomation = {}));
56
+ })(ProtocolIdentifiers = exports.ProtocolIdentifiers || (exports.ProtocolIdentifiers = {}));
57
+ var Strategies;
58
+ (function (Strategies) {
59
+ let MainnetIds;
60
+ (function (MainnetIds) {
61
+ MainnetIds[MainnetIds["MAKER_CLOSE_ON_PRICE_TO_DAI"] = 7] = "MAKER_CLOSE_ON_PRICE_TO_DAI";
62
+ MainnetIds[MainnetIds["MAKER_CLOSE_ON_PRICE_TO_COLL"] = 9] = "MAKER_CLOSE_ON_PRICE_TO_COLL";
63
+ MainnetIds[MainnetIds["LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED"] = 10] = "LIQUITY_CLOSE_ON_PRICE_TO_COLL_DEPRECATED";
64
+ MainnetIds[MainnetIds["MAKER_TRAILING_STOP_LOSS_TO_COLL"] = 11] = "MAKER_TRAILING_STOP_LOSS_TO_COLL";
65
+ MainnetIds[MainnetIds["MAKER_TRAILING_STOP_LOSS_TO_DAI"] = 12] = "MAKER_TRAILING_STOP_LOSS_TO_DAI";
66
+ MainnetIds[MainnetIds["LIQUITY_TRAILING_STOP_LOSS_TO_COLL"] = 13] = "LIQUITY_TRAILING_STOP_LOSS_TO_COLL";
67
+ MainnetIds[MainnetIds["LIQUITY_CLOSE_ON_PRICE_TO_COLL"] = 14] = "LIQUITY_CLOSE_ON_PRICE_TO_COLL";
68
+ MainnetIds[MainnetIds["CHICKEN_BONDS_REBOND"] = 31] = "CHICKEN_BONDS_REBOND";
69
+ MainnetIds[MainnetIds["EXCHANGE_DCA"] = 46] = "EXCHANGE_DCA";
70
+ MainnetIds[MainnetIds["EXCHANGE_LIMIT_ORDER"] = 51] = "EXCHANGE_LIMIT_ORDER";
71
+ MainnetIds[MainnetIds["LIQUITY_DSR_PAYBACK"] = 69] = "LIQUITY_DSR_PAYBACK";
72
+ MainnetIds[MainnetIds["LIQUITY_DSR_SUPPLY"] = 70] = "LIQUITY_DSR_SUPPLY";
73
+ MainnetIds[MainnetIds["LIQUITY_DEBT_IN_FRONT_REPAY"] = 75] = "LIQUITY_DEBT_IN_FRONT_REPAY";
74
+ MainnetIds[MainnetIds["CURVEUSD_PAYBACK"] = 92] = "CURVEUSD_PAYBACK";
75
+ })(MainnetIds = Strategies.MainnetIds || (Strategies.MainnetIds = {}));
76
+ let OptimismIds;
77
+ (function (OptimismIds) {
78
+ OptimismIds[OptimismIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
79
+ OptimismIds[OptimismIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
80
+ })(OptimismIds = Strategies.OptimismIds || (Strategies.OptimismIds = {}));
81
+ let ArbitrumIds;
82
+ (function (ArbitrumIds) {
83
+ ArbitrumIds[ArbitrumIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
84
+ ArbitrumIds[ArbitrumIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
85
+ })(ArbitrumIds = Strategies.ArbitrumIds || (Strategies.ArbitrumIds = {}));
86
+ let Identifiers;
87
+ (function (Identifiers) {
88
+ Identifiers["SavingsLiqProtection"] = "smart-savings-liquidation-protection";
89
+ Identifiers["SavingsDsrPayback"] = "smart-savings-dsr-payback";
90
+ Identifiers["SavingsDsrSupply"] = "smart-savings-dsr-supply";
91
+ Identifiers["Repay"] = "repay";
92
+ Identifiers["EoaRepay"] = "eoa-repay";
93
+ Identifiers["Boost"] = "boost";
94
+ Identifiers["EoaBoost"] = "eoa-boost";
95
+ Identifiers["CloseToDebt"] = "close-to-debt";
96
+ Identifiers["CloseToDebtWithGasPrice"] = "close-to-debt-with-gas-price";
97
+ Identifiers["CloseToCollateral"] = "close-to-collateral";
98
+ Identifiers["CloseToCollateralWithGasPrice"] = "close-to-collateral-with-gas-price";
99
+ Identifiers["CloseOnPriceToDebt"] = "close-on-price-to-debt";
100
+ Identifiers["CloseOnPriceToColl"] = "close-on-price-to-collateral";
101
+ Identifiers["TrailingStopToColl"] = "trailing-stop-to-collateral";
102
+ Identifiers["TrailingStopToDebt"] = "trailing-stop-to-debt";
103
+ Identifiers["Rebond"] = "rebond";
104
+ Identifiers["Payback"] = "payback";
105
+ Identifiers["BondProtection"] = "bond-protection";
106
+ Identifiers["Dca"] = "dca";
107
+ Identifiers["LimitOrder"] = "limit-order";
108
+ Identifiers["DebtInFrontRepay"] = "debt-in-front-repay";
109
+ })(Identifiers = Strategies.Identifiers || (Strategies.Identifiers = {}));
110
+ let IdOverrides;
111
+ (function (IdOverrides) {
112
+ IdOverrides["TakeProfit"] = "take-profit";
113
+ IdOverrides["StopLoss"] = "stop-loss";
114
+ IdOverrides["TakeProfitWithGasPrice"] = "take-profit-with-gas-price";
115
+ IdOverrides["StopLossWithGasPrice"] = "stop-loss-with-gas-price";
116
+ IdOverrides["TrailingStop"] = "trailing-stop";
117
+ IdOverrides["LeverageManagement"] = "leverage-management";
118
+ IdOverrides["EoaLeverageManagement"] = "leverage-management-eoa";
119
+ })(IdOverrides = Strategies.IdOverrides || (Strategies.IdOverrides = {}));
120
+ })(Strategies = exports.Strategies || (exports.Strategies = {}));
121
+ var Bundles;
122
+ (function (Bundles) {
123
+ let MainnetIds;
124
+ (function (MainnetIds) {
125
+ MainnetIds[MainnetIds["MAKER_REPAY_FROM_SMART_SAVINGS_YEARN"] = 0] = "MAKER_REPAY_FROM_SMART_SAVINGS_YEARN";
126
+ MainnetIds[MainnetIds["MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE"] = 1] = "MAKER_REPAY_FROM_SMART_SAVINGS_MSTABLE";
127
+ MainnetIds[MainnetIds["MAKER_REPAY_FROM_SMART_SAVINGS_RARI"] = 2] = "MAKER_REPAY_FROM_SMART_SAVINGS_RARI";
128
+ MainnetIds[MainnetIds["COMP_V3_SW_REPAY_BUNDLE"] = 3] = "COMP_V3_SW_REPAY_BUNDLE";
129
+ MainnetIds[MainnetIds["COMP_V3_SW_BOOST_BUNDLE"] = 4] = "COMP_V3_SW_BOOST_BUNDLE";
130
+ MainnetIds[MainnetIds["COMP_V3_EOA_REPAY_BUNDLE"] = 5] = "COMP_V3_EOA_REPAY_BUNDLE";
131
+ MainnetIds[MainnetIds["COMP_V3_EOA_BOOST_BUNDLE"] = 6] = "COMP_V3_EOA_BOOST_BUNDLE";
132
+ MainnetIds[MainnetIds["LIQUITY_PAYBACK_USING_CHICKEN_BOND"] = 7] = "LIQUITY_PAYBACK_USING_CHICKEN_BOND";
133
+ MainnetIds[MainnetIds["AAVE_V3_REPAY"] = 8] = "AAVE_V3_REPAY";
134
+ MainnetIds[MainnetIds["AAVE_V3_BOOST"] = 9] = "AAVE_V3_BOOST";
135
+ MainnetIds[MainnetIds["MAKER_REPAY"] = 10] = "MAKER_REPAY";
136
+ MainnetIds[MainnetIds["MAKER_BOOST"] = 11] = "MAKER_BOOST";
137
+ MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_DEBT"] = 12] = "AAVE_V3_CLOSE_TO_DEBT";
138
+ MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_DEBT_WITH_GAS_PRICE"] = 24] = "AAVE_V3_CLOSE_TO_DEBT_WITH_GAS_PRICE";
139
+ MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 13] = "AAVE_V3_CLOSE_TO_COLLATERAL";
140
+ MainnetIds[MainnetIds["AAVE_V3_CLOSE_TO_COLLATERAL_WITH_GAS_PRICE"] = 25] = "AAVE_V3_CLOSE_TO_COLLATERAL_WITH_GAS_PRICE";
141
+ MainnetIds[MainnetIds["MORPHO_AAVE_V2_REPAY"] = 14] = "MORPHO_AAVE_V2_REPAY";
142
+ MainnetIds[MainnetIds["MORPHO_AAVE_V2_BOOST"] = 15] = "MORPHO_AAVE_V2_BOOST";
143
+ MainnetIds[MainnetIds["LIQUITY_REPAY"] = 16] = "LIQUITY_REPAY";
144
+ MainnetIds[MainnetIds["LIQUITY_BOOST"] = 17] = "LIQUITY_BOOST";
145
+ MainnetIds[MainnetIds["SPARK_REPAY"] = 18] = "SPARK_REPAY";
146
+ MainnetIds[MainnetIds["SPARK_BOOST"] = 19] = "SPARK_BOOST";
147
+ MainnetIds[MainnetIds["SPARK_CLOSE_TO_DEBT"] = -21231230] = "SPARK_CLOSE_TO_DEBT";
148
+ MainnetIds[MainnetIds["SPARK_CLOSE_TO_COLLATERAL"] = -21231231] = "SPARK_CLOSE_TO_COLLATERAL";
149
+ MainnetIds[MainnetIds["AAVE_V2_REPAY"] = 22] = "AAVE_V2_REPAY";
150
+ MainnetIds[MainnetIds["AAVE_V2_BOOST"] = 23] = "AAVE_V2_BOOST";
151
+ MainnetIds[MainnetIds["COMP_V2_REPAY"] = 20] = "COMP_V2_REPAY";
152
+ MainnetIds[MainnetIds["COMP_V2_BOOST"] = 21] = "COMP_V2_BOOST";
153
+ MainnetIds[MainnetIds["CRVUSD_REPAY"] = 26] = "CRVUSD_REPAY";
154
+ MainnetIds[MainnetIds["CRVUSD_BOOST"] = 27] = "CRVUSD_BOOST";
155
+ MainnetIds[MainnetIds["COMP_V3_SW_REPAY_V2_BUNDLE"] = 28] = "COMP_V3_SW_REPAY_V2_BUNDLE";
156
+ MainnetIds[MainnetIds["COMP_V3_SW_BOOST_V2_BUNDLE"] = 29] = "COMP_V3_SW_BOOST_V2_BUNDLE";
157
+ MainnetIds[MainnetIds["COMP_V3_EOA_REPAY_V2_BUNDLE"] = 30] = "COMP_V3_EOA_REPAY_V2_BUNDLE";
158
+ MainnetIds[MainnetIds["COMP_V3_EOA_BOOST_V2_BUNDLE"] = 31] = "COMP_V3_EOA_BOOST_V2_BUNDLE";
159
+ MainnetIds[MainnetIds["MORPHO_BLUE_REPAY"] = 32] = "MORPHO_BLUE_REPAY";
160
+ MainnetIds[MainnetIds["MORPHO_BLUE_BOOST"] = 33] = "MORPHO_BLUE_BOOST";
161
+ MainnetIds[MainnetIds["MORPHO_BLUE_EOA_REPAY"] = 34] = "MORPHO_BLUE_EOA_REPAY";
162
+ MainnetIds[MainnetIds["MORPHO_BLUE_EOA_BOOST"] = 35] = "MORPHO_BLUE_EOA_BOOST";
163
+ })(MainnetIds = Bundles.MainnetIds || (Bundles.MainnetIds = {}));
164
+ let OptimismIds;
165
+ (function (OptimismIds) {
166
+ OptimismIds[OptimismIds["AAVE_V3_REPAY"] = 0] = "AAVE_V3_REPAY";
167
+ OptimismIds[OptimismIds["AAVE_V3_BOOST"] = 1] = "AAVE_V3_BOOST";
168
+ OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_DEBT"] = 2] = "AAVE_V3_CLOSE_TO_DEBT";
169
+ OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
170
+ })(OptimismIds = Bundles.OptimismIds || (Bundles.OptimismIds = {}));
171
+ let ArbitrumIds;
172
+ (function (ArbitrumIds) {
173
+ ArbitrumIds[ArbitrumIds["AAVE_V3_REPAY"] = 0] = "AAVE_V3_REPAY";
174
+ ArbitrumIds[ArbitrumIds["AAVE_V3_BOOST"] = 1] = "AAVE_V3_BOOST";
175
+ ArbitrumIds[ArbitrumIds["AAVE_V3_CLOSE_TO_DEBT"] = 2] = "AAVE_V3_CLOSE_TO_DEBT";
176
+ ArbitrumIds[ArbitrumIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
177
+ ArbitrumIds[ArbitrumIds["COMP_V3_SW_REPAY_BUNDLE"] = 4] = "COMP_V3_SW_REPAY_BUNDLE";
178
+ ArbitrumIds[ArbitrumIds["COMP_V3_SW_BOOST_BUNDLE"] = 5] = "COMP_V3_SW_BOOST_BUNDLE";
179
+ })(ArbitrumIds = Bundles.ArbitrumIds || (Bundles.ArbitrumIds = {}));
180
+ })(Bundles = exports.Bundles || (exports.Bundles = {}));