@gearbox-protocol/sdk 0.0.2

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 (640) hide show
  1. package/.idea/gearbox-sdk.iml +12 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/.prettierrc +10 -0
  5. package/README.md +4 -0
  6. package/lib/config.d.ts +1 -0
  7. package/lib/config.js +4 -0
  8. package/lib/core/constants.d.ts +17 -0
  9. package/lib/core/constants.js +36 -0
  10. package/lib/core/contracts.d.ts +64 -0
  11. package/lib/core/contracts.js +104 -0
  12. package/lib/core/contractsRegister.d.ts +2 -0
  13. package/lib/core/contractsRegister.js +43 -0
  14. package/lib/core/creditAccount.d.ts +35 -0
  15. package/lib/core/creditAccount.js +98 -0
  16. package/lib/core/creditCard.d.ts +13 -0
  17. package/lib/core/creditCard.js +2 -0
  18. package/lib/core/creditManager.d.ts +37 -0
  19. package/lib/core/creditManager.js +118 -0
  20. package/lib/core/creditOperation.d.ts +9 -0
  21. package/lib/core/creditOperation.js +2 -0
  22. package/lib/core/creditSession.d.ts +26 -0
  23. package/lib/core/creditSession.js +44 -0
  24. package/lib/core/errors.d.ts +26 -0
  25. package/lib/core/errors.js +74 -0
  26. package/lib/core/event.d.ts +42 -0
  27. package/lib/core/event.js +2 -0
  28. package/lib/core/eventOrTx.d.ts +36 -0
  29. package/lib/core/eventOrTx.js +97 -0
  30. package/lib/core/events.d.ts +369 -0
  31. package/lib/core/events.js +730 -0
  32. package/lib/core/history.d.ts +42 -0
  33. package/lib/core/history.js +2 -0
  34. package/lib/core/operations.d.ts +22 -0
  35. package/lib/core/operations.js +20 -0
  36. package/lib/core/oracles.d.ts +6 -0
  37. package/lib/core/oracles.js +2 -0
  38. package/lib/core/pool.d.ts +28 -0
  39. package/lib/core/pool.js +32 -0
  40. package/lib/core/swap.d.ts +4 -0
  41. package/lib/core/swap.js +8 -0
  42. package/lib/core/token.d.ts +3 -0
  43. package/lib/core/token.js +229 -0
  44. package/lib/core/tokenData.d.ts +28 -0
  45. package/lib/core/tokenData.js +58 -0
  46. package/lib/core/tokenDistributor.d.ts +12 -0
  47. package/lib/core/tokenDistributor.js +9 -0
  48. package/lib/core/trade.d.ts +35 -0
  49. package/lib/core/trade.js +62 -0
  50. package/lib/core/transactions.d.ts +127 -0
  51. package/lib/core/transactions.js +306 -0
  52. package/lib/index.d.ts +33 -0
  53. package/lib/index.js +47 -0
  54. package/lib/payload/creditAccount.d.ts +26 -0
  55. package/lib/payload/creditAccount.js +2 -0
  56. package/lib/payload/creditManager.d.ts +43 -0
  57. package/lib/payload/creditManager.js +2 -0
  58. package/lib/payload/creditSession.d.ts +23 -0
  59. package/lib/payload/creditSession.js +2 -0
  60. package/lib/payload/graphPayload.d.ts +9 -0
  61. package/lib/payload/graphPayload.js +2 -0
  62. package/lib/payload/pool.d.ts +17 -0
  63. package/lib/payload/pool.js +3 -0
  64. package/lib/payload/token.d.ts +5 -0
  65. package/lib/payload/token.js +2 -0
  66. package/lib/types/ACL.d.ts +491 -0
  67. package/lib/types/ACLTrait.d.ts +148 -0
  68. package/lib/types/ACLTraitTest.d.ts +209 -0
  69. package/lib/types/AbstractAccountMiner.d.ts +143 -0
  70. package/lib/types/AccountFactory.d.ts +716 -0
  71. package/lib/types/AccountMinerAuction.d.ts +391 -0
  72. package/lib/types/AccountMinerMock.d.ts +241 -0
  73. package/lib/types/AccountMinerNonReceivableTest.d.ts +127 -0
  74. package/lib/types/AccountMinerOwnFunds.d.ts +218 -0
  75. package/lib/types/AccountMining.d.ts +222 -0
  76. package/lib/types/AdaptersDeployer.d.ts +262 -0
  77. package/lib/types/AddressProvider.d.ts +912 -0
  78. package/lib/types/AggregatorV3Interface.d.ts +234 -0
  79. package/lib/types/ChainlinkPriceFeedMock.d.ts +215 -0
  80. package/lib/types/ContractsRegister.d.ts +398 -0
  81. package/lib/types/CoreDeployer.d.ts +394 -0
  82. package/lib/types/CreditAccount.d.ts +443 -0
  83. package/lib/types/CreditFilter.d.ts +1609 -0
  84. package/lib/types/CreditFilterMock.d.ts +1687 -0
  85. package/lib/types/CreditManager.d.ts +1285 -0
  86. package/lib/types/CreditManagerMockForFilter.d.ts +605 -0
  87. package/lib/types/CreditManagerMockForPoolTest.d.ts +204 -0
  88. package/lib/types/CurveMock.d.ts +298 -0
  89. package/lib/types/CurveV1Adapter.d.ts +349 -0
  90. package/lib/types/DataCompressor.d.ts +1331 -0
  91. package/lib/types/Deployer.d.ts +224 -0
  92. package/lib/types/DieselToken.d.ts +567 -0
  93. package/lib/types/ERC165.d.ts +116 -0
  94. package/lib/types/ERC20.d.ts +411 -0
  95. package/lib/types/ERC20BlockingMock.d.ts +568 -0
  96. package/lib/types/ERC721.d.ts +625 -0
  97. package/lib/types/Errors.d.ts +1854 -0
  98. package/lib/types/ExecutorMock.d.ts +140 -0
  99. package/lib/types/FlashLoanAttacker.d.ts +170 -0
  100. package/lib/types/FuzzHarness.d.ts +124 -0
  101. package/lib/types/GearBeta.d.ts +745 -0
  102. package/lib/types/GearToken.d.ts +888 -0
  103. package/lib/types/GenesisDeployer.d.ts +282 -0
  104. package/lib/types/IAccountFactory.d.ts +317 -0
  105. package/lib/types/IAccountMiner.d.ts +124 -0
  106. package/lib/types/IAppAddressProvider.d.ts +198 -0
  107. package/lib/types/IAppCreditManager.d.ts +408 -0
  108. package/lib/types/IAppERC20.d.ts +309 -0
  109. package/lib/types/IAppPoolService.d.ts +166 -0
  110. package/lib/types/ICreditAccount.d.ts +430 -0
  111. package/lib/types/ICreditAccountData.d.ts +347 -0
  112. package/lib/types/ICreditFilter.d.ts +1162 -0
  113. package/lib/types/ICreditManager.d.ts +971 -0
  114. package/lib/types/ICurvePool.d.ts +298 -0
  115. package/lib/types/IDataCompressor.d.ts +1231 -0
  116. package/lib/types/IERC165.d.ts +116 -0
  117. package/lib/types/IERC20.d.ts +294 -0
  118. package/lib/types/IERC721.d.ts +472 -0
  119. package/lib/types/IERC721Enumerable.d.ts +564 -0
  120. package/lib/types/IERC721Metadata.d.ts +523 -0
  121. package/lib/types/IERC721Receiver.d.ts +132 -0
  122. package/lib/types/IGearToken.d.ts +527 -0
  123. package/lib/types/IInterestRateModel.d.ts +121 -0
  124. package/lib/types/IMerkleDistributor.d.ts +190 -0
  125. package/lib/types/IPoolService.d.ts +772 -0
  126. package/lib/types/IPriceOracle.d.ts +211 -0
  127. package/lib/types/IQuoter.d.ts +269 -0
  128. package/lib/types/ISwapRouter.d.ts +404 -0
  129. package/lib/types/IUniswapV2Migrator.d.ts +134 -0
  130. package/lib/types/IUniswapV2Router01.d.ts +1119 -0
  131. package/lib/types/IUniswapV2Router02.d.ts +1432 -0
  132. package/lib/types/IUniswapV3SwapCallback.d.ts +127 -0
  133. package/lib/types/IWETH.d.ts +169 -0
  134. package/lib/types/IWETHGateway.d.ts +335 -0
  135. package/lib/types/IYVault.d.ts +558 -0
  136. package/lib/types/LeveragedActions.d.ts +772 -0
  137. package/lib/types/LinearInterestRateModel.d.ts +279 -0
  138. package/lib/types/MockPoolService.d.ts +1271 -0
  139. package/lib/types/Multicall2.d.ts +449 -0
  140. package/lib/types/Ownable.d.ts +169 -0
  141. package/lib/types/PathFinder.d.ts +379 -0
  142. package/lib/types/Pausable.d.ts +105 -0
  143. package/lib/types/PercentageMathTest.d.ts +154 -0
  144. package/lib/types/PoolDeployer.d.ts +282 -0
  145. package/lib/types/PoolService.d.ts +1174 -0
  146. package/lib/types/PriceOracle.d.ts +387 -0
  147. package/lib/types/Proxy.d.ts +78 -0
  148. package/lib/types/StepVesting.d.ts +411 -0
  149. package/lib/types/TestPoolService.d.ts +1294 -0
  150. package/lib/types/TokenDistributor.d.ts +640 -0
  151. package/lib/types/TokenFeeMock.d.ts +544 -0
  152. package/lib/types/TokenMock.d.ts +531 -0
  153. package/lib/types/TreasuryMock.d.ts +86 -0
  154. package/lib/types/UniswapRouterMock.d.ts +1520 -0
  155. package/lib/types/UniswapV2Adapter.d.ts +1463 -0
  156. package/lib/types/UniswapV3Adapter.d.ts +455 -0
  157. package/lib/types/VestingDeployer.d.ts +247 -0
  158. package/lib/types/WETHGateway.d.ts +376 -0
  159. package/lib/types/WETHMock.d.ts +433 -0
  160. package/lib/types/WadRayMathTest.d.ts +316 -0
  161. package/lib/types/YearnAdapter.d.ts +609 -0
  162. package/lib/types/YearnMock.d.ts +795 -0
  163. package/lib/types/YearnPriceFeed.d.ts +399 -0
  164. package/lib/types/commons.d.ts +16 -0
  165. package/lib/types/commons.js +5 -0
  166. package/lib/types/factories/ACLTraitTest__factory.d.ts +52 -0
  167. package/lib/types/factories/ACLTraitTest__factory.js +138 -0
  168. package/lib/types/factories/ACLTrait__factory.d.ts +31 -0
  169. package/lib/types/factories/ACLTrait__factory.js +75 -0
  170. package/lib/types/factories/ACL__factory.d.ts +45 -0
  171. package/lib/types/factories/ACL__factory.js +317 -0
  172. package/lib/types/factories/AbstractAccountMiner__factory.d.ts +30 -0
  173. package/lib/types/factories/AbstractAccountMiner__factory.js +61 -0
  174. package/lib/types/factories/AccountFactory__factory.d.ts +72 -0
  175. package/lib/types/factories/AccountFactory__factory.js +508 -0
  176. package/lib/types/factories/AccountMinerAuction__factory.js +304 -0
  177. package/lib/types/factories/AccountMinerMock__factory.js +196 -0
  178. package/lib/types/factories/AccountMinerNonReceivableTest__factory.js +84 -0
  179. package/lib/types/factories/AccountMinerOwnFunds__factory.js +181 -0
  180. package/lib/types/factories/AccountMining__factory.d.ts +56 -0
  181. package/lib/types/factories/AccountMining__factory.js +192 -0
  182. package/lib/types/factories/AdaptersDeployer__factory.d.ts +85 -0
  183. package/lib/types/factories/AdaptersDeployer__factory.js +202 -0
  184. package/lib/types/factories/AddressProvider__factory.d.ts +52 -0
  185. package/lib/types/factories/AddressProvider__factory.js +582 -0
  186. package/lib/types/factories/AggregatorV3Interface__factory.d.ts +22 -0
  187. package/lib/types/factories/AggregatorV3Interface__factory.js +133 -0
  188. package/lib/types/factories/ChainlinkPriceFeedMock__factory.d.ts +42 -0
  189. package/lib/types/factories/ChainlinkPriceFeedMock__factory.js +193 -0
  190. package/lib/types/factories/ContractsRegister__factory.d.ts +56 -0
  191. package/lib/types/factories/ContractsRegister__factory.js +310 -0
  192. package/lib/types/factories/CoreDeployer__factory.js +331 -0
  193. package/lib/types/factories/CreditAccount__factory.d.ts +32 -0
  194. package/lib/types/factories/CreditAccount__factory.js +262 -0
  195. package/lib/types/factories/CreditFilterMock__factory.d.ts +56 -0
  196. package/lib/types/factories/CreditFilterMock__factory.js +1083 -0
  197. package/lib/types/factories/CreditFilter__factory.d.ts +56 -0
  198. package/lib/types/factories/CreditFilter__factory.js +1047 -0
  199. package/lib/types/factories/CreditManagerMockForFilter__factory.d.ts +38 -0
  200. package/lib/types/factories/CreditManagerMockForFilter__factory.js +324 -0
  201. package/lib/types/factories/CreditManagerMockForPoolTest__factory.d.ts +48 -0
  202. package/lib/types/factories/CreditManagerMockForPoolTest__factory.js +131 -0
  203. package/lib/types/factories/CreditManager__factory.d.ts +77 -0
  204. package/lib/types/factories/CreditManager__factory.js +1030 -0
  205. package/lib/types/factories/CurveMock__factory.d.ts +42 -0
  206. package/lib/types/factories/CurveMock__factory.js +210 -0
  207. package/lib/types/factories/CurveV1Adapter__factory.d.ts +42 -0
  208. package/lib/types/factories/CurveV1Adapter__factory.js +254 -0
  209. package/lib/types/factories/DataCompressor__factory.d.ts +71 -0
  210. package/lib/types/factories/DataCompressor__factory.js +944 -0
  211. package/lib/types/factories/Deployer__factory.js +248 -0
  212. package/lib/types/factories/DieselToken__factory.d.ts +56 -0
  213. package/lib/types/factories/DieselToken__factory.js +432 -0
  214. package/lib/types/factories/ERC165__factory.d.ts +22 -0
  215. package/lib/types/factories/ERC165__factory.js +41 -0
  216. package/lib/types/factories/ERC20BlockingMock__factory.d.ts +56 -0
  217. package/lib/types/factories/ERC20BlockingMock__factory.js +429 -0
  218. package/lib/types/factories/ERC20__factory.d.ts +56 -0
  219. package/lib/types/factories/ERC20__factory.js +339 -0
  220. package/lib/types/factories/ERC721__factory.d.ts +56 -0
  221. package/lib/types/factories/ERC721__factory.js +468 -0
  222. package/lib/types/factories/Errors__factory.d.ts +28 -0
  223. package/lib/types/factories/Errors__factory.js +1015 -0
  224. package/lib/types/factories/ExecutorMock__factory.d.ts +38 -0
  225. package/lib/types/factories/ExecutorMock__factory.js +103 -0
  226. package/lib/types/factories/FlashLoanAttacker__factory.d.ts +48 -0
  227. package/lib/types/factories/FlashLoanAttacker__factory.js +117 -0
  228. package/lib/types/factories/FuzzHarness__factory.d.ts +38 -0
  229. package/lib/types/factories/FuzzHarness__factory.js +92 -0
  230. package/lib/types/factories/GearBeta__factory.d.ts +52 -0
  231. package/lib/types/factories/GearBeta__factory.js +527 -0
  232. package/lib/types/factories/GearToken__factory.d.ts +56 -0
  233. package/lib/types/factories/GearToken__factory.js +708 -0
  234. package/lib/types/factories/GenesisDeployer__factory.d.ts +108 -0
  235. package/lib/types/factories/GenesisDeployer__factory.js +231 -0
  236. package/lib/types/factories/IAccountFactory__factory.d.ts +35 -0
  237. package/lib/types/factories/IAccountFactory__factory.js +226 -0
  238. package/lib/types/factories/IAccountMiner__factory.d.ts +28 -0
  239. package/lib/types/factories/IAccountMiner__factory.js +48 -0
  240. package/lib/types/factories/IAppAddressProvider__factory.d.ts +18 -0
  241. package/lib/types/factories/IAppAddressProvider__factory.js +100 -0
  242. package/lib/types/factories/IAppCreditManager__factory.d.ts +42 -0
  243. package/lib/types/factories/IAppCreditManager__factory.js +204 -0
  244. package/lib/types/factories/IAppERC20__factory.d.ts +22 -0
  245. package/lib/types/factories/IAppERC20__factory.js +194 -0
  246. package/lib/types/factories/IAppPoolService__factory.d.ts +22 -0
  247. package/lib/types/factories/IAppPoolService__factory.js +69 -0
  248. package/lib/types/factories/ICreditAccountData__factory.d.ts +35 -0
  249. package/lib/types/factories/ICreditAccountData__factory.js +216 -0
  250. package/lib/types/factories/ICreditAccount__factory.d.ts +22 -0
  251. package/lib/types/factories/ICreditAccount__factory.js +218 -0
  252. package/lib/types/factories/ICreditFilter__factory.d.ts +35 -0
  253. package/lib/types/factories/ICreditFilter__factory.js +700 -0
  254. package/lib/types/factories/ICreditManager__factory.d.ts +56 -0
  255. package/lib/types/factories/ICreditManager__factory.js +720 -0
  256. package/lib/types/factories/ICurvePool__factory.d.ts +22 -0
  257. package/lib/types/factories/ICurvePool__factory.js +168 -0
  258. package/lib/types/factories/IDataCompressor__factory.d.ts +51 -0
  259. package/lib/types/factories/IDataCompressor__factory.js +826 -0
  260. package/lib/types/factories/IERC165__factory.d.ts +22 -0
  261. package/lib/types/factories/IERC165__factory.js +41 -0
  262. package/lib/types/factories/IERC20__factory.d.ts +35 -0
  263. package/lib/types/factories/IERC20__factory.js +205 -0
  264. package/lib/types/factories/IERC721Enumerable__factory.d.ts +35 -0
  265. package/lib/types/factories/IERC721Enumerable__factory.js +363 -0
  266. package/lib/types/factories/IERC721Metadata__factory.d.ts +35 -0
  267. package/lib/types/factories/IERC721Metadata__factory.js +352 -0
  268. package/lib/types/factories/IERC721Receiver__factory.d.ts +22 -0
  269. package/lib/types/factories/IERC721Receiver__factory.js +56 -0
  270. package/lib/types/factories/IERC721__factory.d.ts +35 -0
  271. package/lib/types/factories/IERC721__factory.js +307 -0
  272. package/lib/types/factories/IGearToken__factory.d.ts +35 -0
  273. package/lib/types/factories/IGearToken__factory.js +342 -0
  274. package/lib/types/factories/IInterestRateModel__factory.d.ts +22 -0
  275. package/lib/types/factories/IInterestRateModel__factory.js +46 -0
  276. package/lib/types/factories/IMerkleDistributor__factory.d.ts +35 -0
  277. package/lib/types/factories/IMerkleDistributor__factory.js +109 -0
  278. package/lib/types/factories/IPoolService__factory.d.ts +35 -0
  279. package/lib/types/factories/IPoolService__factory.js +580 -0
  280. package/lib/types/factories/IPriceOracle__factory.d.ts +35 -0
  281. package/lib/types/factories/IPriceOracle__factory.js +112 -0
  282. package/lib/types/factories/IQuoter__factory.d.ts +22 -0
  283. package/lib/types/factories/IQuoter__factory.js +148 -0
  284. package/lib/types/factories/ISwapRouter__factory.d.ts +27 -0
  285. package/lib/types/factories/ISwapRouter__factory.js +236 -0
  286. package/lib/types/factories/IUniswapV2Migrator__factory.d.ts +18 -0
  287. package/lib/types/factories/IUniswapV2Migrator__factory.js +55 -0
  288. package/lib/types/factories/IUniswapV2Router01__factory.d.ts +22 -0
  289. package/lib/types/factories/IUniswapV2Router01__factory.js +771 -0
  290. package/lib/types/factories/IUniswapV2Router02__factory.d.ts +22 -0
  291. package/lib/types/factories/IUniswapV2Router02__factory.js +973 -0
  292. package/lib/types/factories/IUniswapV3SwapCallback__factory.d.ts +18 -0
  293. package/lib/types/factories/IUniswapV3SwapCallback__factory.js +45 -0
  294. package/lib/types/factories/IWETHGateway__factory.d.ts +18 -0
  295. package/lib/types/factories/IWETHGateway__factory.js +150 -0
  296. package/lib/types/factories/IWETH__factory.d.ts +22 -0
  297. package/lib/types/factories/IWETH__factory.js +66 -0
  298. package/lib/types/factories/IYVault__factory.d.ts +35 -0
  299. package/lib/types/factories/IYVault__factory.js +411 -0
  300. package/lib/types/factories/LeveragedActions__factory.d.ts +84 -0
  301. package/lib/types/factories/LeveragedActions__factory.js +569 -0
  302. package/lib/types/factories/LinearInterestRateModel__factory.d.ts +42 -0
  303. package/lib/types/factories/LinearInterestRateModel__factory.js +209 -0
  304. package/lib/types/factories/MockPoolService__factory.d.ts +56 -0
  305. package/lib/types/factories/MockPoolService__factory.js +889 -0
  306. package/lib/types/factories/Multicall2__factory.d.ts +52 -0
  307. package/lib/types/factories/Multicall2__factory.js +364 -0
  308. package/lib/types/factories/Ownable__factory.d.ts +42 -0
  309. package/lib/types/factories/Ownable__factory.js +74 -0
  310. package/lib/types/factories/PathFinder__factory.d.ts +61 -0
  311. package/lib/types/factories/PathFinder__factory.js +302 -0
  312. package/lib/types/factories/Pausable__factory.d.ts +31 -0
  313. package/lib/types/factories/Pausable__factory.js +61 -0
  314. package/lib/types/factories/PercentageMathTest__factory.d.ts +32 -0
  315. package/lib/types/factories/PercentageMathTest__factory.js +101 -0
  316. package/lib/types/factories/PoolDeployer__factory.d.ts +113 -0
  317. package/lib/types/factories/PoolDeployer__factory.js +257 -0
  318. package/lib/types/factories/PoolService__factory.d.ts +56 -0
  319. package/lib/types/factories/PoolService__factory.js +873 -0
  320. package/lib/types/factories/PriceOracle__factory.d.ts +56 -0
  321. package/lib/types/factories/PriceOracle__factory.js +290 -0
  322. package/lib/types/factories/Proxy__factory.d.ts +13 -0
  323. package/lib/types/factories/Proxy__factory.js +30 -0
  324. package/lib/types/factories/StepVesting__factory.d.ts +52 -0
  325. package/lib/types/factories/StepVesting__factory.js +296 -0
  326. package/lib/types/factories/TestPoolService__factory.d.ts +56 -0
  327. package/lib/types/factories/TestPoolService__factory.js +932 -0
  328. package/lib/types/factories/TokenDistributor__factory.d.ts +82 -0
  329. package/lib/types/factories/TokenDistributor__factory.js +481 -0
  330. package/lib/types/factories/TokenFeeMock__factory.d.ts +56 -0
  331. package/lib/types/factories/TokenFeeMock__factory.js +427 -0
  332. package/lib/types/factories/TokenMock__factory.d.ts +56 -0
  333. package/lib/types/factories/TokenMock__factory.js +409 -0
  334. package/lib/types/factories/TreasuryMock__factory.d.ts +35 -0
  335. package/lib/types/factories/TreasuryMock__factory.js +70 -0
  336. package/lib/types/factories/UniswapRouterMock__factory.d.ts +32 -0
  337. package/lib/types/factories/UniswapRouterMock__factory.js +1046 -0
  338. package/lib/types/factories/UniswapV2Adapter__factory.d.ts +42 -0
  339. package/lib/types/factories/UniswapV2Adapter__factory.js +1059 -0
  340. package/lib/types/factories/UniswapV3Adapter__factory.d.ts +47 -0
  341. package/lib/types/factories/UniswapV3Adapter__factory.js +322 -0
  342. package/lib/types/factories/VestingDeployer__factory.js +216 -0
  343. package/lib/types/factories/WETHGateway__factory.d.ts +70 -0
  344. package/lib/types/factories/WETHGateway__factory.js +241 -0
  345. package/lib/types/factories/WETHMock__factory.d.ts +52 -0
  346. package/lib/types/factories/WETHMock__factory.js +355 -0
  347. package/lib/types/factories/WadRayMathTest__factory.d.ts +32 -0
  348. package/lib/types/factories/WadRayMathTest__factory.js +239 -0
  349. package/lib/types/factories/YearnAdapter__factory.d.ts +56 -0
  350. package/lib/types/factories/YearnAdapter__factory.js +497 -0
  351. package/lib/types/factories/YearnMock__factory.d.ts +56 -0
  352. package/lib/types/factories/YearnMock__factory.js +598 -0
  353. package/lib/types/factories/YearnPriceFeed__factory.d.ts +56 -0
  354. package/lib/types/factories/YearnPriceFeed__factory.js +350 -0
  355. package/lib/types/hardhat.d.ts +343 -0
  356. package/lib/types/index.d.ts +152 -0
  357. package/lib/types/index.js +156 -0
  358. package/lib/utils/events.d.ts +2 -0
  359. package/lib/utils/events.js +13 -0
  360. package/lib/utils/formatter.d.ts +13 -0
  361. package/lib/utils/formatter.js +125 -0
  362. package/lib/utils/loading.d.ts +1 -0
  363. package/lib/utils/loading.js +17 -0
  364. package/lib/utils/math.d.ts +6 -0
  365. package/lib/utils/math.js +44 -0
  366. package/lib/utils/multicall.d.ts +15 -0
  367. package/lib/utils/multicall.js +84 -0
  368. package/lib/utils/repeater.d.ts +1 -0
  369. package/lib/utils/repeater.js +72 -0
  370. package/lib/utils/validate.d.ts +1 -0
  371. package/lib/utils/validate.js +13 -0
  372. package/package.json +27 -0
  373. package/src/abi/adapters/YearnV2.sol/YearnAdapter.dbg.json +4 -0
  374. package/src/abi/adapters/YearnV2.sol/YearnAdapter.json +455 -0
  375. package/src/abi/core/ACL.sol/ACL.dbg.json +4 -0
  376. package/src/abi/core/ACL.sol/ACL.json +262 -0
  377. package/src/abi/core/ACLTrait.sol/ACLTrait.dbg.json +4 -0
  378. package/src/abi/core/ACLTrait.sol/ACLTrait.json +64 -0
  379. package/src/abi/core/AccountMining.sol/AccountMining.dbg.json +4 -0
  380. package/src/abi/core/AccountMining.sol/AccountMining.json +150 -0
  381. package/src/abi/core/AddressProvider.sol/AddressProvider.dbg.json +4 -0
  382. package/src/abi/core/AddressProvider.sol/AddressProvider.json +496 -0
  383. package/src/abi/core/ContractsRegister.sol/ContractsRegister.dbg.json +4 -0
  384. package/src/abi/core/ContractsRegister.sol/ContractsRegister.json +255 -0
  385. package/src/abi/credit/LeverageActions.sol/LeveragedActions.dbg.json +4 -0
  386. package/src/abi/credit/LeverageActions.sol/LeveragedActions.json +514 -0
  387. package/src/abi/deployer/AdaptersDeployer.sol/AdaptersDeployer.dbg.json +4 -0
  388. package/src/abi/deployer/AdaptersDeployer.sol/AdaptersDeployer.json +160 -0
  389. package/src/abi/deployer/GenesisDeployer.sol/GenesisDeployer.dbg.json +4 -0
  390. package/src/abi/deployer/GenesisDeployer.sol/GenesisDeployer.json +189 -0
  391. package/src/abi/deployer/PoolDeployer.sol/PoolDeployer.dbg.json +4 -0
  392. package/src/abi/deployer/PoolDeployer.sol/PoolDeployer.json +215 -0
  393. package/src/abi/fuzzing/FuzzHarness.sol/FuzzHarness.dbg.json +4 -0
  394. package/src/abi/fuzzing/FuzzHarness.sol/FuzzHarness.json +50 -0
  395. package/src/abi/integrations/yearn/IYVault.sol/IYVault.dbg.json +4 -0
  396. package/src/abi/integrations/yearn/IYVault.sol/IYVault.json +400 -0
  397. package/src/abi/interfaces/IGearToken.sol/IGearToken.dbg.json +4 -0
  398. package/src/abi/interfaces/IGearToken.sol/IGearToken.json +331 -0
  399. package/src/abi/interfaces/IMerkleDistributor.sol/IMerkleDistributor.dbg.json +4 -0
  400. package/src/abi/interfaces/IMerkleDistributor.sol/IMerkleDistributor.json +98 -0
  401. package/src/abi/mocks/core/ACLTraitTest.sol/ACLTraitTest.dbg.json +4 -0
  402. package/src/abi/mocks/core/ACLTraitTest.sol/ACLTraitTest.json +96 -0
  403. package/src/abi/mocks/credit/ExecutorMock.sol/ExecutorMock.dbg.json +4 -0
  404. package/src/abi/mocks/credit/ExecutorMock.sol/ExecutorMock.json +61 -0
  405. package/src/abi/mocks/integrations/CurveMock.sol/CurveMock.dbg.json +4 -0
  406. package/src/abi/mocks/integrations/CurveMock.sol/CurveMock.json +168 -0
  407. package/src/abi/mocks/integrations/YearnMock.sol/YearnMock.dbg.json +4 -0
  408. package/src/abi/mocks/integrations/YearnMock.sol/YearnMock.json +556 -0
  409. package/src/abi/mocks/oracles/ChainlinkPriceFeedMock.sol/ChainlinkPriceFeedMock.dbg.json +4 -0
  410. package/src/abi/mocks/oracles/ChainlinkPriceFeedMock.sol/ChainlinkPriceFeedMock.json +151 -0
  411. package/src/abi/mocks/pool/CreditManagerMockForPoolTest.sol/CreditManagerMockForPoolTest.dbg.json +4 -0
  412. package/src/abi/mocks/pool/CreditManagerMockForPoolTest.sol/CreditManagerMockForPoolTest.json +89 -0
  413. package/src/abi/mocks/tokens/ERC20Blocking.sol/ERC20BlockingMock.dbg.json +4 -0
  414. package/src/abi/mocks/tokens/ERC20Blocking.sol/ERC20BlockingMock.json +387 -0
  415. package/src/abi/mocks/tokens/ERC20Fee.sol/TokenFeeMock.dbg.json +4 -0
  416. package/src/abi/mocks/tokens/ERC20Fee.sol/TokenFeeMock.json +385 -0
  417. package/src/abi/oracles/YearnPriceFeed.sol/YearnPriceFeed.dbg.json +4 -0
  418. package/src/abi/oracles/YearnPriceFeed.sol/YearnPriceFeed.json +321 -0
  419. package/src/abi/support/PathFinder.sol/PathFinder.dbg.json +4 -0
  420. package/src/abi/support/PathFinder.sol/PathFinder.json +189 -0
  421. package/src/abi/tokens/GearNFT.sol/GearBeta.dbg.json +4 -0
  422. package/src/abi/tokens/GearNFT.sol/GearBeta.json +485 -0
  423. package/src/abi/tokens/TokenDistributor.sol/TokenDistributor.dbg.json +4 -0
  424. package/src/abi/tokens/TokenDistributor.sol/TokenDistributor.json +439 -0
  425. package/src/abi/tokens/Vesting.sol/StepVesting.dbg.json +4 -0
  426. package/src/abi/tokens/Vesting.sol/StepVesting.json +254 -0
  427. package/src/config.ts +1 -0
  428. package/src/core/constants.ts +44 -0
  429. package/src/core/contracts.ts +151 -0
  430. package/src/core/contractsRegister.ts +51 -0
  431. package/src/core/creditAccount.ts +105 -0
  432. package/src/core/creditCard.ts +15 -0
  433. package/src/core/creditManager.ts +171 -0
  434. package/src/core/creditOperation.ts +9 -0
  435. package/src/core/creditSession.ts +67 -0
  436. package/src/core/errors.ts +45 -0
  437. package/src/core/eventOrTx.ts +94 -0
  438. package/src/core/events.ts +1167 -0
  439. package/src/core/history.ts +55 -0
  440. package/src/core/operations.ts +35 -0
  441. package/src/core/oracles.ts +7 -0
  442. package/src/core/pool.ts +60 -0
  443. package/src/core/swap.ts +4 -0
  444. package/src/core/token.ts +275 -0
  445. package/src/core/tokenData.ts +84 -0
  446. package/src/core/tokenDistributor.ts +14 -0
  447. package/src/core/trade.ts +83 -0
  448. package/src/core/transactions.ts +407 -0
  449. package/src/index.ts +42 -0
  450. package/src/payload/creditAccount.ts +29 -0
  451. package/src/payload/creditManager.ts +46 -0
  452. package/src/payload/creditSession.ts +24 -0
  453. package/src/payload/graphPayload.ts +10 -0
  454. package/src/payload/pool.ts +20 -0
  455. package/src/payload/token.ts +5 -0
  456. package/src/types/ACL.d.ts +491 -0
  457. package/src/types/ACLTrait.d.ts +148 -0
  458. package/src/types/ACLTraitTest.d.ts +209 -0
  459. package/src/types/AccountFactory.d.ts +716 -0
  460. package/src/types/AccountMining.d.ts +222 -0
  461. package/src/types/AddressProvider.d.ts +912 -0
  462. package/src/types/AggregatorV3Interface.d.ts +234 -0
  463. package/src/types/ChainlinkPriceFeedMock.d.ts +215 -0
  464. package/src/types/ContractsRegister.d.ts +398 -0
  465. package/src/types/CreditAccount.d.ts +443 -0
  466. package/src/types/CreditFilter.d.ts +1609 -0
  467. package/src/types/CreditFilterMock.d.ts +1687 -0
  468. package/src/types/CreditManager.d.ts +1285 -0
  469. package/src/types/CreditManagerMockForFilter.d.ts +605 -0
  470. package/src/types/CreditManagerMockForPoolTest.d.ts +204 -0
  471. package/src/types/CurveMock.d.ts +298 -0
  472. package/src/types/CurveV1Adapter.d.ts +349 -0
  473. package/src/types/DataCompressor.d.ts +1331 -0
  474. package/src/types/DieselToken.d.ts +567 -0
  475. package/src/types/ERC165.d.ts +116 -0
  476. package/src/types/ERC20.d.ts +411 -0
  477. package/src/types/ERC20BlockingMock.d.ts +568 -0
  478. package/src/types/ERC721.d.ts +625 -0
  479. package/src/types/Errors.d.ts +1854 -0
  480. package/src/types/ExecutorMock.d.ts +140 -0
  481. package/src/types/FlashLoanAttacker.d.ts +170 -0
  482. package/src/types/FuzzHarness.d.ts +124 -0
  483. package/src/types/GearBeta.d.ts +745 -0
  484. package/src/types/GearToken.d.ts +888 -0
  485. package/src/types/IAccountFactory.d.ts +317 -0
  486. package/src/types/IAccountMiner.d.ts +124 -0
  487. package/src/types/IAppAddressProvider.d.ts +198 -0
  488. package/src/types/IAppCreditManager.d.ts +408 -0
  489. package/src/types/IAppERC20.d.ts +309 -0
  490. package/src/types/IAppPoolService.d.ts +166 -0
  491. package/src/types/ICreditAccount.d.ts +430 -0
  492. package/src/types/ICreditFilter.d.ts +1162 -0
  493. package/src/types/ICreditManager.d.ts +971 -0
  494. package/src/types/ICurvePool.d.ts +298 -0
  495. package/src/types/IDataCompressor.d.ts +1231 -0
  496. package/src/types/IERC165.d.ts +116 -0
  497. package/src/types/IERC20.d.ts +294 -0
  498. package/src/types/IERC721.d.ts +472 -0
  499. package/src/types/IERC721Enumerable.d.ts +564 -0
  500. package/src/types/IERC721Metadata.d.ts +523 -0
  501. package/src/types/IERC721Receiver.d.ts +132 -0
  502. package/src/types/IGearToken.d.ts +527 -0
  503. package/src/types/IInterestRateModel.d.ts +121 -0
  504. package/src/types/IMerkleDistributor.d.ts +190 -0
  505. package/src/types/IPoolService.d.ts +772 -0
  506. package/src/types/IPriceOracle.d.ts +211 -0
  507. package/src/types/IQuoter.d.ts +269 -0
  508. package/src/types/ISwapRouter.d.ts +404 -0
  509. package/src/types/IUniswapV2Migrator.d.ts +134 -0
  510. package/src/types/IUniswapV2Router01.d.ts +1119 -0
  511. package/src/types/IUniswapV2Router02.d.ts +1432 -0
  512. package/src/types/IUniswapV3SwapCallback.d.ts +127 -0
  513. package/src/types/IWETH.d.ts +169 -0
  514. package/src/types/IWETHGateway.d.ts +335 -0
  515. package/src/types/IYVault.d.ts +558 -0
  516. package/src/types/LeveragedActions.d.ts +772 -0
  517. package/src/types/LinearInterestRateModel.d.ts +279 -0
  518. package/src/types/MockPoolService.d.ts +1271 -0
  519. package/src/types/Multicall2.d.ts +449 -0
  520. package/src/types/Ownable.d.ts +169 -0
  521. package/src/types/PathFinder.d.ts +379 -0
  522. package/src/types/Pausable.d.ts +105 -0
  523. package/src/types/PercentageMathTest.d.ts +154 -0
  524. package/src/types/PoolService.d.ts +1174 -0
  525. package/src/types/PriceOracle.d.ts +387 -0
  526. package/src/types/StepVesting.d.ts +411 -0
  527. package/src/types/TestPoolService.d.ts +1294 -0
  528. package/src/types/TokenDistributor.d.ts +640 -0
  529. package/src/types/TokenFeeMock.d.ts +544 -0
  530. package/src/types/TokenMock.d.ts +531 -0
  531. package/src/types/TreasuryMock.d.ts +86 -0
  532. package/src/types/UniswapRouterMock.d.ts +1520 -0
  533. package/src/types/UniswapV2Adapter.d.ts +1463 -0
  534. package/src/types/UniswapV3Adapter.d.ts +455 -0
  535. package/src/types/WETHGateway.d.ts +376 -0
  536. package/src/types/WETHMock.d.ts +433 -0
  537. package/src/types/WadRayMathTest.d.ts +316 -0
  538. package/src/types/YearnAdapter.d.ts +609 -0
  539. package/src/types/YearnMock.d.ts +795 -0
  540. package/src/types/YearnPriceFeed.d.ts +399 -0
  541. package/src/types/commons.d.ts +16 -0
  542. package/src/types/commons.js +5 -0
  543. package/src/types/commons.ts +37 -0
  544. package/src/types/factories/ACLTraitTest__factory.ts +137 -0
  545. package/src/types/factories/ACLTrait__factory.ts +76 -0
  546. package/src/types/factories/ACL__factory.ts +308 -0
  547. package/src/types/factories/AccountFactory__factory.ts +510 -0
  548. package/src/types/factories/AccountMining__factory.ts +214 -0
  549. package/src/types/factories/AddressProvider__factory.ts +579 -0
  550. package/src/types/factories/AggregatorV3Interface__factory.ts +141 -0
  551. package/src/types/factories/ChainlinkPriceFeedMock__factory.ts +209 -0
  552. package/src/types/factories/ContractsRegister__factory.ts +312 -0
  553. package/src/types/factories/CreditAccount__factory.ts +256 -0
  554. package/src/types/factories/CreditFilterMock__factory.ts +1092 -0
  555. package/src/types/factories/CreditFilter__factory.ts +1053 -0
  556. package/src/types/factories/CreditManagerMockForFilter__factory.ts +325 -0
  557. package/src/types/factories/CreditManagerMockForPoolTest__factory.ts +137 -0
  558. package/src/types/factories/CreditManager__factory.ts +1063 -0
  559. package/src/types/factories/CurveMock__factory.ts +206 -0
  560. package/src/types/factories/CurveV1Adapter__factory.ts +263 -0
  561. package/src/types/factories/DataCompressor__factory.ts +946 -0
  562. package/src/types/factories/DieselToken__factory.ts +449 -0
  563. package/src/types/factories/ERC165__factory.ts +39 -0
  564. package/src/types/factories/ERC20BlockingMock__factory.ts +434 -0
  565. package/src/types/factories/ERC20__factory.ts +334 -0
  566. package/src/types/factories/ERC721__factory.ts +463 -0
  567. package/src/types/factories/Errors__factory.ts +1006 -0
  568. package/src/types/factories/ExecutorMock__factory.ts +97 -0
  569. package/src/types/factories/FlashLoanAttacker__factory.ts +119 -0
  570. package/src/types/factories/FuzzHarness__factory.ts +94 -0
  571. package/src/types/factories/GearBeta__factory.ts +521 -0
  572. package/src/types/factories/GearToken__factory.ts +704 -0
  573. package/src/types/factories/IAccountFactory__factory.ts +230 -0
  574. package/src/types/factories/IAccountMiner__factory.ts +49 -0
  575. package/src/types/factories/IAppAddressProvider__factory.ts +104 -0
  576. package/src/types/factories/IAppCreditManager__factory.ts +208 -0
  577. package/src/types/factories/IAppERC20__factory.ts +195 -0
  578. package/src/types/factories/IAppPoolService__factory.ts +73 -0
  579. package/src/types/factories/ICreditAccount__factory.ts +222 -0
  580. package/src/types/factories/ICreditFilter__factory.ts +701 -0
  581. package/src/types/factories/ICreditManager__factory.ts +724 -0
  582. package/src/types/factories/ICurvePool__factory.ts +169 -0
  583. package/src/types/factories/IDataCompressor__factory.ts +830 -0
  584. package/src/types/factories/IERC165__factory.ts +42 -0
  585. package/src/types/factories/IERC20__factory.ts +203 -0
  586. package/src/types/factories/IERC721Enumerable__factory.ts +367 -0
  587. package/src/types/factories/IERC721Metadata__factory.ts +356 -0
  588. package/src/types/factories/IERC721Receiver__factory.ts +60 -0
  589. package/src/types/factories/IERC721__factory.ts +308 -0
  590. package/src/types/factories/IGearToken__factory.ts +343 -0
  591. package/src/types/factories/IInterestRateModel__factory.ts +50 -0
  592. package/src/types/factories/IMerkleDistributor__factory.ts +113 -0
  593. package/src/types/factories/IPoolService__factory.ts +581 -0
  594. package/src/types/factories/IPriceOracle__factory.ts +113 -0
  595. package/src/types/factories/IQuoter__factory.ts +149 -0
  596. package/src/types/factories/ISwapRouter__factory.ts +237 -0
  597. package/src/types/factories/IUniswapV2Migrator__factory.ts +59 -0
  598. package/src/types/factories/IUniswapV2Router01__factory.ts +775 -0
  599. package/src/types/factories/IUniswapV2Router02__factory.ts +977 -0
  600. package/src/types/factories/IUniswapV3SwapCallback__factory.ts +53 -0
  601. package/src/types/factories/IWETHGateway__factory.ts +151 -0
  602. package/src/types/factories/IWETH__factory.ts +64 -0
  603. package/src/types/factories/IYVault__factory.ts +412 -0
  604. package/src/types/factories/LeveragedActions__factory.ts +571 -0
  605. package/src/types/factories/LinearInterestRateModel__factory.ts +237 -0
  606. package/src/types/factories/MockPoolService__factory.ts +891 -0
  607. package/src/types/factories/Multicall2__factory.ts +358 -0
  608. package/src/types/factories/Ownable__factory.ts +75 -0
  609. package/src/types/factories/PathFinder__factory.ts +301 -0
  610. package/src/types/factories/Pausable__factory.ts +62 -0
  611. package/src/types/factories/PercentageMathTest__factory.ts +98 -0
  612. package/src/types/factories/PoolService__factory.ts +898 -0
  613. package/src/types/factories/PriceOracle__factory.ts +289 -0
  614. package/src/types/factories/StepVesting__factory.ts +290 -0
  615. package/src/types/factories/TestPoolService__factory.ts +960 -0
  616. package/src/types/factories/TokenDistributor__factory.ts +483 -0
  617. package/src/types/factories/TokenFeeMock__factory.ts +439 -0
  618. package/src/types/factories/TokenMock__factory.ts +407 -0
  619. package/src/types/factories/TreasuryMock__factory.ts +64 -0
  620. package/src/types/factories/UniswapRouterMock__factory.ts +1043 -0
  621. package/src/types/factories/UniswapV2Adapter__factory.ts +1064 -0
  622. package/src/types/factories/UniswapV3Adapter__factory.ts +327 -0
  623. package/src/types/factories/WETHGateway__factory.ts +240 -0
  624. package/src/types/factories/WETHMock__factory.ts +349 -0
  625. package/src/types/factories/WadRayMathTest__factory.ts +236 -0
  626. package/src/types/factories/YearnAdapter__factory.ts +499 -0
  627. package/src/types/factories/YearnMock__factory.ts +594 -0
  628. package/src/types/factories/YearnPriceFeed__factory.ts +378 -0
  629. package/src/types/hardhat.d.ts +343 -0
  630. package/src/types/index.d.ts +174 -0
  631. package/src/types/index.js +178 -0
  632. package/src/types/index.ts +156 -0
  633. package/src/utils/events.ts +10 -0
  634. package/src/utils/formatter.ts +138 -0
  635. package/src/utils/loading.ts +9 -0
  636. package/src/utils/math.ts +42 -0
  637. package/src/utils/multicall.ts +54 -0
  638. package/src/utils/repeater.ts +18 -0
  639. package/src/utils/validate.ts +8 -0
  640. package/tsconfig.json +62 -0
@@ -0,0 +1,127 @@
1
+ import { BigNumber } from "ethers";
2
+ import { TokenData } from "./tokenData";
3
+ import { EVMTx, EVMTxProps } from "./eventOrTx";
4
+ export interface TxSerialized {
5
+ type: "TxAddLiquidity" | "TxRemoveLiquidity" | "TxSwap" | "TxAddCollateral" | "TxIncreaseBorrowAmount" | "TxOpenAccount" | "TxRepayAccount" | "TxCloseAccount" | "TxApprove";
6
+ content: string;
7
+ }
8
+ export declare class TxSerializer {
9
+ static serialize(items: Array<EVMTx>): string;
10
+ static deserialize(data: string): Array<EVMTx>;
11
+ }
12
+ interface AddLiquidityProps extends EVMTxProps {
13
+ amount: BigNumber;
14
+ underlyingToken: string;
15
+ pool: string;
16
+ }
17
+ export declare class TxAddLiquidity extends EVMTx {
18
+ readonly amount: BigNumber;
19
+ readonly underlyingToken: string;
20
+ readonly pool: string;
21
+ constructor(opts: AddLiquidityProps);
22
+ toString(tokenData: Record<string, TokenData>): string;
23
+ serialize(): TxSerialized;
24
+ }
25
+ interface RemoveLiquidityProps extends EVMTxProps {
26
+ amount: BigNumber;
27
+ dieselToken: string;
28
+ pool: string;
29
+ }
30
+ export declare class TxRemoveLiquidity extends EVMTx {
31
+ readonly amount: BigNumber;
32
+ readonly dieselToken: string;
33
+ readonly pool: string;
34
+ constructor(opts: RemoveLiquidityProps);
35
+ toString(tokenData: Record<string, TokenData>): string;
36
+ serialize(): TxSerialized;
37
+ }
38
+ interface SwapProps extends EVMTxProps {
39
+ protocol: string;
40
+ operation: string;
41
+ amountFrom: BigNumber;
42
+ amountTo?: BigNumber;
43
+ tokenFrom: string;
44
+ tokenTo?: string;
45
+ creditManager: string;
46
+ }
47
+ export declare class TXSwap extends EVMTx {
48
+ readonly protocol: string;
49
+ readonly operation: string;
50
+ readonly amountFrom: BigNumber;
51
+ readonly amountTo?: BigNumber;
52
+ readonly tokenFrom: string;
53
+ readonly tokenTo?: string;
54
+ readonly creditManager: string;
55
+ constructor(opts: SwapProps);
56
+ toString(tokenData: Record<string, TokenData>): string;
57
+ serialize(): TxSerialized;
58
+ }
59
+ interface AddCollateralProps extends EVMTxProps {
60
+ amount: BigNumber;
61
+ addedToken: string;
62
+ creditManager: string;
63
+ }
64
+ export declare class TxAddCollateral extends EVMTx {
65
+ readonly amount: BigNumber;
66
+ readonly addedToken: string;
67
+ readonly creditManager: string;
68
+ constructor(opts: AddCollateralProps);
69
+ toString(tokenData: Record<string, TokenData>): string;
70
+ serialize(): TxSerialized;
71
+ }
72
+ interface IncreaseBorrowAmountProps extends EVMTxProps {
73
+ amount: BigNumber;
74
+ underlyingToken: string;
75
+ creditManager: string;
76
+ }
77
+ export declare class TxIncreaseBorrowAmount extends EVMTx {
78
+ readonly amount: BigNumber;
79
+ readonly underlyingToken: string;
80
+ readonly creditManager: string;
81
+ constructor(opts: IncreaseBorrowAmountProps);
82
+ toString(tokenData: Record<string, TokenData>): string;
83
+ serialize(): TxSerialized;
84
+ }
85
+ interface OpenAccountProps extends EVMTxProps {
86
+ amount: BigNumber;
87
+ underlyingToken: string;
88
+ leverage: number;
89
+ creditManager: string;
90
+ }
91
+ export declare class TxOpenAccount extends EVMTx {
92
+ readonly amount: BigNumber;
93
+ readonly underlyingToken: string;
94
+ readonly leverage: number;
95
+ readonly creditManager: string;
96
+ constructor(opts: OpenAccountProps);
97
+ toString(tokenData: Record<string, TokenData>): string;
98
+ serialize(): TxSerialized;
99
+ }
100
+ interface RepayAccountProps extends EVMTxProps {
101
+ creditManager: string;
102
+ }
103
+ export declare class TxRepayAccount extends EVMTx {
104
+ readonly creditManager: string;
105
+ constructor(opts: RepayAccountProps);
106
+ toString(_tokenData: Record<string, TokenData>): string;
107
+ serialize(): TxSerialized;
108
+ }
109
+ interface CloseAccountProps extends EVMTxProps {
110
+ creditManager: string;
111
+ }
112
+ export declare class TxCloseAccount extends EVMTx {
113
+ readonly creditManager: string;
114
+ constructor(opts: CloseAccountProps);
115
+ toString(_tokenData: Record<string, TokenData>): string;
116
+ serialize(): TxSerialized;
117
+ }
118
+ interface ApproveProps extends EVMTxProps {
119
+ token: string;
120
+ }
121
+ export declare class TxApprove extends EVMTx {
122
+ readonly token: string;
123
+ constructor(opts: ApproveProps);
124
+ toString(tokenData: Record<string, TokenData>): string;
125
+ serialize(): TxSerialized;
126
+ }
127
+ export {};
@@ -0,0 +1,306 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.TxApprove = exports.TxCloseAccount = exports.TxRepayAccount = exports.TxOpenAccount = exports.TxIncreaseBorrowAmount = exports.TxAddCollateral = exports.TXSwap = exports.TxRemoveLiquidity = exports.TxAddLiquidity = exports.TxSerializer = void 0;
19
+ var ethers_1 = require("ethers");
20
+ var formatter_1 = require("../utils/formatter");
21
+ var eventOrTx_1 = require("./eventOrTx");
22
+ var contractsRegister_1 = require("./contractsRegister");
23
+ var constants_1 = require("./constants");
24
+ var TxSerializer = /** @class */ (function () {
25
+ function TxSerializer() {
26
+ }
27
+ TxSerializer.serialize = function (items) {
28
+ return JSON.stringify(items.map(function (i) { return i.serialize(); }));
29
+ };
30
+ TxSerializer.deserialize = function (data) {
31
+ return JSON.parse(data).map(function (e) {
32
+ var params = JSON.parse(e.content);
33
+ switch (e.type) {
34
+ case "TxAddLiquidity":
35
+ return new TxAddLiquidity(params);
36
+ case "TxRemoveLiquidity":
37
+ return new TxRemoveLiquidity(params);
38
+ case "TxSwap":
39
+ return new TXSwap(params);
40
+ case "TxAddCollateral":
41
+ return new TxAddCollateral(params);
42
+ case "TxIncreaseBorrowAmount":
43
+ return new TxIncreaseBorrowAmount(params);
44
+ case "TxOpenAccount":
45
+ return new TxOpenAccount(params);
46
+ case "TxRepayAccount":
47
+ return new TxRepayAccount(params);
48
+ case "TxCloseAccount":
49
+ return new TxCloseAccount(params);
50
+ case "TxApprove":
51
+ return new TxApprove(params);
52
+ default:
53
+ throw new Error("Unknown transaction for parsing");
54
+ }
55
+ });
56
+ };
57
+ return TxSerializer;
58
+ }());
59
+ exports.TxSerializer = TxSerializer;
60
+ var TxAddLiquidity = /** @class */ (function (_super) {
61
+ __extends(TxAddLiquidity, _super);
62
+ function TxAddLiquidity(opts) {
63
+ var _this = _super.call(this, {
64
+ block: opts.block,
65
+ txHash: opts.txHash,
66
+ txStatus: opts.txStatus,
67
+ timestamp: opts.timestamp
68
+ }) || this;
69
+ _this.amount = opts.amount;
70
+ _this.underlyingToken = opts.underlyingToken;
71
+ _this.pool = opts.pool;
72
+ return _this;
73
+ }
74
+ TxAddLiquidity.prototype.toString = function (tokenData) {
75
+ var token = tokenData[this.underlyingToken];
76
+ return "".concat((0, contractsRegister_1.getContractName)(this.pool), ": Deposit ").concat((0, formatter_1.formatBN)(this.amount, (token === null || token === void 0 ? void 0 : token.decimals) || 18), " ").concat((token === null || token === void 0 ? void 0 : token.symbol) || "");
77
+ };
78
+ TxAddLiquidity.prototype.serialize = function () {
79
+ return {
80
+ type: "TxAddLiquidity",
81
+ content: JSON.stringify(this)
82
+ };
83
+ };
84
+ return TxAddLiquidity;
85
+ }(eventOrTx_1.EVMTx));
86
+ exports.TxAddLiquidity = TxAddLiquidity;
87
+ var TxRemoveLiquidity = /** @class */ (function (_super) {
88
+ __extends(TxRemoveLiquidity, _super);
89
+ function TxRemoveLiquidity(opts) {
90
+ var _this = _super.call(this, {
91
+ block: opts.block,
92
+ txHash: opts.txHash,
93
+ txStatus: opts.txStatus,
94
+ timestamp: opts.timestamp
95
+ }) || this;
96
+ _this.amount = opts.amount;
97
+ _this.dieselToken = opts.dieselToken;
98
+ _this.pool = opts.pool;
99
+ return _this;
100
+ }
101
+ TxRemoveLiquidity.prototype.toString = function (tokenData) {
102
+ var dtoken = tokenData[this.dieselToken];
103
+ return "".concat((0, contractsRegister_1.getContractName)(this.pool), ": Withdraw ").concat((0, formatter_1.formatBN)(this.amount, (dtoken === null || dtoken === void 0 ? void 0 : dtoken.decimals) || 18), " ").concat((dtoken === null || dtoken === void 0 ? void 0 : dtoken.symbol) || "");
104
+ };
105
+ TxRemoveLiquidity.prototype.serialize = function () {
106
+ return {
107
+ type: "TxRemoveLiquidity",
108
+ content: JSON.stringify(this)
109
+ };
110
+ };
111
+ return TxRemoveLiquidity;
112
+ }(eventOrTx_1.EVMTx));
113
+ exports.TxRemoveLiquidity = TxRemoveLiquidity;
114
+ var TXSwap = /** @class */ (function (_super) {
115
+ __extends(TXSwap, _super);
116
+ function TXSwap(opts) {
117
+ var _this = _super.call(this, {
118
+ block: opts.block,
119
+ txHash: opts.txHash,
120
+ txStatus: opts.txStatus,
121
+ timestamp: opts.timestamp
122
+ }) || this;
123
+ _this.protocol = opts.protocol;
124
+ _this.operation = opts.operation;
125
+ _this.amountFrom = opts.amountFrom;
126
+ _this.amountTo = opts.amountTo;
127
+ _this.tokenFrom = opts.tokenFrom;
128
+ _this.tokenTo = opts.tokenTo;
129
+ _this.creditManager = opts.creditManager;
130
+ return _this;
131
+ }
132
+ TXSwap.prototype.toString = function (tokenData) {
133
+ var tokenFrom = tokenData[this.tokenFrom];
134
+ var toPart = "";
135
+ if (this.tokenTo && this.amountTo) {
136
+ var tokenTo = tokenData[this.tokenTo];
137
+ toPart = " \u21D2 ".concat((0, formatter_1.formatBN)(this.amountTo, (tokenTo === null || tokenTo === void 0 ? void 0 : tokenTo.decimals) || 18), " ").concat((tokenTo === null || tokenTo === void 0 ? void 0 : tokenTo.symbol) || "");
138
+ }
139
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": ").concat(this.operation, " ").concat((0, formatter_1.formatBN)(this.amountFrom, (tokenFrom === null || tokenFrom === void 0 ? void 0 : tokenFrom.decimals) || 18), " ").concat((tokenFrom === null || tokenFrom === void 0 ? void 0 : tokenFrom.symbol) || "", " ").concat(toPart, " on ").concat((0, contractsRegister_1.getContractName)(this.protocol));
140
+ };
141
+ TXSwap.prototype.serialize = function () {
142
+ return {
143
+ type: "TxSwap",
144
+ content: JSON.stringify(this)
145
+ };
146
+ };
147
+ return TXSwap;
148
+ }(eventOrTx_1.EVMTx));
149
+ exports.TXSwap = TXSwap;
150
+ var TxAddCollateral = /** @class */ (function (_super) {
151
+ __extends(TxAddCollateral, _super);
152
+ function TxAddCollateral(opts) {
153
+ var _this = _super.call(this, {
154
+ block: opts.block,
155
+ txHash: opts.txHash,
156
+ txStatus: opts.txStatus,
157
+ timestamp: opts.timestamp
158
+ }) || this;
159
+ _this.amount = opts.amount;
160
+ _this.addedToken = opts.addedToken;
161
+ _this.creditManager = opts.creditManager;
162
+ return _this;
163
+ }
164
+ TxAddCollateral.prototype.toString = function (tokenData) {
165
+ var addedToken = tokenData[this.addedToken];
166
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Added ").concat((0, formatter_1.formatBN)(this.amount, addedToken.decimals), " ").concat(addedToken.symbol, " as collateral");
167
+ };
168
+ TxAddCollateral.prototype.serialize = function () {
169
+ return {
170
+ type: "TxAddCollateral",
171
+ content: JSON.stringify(this)
172
+ };
173
+ };
174
+ return TxAddCollateral;
175
+ }(eventOrTx_1.EVMTx));
176
+ exports.TxAddCollateral = TxAddCollateral;
177
+ var TxIncreaseBorrowAmount = /** @class */ (function (_super) {
178
+ __extends(TxIncreaseBorrowAmount, _super);
179
+ function TxIncreaseBorrowAmount(opts) {
180
+ var _this = _super.call(this, {
181
+ block: opts.block,
182
+ txHash: opts.txHash,
183
+ txStatus: opts.txStatus,
184
+ timestamp: opts.timestamp
185
+ }) || this;
186
+ _this.amount = opts.amount;
187
+ _this.underlyingToken = opts.underlyingToken;
188
+ _this.creditManager = opts.creditManager;
189
+ return _this;
190
+ }
191
+ TxIncreaseBorrowAmount.prototype.toString = function (tokenData) {
192
+ var token = tokenData[this.underlyingToken];
193
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Borrowed amount was increased for ").concat((0, formatter_1.formatBN)(this.amount, (token === null || token === void 0 ? void 0 : token.decimals) || 18), " ").concat(token === null || token === void 0 ? void 0 : token.symbol);
194
+ };
195
+ TxIncreaseBorrowAmount.prototype.serialize = function () {
196
+ return {
197
+ type: "TxIncreaseBorrowAmount",
198
+ content: JSON.stringify(this)
199
+ };
200
+ };
201
+ return TxIncreaseBorrowAmount;
202
+ }(eventOrTx_1.EVMTx));
203
+ exports.TxIncreaseBorrowAmount = TxIncreaseBorrowAmount;
204
+ var TxOpenAccount = /** @class */ (function (_super) {
205
+ __extends(TxOpenAccount, _super);
206
+ function TxOpenAccount(opts) {
207
+ var _this = _super.call(this, {
208
+ block: opts.block,
209
+ txHash: opts.txHash,
210
+ txStatus: opts.txStatus,
211
+ timestamp: opts.timestamp
212
+ }) || this;
213
+ _this.amount = ethers_1.BigNumber.from(opts.amount);
214
+ _this.underlyingToken = opts.underlyingToken;
215
+ _this.leverage = opts.leverage;
216
+ _this.creditManager = opts.creditManager;
217
+ return _this;
218
+ }
219
+ TxOpenAccount.prototype.toString = function (tokenData) {
220
+ var token = tokenData[this.underlyingToken];
221
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": opening ").concat((0, formatter_1.formatBN)(this.amount, (token === null || token === void 0 ? void 0 : token.decimals) || 18), " ").concat(token === null || token === void 0 ? void 0 : token.symbol, " x ").concat(this.leverage.toFixed(2), " \u21D2 \n ").concat((0, formatter_1.formatBN)(this.amount
222
+ .mul(Math.floor(this.leverage * constants_1.LEVERAGE_DECIMALS))
223
+ .div(constants_1.LEVERAGE_DECIMALS), (token === null || token === void 0 ? void 0 : token.decimals) || 18), " ").concat(token === null || token === void 0 ? void 0 : token.symbol);
224
+ };
225
+ TxOpenAccount.prototype.serialize = function () {
226
+ return {
227
+ type: "TxOpenAccount",
228
+ content: JSON.stringify(this)
229
+ };
230
+ };
231
+ return TxOpenAccount;
232
+ }(eventOrTx_1.EVMTx));
233
+ exports.TxOpenAccount = TxOpenAccount;
234
+ var TxRepayAccount = /** @class */ (function (_super) {
235
+ __extends(TxRepayAccount, _super);
236
+ function TxRepayAccount(opts) {
237
+ var _this = _super.call(this, {
238
+ block: opts.block,
239
+ txHash: opts.txHash,
240
+ txStatus: opts.txStatus,
241
+ timestamp: opts.timestamp
242
+ }) || this;
243
+ _this.creditManager = opts.creditManager;
244
+ return _this;
245
+ }
246
+ TxRepayAccount.prototype.toString = function (_tokenData) {
247
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Repaying account");
248
+ };
249
+ TxRepayAccount.prototype.serialize = function () {
250
+ return {
251
+ type: "TxRepayAccount",
252
+ content: JSON.stringify(this)
253
+ };
254
+ };
255
+ return TxRepayAccount;
256
+ }(eventOrTx_1.EVMTx));
257
+ exports.TxRepayAccount = TxRepayAccount;
258
+ var TxCloseAccount = /** @class */ (function (_super) {
259
+ __extends(TxCloseAccount, _super);
260
+ function TxCloseAccount(opts) {
261
+ var _this = _super.call(this, {
262
+ block: opts.block,
263
+ txHash: opts.txHash,
264
+ txStatus: opts.txStatus,
265
+ timestamp: opts.timestamp
266
+ }) || this;
267
+ _this.creditManager = opts.creditManager;
268
+ return _this;
269
+ }
270
+ TxCloseAccount.prototype.toString = function (_tokenData) {
271
+ return "Credit account ".concat((0, contractsRegister_1.getContractName)(this.creditManager), ": Closing account");
272
+ };
273
+ TxCloseAccount.prototype.serialize = function () {
274
+ return {
275
+ type: "TxCloseAccount",
276
+ content: JSON.stringify(this)
277
+ };
278
+ };
279
+ return TxCloseAccount;
280
+ }(eventOrTx_1.EVMTx));
281
+ exports.TxCloseAccount = TxCloseAccount;
282
+ var TxApprove = /** @class */ (function (_super) {
283
+ __extends(TxApprove, _super);
284
+ function TxApprove(opts) {
285
+ var _this = _super.call(this, {
286
+ block: opts.block,
287
+ txHash: opts.txHash,
288
+ txStatus: opts.txStatus,
289
+ timestamp: opts.timestamp
290
+ }) || this;
291
+ _this.token = opts.token;
292
+ return _this;
293
+ }
294
+ TxApprove.prototype.toString = function (tokenData) {
295
+ var token = tokenData[this.token];
296
+ return "Approve ".concat(token === null || token === void 0 ? void 0 : token.symbol);
297
+ };
298
+ TxApprove.prototype.serialize = function () {
299
+ return {
300
+ type: "TxApprove",
301
+ content: JSON.stringify(this)
302
+ };
303
+ };
304
+ return TxApprove;
305
+ }(eventOrTx_1.EVMTx));
306
+ exports.TxApprove = TxApprove;
package/lib/index.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ export * from "./core/constants";
2
+ export * from "./core/creditAccount";
3
+ export * from "./core/creditManager";
4
+ export * from "./core/creditSession";
5
+ export * from "./core/contracts";
6
+ export * from "./core/events";
7
+ export * from "./core/errors";
8
+ export * from "./core/pool";
9
+ export * from "./core/operations";
10
+ export * from "./core/oracles";
11
+ export * from "./core/swap";
12
+ export * from "./core/token";
13
+ export * from "./core/tokenData";
14
+ export * from "./core/tokenDistributor";
15
+ export * from "./core/trade";
16
+ export * from "./core/transactions";
17
+ export * from "./payload/creditAccount";
18
+ export * from "./payload/creditManager";
19
+ export * from "./payload/creditSession";
20
+ export * from "./payload/pool";
21
+ export * from "./payload/token";
22
+ export * from "./utils/formatter";
23
+ export * from "./utils/loading";
24
+ export * from "./utils/validate";
25
+ export * from "./utils/events";
26
+ export * from "./utils/math";
27
+ export * from "./core/creditCard";
28
+ export * from "./payload/graphPayload";
29
+ export * from "./types/index";
30
+ export type { IAppPoolService, IAppCreditManager, IAppERC20, IAppAddressProvider, IDataCompressor, IWETHGateway, } from "./types";
31
+ export * from "./core/history";
32
+ export { MultiCallContract } from "./utils/multicall";
33
+ export { callRepeater } from "./utils/repeater";
package/lib/index.js ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.callRepeater = exports.MultiCallContract = void 0;
14
+ __exportStar(require("./core/constants"), exports);
15
+ __exportStar(require("./core/creditAccount"), exports);
16
+ __exportStar(require("./core/creditManager"), exports);
17
+ __exportStar(require("./core/creditSession"), exports);
18
+ __exportStar(require("./core/contracts"), exports);
19
+ __exportStar(require("./core/events"), exports);
20
+ __exportStar(require("./core/errors"), exports);
21
+ __exportStar(require("./core/pool"), exports);
22
+ __exportStar(require("./core/operations"), exports);
23
+ __exportStar(require("./core/oracles"), exports);
24
+ __exportStar(require("./core/swap"), exports);
25
+ __exportStar(require("./core/token"), exports);
26
+ __exportStar(require("./core/tokenData"), exports);
27
+ __exportStar(require("./core/tokenDistributor"), exports);
28
+ __exportStar(require("./core/trade"), exports);
29
+ __exportStar(require("./core/transactions"), exports);
30
+ __exportStar(require("./payload/creditAccount"), exports);
31
+ __exportStar(require("./payload/creditManager"), exports);
32
+ __exportStar(require("./payload/creditSession"), exports);
33
+ __exportStar(require("./payload/pool"), exports);
34
+ __exportStar(require("./payload/token"), exports);
35
+ __exportStar(require("./utils/formatter"), exports);
36
+ __exportStar(require("./utils/loading"), exports);
37
+ __exportStar(require("./utils/validate"), exports);
38
+ __exportStar(require("./utils/events"), exports);
39
+ __exportStar(require("./utils/math"), exports);
40
+ __exportStar(require("./core/creditCard"), exports);
41
+ __exportStar(require("./payload/graphPayload"), exports);
42
+ __exportStar(require("./types/index"), exports);
43
+ __exportStar(require("./core/history"), exports);
44
+ var multicall_1 = require("./utils/multicall");
45
+ Object.defineProperty(exports, "MultiCallContract", { enumerable: true, get: function () { return multicall_1.MultiCallContract; } });
46
+ var repeater_1 = require("./utils/repeater");
47
+ Object.defineProperty(exports, "callRepeater", { enumerable: true, get: function () { return repeater_1.callRepeater; } });
@@ -0,0 +1,26 @@
1
+ import { BigNumberish } from "ethers";
2
+ export interface TokenBalancePayload {
3
+ token: string;
4
+ balance: BigNumberish;
5
+ isAllowed: boolean;
6
+ }
7
+ export interface CreditAccountDataPayload {
8
+ addr: string;
9
+ borrower: string;
10
+ inUse: boolean;
11
+ creditManager: string;
12
+ underlyingToken: string;
13
+ borrowedAmountPlusInterest: BigNumberish;
14
+ totalValue: BigNumberish;
15
+ healthFactor: BigNumberish;
16
+ borrowRate: BigNumberish;
17
+ balances?: Array<TokenBalancePayload>;
18
+ }
19
+ export interface CreditAccountDataExtendedPayload extends CreditAccountDataPayload {
20
+ repayAmount: BigNumberish;
21
+ liquidationAmount: BigNumberish;
22
+ canBeClosed?: boolean;
23
+ borrowedAmount: BigNumberish;
24
+ cumulativeIndexAtOpen: BigNumberish;
25
+ since: BigNumberish;
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,43 @@
1
+ import { BigNumberish } from "ethers";
2
+ export interface AdapterPayload {
3
+ allowedContract: string;
4
+ adapter: string;
5
+ }
6
+ export interface CreditManagerDataPayload {
7
+ addr: string;
8
+ hasAccount?: boolean;
9
+ underlyingToken?: string;
10
+ isWETH?: boolean;
11
+ canBorrow?: boolean;
12
+ borrowRate?: BigNumberish;
13
+ minAmount?: BigNumberish;
14
+ maxAmount?: BigNumberish;
15
+ maxLeverageFactor?: BigNumberish;
16
+ availableLiquidity?: BigNumberish;
17
+ allowedTokens?: Array<string>;
18
+ adapters?: Array<AdapterPayload>;
19
+ }
20
+ export interface CreditManagerStatPayload {
21
+ addr: string;
22
+ underlyingToken?: string;
23
+ isWETH?: boolean;
24
+ canBorrow?: boolean;
25
+ borrowRate?: BigNumberish;
26
+ minAmount?: BigNumberish;
27
+ maxAmount?: BigNumberish;
28
+ maxLeverageFactor?: BigNumberish;
29
+ availableLiquidity?: BigNumberish;
30
+ allowedTokens?: Array<string>;
31
+ allowedContracts?: Array<string>;
32
+ uniqueUsers: number;
33
+ openedAccountsCount?: number;
34
+ totalOpenedAccounts?: number;
35
+ totalClosedAccounts?: number;
36
+ totalRepaidAccounts?: number;
37
+ totalLiquidatedAccounts?: number;
38
+ totalBorrowed?: BigNumberish;
39
+ cumulativeBorrowed?: BigNumberish;
40
+ totalRepaid?: BigNumberish;
41
+ totalProfit?: BigNumberish;
42
+ totalLosses?: BigNumberish;
43
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import { BigNumberish } from "ethers";
2
+ import { CreditOperation } from "../core/creditOperation";
3
+ export interface CreditSessionPayload {
4
+ id: string;
5
+ status: number;
6
+ name: string;
7
+ background: string;
8
+ borrower: string;
9
+ creditManager: string;
10
+ account: string;
11
+ since: number;
12
+ sinceTimestamp: number;
13
+ closedAt: number;
14
+ closedAtTimestamp: number;
15
+ initialAmount: BigNumberish;
16
+ borrowedAmount: BigNumberish;
17
+ totalValue?: BigNumberish;
18
+ healthFactor?: BigNumberish;
19
+ profit: BigNumberish;
20
+ profitPercentage: number;
21
+ score: number;
22
+ operations: Array<CreditOperation>;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export interface GraphData {
2
+ time: number;
3
+ value: number;
4
+ }
5
+ export interface GraphPayload {
6
+ id: string;
7
+ title: string;
8
+ data: Array<GraphData>;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { BigNumberish } from "ethers";
2
+ export interface PoolDataPayload {
3
+ addr: string;
4
+ underlyingToken: string;
5
+ dieselToken: string;
6
+ isWETH: boolean;
7
+ expectedLiquidity: BigNumberish;
8
+ expectedLiquidityLimit?: BigNumberish;
9
+ availableLiquidity: BigNumberish;
10
+ totalBorrowed: BigNumberish;
11
+ depositAPY_RAY: BigNumberish;
12
+ borrowAPY_RAY: BigNumberish;
13
+ dieselRate_RAY: BigNumberish;
14
+ withdrawFee: BigNumberish;
15
+ timestampLU?: BigNumberish;
16
+ cumulativeIndex_RAY?: BigNumberish;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //
@@ -0,0 +1,5 @@
1
+ export interface TokenDataPayload {
2
+ addr: string;
3
+ symbol: string;
4
+ decimals: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });