@defisaver/automation-sdk 3.0.7 → 3.0.8-dev2

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 +24 -45
  48. package/esm/constants/index.js +426 -395
  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 +709 -700
  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 +100 -87
  62. package/esm/services/strategySubService.js +264 -257
  63. package/esm/services/strategySubService.test.d.ts +1 -1
  64. package/esm/services/strategySubService.test.js +934 -894
  65. package/esm/services/subDataService.d.ts +192 -181
  66. package/esm/services/subDataService.js +475 -443
  67. package/esm/services/subDataService.test.d.ts +1 -1
  68. package/esm/services/subDataService.test.js +1282 -1225
  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 +168 -160
  96. package/esm/types/enums.js +188 -180
  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 +441 -409
  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 +917 -904
  131. package/src/services/strategySubService.test.ts +1119 -1065
  132. package/src/services/strategySubService.ts +518 -496
  133. package/src/services/subDataService.test.ts +1387 -1326
  134. package/src/services/subDataService.ts +645 -595
  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 +182 -174
  140. package/src/types/index.ts +262 -262
  141. package/tsconfig.json +79 -79
  142. package/umd/index.js +120 -17
  143. package/webpack.umd.js +52 -52
package/tsconfig.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
-
5
- /* Basic Options */
6
- // "incremental": true, /* Enable incremental compilation */
7
- "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8
- "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9
- // "lib": [], /* Specify library files to be included in the compilation. */
10
- "allowJs": true, /* Allow javascript files to be compiled. */
11
- // "checkJs": true, /* Report errors in .js files. */
12
- // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
13
- "declaration": true, /* Generates corresponding '.d.ts' file. */
14
- // "emitDeclarationOnly": false,
15
- // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
16
- // "sourceMap": true, /* Generates corresponding '.map' file. */
17
- // "outFile": "./", /* Concatenate and emit output to single file. */
18
- "outDir": "./esm/", /* Redirect output structure to the directory. */
19
- // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
20
- // "composite": true, /* Enable project compilation */
21
- // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
22
- // "removeComments": true, /* Do not emit comments to output. */
23
- // "noEmit": true, /* Do not emit outputs. */
24
- // "importHelpers": true, /* Import emit helpers from 'tslib'. */
25
- // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
26
- // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
27
-
28
- /* Strict Type-Checking Options */
29
- "strict": true, /* Enable all strict type-checking options. */
30
- // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
31
- // "strictNullChecks": true, /* Enable strict null checks. */
32
- // "strictFunctionTypes": true, /* Enable strict checking of function types. */
33
- // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
34
- // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
35
- // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
36
- // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
37
- "resolveJsonModule": true,
38
-
39
- /* Additional Checks */
40
- // "noUnusedLocals": true, /* Report errors on unused locals. */
41
- // "noUnusedParameters": true, /* Report errors on unused parameters. */
42
- // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
43
- // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
44
- // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
45
-
46
- /* Module Resolution Options */
47
- "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
48
- // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
49
- // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
50
- // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
51
- //"typeRoots": ["utils.ts"], /* List of folders to include type definitions from. */
52
- //"types": ["./src/utils.ts"], /* Type declaration files to be included in compilation. */
53
- // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
54
- "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
55
- // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
56
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
57
-
58
- /* Source Map Options */
59
- // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
60
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
61
- // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
62
- // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
63
-
64
- /* Experimental Options */
65
- // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
66
- // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
67
-
68
- /* Advanced Options */
69
- "skipLibCheck": true, /* Skip type checking of declaration files. */
70
- "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
71
- },
72
- "include": [
73
- "./src/**/*",
74
- ],
75
- "typedocOptions": {
76
- "entryPoints": ["./src/index.ts"],
77
- "out": "docs",
78
- }
79
- }
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+
5
+ /* Basic Options */
6
+ // "incremental": true, /* Enable incremental compilation */
7
+ "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8
+ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9
+ // "lib": [], /* Specify library files to be included in the compilation. */
10
+ "allowJs": true, /* Allow javascript files to be compiled. */
11
+ // "checkJs": true, /* Report errors in .js files. */
12
+ // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
13
+ "declaration": true, /* Generates corresponding '.d.ts' file. */
14
+ // "emitDeclarationOnly": false,
15
+ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
16
+ // "sourceMap": true, /* Generates corresponding '.map' file. */
17
+ // "outFile": "./", /* Concatenate and emit output to single file. */
18
+ "outDir": "./esm/", /* Redirect output structure to the directory. */
19
+ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
20
+ // "composite": true, /* Enable project compilation */
21
+ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
22
+ // "removeComments": true, /* Do not emit comments to output. */
23
+ // "noEmit": true, /* Do not emit outputs. */
24
+ // "importHelpers": true, /* Import emit helpers from 'tslib'. */
25
+ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
26
+ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
27
+
28
+ /* Strict Type-Checking Options */
29
+ "strict": true, /* Enable all strict type-checking options. */
30
+ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
31
+ // "strictNullChecks": true, /* Enable strict null checks. */
32
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
33
+ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
34
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
35
+ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
36
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
37
+ "resolveJsonModule": true,
38
+
39
+ /* Additional Checks */
40
+ // "noUnusedLocals": true, /* Report errors on unused locals. */
41
+ // "noUnusedParameters": true, /* Report errors on unused parameters. */
42
+ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
43
+ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
44
+ // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
45
+
46
+ /* Module Resolution Options */
47
+ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
48
+ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
49
+ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
50
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
51
+ //"typeRoots": ["utils.ts"], /* List of folders to include type definitions from. */
52
+ //"types": ["./src/utils.ts"], /* Type declaration files to be included in compilation. */
53
+ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
54
+ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
55
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
56
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
57
+
58
+ /* Source Map Options */
59
+ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
60
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
61
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
62
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
63
+
64
+ /* Experimental Options */
65
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
66
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
67
+
68
+ /* Advanced Options */
69
+ "skipLibCheck": true, /* Skip type checking of declaration files. */
70
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
71
+ },
72
+ "include": [
73
+ "./src/**/*",
74
+ ],
75
+ "typedocOptions": {
76
+ "entryPoints": ["./src/index.ts"],
77
+ "out": "docs",
78
+ }
79
+ }
package/umd/index.js CHANGED
@@ -68,6 +68,7 @@ class LegacyMakerAutomation extends _private_LegacyAutomation__WEBPACK_IMPORTED_
68
68
  "use strict";
69
69
  __webpack_require__.r(__webpack_exports__);
70
70
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
71
+ /* harmony export */ AAVE_V3_VARIABLE_BORROW_RATE: () => (/* binding */ AAVE_V3_VARIABLE_BORROW_RATE),
71
72
  /* harmony export */ ARBITRUM_BUNDLES_INFO: () => (/* binding */ ARBITRUM_BUNDLES_INFO),
72
73
  /* harmony export */ ARBITRUM_STRATEGIES_INFO: () => (/* binding */ ARBITRUM_STRATEGIES_INFO),
73
74
  /* harmony export */ BUNDLES_INFO: () => (/* binding */ BUNDLES_INFO),
@@ -91,6 +92,7 @@ __webpack_require__.r(__webpack_exports__);
91
92
 
92
93
  // General
93
94
  var ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
95
+ var AAVE_V3_VARIABLE_BORROW_RATE = 2;
94
96
  var PROTOCOLS = (() => {
95
97
  var protocolsMapping = {};
96
98
  Object.entries(_types_enums__WEBPACK_IMPORTED_MODULE_0__.ProtocolIdentifiers.StrategiesAutomation).forEach(_ref => {
@@ -183,6 +185,11 @@ var MAINNET_STRATEGIES_INFO = {
183
185
  strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.CURVEUSD_PAYBACK,
184
186
  strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Payback,
185
187
  protocol: PROTOCOLS.CrvUSD
188
+ },
189
+ [_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.AAVE_V3_OPEN_ORDER_FROM_DEBT]: {
190
+ strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.MainnetIds.AAVE_V3_OPEN_ORDER_FROM_DEBT,
191
+ strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.OpenOrderFromDebt,
192
+ protocol: PROTOCOLS.AaveV3
186
193
  }
187
194
  };
188
195
  var OPTIMISM_STRATEGIES_INFO = {
@@ -195,6 +202,11 @@ var OPTIMISM_STRATEGIES_INFO = {
195
202
  strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.OptimismIds.EXCHANGE_LIMIT_ORDER,
196
203
  strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.LimitOrder,
197
204
  protocol: PROTOCOLS.Exchange
205
+ },
206
+ [_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.OptimismIds.AAVE_V3_OPEN_ORDER_FROM_DEBT]: {
207
+ strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.OptimismIds.AAVE_V3_OPEN_ORDER_FROM_DEBT,
208
+ strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.OpenOrderFromDebt,
209
+ protocol: PROTOCOLS.AaveV3
198
210
  }
199
211
  };
200
212
  var ARBITRUM_STRATEGIES_INFO = {
@@ -207,6 +219,11 @@ var ARBITRUM_STRATEGIES_INFO = {
207
219
  strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.ArbitrumIds.EXCHANGE_LIMIT_ORDER,
208
220
  strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.LimitOrder,
209
221
  protocol: PROTOCOLS.Exchange
222
+ },
223
+ [_types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.ArbitrumIds.AAVE_V3_OPEN_ORDER_FROM_DEBT]: {
224
+ strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.ArbitrumIds.AAVE_V3_OPEN_ORDER_FROM_DEBT,
225
+ strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.OpenOrderFromDebt,
226
+ protocol: PROTOCOLS.AaveV3
210
227
  }
211
228
  };
212
229
  var STRATEGIES_INFO = {
@@ -417,6 +434,11 @@ var MAINNET_BUNDLES_INFO = {
417
434
  strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.MORPHO_BLUE_EOA_BOOST,
418
435
  strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.EoaBoost,
419
436
  protocol: PROTOCOLS.MorphoBlue
437
+ },
438
+ [_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.AAVE_V3_OPEN_ORDER_FROM_COLLATERAL]: {
439
+ strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.MainnetIds.AAVE_V3_OPEN_ORDER_FROM_COLLATERAL,
440
+ strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.OpenOrderFromCollateral,
441
+ protocol: PROTOCOLS.AaveV3
420
442
  }
421
443
  };
422
444
  var OPTIMISM_BUNDLES_INFO = {
@@ -439,6 +461,11 @@ var OPTIMISM_BUNDLES_INFO = {
439
461
  strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_CLOSE_TO_COLLATERAL,
440
462
  strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.CloseToCollateral,
441
463
  protocol: PROTOCOLS.AaveV3
464
+ },
465
+ [_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_OPEN_ORDER_FROM_COLLATERAL]: {
466
+ strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.OptimismIds.AAVE_V3_OPEN_ORDER_FROM_COLLATERAL,
467
+ strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.OpenOrderFromCollateral,
468
+ protocol: PROTOCOLS.AaveV3
442
469
  }
443
470
  };
444
471
  var ARBITRUM_BUNDLES_INFO = {
@@ -471,6 +498,11 @@ var ARBITRUM_BUNDLES_INFO = {
471
498
  strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.COMP_V3_SW_REPAY_BUNDLE,
472
499
  strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.Repay,
473
500
  protocol: PROTOCOLS.CompoundV3
501
+ },
502
+ [_types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_OPEN_ORDER_FROM_COLLATERAL]: {
503
+ strategyOrBundleId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Bundles.ArbitrumIds.AAVE_V3_OPEN_ORDER_FROM_COLLATERAL,
504
+ strategyId: _types_enums__WEBPACK_IMPORTED_MODULE_0__.Strategies.Identifiers.OpenOrderFromCollateral,
505
+ protocol: PROTOCOLS.AaveV3
474
506
  }
475
507
  };
476
508
  var BUNDLES_INFO = {
@@ -517,12 +549,12 @@ var OrderType;
517
549
  })(OrderType || (OrderType = {}));
518
550
  var BundleProtocols;
519
551
 
520
- /**
521
- * @dev Follow the naming convention:
522
- * - Enum name consists of two parts, name and version
523
- * - Name should be human-readable name of the protocol, it can include spaces or any characters needed
524
- * - Version should be separated from the name with double underscores `__` (If there is no version leave it out)
525
- * - Example `Name of ThePROTOCOL__v1` (Without version `Name of ThePROTOCOL`)
552
+ /**
553
+ * @dev Follow the naming convention:
554
+ * - Enum name consists of two parts, name and version
555
+ * - Name should be human-readable name of the protocol, it can include spaces or any characters needed
556
+ * - Version should be separated from the name with double underscores `__` (If there is no version leave it out)
557
+ * - Example `Name of ThePROTOCOL__v1` (Without version `Name of ThePROTOCOL`)
526
558
  */
527
559
  (function (BundleProtocols) {
528
560
  BundleProtocols["MStable"] = "mstable";
@@ -573,18 +605,21 @@ var Strategies;
573
605
  MainnetIds[MainnetIds["LIQUITY_DSR_SUPPLY"] = 70] = "LIQUITY_DSR_SUPPLY";
574
606
  MainnetIds[MainnetIds["LIQUITY_DEBT_IN_FRONT_REPAY"] = 75] = "LIQUITY_DEBT_IN_FRONT_REPAY";
575
607
  MainnetIds[MainnetIds["CURVEUSD_PAYBACK"] = 92] = "CURVEUSD_PAYBACK";
608
+ MainnetIds[MainnetIds["AAVE_V3_OPEN_ORDER_FROM_DEBT"] = 96] = "AAVE_V3_OPEN_ORDER_FROM_DEBT";
576
609
  })(MainnetIds || (MainnetIds = {}));
577
610
  _Strategies.MainnetIds = MainnetIds;
578
611
  var OptimismIds;
579
612
  (function (OptimismIds) {
580
613
  OptimismIds[OptimismIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
581
614
  OptimismIds[OptimismIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
615
+ OptimismIds[OptimismIds["AAVE_V3_OPEN_ORDER_FROM_DEBT"] = 12] = "AAVE_V3_OPEN_ORDER_FROM_DEBT";
582
616
  })(OptimismIds || (OptimismIds = {}));
583
617
  _Strategies.OptimismIds = OptimismIds;
584
618
  var ArbitrumIds;
585
619
  (function (ArbitrumIds) {
586
620
  ArbitrumIds[ArbitrumIds["EXCHANGE_DCA"] = 8] = "EXCHANGE_DCA";
587
621
  ArbitrumIds[ArbitrumIds["EXCHANGE_LIMIT_ORDER"] = 9] = "EXCHANGE_LIMIT_ORDER";
622
+ ArbitrumIds[ArbitrumIds["AAVE_V3_OPEN_ORDER_FROM_DEBT"] = 16] = "AAVE_V3_OPEN_ORDER_FROM_DEBT";
588
623
  })(ArbitrumIds || (ArbitrumIds = {}));
589
624
  _Strategies.ArbitrumIds = ArbitrumIds;
590
625
  var Identifiers;
@@ -610,6 +645,8 @@ var Strategies;
610
645
  Identifiers["Dca"] = "dca";
611
646
  Identifiers["LimitOrder"] = "limit-order";
612
647
  Identifiers["DebtInFrontRepay"] = "debt-in-front-repay";
648
+ Identifiers["OpenOrderFromCollateral"] = "open-order-from-collateral";
649
+ Identifiers["OpenOrderFromDebt"] = "open-order-from-debt";
613
650
  })(Identifiers || (Identifiers = {}));
614
651
  _Strategies.Identifiers = Identifiers;
615
652
  var IdOverrides;
@@ -666,6 +703,7 @@ var Bundles;
666
703
  MainnetIds[MainnetIds["MORPHO_BLUE_BOOST"] = 33] = "MORPHO_BLUE_BOOST";
667
704
  MainnetIds[MainnetIds["MORPHO_BLUE_EOA_REPAY"] = 34] = "MORPHO_BLUE_EOA_REPAY";
668
705
  MainnetIds[MainnetIds["MORPHO_BLUE_EOA_BOOST"] = 35] = "MORPHO_BLUE_EOA_BOOST";
706
+ MainnetIds[MainnetIds["AAVE_V3_OPEN_ORDER_FROM_COLLATERAL"] = 36] = "AAVE_V3_OPEN_ORDER_FROM_COLLATERAL";
669
707
  })(MainnetIds || (MainnetIds = {}));
670
708
  _Bundles.MainnetIds = MainnetIds;
671
709
  var OptimismIds;
@@ -674,6 +712,7 @@ var Bundles;
674
712
  OptimismIds[OptimismIds["AAVE_V3_BOOST"] = 1] = "AAVE_V3_BOOST";
675
713
  OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_DEBT"] = 2] = "AAVE_V3_CLOSE_TO_DEBT";
676
714
  OptimismIds[OptimismIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
715
+ OptimismIds[OptimismIds["AAVE_V3_OPEN_ORDER_FROM_COLLATERAL"] = 4] = "AAVE_V3_OPEN_ORDER_FROM_COLLATERAL";
677
716
  })(OptimismIds || (OptimismIds = {}));
678
717
  _Bundles.OptimismIds = OptimismIds;
679
718
  var ArbitrumIds;
@@ -684,6 +723,7 @@ var Bundles;
684
723
  ArbitrumIds[ArbitrumIds["AAVE_V3_CLOSE_TO_COLLATERAL"] = 3] = "AAVE_V3_CLOSE_TO_COLLATERAL";
685
724
  ArbitrumIds[ArbitrumIds["COMP_V3_SW_REPAY_BUNDLE"] = 4] = "COMP_V3_SW_REPAY_BUNDLE";
686
725
  ArbitrumIds[ArbitrumIds["COMP_V3_SW_BOOST_BUNDLE"] = 5] = "COMP_V3_SW_BOOST_BUNDLE";
726
+ ArbitrumIds[ArbitrumIds["AAVE_V3_OPEN_ORDER_FROM_COLLATERAL"] = 6] = "AAVE_V3_OPEN_ORDER_FROM_COLLATERAL";
687
727
  })(ArbitrumIds || (ArbitrumIds = {}));
688
728
  _Bundles.ArbitrumIds = ArbitrumIds;
689
729
  })(Bundles || (Bundles = {}));
@@ -730,8 +770,8 @@ class Protocol {
730
770
  return this.id.split(_classPrivateFieldGet(this, _versionSeparator));
731
771
  }
732
772
 
733
- /**
734
- * @dev See naming convention at ProtocolIdentifiers declaration
773
+ /**
774
+ * @dev See naming convention at ProtocolIdentifiers declaration
735
775
  */
736
776
  getVersion() {
737
777
  return this.hasVersion() ? this.splitId().reverse()[0] : '';
@@ -789,8 +829,8 @@ class Protocol {
789
829
  return this.id.split(_classPrivateFieldGet(this, _versionSeparator));
790
830
  }
791
831
 
792
- /**
793
- * @dev See naming convention at ProtocolIdentifiers declaration
832
+ /**
833
+ * @dev See naming convention at ProtocolIdentifiers declaration
794
834
  */
795
835
  getVersion() {
796
836
  return this.hasVersion() ? this.splitId().reverse()[0] : '';
@@ -1560,8 +1600,8 @@ class StrategiesAutomation extends _Automation__WEBPACK_IMPORTED_MODULE_6__["def
1560
1600
  return (0,_services_strategiesService__WEBPACK_IMPORTED_MODULE_5__.parseStrategiesAutomatedPosition)(parseData);
1561
1601
  }
1562
1602
 
1563
- /**
1564
- * @description Removes expired Limit Order subscriptions
1603
+ /**
1604
+ * @description Removes expired Limit Order subscriptions
1565
1605
  */
1566
1606
  removeExpiredSubscriptions(subscriptions) {
1567
1607
  return subscriptions.filter(subscription => {
@@ -2347,6 +2387,16 @@ function parseMorphoBlueLeverageManagement(position, parseData) {
2347
2387
  _position.strategy.strategyId = isEOA ? _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.IdOverrides.EoaLeverageManagement : _types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.IdOverrides.LeverageManagement;
2348
2388
  return _position;
2349
2389
  }
2390
+ function parseAaveV3OpenOrderFromCollateral(position, parseData) {
2391
+ var _position = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(position);
2392
+ var {
2393
+ subStruct
2394
+ } = parseData.subscriptionEventData;
2395
+ _position.strategyData.decoded.triggerData = _triggerService__WEBPACK_IMPORTED_MODULE_6__.aaveV3QuotePriceTrigger.decode(subStruct.triggerData);
2396
+ _position.strategyData.decoded.subData = _subDataService__WEBPACK_IMPORTED_MODULE_5__.aaveV3OpenOrderSubData.decode(subStruct.subData);
2397
+ _position.positionId = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getPositionId)(_position.chainId, _position.protocol.id, _position.owner, Math.random());
2398
+ return _position;
2399
+ }
2350
2400
  var parsingMethodsMapping = {
2351
2401
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.ProtocolIdentifiers.StrategiesAutomation.MakerDAO]: {
2352
2402
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.SavingsLiqProtection]: parseMakerSavingsLiqProtection,
@@ -2377,7 +2427,8 @@ var parsingMethodsMapping = {
2377
2427
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToDebt]: parseAaveV3CloseOnPrice,
2378
2428
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToDebtWithGasPrice]: parseAaveV3CloseOnPriceWithMaximumGasPrice,
2379
2429
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToCollateral]: parseAaveV3CloseOnPrice,
2380
- [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToCollateralWithGasPrice]: parseAaveV3CloseOnPriceWithMaximumGasPrice
2430
+ [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.CloseToCollateralWithGasPrice]: parseAaveV3CloseOnPriceWithMaximumGasPrice,
2431
+ [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.OpenOrderFromCollateral]: parseAaveV3OpenOrderFromCollateral
2381
2432
  },
2382
2433
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.ProtocolIdentifiers.StrategiesAutomation.CompoundV2]: {
2383
2434
  [_types_enums__WEBPACK_IMPORTED_MODULE_3__.Strategies.Identifiers.Repay]: parseCompoundV2LeverageManagement,
@@ -19684,6 +19735,7 @@ __webpack_require__.r(__webpack_exports__);
19684
19735
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19685
19736
  /* harmony export */ aaveV2LeverageManagementSubData: () => (/* binding */ aaveV2LeverageManagementSubData),
19686
19737
  /* harmony export */ aaveV3LeverageManagementSubData: () => (/* binding */ aaveV3LeverageManagementSubData),
19738
+ /* harmony export */ aaveV3OpenOrderSubData: () => (/* binding */ aaveV3OpenOrderSubData),
19687
19739
  /* harmony export */ aaveV3QuotePriceSubData: () => (/* binding */ aaveV3QuotePriceSubData),
19688
19740
  /* harmony export */ cBondsRebondSubData: () => (/* binding */ cBondsRebondSubData),
19689
19741
  /* harmony export */ compoundV2LeverageManagementSubData: () => (/* binding */ compoundV2LeverageManagementSubData),
@@ -19957,10 +20009,10 @@ var cBondsRebondSubData = {
19957
20009
  }
19958
20010
  };
19959
20011
  var liquityPaybackUsingChickenBondSubData = {
19960
- /**
19961
- * @param sourceId bondId or subId
19962
- * @param sourceType 0 for bond, 1 for subId
19963
- * @param chainId
20012
+ /**
20013
+ * @param sourceId bondId or subId
20014
+ * @param sourceType 0 for bond, 1 for subId
20015
+ * @param chainId
19964
20016
  */
19965
20017
  encode: function encode(sourceId, sourceType) {
19966
20018
  var chainId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _types_enums__WEBPACK_IMPORTED_MODULE_5__.ChainId.Ethereum;
@@ -20179,6 +20231,35 @@ var morphoBlueLeverageManagementSubData = {
20179
20231
  };
20180
20232
  }
20181
20233
  };
20234
+ var aaveV3OpenOrderSubData = {
20235
+ encode(collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio) {
20236
+ var encodedColl = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('address', collAsset);
20237
+ var encodedCollId = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('uint8', collAssetId);
20238
+ var encodedDebt = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('address', debtAsset);
20239
+ var encodedDebtId = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('uint8', debtAssetId);
20240
+ var encodedMarket = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('address', marketAddr);
20241
+ var encodedTargetRatio = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('uint256', (0,_utils__WEBPACK_IMPORTED_MODULE_7__.ratioPercentageToWei)(targetRatio));
20242
+ var useOnBehalfEncoded = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().encodeParameter('bool', false);
20243
+ return [encodedColl, encodedCollId, encodedDebt, encodedDebtId, encodedMarket, encodedTargetRatio, useOnBehalfEncoded];
20244
+ },
20245
+ decode(subData) {
20246
+ var collAsset = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().decodeParameter('address', subData[0]);
20247
+ var collAssetId = Number(web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().decodeParameter('uint8', subData[1]));
20248
+ var debtAsset = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().decodeParameter('address', subData[2]);
20249
+ var debtAssetId = Number(web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().decodeParameter('uint8', subData[3]));
20250
+ var marketAddr = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().decodeParameter('address', subData[4]);
20251
+ var weiRatio = web3_eth_abi__WEBPACK_IMPORTED_MODULE_1___default().decodeParameter('uint256', subData[5]);
20252
+ var targetRatio = (0,_utils__WEBPACK_IMPORTED_MODULE_7__.weiToRatioPercentage)(weiRatio);
20253
+ return {
20254
+ collAsset,
20255
+ collAssetId,
20256
+ debtAsset,
20257
+ debtAssetId,
20258
+ marketAddr,
20259
+ targetRatio
20260
+ };
20261
+ }
20262
+ };
20182
20263
 
20183
20264
  /***/ }),
20184
20265
  /* 31 */
@@ -33858,6 +33939,28 @@ var aaveV3Encode = {
33858
33939
  } = triggerData;
33859
33940
  var triggerDataEncoded = _triggerService__WEBPACK_IMPORTED_MODULE_5__.aaveV3QuotePriceWithMaximumGasPriceTrigger.encode(baseTokenAddress, quoteTokenAddress, price, ratioState, maximumGasPrice);
33860
33941
  return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
33942
+ },
33943
+ openOrder(strategyOrBundleId) {
33944
+ var isBundle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
33945
+ var triggerData = arguments.length > 2 ? arguments[2] : undefined;
33946
+ var subData = arguments.length > 3 ? arguments[3] : undefined;
33947
+ var {
33948
+ collAsset,
33949
+ collAssetId,
33950
+ debtAsset,
33951
+ debtAssetId,
33952
+ marketAddr,
33953
+ targetRatio
33954
+ } = subData;
33955
+ var subDataEncoded = _subDataService__WEBPACK_IMPORTED_MODULE_4__.aaveV3OpenOrderSubData.encode(collAsset, collAssetId, debtAsset, debtAssetId, marketAddr, targetRatio);
33956
+ var {
33957
+ baseTokenAddress,
33958
+ quoteTokenAddress,
33959
+ price,
33960
+ state
33961
+ } = triggerData;
33962
+ var triggerDataEncoded = _triggerService__WEBPACK_IMPORTED_MODULE_5__.aaveV3QuotePriceTrigger.encode(baseTokenAddress, quoteTokenAddress, price, state);
33963
+ return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
33861
33964
  }
33862
33965
  };
33863
33966
  var compoundV2Encode = {
package/webpack.umd.js CHANGED
@@ -1,52 +1,52 @@
1
- const path = require('path');
2
-
3
- module.exports = {
4
- mode: "none",
5
- entry: './src/index.ts',
6
- target: 'node',
7
- output: {
8
- library: 'defisaver-sdk',
9
- libraryTarget: 'umd',
10
- path: path.resolve(__dirname, 'umd'),
11
- filename: 'index.js',
12
- globalObject: 'this'
13
- },
14
- module: {
15
- rules: [
16
- {
17
- test: /\.[tj]s$/,
18
- exclude: /node_modules/,
19
- use: {
20
- loader: "babel-loader",
21
- options: {
22
- presets: [
23
- '@babel/preset-typescript',
24
- [
25
- "@babel/preset-env",
26
- {
27
- "targets": {
28
- "esmodules": true
29
- }
30
- },
31
- ],
32
- ]
33
- }
34
- }
35
- },
36
- ]
37
- },
38
- externals: [
39
- "decimal.js",
40
- 'web3',
41
- "web3-eth-abi",
42
- "web3-utils",
43
- "@defisaver/tokens",
44
- "@ethersproject/address",
45
- "@ethersproject/solidity",
46
- "@types/web3-eth-abi",
47
- '@types/web3',
48
- "axios"],
49
- resolve: {
50
- extensions: ['.ts', '.js'],
51
- },
52
- };
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ mode: "none",
5
+ entry: './src/index.ts',
6
+ target: 'node',
7
+ output: {
8
+ library: 'defisaver-sdk',
9
+ libraryTarget: 'umd',
10
+ path: path.resolve(__dirname, 'umd'),
11
+ filename: 'index.js',
12
+ globalObject: 'this'
13
+ },
14
+ module: {
15
+ rules: [
16
+ {
17
+ test: /\.[tj]s$/,
18
+ exclude: /node_modules/,
19
+ use: {
20
+ loader: "babel-loader",
21
+ options: {
22
+ presets: [
23
+ '@babel/preset-typescript',
24
+ [
25
+ "@babel/preset-env",
26
+ {
27
+ "targets": {
28
+ "esmodules": true
29
+ }
30
+ },
31
+ ],
32
+ ]
33
+ }
34
+ }
35
+ },
36
+ ]
37
+ },
38
+ externals: [
39
+ "decimal.js",
40
+ 'web3',
41
+ "web3-eth-abi",
42
+ "web3-utils",
43
+ "@defisaver/tokens",
44
+ "@ethersproject/address",
45
+ "@ethersproject/solidity",
46
+ "@types/web3-eth-abi",
47
+ '@types/web3',
48
+ "axios"],
49
+ resolve: {
50
+ extensions: ['.ts', '.js'],
51
+ },
52
+ };