impermax-sdk 1.0.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 (103) hide show
  1. package/.idea/impermax-sdk.iml +12 -0
  2. package/.idea/misc.xml +6 -0
  3. package/.idea/modules.xml +8 -0
  4. package/.idea/workspace.xml +642 -0
  5. package/abis/ImpermaxABI.ts +3 -0
  6. package/abis/contracts/BAllowance.json +4735 -0
  7. package/abis/contracts/BDeployer.json +1195 -0
  8. package/abis/contracts/BInterestRateModel.json +10796 -0
  9. package/abis/contracts/BSetter.json +6219 -0
  10. package/abis/contracts/BStorage.json +2613 -0
  11. package/abis/contracts/Borrowable.json +19937 -0
  12. package/abis/contracts/CDeployer.json +1104 -0
  13. package/abis/contracts/CSetter.json +5094 -0
  14. package/abis/contracts/CStorage.json +516 -0
  15. package/abis/contracts/ClaimAggregator.json +2015 -0
  16. package/abis/contracts/Collateral.json +21615 -0
  17. package/abis/contracts/ERC20.json +819 -0
  18. package/abis/contracts/Factory.json +21986 -0
  19. package/abis/contracts/FarmingPool.json +8601 -0
  20. package/abis/contracts/IBDeployer.json +351 -0
  21. package/abis/contracts/IBorrowTracker.json +346 -0
  22. package/abis/contracts/IBorrowable.json +13207 -0
  23. package/abis/contracts/ICDeployer.json +294 -0
  24. package/abis/contracts/IClaimable.json +406 -0
  25. package/abis/contracts/ICollateral.json +8952 -0
  26. package/abis/contracts/IERC20.json +2376 -0
  27. package/abis/contracts/IFactory.json +3660 -0
  28. package/abis/contracts/IFarmingPool.json +3584 -0
  29. package/abis/contracts/IImpermaxCallee.json +679 -0
  30. package/abis/contracts/IMerkleDistributor.json +1134 -0
  31. package/abis/contracts/IPoolToken.json +5343 -0
  32. package/abis/contracts/IRouter01.json +6891 -0
  33. package/abis/contracts/IRouter02.json +7283 -0
  34. package/abis/contracts/ISimpleUniswapOracle.json +1469 -0
  35. package/abis/contracts/IStakedLPToken.json +7309 -0
  36. package/abis/contracts/IStakingRewards.json +1036 -0
  37. package/abis/contracts/IUniswapV2Callee.json +403 -0
  38. package/abis/contracts/IUniswapV2ERC20.json +3155 -0
  39. package/abis/contracts/IUniswapV2Factory.json +1690 -0
  40. package/abis/contracts/IUniswapV2Pair.json +6761 -0
  41. package/abis/contracts/IWETH.json +561 -0
  42. package/abis/contracts/ImpermaxChef.json +20945 -0
  43. package/abis/contracts/ImpermaxERC20.json +12095 -0
  44. package/abis/contracts/Math.json +1966 -0
  45. package/abis/contracts/MockERC20.json +8884 -0
  46. package/abis/contracts/PoolToken.json +10784 -0
  47. package/abis/contracts/Router01.json +43963 -0
  48. package/abis/contracts/SafeMath.json +6828 -0
  49. package/abis/contracts/SimpleUniswapOracle.json +9640 -0
  50. package/abis/contracts/TransferHelper.json +4875 -0
  51. package/abis/contracts/UQ112x112.json +1201 -0
  52. package/abis/contracts/UniswapV2ERC20.json +10969 -0
  53. package/abis/contracts/UniswapV2Factory.json +5521 -0
  54. package/abis/contracts/UniswapV2Library.json +13789 -0
  55. package/abis/contracts/UniswapV2Pair.json +30782 -0
  56. package/abis/contracts/WETH9.json +6613 -0
  57. package/config/amms.ts +199 -0
  58. package/config/contracts/claim-aggregators.ts +16 -0
  59. package/config/contracts/impermax-chef.ts +16 -0
  60. package/config/contracts/imxes.ts +16 -0
  61. package/config/contracts/merkle-distributors.ts +13 -0
  62. package/config/contracts/routers.ts +36 -0
  63. package/config/contracts/simple-uniswap-oracles.ts +33 -0
  64. package/config/contracts/weths.ts +18 -0
  65. package/config/debank-ids.ts +15 -0
  66. package/config/endpoints/merkle-distributors.ts +13 -0
  67. package/config/eth.ts +32 -0
  68. package/config/factories.ts +26 -0
  69. package/config/farms.ts +119 -0
  70. package/config/general.ts +8 -0
  71. package/config/subgraphs.ts +69 -0
  72. package/config/types.ts +81 -0
  73. package/impermax-router/Account.ts +123 -0
  74. package/impermax-router/AccountBorrowable.ts +110 -0
  75. package/impermax-router/AccountCollateral.ts +40 -0
  76. package/impermax-router/AccountLendingPool.ts +231 -0
  77. package/impermax-router/AccountPoolToken.ts +76 -0
  78. package/impermax-router/Borrowable.ts +86 -0
  79. package/impermax-router/Collateral.ts +26 -0
  80. package/impermax-router/ContractsHelper.ts +64 -0
  81. package/impermax-router/ImpermaxFactory.ts +47 -0
  82. package/impermax-router/Interactions.ts +94 -0
  83. package/impermax-router/InteractionsLendingPool.ts +129 -0
  84. package/impermax-router/InteractionsPoolToken.ts +187 -0
  85. package/impermax-router/LendingPool.ts +256 -0
  86. package/impermax-router/PoolToken.ts +112 -0
  87. package/impermax-router/index.ts +49 -0
  88. package/impermax-router/interfaces.ts +233 -0
  89. package/index.ts +5 -0
  90. package/package.json +23 -0
  91. package/subgraph/Account.ts +93 -0
  92. package/subgraph/AccountLendingPool.ts +60 -0
  93. package/subgraph/AccountPoolToken.ts +60 -0
  94. package/subgraph/LendingPool.ts +179 -0
  95. package/subgraph/PoolToken.ts +381 -0
  96. package/subgraph/PriceHelper.ts +150 -0
  97. package/subgraph/SolidexHelper.ts +54 -0
  98. package/subgraph/index.ts +166 -0
  99. package/subgraph/initializer.ts +509 -0
  100. package/subgraph/query.ts +224 -0
  101. package/tsconfig.json +16 -0
  102. package/utils/ether-utils.ts +22 -0
  103. package/utils/index.ts +12 -0
@@ -0,0 +1,351 @@
1
+ {
2
+ "contractName": "IBDeployer",
3
+ "abi": [
4
+ {
5
+ "constant": false,
6
+ "inputs": [
7
+ {
8
+ "internalType": "address",
9
+ "name": "uniswapV2Pair",
10
+ "type": "address"
11
+ },
12
+ {
13
+ "internalType": "uint8",
14
+ "name": "index",
15
+ "type": "uint8"
16
+ }
17
+ ],
18
+ "name": "deployBorrowable",
19
+ "outputs": [
20
+ {
21
+ "internalType": "address",
22
+ "name": "borrowable",
23
+ "type": "address"
24
+ }
25
+ ],
26
+ "payable": false,
27
+ "stateMutability": "nonpayable",
28
+ "type": "function"
29
+ }
30
+ ],
31
+ "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"uniswapV2Pair\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deployBorrowable\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"borrowable\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBDeployer.sol\":\"IBDeployer\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBDeployer.sol\":{\"keccak256\":\"0x355a390f6ae04754647499879c85e4c7ef044e57b8cf7e1abd7fe3151b137941\",\"urls\":[\"bzz-raw://f9c26d8987afac1db2b0885af8012ee9690e372e31ab5c1584ec2cbf7b26e915\",\"dweb:/ipfs/QmNyjWKPymsDrYNptQ1D6PQwVWmWW5rp4m73QsUocnnym3\"]}},\"version\":1}",
32
+ "bytecode": "0x",
33
+ "deployedBytecode": "0x",
34
+ "sourceMap": "",
35
+ "deployedSourceMap": "",
36
+ "source": "pragma solidity >=0.5.0;\r\n\r\ninterface IBDeployer {\r\n\tfunction deployBorrowable(address uniswapV2Pair, uint8 index) external returns (address borrowable);\r\n}",
37
+ "sourcePath": "C:\\Users\\simor\\Desktop\\impermax-x-uniswapv2-periphery\\test\\Contracts\\imx-univ2-core\\interfaces\\IBDeployer.sol",
38
+ "ast": {
39
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBDeployer.sol",
40
+ "exportedSymbols": {
41
+ "IBDeployer": [
42
+ 4932
43
+ ]
44
+ },
45
+ "id": 4933,
46
+ "nodeType": "SourceUnit",
47
+ "nodes": [
48
+ {
49
+ "id": 4922,
50
+ "literals": [
51
+ "solidity",
52
+ ">=",
53
+ "0.5",
54
+ ".0"
55
+ ],
56
+ "nodeType": "PragmaDirective",
57
+ "src": "0:24:17"
58
+ },
59
+ {
60
+ "baseContracts": [],
61
+ "contractDependencies": [],
62
+ "contractKind": "interface",
63
+ "documentation": null,
64
+ "fullyImplemented": false,
65
+ "id": 4932,
66
+ "linearizedBaseContracts": [
67
+ 4932
68
+ ],
69
+ "name": "IBDeployer",
70
+ "nodeType": "ContractDefinition",
71
+ "nodes": [
72
+ {
73
+ "body": null,
74
+ "documentation": null,
75
+ "id": 4931,
76
+ "implemented": false,
77
+ "kind": "function",
78
+ "modifiers": [],
79
+ "name": "deployBorrowable",
80
+ "nodeType": "FunctionDefinition",
81
+ "parameters": {
82
+ "id": 4927,
83
+ "nodeType": "ParameterList",
84
+ "parameters": [
85
+ {
86
+ "constant": false,
87
+ "id": 4924,
88
+ "name": "uniswapV2Pair",
89
+ "nodeType": "VariableDeclaration",
90
+ "scope": 4931,
91
+ "src": "79:21:17",
92
+ "stateVariable": false,
93
+ "storageLocation": "default",
94
+ "typeDescriptions": {
95
+ "typeIdentifier": "t_address",
96
+ "typeString": "address"
97
+ },
98
+ "typeName": {
99
+ "id": 4923,
100
+ "name": "address",
101
+ "nodeType": "ElementaryTypeName",
102
+ "src": "79:7:17",
103
+ "stateMutability": "nonpayable",
104
+ "typeDescriptions": {
105
+ "typeIdentifier": "t_address",
106
+ "typeString": "address"
107
+ }
108
+ },
109
+ "value": null,
110
+ "visibility": "internal"
111
+ },
112
+ {
113
+ "constant": false,
114
+ "id": 4926,
115
+ "name": "index",
116
+ "nodeType": "VariableDeclaration",
117
+ "scope": 4931,
118
+ "src": "102:11:17",
119
+ "stateVariable": false,
120
+ "storageLocation": "default",
121
+ "typeDescriptions": {
122
+ "typeIdentifier": "t_uint8",
123
+ "typeString": "uint8"
124
+ },
125
+ "typeName": {
126
+ "id": 4925,
127
+ "name": "uint8",
128
+ "nodeType": "ElementaryTypeName",
129
+ "src": "102:5:17",
130
+ "typeDescriptions": {
131
+ "typeIdentifier": "t_uint8",
132
+ "typeString": "uint8"
133
+ }
134
+ },
135
+ "value": null,
136
+ "visibility": "internal"
137
+ }
138
+ ],
139
+ "src": "78:36:17"
140
+ },
141
+ "returnParameters": {
142
+ "id": 4930,
143
+ "nodeType": "ParameterList",
144
+ "parameters": [
145
+ {
146
+ "constant": false,
147
+ "id": 4929,
148
+ "name": "borrowable",
149
+ "nodeType": "VariableDeclaration",
150
+ "scope": 4931,
151
+ "src": "133:18:17",
152
+ "stateVariable": false,
153
+ "storageLocation": "default",
154
+ "typeDescriptions": {
155
+ "typeIdentifier": "t_address",
156
+ "typeString": "address"
157
+ },
158
+ "typeName": {
159
+ "id": 4928,
160
+ "name": "address",
161
+ "nodeType": "ElementaryTypeName",
162
+ "src": "133:7:17",
163
+ "stateMutability": "nonpayable",
164
+ "typeDescriptions": {
165
+ "typeIdentifier": "t_address",
166
+ "typeString": "address"
167
+ }
168
+ },
169
+ "value": null,
170
+ "visibility": "internal"
171
+ }
172
+ ],
173
+ "src": "132:20:17"
174
+ },
175
+ "scope": 4932,
176
+ "src": "53:100:17",
177
+ "stateMutability": "nonpayable",
178
+ "superFunction": null,
179
+ "visibility": "external"
180
+ }
181
+ ],
182
+ "scope": 4933,
183
+ "src": "28:128:17"
184
+ }
185
+ ],
186
+ "src": "0:156:17"
187
+ },
188
+ "legacyAST": {
189
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/interfaces/IBDeployer.sol",
190
+ "exportedSymbols": {
191
+ "IBDeployer": [
192
+ 4932
193
+ ]
194
+ },
195
+ "id": 4933,
196
+ "nodeType": "SourceUnit",
197
+ "nodes": [
198
+ {
199
+ "id": 4922,
200
+ "literals": [
201
+ "solidity",
202
+ ">=",
203
+ "0.5",
204
+ ".0"
205
+ ],
206
+ "nodeType": "PragmaDirective",
207
+ "src": "0:24:17"
208
+ },
209
+ {
210
+ "baseContracts": [],
211
+ "contractDependencies": [],
212
+ "contractKind": "interface",
213
+ "documentation": null,
214
+ "fullyImplemented": false,
215
+ "id": 4932,
216
+ "linearizedBaseContracts": [
217
+ 4932
218
+ ],
219
+ "name": "IBDeployer",
220
+ "nodeType": "ContractDefinition",
221
+ "nodes": [
222
+ {
223
+ "body": null,
224
+ "documentation": null,
225
+ "id": 4931,
226
+ "implemented": false,
227
+ "kind": "function",
228
+ "modifiers": [],
229
+ "name": "deployBorrowable",
230
+ "nodeType": "FunctionDefinition",
231
+ "parameters": {
232
+ "id": 4927,
233
+ "nodeType": "ParameterList",
234
+ "parameters": [
235
+ {
236
+ "constant": false,
237
+ "id": 4924,
238
+ "name": "uniswapV2Pair",
239
+ "nodeType": "VariableDeclaration",
240
+ "scope": 4931,
241
+ "src": "79:21:17",
242
+ "stateVariable": false,
243
+ "storageLocation": "default",
244
+ "typeDescriptions": {
245
+ "typeIdentifier": "t_address",
246
+ "typeString": "address"
247
+ },
248
+ "typeName": {
249
+ "id": 4923,
250
+ "name": "address",
251
+ "nodeType": "ElementaryTypeName",
252
+ "src": "79:7:17",
253
+ "stateMutability": "nonpayable",
254
+ "typeDescriptions": {
255
+ "typeIdentifier": "t_address",
256
+ "typeString": "address"
257
+ }
258
+ },
259
+ "value": null,
260
+ "visibility": "internal"
261
+ },
262
+ {
263
+ "constant": false,
264
+ "id": 4926,
265
+ "name": "index",
266
+ "nodeType": "VariableDeclaration",
267
+ "scope": 4931,
268
+ "src": "102:11:17",
269
+ "stateVariable": false,
270
+ "storageLocation": "default",
271
+ "typeDescriptions": {
272
+ "typeIdentifier": "t_uint8",
273
+ "typeString": "uint8"
274
+ },
275
+ "typeName": {
276
+ "id": 4925,
277
+ "name": "uint8",
278
+ "nodeType": "ElementaryTypeName",
279
+ "src": "102:5:17",
280
+ "typeDescriptions": {
281
+ "typeIdentifier": "t_uint8",
282
+ "typeString": "uint8"
283
+ }
284
+ },
285
+ "value": null,
286
+ "visibility": "internal"
287
+ }
288
+ ],
289
+ "src": "78:36:17"
290
+ },
291
+ "returnParameters": {
292
+ "id": 4930,
293
+ "nodeType": "ParameterList",
294
+ "parameters": [
295
+ {
296
+ "constant": false,
297
+ "id": 4929,
298
+ "name": "borrowable",
299
+ "nodeType": "VariableDeclaration",
300
+ "scope": 4931,
301
+ "src": "133:18:17",
302
+ "stateVariable": false,
303
+ "storageLocation": "default",
304
+ "typeDescriptions": {
305
+ "typeIdentifier": "t_address",
306
+ "typeString": "address"
307
+ },
308
+ "typeName": {
309
+ "id": 4928,
310
+ "name": "address",
311
+ "nodeType": "ElementaryTypeName",
312
+ "src": "133:7:17",
313
+ "stateMutability": "nonpayable",
314
+ "typeDescriptions": {
315
+ "typeIdentifier": "t_address",
316
+ "typeString": "address"
317
+ }
318
+ },
319
+ "value": null,
320
+ "visibility": "internal"
321
+ }
322
+ ],
323
+ "src": "132:20:17"
324
+ },
325
+ "scope": 4932,
326
+ "src": "53:100:17",
327
+ "stateMutability": "nonpayable",
328
+ "superFunction": null,
329
+ "visibility": "external"
330
+ }
331
+ ],
332
+ "scope": 4933,
333
+ "src": "28:128:17"
334
+ }
335
+ ],
336
+ "src": "0:156:17"
337
+ },
338
+ "compiler": {
339
+ "name": "solc",
340
+ "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
341
+ },
342
+ "networks": {},
343
+ "schemaVersion": "3.3.2",
344
+ "updatedAt": "2021-01-07T23:07:24.813Z",
345
+ "devdoc": {
346
+ "methods": {}
347
+ },
348
+ "userdoc": {
349
+ "methods": {}
350
+ }
351
+ }