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,406 @@
1
+ {
2
+ "contractName": "IClaimable",
3
+ "abi": [
4
+ {
5
+ "anonymous": false,
6
+ "inputs": [
7
+ {
8
+ "indexed": true,
9
+ "internalType": "address",
10
+ "name": "account",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "indexed": false,
15
+ "internalType": "uint256",
16
+ "name": "amount",
17
+ "type": "uint256"
18
+ }
19
+ ],
20
+ "name": "Claim",
21
+ "type": "event"
22
+ },
23
+ {
24
+ "inputs": [],
25
+ "name": "claim",
26
+ "outputs": [
27
+ {
28
+ "internalType": "uint256",
29
+ "name": "amount",
30
+ "type": "uint256"
31
+ }
32
+ ],
33
+ "stateMutability": "nonpayable",
34
+ "type": "function"
35
+ }
36
+ ],
37
+ "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Claim\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/imx/contracts/interfaces/IClaimable.sol\":\"IClaimable\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/imx/contracts/interfaces/IClaimable.sol\":{\"keccak256\":\"0x7f94e724893f9450b25342cf35f745a8056d2a7a648a661c49ecba23c3765ddb\",\"urls\":[\"bzz-raw://d4efafed9f7465ce417b331c3832bda372d59224ccd78cc6b24e72c7d349a8fe\",\"dweb:/ipfs/QmPqNxRmjtoxJFVx2vF7ZQrqn5Zy85Ejts9PsAHQMMotjV\"]}},\"version\":1}",
38
+ "bytecode": "0x",
39
+ "deployedBytecode": "0x",
40
+ "immutableReferences": {},
41
+ "sourceMap": "",
42
+ "deployedSourceMap": "",
43
+ "source": "pragma solidity =0.6.6;\r\n\r\ninterface IClaimable {\r\n\tfunction claim() external returns (uint amount);\r\n\tevent Claim(address indexed account, uint amount);\r\n}",
44
+ "sourcePath": "C:\\Users\\simor\\Desktop\\imx\\contracts\\interfaces\\IClaimable.sol",
45
+ "ast": {
46
+ "absolutePath": "/C/Users/simor/Desktop/imx/contracts/interfaces/IClaimable.sol",
47
+ "exportedSymbols": {
48
+ "IClaimable": [
49
+ 2790
50
+ ]
51
+ },
52
+ "id": 2791,
53
+ "nodeType": "SourceUnit",
54
+ "nodes": [
55
+ {
56
+ "id": 2778,
57
+ "literals": [
58
+ "solidity",
59
+ "=",
60
+ "0.6",
61
+ ".6"
62
+ ],
63
+ "nodeType": "PragmaDirective",
64
+ "src": "0:23:11"
65
+ },
66
+ {
67
+ "abstract": false,
68
+ "baseContracts": [],
69
+ "contractDependencies": [],
70
+ "contractKind": "interface",
71
+ "documentation": null,
72
+ "fullyImplemented": false,
73
+ "id": 2790,
74
+ "linearizedBaseContracts": [
75
+ 2790
76
+ ],
77
+ "name": "IClaimable",
78
+ "nodeType": "ContractDefinition",
79
+ "nodes": [
80
+ {
81
+ "body": null,
82
+ "documentation": null,
83
+ "functionSelector": "4e71d92d",
84
+ "id": 2783,
85
+ "implemented": false,
86
+ "kind": "function",
87
+ "modifiers": [],
88
+ "name": "claim",
89
+ "nodeType": "FunctionDefinition",
90
+ "overrides": null,
91
+ "parameters": {
92
+ "id": 2779,
93
+ "nodeType": "ParameterList",
94
+ "parameters": [],
95
+ "src": "66:2:11"
96
+ },
97
+ "returnParameters": {
98
+ "id": 2782,
99
+ "nodeType": "ParameterList",
100
+ "parameters": [
101
+ {
102
+ "constant": false,
103
+ "id": 2781,
104
+ "mutability": "mutable",
105
+ "name": "amount",
106
+ "nodeType": "VariableDeclaration",
107
+ "overrides": null,
108
+ "scope": 2783,
109
+ "src": "87:11:11",
110
+ "stateVariable": false,
111
+ "storageLocation": "default",
112
+ "typeDescriptions": {
113
+ "typeIdentifier": "t_uint256",
114
+ "typeString": "uint256"
115
+ },
116
+ "typeName": {
117
+ "id": 2780,
118
+ "name": "uint",
119
+ "nodeType": "ElementaryTypeName",
120
+ "src": "87:4:11",
121
+ "typeDescriptions": {
122
+ "typeIdentifier": "t_uint256",
123
+ "typeString": "uint256"
124
+ }
125
+ },
126
+ "value": null,
127
+ "visibility": "internal"
128
+ }
129
+ ],
130
+ "src": "86:13:11"
131
+ },
132
+ "scope": 2790,
133
+ "src": "52:48:11",
134
+ "stateMutability": "nonpayable",
135
+ "virtual": false,
136
+ "visibility": "external"
137
+ },
138
+ {
139
+ "anonymous": false,
140
+ "documentation": null,
141
+ "id": 2789,
142
+ "name": "Claim",
143
+ "nodeType": "EventDefinition",
144
+ "parameters": {
145
+ "id": 2788,
146
+ "nodeType": "ParameterList",
147
+ "parameters": [
148
+ {
149
+ "constant": false,
150
+ "id": 2785,
151
+ "indexed": true,
152
+ "mutability": "mutable",
153
+ "name": "account",
154
+ "nodeType": "VariableDeclaration",
155
+ "overrides": null,
156
+ "scope": 2789,
157
+ "src": "115:23:11",
158
+ "stateVariable": false,
159
+ "storageLocation": "default",
160
+ "typeDescriptions": {
161
+ "typeIdentifier": "t_address",
162
+ "typeString": "address"
163
+ },
164
+ "typeName": {
165
+ "id": 2784,
166
+ "name": "address",
167
+ "nodeType": "ElementaryTypeName",
168
+ "src": "115:7:11",
169
+ "stateMutability": "nonpayable",
170
+ "typeDescriptions": {
171
+ "typeIdentifier": "t_address",
172
+ "typeString": "address"
173
+ }
174
+ },
175
+ "value": null,
176
+ "visibility": "internal"
177
+ },
178
+ {
179
+ "constant": false,
180
+ "id": 2787,
181
+ "indexed": false,
182
+ "mutability": "mutable",
183
+ "name": "amount",
184
+ "nodeType": "VariableDeclaration",
185
+ "overrides": null,
186
+ "scope": 2789,
187
+ "src": "140:11:11",
188
+ "stateVariable": false,
189
+ "storageLocation": "default",
190
+ "typeDescriptions": {
191
+ "typeIdentifier": "t_uint256",
192
+ "typeString": "uint256"
193
+ },
194
+ "typeName": {
195
+ "id": 2786,
196
+ "name": "uint",
197
+ "nodeType": "ElementaryTypeName",
198
+ "src": "140:4:11",
199
+ "typeDescriptions": {
200
+ "typeIdentifier": "t_uint256",
201
+ "typeString": "uint256"
202
+ }
203
+ },
204
+ "value": null,
205
+ "visibility": "internal"
206
+ }
207
+ ],
208
+ "src": "114:38:11"
209
+ },
210
+ "src": "103:50:11"
211
+ }
212
+ ],
213
+ "scope": 2791,
214
+ "src": "27:129:11"
215
+ }
216
+ ],
217
+ "src": "0:156:11"
218
+ },
219
+ "legacyAST": {
220
+ "absolutePath": "/C/Users/simor/Desktop/imx/contracts/interfaces/IClaimable.sol",
221
+ "exportedSymbols": {
222
+ "IClaimable": [
223
+ 2790
224
+ ]
225
+ },
226
+ "id": 2791,
227
+ "nodeType": "SourceUnit",
228
+ "nodes": [
229
+ {
230
+ "id": 2778,
231
+ "literals": [
232
+ "solidity",
233
+ "=",
234
+ "0.6",
235
+ ".6"
236
+ ],
237
+ "nodeType": "PragmaDirective",
238
+ "src": "0:23:11"
239
+ },
240
+ {
241
+ "abstract": false,
242
+ "baseContracts": [],
243
+ "contractDependencies": [],
244
+ "contractKind": "interface",
245
+ "documentation": null,
246
+ "fullyImplemented": false,
247
+ "id": 2790,
248
+ "linearizedBaseContracts": [
249
+ 2790
250
+ ],
251
+ "name": "IClaimable",
252
+ "nodeType": "ContractDefinition",
253
+ "nodes": [
254
+ {
255
+ "body": null,
256
+ "documentation": null,
257
+ "functionSelector": "4e71d92d",
258
+ "id": 2783,
259
+ "implemented": false,
260
+ "kind": "function",
261
+ "modifiers": [],
262
+ "name": "claim",
263
+ "nodeType": "FunctionDefinition",
264
+ "overrides": null,
265
+ "parameters": {
266
+ "id": 2779,
267
+ "nodeType": "ParameterList",
268
+ "parameters": [],
269
+ "src": "66:2:11"
270
+ },
271
+ "returnParameters": {
272
+ "id": 2782,
273
+ "nodeType": "ParameterList",
274
+ "parameters": [
275
+ {
276
+ "constant": false,
277
+ "id": 2781,
278
+ "mutability": "mutable",
279
+ "name": "amount",
280
+ "nodeType": "VariableDeclaration",
281
+ "overrides": null,
282
+ "scope": 2783,
283
+ "src": "87:11:11",
284
+ "stateVariable": false,
285
+ "storageLocation": "default",
286
+ "typeDescriptions": {
287
+ "typeIdentifier": "t_uint256",
288
+ "typeString": "uint256"
289
+ },
290
+ "typeName": {
291
+ "id": 2780,
292
+ "name": "uint",
293
+ "nodeType": "ElementaryTypeName",
294
+ "src": "87:4:11",
295
+ "typeDescriptions": {
296
+ "typeIdentifier": "t_uint256",
297
+ "typeString": "uint256"
298
+ }
299
+ },
300
+ "value": null,
301
+ "visibility": "internal"
302
+ }
303
+ ],
304
+ "src": "86:13:11"
305
+ },
306
+ "scope": 2790,
307
+ "src": "52:48:11",
308
+ "stateMutability": "nonpayable",
309
+ "virtual": false,
310
+ "visibility": "external"
311
+ },
312
+ {
313
+ "anonymous": false,
314
+ "documentation": null,
315
+ "id": 2789,
316
+ "name": "Claim",
317
+ "nodeType": "EventDefinition",
318
+ "parameters": {
319
+ "id": 2788,
320
+ "nodeType": "ParameterList",
321
+ "parameters": [
322
+ {
323
+ "constant": false,
324
+ "id": 2785,
325
+ "indexed": true,
326
+ "mutability": "mutable",
327
+ "name": "account",
328
+ "nodeType": "VariableDeclaration",
329
+ "overrides": null,
330
+ "scope": 2789,
331
+ "src": "115:23:11",
332
+ "stateVariable": false,
333
+ "storageLocation": "default",
334
+ "typeDescriptions": {
335
+ "typeIdentifier": "t_address",
336
+ "typeString": "address"
337
+ },
338
+ "typeName": {
339
+ "id": 2784,
340
+ "name": "address",
341
+ "nodeType": "ElementaryTypeName",
342
+ "src": "115:7:11",
343
+ "stateMutability": "nonpayable",
344
+ "typeDescriptions": {
345
+ "typeIdentifier": "t_address",
346
+ "typeString": "address"
347
+ }
348
+ },
349
+ "value": null,
350
+ "visibility": "internal"
351
+ },
352
+ {
353
+ "constant": false,
354
+ "id": 2787,
355
+ "indexed": false,
356
+ "mutability": "mutable",
357
+ "name": "amount",
358
+ "nodeType": "VariableDeclaration",
359
+ "overrides": null,
360
+ "scope": 2789,
361
+ "src": "140:11:11",
362
+ "stateVariable": false,
363
+ "storageLocation": "default",
364
+ "typeDescriptions": {
365
+ "typeIdentifier": "t_uint256",
366
+ "typeString": "uint256"
367
+ },
368
+ "typeName": {
369
+ "id": 2786,
370
+ "name": "uint",
371
+ "nodeType": "ElementaryTypeName",
372
+ "src": "140:4:11",
373
+ "typeDescriptions": {
374
+ "typeIdentifier": "t_uint256",
375
+ "typeString": "uint256"
376
+ }
377
+ },
378
+ "value": null,
379
+ "visibility": "internal"
380
+ }
381
+ ],
382
+ "src": "114:38:11"
383
+ },
384
+ "src": "103:50:11"
385
+ }
386
+ ],
387
+ "scope": 2791,
388
+ "src": "27:129:11"
389
+ }
390
+ ],
391
+ "src": "0:156:11"
392
+ },
393
+ "compiler": {
394
+ "name": "solc",
395
+ "version": "0.6.6+commit.6c089d02.Emscripten.clang"
396
+ },
397
+ "networks": {},
398
+ "schemaVersion": "3.3.2",
399
+ "updatedAt": "2021-03-20T20:28:28.895Z",
400
+ "devdoc": {
401
+ "methods": {}
402
+ },
403
+ "userdoc": {
404
+ "methods": {}
405
+ }
406
+ }