@gearbox-protocol/sdk 0.0.59 → 0.0.62

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 (331) hide show
  1. package/lib/index.d.ts +1 -0
  2. package/lib/index.js +3 -1
  3. package/lib/pathfinder/path.js +9 -8
  4. package/lib/pathfinder/priority.d.ts +1 -1
  5. package/lib/pathfinder/priority.js +11 -11
  6. package/lib/tokens/convex.d.ts +2 -1
  7. package/lib/tokens/convex.js +11 -11
  8. package/lib/tokens/curveLP.d.ts +2 -1
  9. package/lib/tokens/curveLP.js +7 -7
  10. package/lib/tokens/gear.d.ts +2 -1
  11. package/lib/tokens/gear.js +6 -6
  12. package/lib/tokens/normal.d.ts +2 -1
  13. package/lib/tokens/normal.js +29 -29
  14. package/lib/tokens/token.d.ts +0 -12
  15. package/lib/tokens/token.js +1 -14
  16. package/lib/tokens/tokenType.d.ts +12 -0
  17. package/lib/tokens/tokenType.js +16 -0
  18. package/lib/tokens/yearn.d.ts +2 -1
  19. package/lib/tokens/yearn.js +7 -7
  20. package/package.json +1 -1
  21. package/src/index.ts +1 -0
  22. package/src/pathfinder/path.ts +3 -2
  23. package/src/pathfinder/priority.ts +1 -1
  24. package/src/tokens/convex.ts +2 -1
  25. package/src/tokens/curveLP.ts +2 -1
  26. package/src/tokens/gear.ts +2 -1
  27. package/src/tokens/normal.ts +2 -1
  28. package/src/tokens/token.ts +0 -13
  29. package/src/tokens/tokenType.ts +12 -0
  30. package/src/tokens/yearn.ts +2 -1
  31. package/lib/core/pathfinder.d.ts +0 -54
  32. package/lib/core/pathfinder.js +0 -612
  33. package/lib/core/token.d.ts +0 -104
  34. package/lib/core/token.js +0 -1359
  35. package/lib/core/tokenData.d.ts +0 -24
  36. package/lib/core/tokenData.js +0 -57
  37. package/lib/pathfinder/connector.d.ts +0 -7
  38. package/lib/pathfinder/connector.js +0 -78
  39. package/lib/pathfinder/connectorPathAsset.d.ts +0 -7
  40. package/lib/pathfinder/connectorPathAsset.js +0 -144
  41. package/lib/pathfinder/convexLPTokenPathAsset.d.ts +0 -5
  42. package/lib/pathfinder/convexLPTokenPathAsset.js +0 -77
  43. package/lib/pathfinder/curveLPPathAsset.d.ts +0 -5
  44. package/lib/pathfinder/curveLPPathAsset.js +0 -72
  45. package/lib/pathfinder/curveMetaLP.d.ts +0 -5
  46. package/lib/pathfinder/curveMetaLP.js +0 -72
  47. package/lib/pathfinder/metaCurveLPPathAsset.d.ts +0 -5
  48. package/lib/pathfinder/metaCurveLPPathAsset.js +0 -72
  49. package/lib/pathfinder/normalToken.d.ts +0 -7
  50. package/lib/pathfinder/normalToken.js +0 -78
  51. package/lib/pathfinder/normalTokenPathAsset.d.ts +0 -5
  52. package/lib/pathfinder/normalTokenPathAsset.js +0 -136
  53. package/lib/pathfinder/notes.d.ts +0 -4
  54. package/lib/pathfinder/notes.js +0 -58
  55. package/lib/pathfinder/pathfinder.d.ts +0 -24
  56. package/lib/pathfinder/pathfinder.js +0 -132
  57. package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.d.ts +0 -5
  58. package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.js +0 -87
  59. package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.d.ts +0 -5
  60. package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.js +0 -87
  61. package/lib/pathfinder/yearnVaultPathAsset.d.ts +0 -5
  62. package/lib/pathfinder/yearnVaultPathAsset.js +0 -87
  63. package/lib/types/ACL.d.ts +0 -491
  64. package/lib/types/ACLTrait.d.ts +0 -148
  65. package/lib/types/ACLTraitTest.d.ts +0 -209
  66. package/lib/types/AccountFactory.d.ts +0 -716
  67. package/lib/types/AccountMining.d.ts +0 -222
  68. package/lib/types/AddressProvider.d.ts +0 -912
  69. package/lib/types/AggregatorV3Interface.d.ts +0 -234
  70. package/lib/types/ChainlinkPriceFeedMock.d.ts +0 -215
  71. package/lib/types/ContractsRegister.d.ts +0 -398
  72. package/lib/types/CreditAccount.d.ts +0 -443
  73. package/lib/types/CreditFilter.d.ts +0 -1609
  74. package/lib/types/CreditFilterMock.d.ts +0 -1687
  75. package/lib/types/CreditManager.d.ts +0 -1285
  76. package/lib/types/CreditManagerMockForFilter.d.ts +0 -605
  77. package/lib/types/CreditManagerMockForPoolTest.d.ts +0 -204
  78. package/lib/types/CurveMock.d.ts +0 -298
  79. package/lib/types/CurveV1Adapter.d.ts +0 -349
  80. package/lib/types/DataCompressor.d.ts +0 -1331
  81. package/lib/types/DieselToken.d.ts +0 -567
  82. package/lib/types/ERC165.d.ts +0 -116
  83. package/lib/types/ERC20.d.ts +0 -411
  84. package/lib/types/ERC20BlockingMock.d.ts +0 -568
  85. package/lib/types/ERC721.d.ts +0 -625
  86. package/lib/types/Errors.d.ts +0 -1854
  87. package/lib/types/ExecutorMock.d.ts +0 -140
  88. package/lib/types/FlashLoanAttacker.d.ts +0 -170
  89. package/lib/types/FuzzHarness.d.ts +0 -124
  90. package/lib/types/GearBeta.d.ts +0 -745
  91. package/lib/types/GearToken.d.ts +0 -888
  92. package/lib/types/IAccountFactory.d.ts +0 -317
  93. package/lib/types/IAccountMiner.d.ts +0 -124
  94. package/lib/types/IAppAddressProvider.d.ts +0 -198
  95. package/lib/types/IAppCreditManager.d.ts +0 -408
  96. package/lib/types/IAppERC20.d.ts +0 -309
  97. package/lib/types/IAppPoolService.d.ts +0 -166
  98. package/lib/types/ICreditAccount.d.ts +0 -430
  99. package/lib/types/ICreditFilter.d.ts +0 -1162
  100. package/lib/types/ICreditManager.d.ts +0 -971
  101. package/lib/types/ICurvePool.d.ts +0 -298
  102. package/lib/types/IDataCompressor.d.ts +0 -1231
  103. package/lib/types/IERC165.d.ts +0 -116
  104. package/lib/types/IERC20.d.ts +0 -294
  105. package/lib/types/IERC721.d.ts +0 -472
  106. package/lib/types/IERC721Enumerable.d.ts +0 -564
  107. package/lib/types/IERC721Metadata.d.ts +0 -523
  108. package/lib/types/IERC721Receiver.d.ts +0 -132
  109. package/lib/types/IGearToken.d.ts +0 -527
  110. package/lib/types/IInterestRateModel.d.ts +0 -121
  111. package/lib/types/IMerkleDistributor.d.ts +0 -190
  112. package/lib/types/IPoolService.d.ts +0 -772
  113. package/lib/types/IPriceOracle.d.ts +0 -211
  114. package/lib/types/IQuoter.d.ts +0 -269
  115. package/lib/types/ISwapRouter.d.ts +0 -404
  116. package/lib/types/IUniswapV2Migrator.d.ts +0 -134
  117. package/lib/types/IUniswapV2Router01.d.ts +0 -1119
  118. package/lib/types/IUniswapV2Router02.d.ts +0 -1432
  119. package/lib/types/IUniswapV3SwapCallback.d.ts +0 -127
  120. package/lib/types/IWETH.d.ts +0 -169
  121. package/lib/types/IWETHGateway.d.ts +0 -335
  122. package/lib/types/IYVault.d.ts +0 -558
  123. package/lib/types/LeveragedActions.d.ts +0 -772
  124. package/lib/types/LinearInterestRateModel.d.ts +0 -279
  125. package/lib/types/MockPoolService.d.ts +0 -1271
  126. package/lib/types/Multicall2.d.ts +0 -449
  127. package/lib/types/Ownable.d.ts +0 -169
  128. package/lib/types/PathFinder.d.ts +0 -379
  129. package/lib/types/Pausable.d.ts +0 -105
  130. package/lib/types/PercentageMathTest.d.ts +0 -154
  131. package/lib/types/PoolService.d.ts +0 -1174
  132. package/lib/types/PriceOracle.d.ts +0 -387
  133. package/lib/types/StepVesting.d.ts +0 -411
  134. package/lib/types/TestPoolService.d.ts +0 -1294
  135. package/lib/types/TokenDistributor.d.ts +0 -640
  136. package/lib/types/TokenFeeMock.d.ts +0 -544
  137. package/lib/types/TokenMock.d.ts +0 -531
  138. package/lib/types/TreasuryMock.d.ts +0 -86
  139. package/lib/types/UniswapRouterMock.d.ts +0 -1520
  140. package/lib/types/UniswapV2Adapter.d.ts +0 -1463
  141. package/lib/types/UniswapV3Adapter.d.ts +0 -455
  142. package/lib/types/WETHGateway.d.ts +0 -376
  143. package/lib/types/WETHMock.d.ts +0 -433
  144. package/lib/types/WadRayMathTest.d.ts +0 -316
  145. package/lib/types/YearnAdapter.d.ts +0 -609
  146. package/lib/types/YearnMock.d.ts +0 -795
  147. package/lib/types/YearnPriceFeed.d.ts +0 -399
  148. package/lib/types/commons.d.ts +0 -16
  149. package/lib/types/commons.js +0 -5
  150. package/lib/types/contracts/support/PathFinder.d.ts +0 -154
  151. package/lib/types/contracts/support/PathFinder.js +0 -2
  152. package/lib/types/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/ClaimZapFormatter.d.ts +0 -52
  153. package/lib/types/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/ClaimZapFormatter.js +0 -2
  154. package/lib/types/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/index.d.ts +0 -1
  155. package/lib/types/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/index.js +0 -2
  156. package/lib/types/factories/ACLTraitTest__factory.d.ts +0 -52
  157. package/lib/types/factories/ACLTraitTest__factory.js +0 -138
  158. package/lib/types/factories/ACLTrait__factory.d.ts +0 -31
  159. package/lib/types/factories/ACLTrait__factory.js +0 -75
  160. package/lib/types/factories/ACL__factory.d.ts +0 -45
  161. package/lib/types/factories/ACL__factory.js +0 -317
  162. package/lib/types/factories/AccountFactory__factory.d.ts +0 -72
  163. package/lib/types/factories/AccountFactory__factory.js +0 -508
  164. package/lib/types/factories/AccountMining__factory.d.ts +0 -56
  165. package/lib/types/factories/AccountMining__factory.js +0 -192
  166. package/lib/types/factories/AddressProvider__factory.d.ts +0 -52
  167. package/lib/types/factories/AddressProvider__factory.js +0 -582
  168. package/lib/types/factories/AggregatorV3Interface__factory.d.ts +0 -22
  169. package/lib/types/factories/AggregatorV3Interface__factory.js +0 -133
  170. package/lib/types/factories/ChainlinkPriceFeedMock__factory.d.ts +0 -42
  171. package/lib/types/factories/ChainlinkPriceFeedMock__factory.js +0 -193
  172. package/lib/types/factories/ContractsRegister__factory.d.ts +0 -56
  173. package/lib/types/factories/ContractsRegister__factory.js +0 -310
  174. package/lib/types/factories/CreditAccount__factory.d.ts +0 -32
  175. package/lib/types/factories/CreditAccount__factory.js +0 -262
  176. package/lib/types/factories/CreditFilterMock__factory.d.ts +0 -56
  177. package/lib/types/factories/CreditFilterMock__factory.js +0 -1083
  178. package/lib/types/factories/CreditFilter__factory.d.ts +0 -56
  179. package/lib/types/factories/CreditFilter__factory.js +0 -1047
  180. package/lib/types/factories/CreditManagerMockForFilter__factory.d.ts +0 -38
  181. package/lib/types/factories/CreditManagerMockForFilter__factory.js +0 -324
  182. package/lib/types/factories/CreditManagerMockForPoolTest__factory.d.ts +0 -48
  183. package/lib/types/factories/CreditManagerMockForPoolTest__factory.js +0 -131
  184. package/lib/types/factories/CreditManager__factory.d.ts +0 -77
  185. package/lib/types/factories/CreditManager__factory.js +0 -1030
  186. package/lib/types/factories/CurveMock__factory.d.ts +0 -42
  187. package/lib/types/factories/CurveMock__factory.js +0 -210
  188. package/lib/types/factories/CurveV1Adapter__factory.d.ts +0 -42
  189. package/lib/types/factories/CurveV1Adapter__factory.js +0 -254
  190. package/lib/types/factories/DataCompressor__factory.d.ts +0 -71
  191. package/lib/types/factories/DataCompressor__factory.js +0 -944
  192. package/lib/types/factories/DieselToken__factory.d.ts +0 -56
  193. package/lib/types/factories/DieselToken__factory.js +0 -432
  194. package/lib/types/factories/ERC165__factory.d.ts +0 -22
  195. package/lib/types/factories/ERC165__factory.js +0 -41
  196. package/lib/types/factories/ERC20BlockingMock__factory.d.ts +0 -56
  197. package/lib/types/factories/ERC20BlockingMock__factory.js +0 -429
  198. package/lib/types/factories/ERC20__factory.d.ts +0 -56
  199. package/lib/types/factories/ERC20__factory.js +0 -339
  200. package/lib/types/factories/ERC721__factory.d.ts +0 -56
  201. package/lib/types/factories/ERC721__factory.js +0 -468
  202. package/lib/types/factories/Errors__factory.d.ts +0 -28
  203. package/lib/types/factories/Errors__factory.js +0 -1015
  204. package/lib/types/factories/ExecutorMock__factory.d.ts +0 -38
  205. package/lib/types/factories/ExecutorMock__factory.js +0 -103
  206. package/lib/types/factories/FlashLoanAttacker__factory.d.ts +0 -48
  207. package/lib/types/factories/FlashLoanAttacker__factory.js +0 -117
  208. package/lib/types/factories/FuzzHarness__factory.d.ts +0 -38
  209. package/lib/types/factories/FuzzHarness__factory.js +0 -92
  210. package/lib/types/factories/GearBeta__factory.d.ts +0 -52
  211. package/lib/types/factories/GearBeta__factory.js +0 -527
  212. package/lib/types/factories/GearToken__factory.d.ts +0 -56
  213. package/lib/types/factories/GearToken__factory.js +0 -708
  214. package/lib/types/factories/IAccountFactory__factory.d.ts +0 -35
  215. package/lib/types/factories/IAccountFactory__factory.js +0 -226
  216. package/lib/types/factories/IAccountMiner__factory.d.ts +0 -28
  217. package/lib/types/factories/IAccountMiner__factory.js +0 -48
  218. package/lib/types/factories/IAppAddressProvider__factory.d.ts +0 -18
  219. package/lib/types/factories/IAppAddressProvider__factory.js +0 -100
  220. package/lib/types/factories/IAppCreditManager__factory.d.ts +0 -42
  221. package/lib/types/factories/IAppCreditManager__factory.js +0 -204
  222. package/lib/types/factories/IAppERC20__factory.d.ts +0 -22
  223. package/lib/types/factories/IAppERC20__factory.js +0 -194
  224. package/lib/types/factories/IAppPoolService__factory.d.ts +0 -22
  225. package/lib/types/factories/IAppPoolService__factory.js +0 -69
  226. package/lib/types/factories/ICreditAccount__factory.d.ts +0 -22
  227. package/lib/types/factories/ICreditAccount__factory.js +0 -218
  228. package/lib/types/factories/ICreditFilter__factory.d.ts +0 -35
  229. package/lib/types/factories/ICreditFilter__factory.js +0 -700
  230. package/lib/types/factories/ICreditManager__factory.d.ts +0 -56
  231. package/lib/types/factories/ICreditManager__factory.js +0 -720
  232. package/lib/types/factories/ICurvePool__factory.d.ts +0 -22
  233. package/lib/types/factories/ICurvePool__factory.js +0 -168
  234. package/lib/types/factories/IDataCompressor__factory.d.ts +0 -51
  235. package/lib/types/factories/IDataCompressor__factory.js +0 -826
  236. package/lib/types/factories/IERC165__factory.d.ts +0 -22
  237. package/lib/types/factories/IERC165__factory.js +0 -41
  238. package/lib/types/factories/IERC20__factory.d.ts +0 -35
  239. package/lib/types/factories/IERC20__factory.js +0 -205
  240. package/lib/types/factories/IERC721Enumerable__factory.d.ts +0 -35
  241. package/lib/types/factories/IERC721Enumerable__factory.js +0 -363
  242. package/lib/types/factories/IERC721Metadata__factory.d.ts +0 -35
  243. package/lib/types/factories/IERC721Metadata__factory.js +0 -352
  244. package/lib/types/factories/IERC721Receiver__factory.d.ts +0 -22
  245. package/lib/types/factories/IERC721Receiver__factory.js +0 -56
  246. package/lib/types/factories/IERC721__factory.d.ts +0 -35
  247. package/lib/types/factories/IERC721__factory.js +0 -307
  248. package/lib/types/factories/IGearToken__factory.d.ts +0 -35
  249. package/lib/types/factories/IGearToken__factory.js +0 -342
  250. package/lib/types/factories/IInterestRateModel__factory.d.ts +0 -22
  251. package/lib/types/factories/IInterestRateModel__factory.js +0 -46
  252. package/lib/types/factories/IMerkleDistributor__factory.d.ts +0 -35
  253. package/lib/types/factories/IMerkleDistributor__factory.js +0 -109
  254. package/lib/types/factories/IPoolService__factory.d.ts +0 -35
  255. package/lib/types/factories/IPoolService__factory.js +0 -580
  256. package/lib/types/factories/IPriceOracle__factory.d.ts +0 -35
  257. package/lib/types/factories/IPriceOracle__factory.js +0 -112
  258. package/lib/types/factories/IQuoter__factory.d.ts +0 -22
  259. package/lib/types/factories/IQuoter__factory.js +0 -148
  260. package/lib/types/factories/ISwapRouter__factory.d.ts +0 -27
  261. package/lib/types/factories/ISwapRouter__factory.js +0 -236
  262. package/lib/types/factories/IUniswapV2Migrator__factory.d.ts +0 -18
  263. package/lib/types/factories/IUniswapV2Migrator__factory.js +0 -55
  264. package/lib/types/factories/IUniswapV2Router01__factory.d.ts +0 -22
  265. package/lib/types/factories/IUniswapV2Router01__factory.js +0 -771
  266. package/lib/types/factories/IUniswapV2Router02__factory.d.ts +0 -22
  267. package/lib/types/factories/IUniswapV2Router02__factory.js +0 -973
  268. package/lib/types/factories/IUniswapV3SwapCallback__factory.d.ts +0 -18
  269. package/lib/types/factories/IUniswapV3SwapCallback__factory.js +0 -45
  270. package/lib/types/factories/IWETHGateway__factory.d.ts +0 -18
  271. package/lib/types/factories/IWETHGateway__factory.js +0 -150
  272. package/lib/types/factories/IWETH__factory.d.ts +0 -22
  273. package/lib/types/factories/IWETH__factory.js +0 -66
  274. package/lib/types/factories/IYVault__factory.d.ts +0 -35
  275. package/lib/types/factories/IYVault__factory.js +0 -411
  276. package/lib/types/factories/LeveragedActions__factory.d.ts +0 -84
  277. package/lib/types/factories/LeveragedActions__factory.js +0 -569
  278. package/lib/types/factories/LinearInterestRateModel__factory.d.ts +0 -42
  279. package/lib/types/factories/LinearInterestRateModel__factory.js +0 -209
  280. package/lib/types/factories/MockPoolService__factory.d.ts +0 -56
  281. package/lib/types/factories/MockPoolService__factory.js +0 -889
  282. package/lib/types/factories/Multicall2__factory.d.ts +0 -52
  283. package/lib/types/factories/Multicall2__factory.js +0 -364
  284. package/lib/types/factories/Ownable__factory.d.ts +0 -42
  285. package/lib/types/factories/Ownable__factory.js +0 -74
  286. package/lib/types/factories/PathFinder__factory.d.ts +0 -61
  287. package/lib/types/factories/PathFinder__factory.js +0 -302
  288. package/lib/types/factories/Pausable__factory.d.ts +0 -31
  289. package/lib/types/factories/Pausable__factory.js +0 -61
  290. package/lib/types/factories/PercentageMathTest__factory.d.ts +0 -32
  291. package/lib/types/factories/PercentageMathTest__factory.js +0 -101
  292. package/lib/types/factories/PoolService__factory.d.ts +0 -56
  293. package/lib/types/factories/PoolService__factory.js +0 -873
  294. package/lib/types/factories/PriceOracle__factory.d.ts +0 -56
  295. package/lib/types/factories/PriceOracle__factory.js +0 -290
  296. package/lib/types/factories/StepVesting__factory.d.ts +0 -52
  297. package/lib/types/factories/StepVesting__factory.js +0 -296
  298. package/lib/types/factories/TestPoolService__factory.d.ts +0 -56
  299. package/lib/types/factories/TestPoolService__factory.js +0 -932
  300. package/lib/types/factories/TokenDistributor__factory.d.ts +0 -82
  301. package/lib/types/factories/TokenDistributor__factory.js +0 -481
  302. package/lib/types/factories/TokenFeeMock__factory.d.ts +0 -56
  303. package/lib/types/factories/TokenFeeMock__factory.js +0 -427
  304. package/lib/types/factories/TokenMock__factory.d.ts +0 -56
  305. package/lib/types/factories/TokenMock__factory.js +0 -409
  306. package/lib/types/factories/TreasuryMock__factory.d.ts +0 -35
  307. package/lib/types/factories/TreasuryMock__factory.js +0 -70
  308. package/lib/types/factories/UniswapRouterMock__factory.d.ts +0 -32
  309. package/lib/types/factories/UniswapRouterMock__factory.js +0 -1046
  310. package/lib/types/factories/UniswapV2Adapter__factory.d.ts +0 -42
  311. package/lib/types/factories/UniswapV2Adapter__factory.js +0 -1059
  312. package/lib/types/factories/UniswapV3Adapter__factory.d.ts +0 -47
  313. package/lib/types/factories/UniswapV3Adapter__factory.js +0 -322
  314. package/lib/types/factories/WETHGateway__factory.d.ts +0 -70
  315. package/lib/types/factories/WETHGateway__factory.js +0 -241
  316. package/lib/types/factories/WETHMock__factory.d.ts +0 -52
  317. package/lib/types/factories/WETHMock__factory.js +0 -355
  318. package/lib/types/factories/WadRayMathTest__factory.d.ts +0 -32
  319. package/lib/types/factories/WadRayMathTest__factory.js +0 -239
  320. package/lib/types/factories/YearnAdapter__factory.d.ts +0 -56
  321. package/lib/types/factories/YearnAdapter__factory.js +0 -497
  322. package/lib/types/factories/YearnMock__factory.d.ts +0 -56
  323. package/lib/types/factories/YearnMock__factory.js +0 -598
  324. package/lib/types/factories/YearnPriceFeed__factory.d.ts +0 -56
  325. package/lib/types/factories/YearnPriceFeed__factory.js +0 -350
  326. package/lib/types/factories/contracts/support/PathFinder__factory.d.ts +0 -63
  327. package/lib/types/factories/contracts/support/PathFinder__factory.js +0 -319
  328. package/lib/types/factories/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/ClaimZapFormatter__factory.d.ts +0 -34
  329. package/lib/types/factories/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/ClaimZapFormatter__factory.js +0 -124
  330. package/lib/types/factories/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/index.d.ts +0 -1
  331. package/lib/types/factories/contracts/test/mocks/integrations/ConvexClaimZapFormatter.sol/index.js +0 -8
@@ -1,78 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.NormalTokenPathFinder = void 0;
55
- var path_1 = require("./path");
56
- var NormalTokenPathFinder = /** @class */ (function (_super) {
57
- __extends(NormalTokenPathFinder, _super);
58
- function NormalTokenPathFinder(_token) {
59
- var _this = _super.call(this) || this;
60
- _this.token = _token;
61
- return _this;
62
- }
63
- NormalTokenPathFinder.prototype.getBestPath = function (p) {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var currentBalance;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- currentBalance = p.popBalance(this.token);
70
- return [4 /*yield*/, p.getBestPath()];
71
- case 1: return [2 /*return*/, _a.sent()];
72
- }
73
- });
74
- });
75
- };
76
- return NormalTokenPathFinder;
77
- }(path_1.PathAsset));
78
- exports.NormalTokenPathFinder = NormalTokenPathFinder;
@@ -1,5 +0,0 @@
1
- import { SupportedToken } from "../core/token";
2
- import { Path, PathAsset } from "./path";
3
- export declare class NormalTokenPathAsset extends PathAsset {
4
- getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
5
- }
@@ -1,136 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.NormalTokenPathAsset = void 0;
55
- var ethers_1 = require("ethers");
56
- var token_1 = require("../core/token");
57
- var path_1 = require("./path");
58
- var connectorPathAsset_1 = require("./connectorPathAsset");
59
- var NormalTokenPathAsset = /** @class */ (function (_super) {
60
- __extends(NormalTokenPathAsset, _super);
61
- function NormalTokenPathAsset() {
62
- return _super !== null && _super.apply(this, arguments) || this;
63
- }
64
- NormalTokenPathAsset.prototype.getBestPath = function (currentToken, p) {
65
- return __awaiter(this, void 0, void 0, function () {
66
- var currentBalance, currentTokenAddress, currentTokenData, actionData, nextToken, maxPoolAmountOut, _i, ConnectorTokens_1, connToken, connTokenAddress, _a, _b, swapAction, tmpActionData, connectorPathAsset, poolAmountOut;
67
- return __generator(this, function (_c) {
68
- switch (_c.label) {
69
- case 0:
70
- currentBalance = p.balances[currentToken].sub(1);
71
- currentTokenAddress = token_1.tokenDataByNetwork[p.networkType][currentToken];
72
- currentTokenData = token_1.supportedTokens[currentToken];
73
- actionData = {
74
- callData: {
75
- targetContract: "",
76
- callData: ""
77
- },
78
- amountOut: ethers_1.BigNumber.from(0),
79
- gasLimit: ethers_1.BigNumber.from(0),
80
- };
81
- nextToken = p.pool;
82
- maxPoolAmountOut = ethers_1.BigNumber.from(0);
83
- _i = 0, ConnectorTokens_1 = token_1.ConnectorTokens;
84
- _c.label = 1;
85
- case 1:
86
- if (!(_i < ConnectorTokens_1.length)) return [3 /*break*/, 8];
87
- connToken = ConnectorTokens_1[_i];
88
- connTokenAddress = token_1.tokenDataByNetwork[p.networkType][connToken];
89
- _a = 0, _b = currentTokenData.swapActions;
90
- _c.label = 2;
91
- case 2:
92
- if (!(_a < _b.length)) return [3 /*break*/, 7];
93
- swapAction = _b[_a];
94
- return [4 /*yield*/, this.getActionData(swapAction, currentTokenAddress, currentToken, currentBalance, connTokenAddress, connToken, p)];
95
- case 3:
96
- tmpActionData = _c.sent();
97
- if (!(connToken != p.pool)) return [3 /*break*/, 5];
98
- connectorPathAsset = new connectorPathAsset_1.ConnectorPathAsset();
99
- return [4 /*yield*/, connectorPathAsset.getMaxPoolAmount(connToken, actionData.amountOut, p)];
100
- case 4:
101
- poolAmountOut = _c.sent();
102
- if (poolAmountOut > maxPoolAmountOut) {
103
- maxPoolAmountOut = poolAmountOut;
104
- actionData = tmpActionData;
105
- nextToken = connToken;
106
- }
107
- return [3 /*break*/, 6];
108
- case 5:
109
- if (actionData.amountOut > maxPoolAmountOut) {
110
- maxPoolAmountOut = actionData.amountOut;
111
- actionData = tmpActionData;
112
- nextToken = p.pool;
113
- }
114
- _c.label = 6;
115
- case 6:
116
- _a++;
117
- return [3 /*break*/, 2];
118
- case 7:
119
- _i++;
120
- return [3 /*break*/, 1];
121
- case 8:
122
- if (actionData.callData.targetContract != "") {
123
- p.balances[nextToken].add(actionData.amountOut);
124
- p.balances[currentToken] = ethers_1.BigNumber.from(1);
125
- p.totalGasLimit.add(actionData.gasLimit);
126
- p.calls.push(actionData.callData);
127
- }
128
- return [4 /*yield*/, p.getBestPath()];
129
- case 9: return [2 /*return*/, _c.sent()];
130
- }
131
- });
132
- });
133
- };
134
- return NormalTokenPathAsset;
135
- }(path_1.PathAsset));
136
- exports.NormalTokenPathAsset = NormalTokenPathAsset;
@@ -1,4 +0,0 @@
1
- import { PathAsset, Path } from "./pathfinder";
2
- export declare class ConnectorPathAsset implements PathAsset {
3
- getBestPath(p: Path): Promise<Path>;
4
- }
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConnectorPathAsset = void 0;
4
- var ConnectorPathAsset = /** @class */ (function () {
5
- function ConnectorPathAsset() {
6
- }
7
- ConnectorPathAsset.prototype.getBestPath = function (p) {
8
- console.log(p);
9
- // How to unwrap
10
- // set balance of current token to 0
11
- // add balnace what we get
12
- // add call
13
- // create new Paths
14
- // 3CRV:
15
- // coinst balance3crv = p.balance["3rcv"];
16
- // const p.balance["3rcv"] = 0;
17
- // DAI
18
- // const daiPath = {...p};
19
- // const daiPath["Dai"] = await curve.getAmount(t balance3crv);
20
- // const pathDai = new Path(daiPath)
21
- // ...
22
- // const bestPath = pathDai.balance[0] > pathUSDC.balance(0) ? pathDai : pathUsdc;
23
- // --- DAI
24
- // --|
25
- // --- USDC
26
- //
27
- // NORMAL TOKEN
28
- // ============
29
- //
30
- // - NORMAL -> POOL (1 pair) => #1
31
- // for(let conn of connectors) {
32
- // const result = getAmount([NORMAL, conn, pool])
33
- // }
34
- // => best Path to get max Pool tokens
35
- // const resultInConnector = getAmount([NORMAL, conn]);
36
- // calls.push("Uniswap.swap(NORMAL, conn)");
37
- // CRV => CRV -> USDC -> DAI
38
- // LINK => LINK -> USDC -> DAI
39
- //
40
- // [UniV2.swap("CRV", "USDC"),
41
- // UniV3.swap("LINK", "USDC"),
42
- // Curve.exchange("USDC", "DAI")]
43
- //
44
- // Below is not optimal:
45
- // [ UniV2.swap("CRV -> USDC -> DAI"),
46
- // UniV2.swap("LINK -> USDC -> DAI")]
47
- //
48
- //
49
- // [ UniV2.swap("CRV -> USDC")
50
- // UniV2.swap("USDC -> DAI"),
51
- // UniV2.swap("LINK -> USDC"),
52
- // UniV2.swap("USDC -> DAI") ]
53
- // return maxValuable(new Paths.getBestPath())
54
- throw new Error("Method not implemented.");
55
- };
56
- return ConnectorPathAsset;
57
- }());
58
- exports.ConnectorPathAsset = ConnectorPathAsset;
@@ -1,24 +0,0 @@
1
- import { BigNumber } from "ethers";
2
- import { CreditManagerData } from "./creditManager";
3
- import { MultiCall } from "./multicall";
4
- import { SupportedToken } from "./token";
5
- export declare class Path {
6
- readonly calls: Array<MultiCall>;
7
- readonly balances: Record<SupportedToken, BigNumber>;
8
- protected _gasUsed: number;
9
- readonly pool: SupportedToken;
10
- readonly creditManager: CreditManagerData;
11
- constructor(opts: {
12
- gasUsed: number;
13
- balances: Record<SupportedToken, BigNumber>;
14
- pool: SupportedToken;
15
- creditManager: CreditManagerData;
16
- });
17
- getBestPath(): Promise<Path>;
18
- }
19
- export interface PathAsset {
20
- getBestPath(p: Path): Promise<Path>;
21
- }
22
- export declare class ConnectorPathAsset implements PathAsset {
23
- getBestPath(p: Path): Promise<Path>;
24
- }
@@ -1,132 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.ConnectorPathAsset = exports.Path = void 0;
40
- // const path = new Path({gasUsed:0, balances: creditAccount.balances, })
41
- // const closurePath = await path.getBestPath();
42
- // closurePath.calls -> multicalls (!)
43
- // closurePath.balances[path.pool] = (X)
44
- // closurePath.balances[!path.pool] = 0 / 1;
45
- //
46
- // [0,0,0, 100]
47
- // [ 12, 12, 12, 0]
48
- var Path = /** @class */ (function () {
49
- function Path(opts) {
50
- this.calls = [];
51
- this._gasUsed = opts.gasUsed;
52
- this.balances = opts.balances;
53
- this.pool = opts.pool;
54
- this.creditManager = opts.creditManager;
55
- }
56
- Path.prototype.getBestPath = function () {
57
- return __awaiter(this, void 0, void 0, function () {
58
- return __generator(this, function (_a) {
59
- // const nextToken = Object.entries(this.balances).filter(([token, balance]) => balance.gt(1) ) //.sort((a,b) => {})
60
- // if (nextToken.length ===1 ) {
61
- // }
62
- // Get balances and keep non-zero only
63
- // Find token with highest priority
64
- // Get token type of this token
65
- // switch (type) {
66
- // case TokenType.YearnValut:
67
- // const assetPathClass = new YearnPathAsset();
68
- // return assetPathClass.getBestPath(this);
69
- // ...
70
- //}
71
- throw new Error("Not implmented");
72
- });
73
- });
74
- };
75
- return Path;
76
- }());
77
- exports.Path = Path;
78
- var ConnectorPathAsset = /** @class */ (function () {
79
- function ConnectorPathAsset() {
80
- }
81
- ConnectorPathAsset.prototype.getBestPath = function (p) {
82
- console.log(p);
83
- // How to unwrap
84
- // set balance of current token to 0
85
- // add balnace what we get
86
- // add call
87
- // create new Paths
88
- // 3CRV:
89
- // coinst balance3crv = p.balance["3rcv"];
90
- // const p.balance["3rcv"] = 0;
91
- // DAI
92
- // const daiPath = {...p};
93
- // const daiPath["Dai"] = await curve.getAmount(t balance3crv);
94
- // const pathDai = new Path(daiPath)
95
- // ...
96
- // const bestPath = pathDai.balance[0] > pathUSDC.balance(0) ? pathDai : pathUsdc;
97
- // --- DAI
98
- // --|
99
- // --- USDC
100
- //
101
- // NORMAL TOKEN
102
- // ============
103
- //
104
- // - NORMAL -> POOL (1 pair) => #1
105
- // for(let conn of connectors) {
106
- // const result = getAmount([NORMAL, conn, pool])
107
- // }
108
- // => best Path to get max Pool tokens
109
- // const resultInConnector = getAmount([NORMAL, conn]);
110
- // calls.push("Uniswap.swap(NORMAL, conn)");
111
- // CRV => CRV -> USDC -> DAI
112
- // LINK => LINK -> USDC -> DAI
113
- //
114
- // [UniV2.swap("CRV", "USDC"),
115
- // UniV3.swap("LINK", "USDC"),
116
- // Curve.exchange("USDC", "DAI")]
117
- //
118
- // Below is not optimal:
119
- // [ UniV2.swap("CRV -> USDC -> DAI"),
120
- // UniV2.swap("LINK -> USDC -> DAI")]
121
- //
122
- //
123
- // [ UniV2.swap("CRV -> USDC")
124
- // UniV2.swap("USDC -> DAI"),
125
- // UniV2.swap("LINK -> USDC"),
126
- // UniV2.swap("USDC -> DAI") ]
127
- // return maxValuable(new Paths.getBestPath())
128
- throw new Error("Method not implemented.");
129
- };
130
- return ConnectorPathAsset;
131
- }());
132
- exports.ConnectorPathAsset = ConnectorPathAsset;
@@ -1,5 +0,0 @@
1
- import { SupportedToken } from "../core/token";
2
- import { Path, PathAsset } from "./path";
3
- export declare class YearnVaultOfCurveLPPathAsset extends PathAsset {
4
- getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
5
- }
@@ -1,87 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.YearnVaultOfCurveLPPathAsset = void 0;
55
- var token_1 = require("../core/token");
56
- var path_1 = require("./path");
57
- var ethers_1 = require("ethers");
58
- var YearnVaultOfCurveLPPathAsset = /** @class */ (function (_super) {
59
- __extends(YearnVaultOfCurveLPPathAsset, _super);
60
- function YearnVaultOfCurveLPPathAsset() {
61
- return _super !== null && _super.apply(this, arguments) || this;
62
- }
63
- YearnVaultOfCurveLPPathAsset.prototype.getBestPath = function (currentToken, p) {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var currentBalance, currentTokenData, outputToken, yearnActionData;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- currentBalance = p.balances[currentToken].sub(1);
70
- currentTokenData = token_1.supportedTokens[currentToken];
71
- outputToken = currentTokenData.lpActions[0].tokenOut;
72
- return [4 /*yield*/, this.getYearnActionData(currentTokenData.lpActions[0], currentBalance, p)];
73
- case 1:
74
- yearnActionData = _a.sent();
75
- p.balances[outputToken].add(yearnActionData.amountOut);
76
- p.balances[currentToken] = ethers_1.BigNumber.from(1);
77
- p.totalGasLimit.add(yearnActionData.gasLimit);
78
- p.calls.push(yearnActionData.callData);
79
- return [4 /*yield*/, p.getBestPath()];
80
- case 2: return [2 /*return*/, _a.sent()];
81
- }
82
- });
83
- });
84
- };
85
- return YearnVaultOfCurveLPPathAsset;
86
- }(path_1.PathAsset));
87
- exports.YearnVaultOfCurveLPPathAsset = YearnVaultOfCurveLPPathAsset;
@@ -1,5 +0,0 @@
1
- import { SupportedToken } from "../core/token";
2
- import { Path, PathAsset } from "./path";
3
- export declare class YearnVaultOfMetaCurveLPPathAsset extends PathAsset {
4
- getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
5
- }
@@ -1,87 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.YearnVaultOfMetaCurveLPPathAsset = void 0;
55
- var token_1 = require("../core/token");
56
- var path_1 = require("./path");
57
- var ethers_1 = require("ethers");
58
- var YearnVaultOfMetaCurveLPPathAsset = /** @class */ (function (_super) {
59
- __extends(YearnVaultOfMetaCurveLPPathAsset, _super);
60
- function YearnVaultOfMetaCurveLPPathAsset() {
61
- return _super !== null && _super.apply(this, arguments) || this;
62
- }
63
- YearnVaultOfMetaCurveLPPathAsset.prototype.getBestPath = function (currentToken, p) {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var currentBalance, currentTokenData, outputToken, yearnActionData;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- currentBalance = p.balances[currentToken].sub(1);
70
- currentTokenData = token_1.supportedTokens[currentToken];
71
- outputToken = currentTokenData.lpActions[0].tokenOut;
72
- return [4 /*yield*/, this.getYearnActionData(currentTokenData.lpActions[0], currentBalance, p)];
73
- case 1:
74
- yearnActionData = _a.sent();
75
- p.balances[outputToken].add(yearnActionData.amountOut);
76
- p.balances[currentToken] = ethers_1.BigNumber.from(1);
77
- p.totalGasLimit.add(yearnActionData.gasLimit);
78
- p.calls.push(yearnActionData.callData);
79
- return [4 /*yield*/, p.getBestPath()];
80
- case 2: return [2 /*return*/, _a.sent()];
81
- }
82
- });
83
- });
84
- };
85
- return YearnVaultOfMetaCurveLPPathAsset;
86
- }(path_1.PathAsset));
87
- exports.YearnVaultOfMetaCurveLPPathAsset = YearnVaultOfMetaCurveLPPathAsset;
@@ -1,5 +0,0 @@
1
- import { SupportedToken } from "../core/token";
2
- import { Path, PathAsset } from "./path";
3
- export declare class YearnVaultPathAsset extends PathAsset {
4
- getBestPath(currentToken: SupportedToken, p: Path): Promise<Path>;
5
- }