@curvefi/api 1.25.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +775 -589
  2. package/docs/v1/README.md +916 -0
  3. package/lib/boosting.d.ts +12 -12
  4. package/lib/boosting.js +23 -23
  5. package/lib/constants/abis/{json/2pool → 2pool}/swap.json +0 -0
  6. package/lib/constants/abis/{json/3pool → 3pool}/swap.json +0 -0
  7. package/lib/constants/abis/{json/4pool → 4pool}/swap.json +0 -0
  8. package/lib/constants/abis/{json/ERC20.json → ERC20.json} +0 -0
  9. package/lib/constants/abis/{json/aave → aave}/rewards.json +0 -0
  10. package/lib/constants/abis/{json/aave → aave}/swap.json +0 -0
  11. package/lib/constants/abis/{json/address_provider.json → address_provider.json} +0 -0
  12. package/lib/constants/abis/{json/ankreth → ankreth}/sCurveRewards.json +0 -0
  13. package/lib/constants/abis/{json/ankreth → ankreth}/swap.json +0 -0
  14. package/lib/constants/abis/{json/atricrypto3 → atricrypto3}/swap.json +0 -0
  15. package/lib/constants/abis/{json/atricrypto3 → atricrypto3}/zap.json +0 -0
  16. package/lib/constants/abis/{json/bbtc → bbtc}/deposit.json +0 -0
  17. package/lib/constants/abis/{json/bbtc → bbtc}/swap.json +0 -0
  18. package/lib/constants/abis/{json/busd → busd}/deposit.json +0 -0
  19. package/lib/constants/abis/{json/busd → busd}/swap.json +0 -0
  20. package/lib/constants/abis/{json/cERC20.json → cERC20.json} +0 -0
  21. package/lib/constants/abis/{json/compound → compound}/deposit.json +0 -0
  22. package/lib/constants/abis/{json/compound → compound}/swap.json +0 -0
  23. package/lib/constants/abis/{json/crveth → crveth}/swap.json +0 -0
  24. package/lib/constants/abis/{json/deposit_and_stake.json → deposit_and_stake.json} +0 -0
  25. package/lib/constants/abis/{json/dusd → dusd}/deposit.json +0 -0
  26. package/lib/constants/abis/{json/dusd → dusd}/sCurveRewards.json +0 -0
  27. package/lib/constants/abis/{json/dusd → dusd}/swap.json +0 -0
  28. package/lib/constants/abis/{json/eurs → eurs}/sCurveRewards.json +0 -0
  29. package/lib/constants/abis/{json/eurs → eurs}/swap.json +0 -0
  30. package/lib/constants/abis/{json/eursusd → eursusd}/swap.json +0 -0
  31. package/lib/constants/abis/{json/eurt → eurt}/swap.json +0 -0
  32. package/lib/constants/abis/{json/eurtusd → eurtusd}/deposit.json +0 -0
  33. package/lib/constants/abis/{json/eurtusd → eurtusd}/swap.json +0 -0
  34. package/lib/constants/abis/{json/factory-crypto → factory-crypto}/factory-crypto-pool-2.json +0 -0
  35. package/lib/constants/abis/{json/factory-crypto.json → factory-crypto.json} +0 -0
  36. package/lib/constants/abis/{json/factory-v2 → factory-v2}/DepositZapMetaBtcPolygon.json +0 -0
  37. package/lib/constants/abis/{json/factory-v2 → factory-v2}/DepositZapMetaUsdPolygon.json +0 -0
  38. package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTC.json +0 -0
  39. package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTCBalances.json +0 -0
  40. package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTCBalancesRen.json +0 -0
  41. package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaBTCRen.json +0 -0
  42. package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaUSD.json +0 -0
  43. package/lib/constants/abis/{json/factory-v2 → factory-v2}/MetaUSDBalances.json +0 -0
  44. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2Balances.json +0 -0
  45. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2Basic.json +0 -0
  46. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2ETH.json +0 -0
  47. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain2Optimized.json +0 -0
  48. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3Balances.json +0 -0
  49. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3Basic.json +0 -0
  50. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3ETH.json +0 -0
  51. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain3Optimized.json +0 -0
  52. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4Balances.json +0 -0
  53. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4Basic.json +0 -0
  54. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4ETH.json +0 -0
  55. package/lib/constants/abis/{json/factory-v2 → factory-v2}/Plain4Optimized.json +0 -0
  56. package/lib/constants/abis/{json/factory.json → factory.json} +0 -0
  57. package/lib/constants/abis/{json/factoryPools → factoryPools}/deposit.json +0 -0
  58. package/lib/constants/abis/{json/factoryPools → factoryPools}/rewards.json +0 -0
  59. package/lib/constants/abis/{json/factoryPools → factoryPools}/swap.json +0 -0
  60. package/lib/constants/abis/{json/gauge.json → gauge.json} +0 -0
  61. package/lib/constants/abis/{json/gauge_factory.json → gauge_factory.json} +0 -0
  62. package/lib/constants/abis/{json/gauge_rewards_only.json → gauge_rewards_only.json} +0 -0
  63. package/lib/constants/abis/{json/gauge_synthetix.json → gauge_synthetix.json} +0 -0
  64. package/lib/constants/abis/{json/gauge_v2.json → gauge_v2.json} +0 -0
  65. package/lib/constants/abis/{json/gauge_v3.json → gauge_v3.json} +0 -0
  66. package/lib/constants/abis/{json/gauge_v4.json → gauge_v4.json} +0 -0
  67. package/lib/constants/abis/{json/gauge_v5.json → gauge_v5.json} +0 -0
  68. package/lib/constants/abis/{json/gaugecontroller.json → gaugecontroller.json} +0 -0
  69. package/lib/constants/abis/{json/gusd → gusd}/deposit.json +0 -0
  70. package/lib/constants/abis/{json/gusd → gusd}/swap.json +0 -0
  71. package/lib/constants/abis/{json/hbtc → hbtc}/swap.json +0 -0
  72. package/lib/constants/abis/{json/husd → husd}/deposit.json +0 -0
  73. package/lib/constants/abis/{json/husd → husd}/swap.json +0 -0
  74. package/lib/constants/abis/{json/ib → ib}/swap.json +0 -0
  75. package/lib/constants/abis/{json/iearn → iearn}/deposit.json +0 -0
  76. package/lib/constants/abis/{json/iearn → iearn}/sCurveRewards.json +0 -0
  77. package/lib/constants/abis/{json/iearn → iearn}/swap.json +0 -0
  78. package/lib/constants/abis/{json/link → link}/swap.json +0 -0
  79. package/lib/constants/abis/{json/minter.json → minter.json} +0 -0
  80. package/lib/constants/abis/{json/musd → musd}/deposit.json +0 -0
  81. package/lib/constants/abis/{json/musd → musd}/sCurveRewards.json +0 -0
  82. package/lib/constants/abis/{json/musd → musd}/swap.json +0 -0
  83. package/lib/constants/abis/{json/obtc → obtc}/deposit.json +0 -0
  84. package/lib/constants/abis/{json/obtc → obtc}/sCurveRewards.json +0 -0
  85. package/lib/constants/abis/{json/obtc → obtc}/swap.json +0 -0
  86. package/lib/constants/abis/{json/paave → paave}/rewards.json +0 -0
  87. package/lib/constants/abis/{json/pax → pax}/deposit.json +0 -0
  88. package/lib/constants/abis/{json/pax → pax}/swap.json +0 -0
  89. package/lib/constants/abis/{json/pbtc → pbtc}/deposit.json +0 -0
  90. package/lib/constants/abis/{json/pbtc → pbtc}/sCurveRewards.json +0 -0
  91. package/lib/constants/abis/{json/pbtc → pbtc}/swap.json +0 -0
  92. package/lib/constants/abis/{json/rai → rai}/deposit.json +0 -0
  93. package/lib/constants/abis/{json/rai → rai}/swap.json +0 -0
  94. package/lib/constants/abis/{json/registry_exchange.json → registry_exchange.json} +0 -0
  95. package/lib/constants/abis/{json/ren → ren}/swap.json +0 -0
  96. package/lib/constants/abis/{json/ren-polygon → ren-polygon}/swap.json +0 -0
  97. package/lib/constants/abis/{json/reth → reth}/swap.json +0 -0
  98. package/lib/constants/abis/{json/router.json → router.json} +0 -0
  99. package/lib/constants/abis/{json/rsv → rsv}/deposit.json +0 -0
  100. package/lib/constants/abis/{json/rsv → rsv}/sCurveRewards.json +0 -0
  101. package/lib/constants/abis/{json/rsv → rsv}/swap.json +0 -0
  102. package/lib/constants/abis/{json/saave → saave}/swap.json +0 -0
  103. package/lib/constants/abis/{json/sbtc → sbtc}/sCurveRewards.json +0 -0
  104. package/lib/constants/abis/{json/sbtc → sbtc}/swap.json +0 -0
  105. package/lib/constants/abis/{json/seth → seth}/swap.json +0 -0
  106. package/lib/constants/abis/{json/steth → steth}/sCurveRewards.json +0 -0
  107. package/lib/constants/abis/{json/steth → steth}/swap.json +0 -0
  108. package/lib/constants/abis/{json/streamer.json → streamer.json} +0 -0
  109. package/lib/constants/abis/{json/susdv2 → susdv2}/deposit.json +0 -0
  110. package/lib/constants/abis/{json/susdv2 → susdv2}/sCurveRewards.json +0 -0
  111. package/lib/constants/abis/{json/susdv2 → susdv2}/swap.json +0 -0
  112. package/lib/constants/abis/{json/tbtc → tbtc}/deposit.json +0 -0
  113. package/lib/constants/abis/{json/tbtc → tbtc}/sCurveRewards.json +0 -0
  114. package/lib/constants/abis/{json/tbtc → tbtc}/swap.json +0 -0
  115. package/lib/constants/abis/{json/tricrypto2 → tricrypto2}/deposit.json +0 -0
  116. package/lib/constants/abis/{json/tricrypto2 → tricrypto2}/swap.json +0 -0
  117. package/lib/constants/abis/{json/usdk → usdk}/deposit.json +0 -0
  118. package/lib/constants/abis/{json/usdk → usdk}/swap.json +0 -0
  119. package/lib/constants/abis/{json/usdn → usdn}/deposit.json +0 -0
  120. package/lib/constants/abis/{json/usdn → usdn}/swap.json +0 -0
  121. package/lib/constants/abis/{json/usdp → usdp}/deposit.json +0 -0
  122. package/lib/constants/abis/{json/usdp → usdp}/swap.json +0 -0
  123. package/lib/constants/abis/{json/usdt → usdt}/deposit.json +0 -0
  124. package/lib/constants/abis/{json/usdt → usdt}/swap.json +0 -0
  125. package/lib/constants/abis/{json/ust → ust}/deposit.json +0 -0
  126. package/lib/constants/abis/{json/ust → ust}/swap.json +0 -0
  127. package/lib/constants/abis/{json/votingescrow.json → votingescrow.json} +0 -0
  128. package/lib/constants/abis/{json/yERC20.json → yERC20.json} +0 -0
  129. package/lib/constants/aliases.d.ts +2 -24
  130. package/lib/constants/aliases.js +5 -4
  131. package/lib/constants/{coins-ethereum.d.ts → coins/ethereum.d.ts} +0 -9
  132. package/lib/constants/{coins-ethereum.js → coins/ethereum.js} +12 -23
  133. package/lib/constants/{coins-polygon.d.ts → coins/polygon.d.ts} +0 -12
  134. package/lib/constants/{coins-polygon.js → coins/polygon.js} +8 -20
  135. package/lib/constants/pools/ethereum.d.ts +2 -0
  136. package/lib/constants/{abis/abis-ethereum.js → pools/ethereum.js} +517 -1012
  137. package/lib/constants/pools/index.d.ts +3 -0
  138. package/lib/constants/pools/index.js +7 -0
  139. package/lib/constants/pools/polygon.d.ts +4 -0
  140. package/lib/constants/{abis/abis-polygon.js → pools/polygon.js} +52 -80
  141. package/lib/constants/utils.d.ts +5 -0
  142. package/lib/constants/utils.js +69 -0
  143. package/lib/curve.d.ts +10 -32
  144. package/lib/curve.js +188 -232
  145. package/lib/external-api.d.ts +3 -2
  146. package/lib/external-api.js +18 -1
  147. package/lib/factory/constants.d.ts +15 -15
  148. package/lib/factory/constants.js +19 -19
  149. package/lib/factory/factory-api.d.ts +2 -2
  150. package/lib/factory/factory-api.js +34 -49
  151. package/lib/factory/factory-crypto.d.ts +2 -2
  152. package/lib/factory/factory-crypto.js +23 -31
  153. package/lib/factory/factory.d.ts +2 -2
  154. package/lib/factory/factory.js +53 -66
  155. package/lib/index.d.ts +36 -53
  156. package/lib/index.js +27 -35
  157. package/lib/interfaces.d.ts +25 -67
  158. package/lib/pools/PoolTemplate.d.ts +210 -0
  159. package/lib/pools/PoolTemplate.js +2292 -0
  160. package/lib/pools/index.d.ts +3 -0
  161. package/lib/pools/index.js +7 -0
  162. package/lib/pools/mixins/common.d.ts +3 -0
  163. package/lib/pools/mixins/common.js +77 -0
  164. package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +5 -0
  165. package/lib/pools/mixins/depositBalancedAmountsMixins.js +145 -0
  166. package/lib/pools/mixins/depositBonusMixins.d.ts +5 -0
  167. package/lib/pools/mixins/depositBonusMixins.js +164 -0
  168. package/lib/pools/mixins/depositMixins.d.ts +5 -0
  169. package/lib/pools/mixins/depositMixins.js +373 -0
  170. package/lib/pools/mixins/depositWrappedMixins.d.ts +3 -0
  171. package/lib/pools/mixins/depositWrappedMixins.js +243 -0
  172. package/lib/pools/mixins/poolBalancesMixin.d.ts +4 -0
  173. package/lib/pools/mixins/poolBalancesMixin.js +129 -0
  174. package/lib/pools/mixins/swapMixins.d.ts +4 -0
  175. package/lib/pools/mixins/swapMixins.js +313 -0
  176. package/lib/pools/mixins/swapWrappedMixins.d.ts +4 -0
  177. package/lib/pools/mixins/swapWrappedMixins.js +297 -0
  178. package/lib/pools/mixins/withdrawExpectedMixins.d.ts +6 -0
  179. package/lib/pools/mixins/withdrawExpectedMixins.js +164 -0
  180. package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +5 -0
  181. package/lib/pools/mixins/withdrawImbalanceMixins.js +348 -0
  182. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +3 -0
  183. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +207 -0
  184. package/lib/pools/mixins/withdrawMixins.d.ts +5 -0
  185. package/lib/pools/mixins/withdrawMixins.js +347 -0
  186. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +5 -0
  187. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +104 -0
  188. package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +5 -0
  189. package/lib/pools/mixins/withdrawOneCoinMixins.js +347 -0
  190. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +3 -0
  191. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +72 -0
  192. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +3 -0
  193. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +205 -0
  194. package/lib/pools/mixins/withdrawWrappedMixins.d.ts +3 -0
  195. package/lib/pools/mixins/withdrawWrappedMixins.js +206 -0
  196. package/lib/pools/poolConstructor.d.ts +2 -0
  197. package/lib/pools/poolConstructor.js +228 -0
  198. package/lib/pools/utils.d.ts +4 -0
  199. package/lib/pools/utils.js +85 -0
  200. package/lib/router.d.ts +12 -0
  201. package/lib/router.js +624 -0
  202. package/lib/utils.d.ts +10 -16
  203. package/lib/utils.js +33 -126
  204. package/package.json +1 -1
  205. package/lib/constants/abis/abis-ethereum.d.ts +0 -4
  206. package/lib/constants/abis/abis-polygon.d.ts +0 -4
  207. package/lib/constants/abis/json/aRewards.json +0 -1
  208. package/lib/constants/abis/json/compound/migration.json +0 -57
  209. package/lib/constants/abis/json/compound/oldSwap.json +0 -688
  210. package/lib/constants/abis/json/ren/adapter.json +0 -1
  211. package/lib/constants/abis/json/sbtc/adapter.json +0 -1
  212. package/lib/pools.d.ts +0 -267
  213. package/lib/pools.js +0 -4752
@@ -51,30 +51,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.getFactoryPoolData = void 0;
52
52
  var ethers_1 = require("ethers");
53
53
  var ethcall_1 = require("ethcall");
54
- var ERC20_json_1 = __importDefault(require("../constants/abis/json/ERC20.json"));
55
- var swap_json_1 = __importDefault(require("../constants/abis/json/factoryPools/swap.json"));
56
- var deposit_json_1 = __importDefault(require("../constants/abis/json/factoryPools/deposit.json"));
57
- var gauge_factory_json_1 = __importDefault(require("../constants/abis/json/gauge_factory.json"));
58
- var DepositZapMetaUsdPolygon_json_1 = __importDefault(require("../constants/abis/json/factory-v2/DepositZapMetaUsdPolygon.json"));
59
- var DepositZapMetaBtcPolygon_json_1 = __importDefault(require("../constants/abis/json/factory-v2/DepositZapMetaBtcPolygon.json"));
60
- var MetaUSD_json_1 = __importDefault(require("../constants/abis/json/factory-v2/MetaUSD.json"));
61
- var MetaUSDBalances_json_1 = __importDefault(require("../constants/abis/json/factory-v2/MetaUSDBalances.json"));
62
- var MetaBTC_json_1 = __importDefault(require("../constants/abis/json/factory-v2/MetaBTC.json"));
63
- var MetaBTCBalances_json_1 = __importDefault(require("../constants/abis/json/factory-v2/MetaBTCBalances.json"));
64
- var MetaBTCRen_json_1 = __importDefault(require("../constants/abis/json/factory-v2/MetaBTCRen.json"));
65
- var MetaBTCBalancesRen_json_1 = __importDefault(require("../constants/abis/json/factory-v2/MetaBTCBalancesRen.json"));
66
- var Plain2Basic_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain2Basic.json"));
67
- var Plain2Balances_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain2Balances.json"));
68
- var Plain2ETH_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain2ETH.json"));
69
- var Plain2Optimized_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain2Optimized.json"));
70
- var Plain3Basic_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain3Basic.json"));
71
- var Plain3Balances_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain3Balances.json"));
72
- var Plain3ETH_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain3ETH.json"));
73
- var Plain3Optimized_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain3Optimized.json"));
74
- var Plain4Basic_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain4Basic.json"));
75
- var Plain4Balances_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain4Balances.json"));
76
- var Plain4ETH_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain4ETH.json"));
77
- var Plain4Optimized_json_1 = __importDefault(require("../constants/abis/json/factory-v2/Plain4Optimized.json"));
54
+ var ERC20_json_1 = __importDefault(require("../constants/abis/ERC20.json"));
55
+ var swap_json_1 = __importDefault(require("../constants/abis/factoryPools/swap.json"));
56
+ var deposit_json_1 = __importDefault(require("../constants/abis/factoryPools/deposit.json"));
57
+ var gauge_factory_json_1 = __importDefault(require("../constants/abis/gauge_factory.json"));
58
+ var DepositZapMetaUsdPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaUsdPolygon.json"));
59
+ var DepositZapMetaBtcPolygon_json_1 = __importDefault(require("../constants/abis/factory-v2/DepositZapMetaBtcPolygon.json"));
60
+ var MetaUSD_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaUSD.json"));
61
+ var MetaUSDBalances_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaUSDBalances.json"));
62
+ var MetaBTC_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTC.json"));
63
+ var MetaBTCBalances_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTCBalances.json"));
64
+ var MetaBTCRen_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTCRen.json"));
65
+ var MetaBTCBalancesRen_json_1 = __importDefault(require("../constants/abis/factory-v2/MetaBTCBalancesRen.json"));
66
+ var Plain2Basic_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain2Basic.json"));
67
+ var Plain2Balances_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain2Balances.json"));
68
+ var Plain2ETH_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain2ETH.json"));
69
+ var Plain2Optimized_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain2Optimized.json"));
70
+ var Plain3Basic_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain3Basic.json"));
71
+ var Plain3Balances_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain3Balances.json"));
72
+ var Plain3ETH_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain3ETH.json"));
73
+ var Plain3Optimized_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain3Optimized.json"));
74
+ var Plain4Basic_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4Basic.json"));
75
+ var Plain4Balances_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4Balances.json"));
76
+ var Plain4ETH_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4ETH.json"));
77
+ var Plain4Optimized_json_1 = __importDefault(require("../constants/abis/factory-v2/Plain4Optimized.json"));
78
78
  var implementationABIDictEthereum = {
79
79
  "0x5F890841f657d90E081bAbdB532A05996Af79Fe6": swap_json_1.default,
80
80
  "0x213be373FDff327658139C7df330817DAD2d5bBE": MetaUSD_json_1.default,
@@ -358,9 +358,9 @@ function setFactoryCoinsContracts(coinAddresses) {
358
358
  function getExistingCoinAddressNameDict() {
359
359
  var dict = {};
360
360
  var _loop_1 = function (poolData) {
361
- poolData.coin_addresses.forEach(function (addr, i) {
361
+ poolData.wrapped_coin_addresses.forEach(function (addr, i) {
362
362
  if (!(addr.toLowerCase() in dict)) {
363
- dict[addr.toLowerCase()] = poolData.coins[i];
363
+ dict[addr.toLowerCase()] = poolData.wrapped_coins[i];
364
364
  }
365
365
  });
366
366
  poolData.underlying_coin_addresses.forEach(function (addr, i) {
@@ -437,7 +437,6 @@ function getCoinAddressDecimalsDict(coinAddresses, existingCoinAddressDecimalsDi
437
437
  decimals = (_a.sent()).map(function (_d) { return Number(ethers_1.ethers.utils.formatUnits(_d, 0)); });
438
438
  newCoinAddresses.forEach(function (addr, i) {
439
439
  coinAddrNamesDict[addr] = decimals[i];
440
- existingCoinAddressDecimalsDict[addr] = decimals[i]; // Add to DECIMALS_LOWER_CASE TODO move to another place
441
440
  });
442
441
  return [2 /*return*/, coinAddrNamesDict];
443
442
  }
@@ -506,45 +505,42 @@ function setFactoryZapContracts() {
506
505
  function getFactoryPoolData() {
507
506
  return __awaiter(this, void 0, void 0, function () {
508
507
  var _a, poolIds, swapAddresses, swapABIs, gaugeAddresses, _b, poolSymbols, poolNames, referenceAssets, coinAddresses, existingCoinAddressNameDict, coinAddressNameDict, coinAddressDecimalsDict, isMeta, basePoolAddresses, basePoolAddressCoinsDict, basePoolAddressNameDict, basePoolAddressCoinAddressesDict, basePoolAddressDecimalsDict, basePoolAddressZapDict, FACTORY_POOLS_DATA, i;
509
- var _c, _e;
510
- return __generator(this, function (_f) {
511
- switch (_f.label) {
508
+ return __generator(this, function (_c) {
509
+ switch (_c.label) {
512
510
  case 0: return [4 /*yield*/, getFactoryIdsAndSwapAddresses.call(this)];
513
511
  case 1:
514
- _a = _f.sent(), poolIds = _a[0], swapAddresses = _a[1];
512
+ _a = _c.sent(), poolIds = _a[0], swapAddresses = _a[1];
515
513
  return [4 /*yield*/, getFactorySwapABIs.call(this, swapAddresses)];
516
514
  case 2:
517
- swapABIs = _f.sent();
515
+ swapABIs = _c.sent();
518
516
  setFactorySwapContracts.call(this, swapAddresses, swapABIs);
519
- (_c = this.constants.LP_TOKENS).push.apply(_c, swapAddresses); // TODO move to another place
520
517
  return [4 /*yield*/, getFactoryGaugeAddresses.call(this, swapAddresses)];
521
518
  case 3:
522
- gaugeAddresses = _f.sent();
519
+ gaugeAddresses = _c.sent();
523
520
  setFactoryGaugeContracts.call(this, gaugeAddresses);
524
- (_e = this.constants.GAUGES).push.apply(_e, gaugeAddresses.filter(function (addr) { return addr !== ethers_1.ethers.constants.AddressZero; })); // TODO move to another place
525
521
  return [4 /*yield*/, getFactorySymbolsAndNames.call(this, swapAddresses)];
526
522
  case 4:
527
- _b = _f.sent(), poolSymbols = _b[0], poolNames = _b[1];
523
+ _b = _c.sent(), poolSymbols = _b[0], poolNames = _b[1];
528
524
  return [4 /*yield*/, getFactoryReferenceAssets.call(this, swapAddresses)];
529
525
  case 5:
530
- referenceAssets = _f.sent();
526
+ referenceAssets = _c.sent();
531
527
  return [4 /*yield*/, getFactoryCoinAddresses.call(this, swapAddresses)];
532
528
  case 6:
533
- coinAddresses = _f.sent();
529
+ coinAddresses = _c.sent();
534
530
  setFactoryCoinsContracts.call(this, coinAddresses);
535
531
  existingCoinAddressNameDict = getExistingCoinAddressNameDict.call(this);
536
532
  return [4 /*yield*/, getCoinAddressNameDict.call(this, coinAddresses, existingCoinAddressNameDict)];
537
533
  case 7:
538
- coinAddressNameDict = _f.sent();
539
- return [4 /*yield*/, getCoinAddressDecimalsDict.call(this, coinAddresses, this.constants.DECIMALS_LOWER_CASE)];
534
+ coinAddressNameDict = _c.sent();
535
+ return [4 /*yield*/, getCoinAddressDecimalsDict.call(this, coinAddresses, this.constants.DECIMALS)];
540
536
  case 8:
541
- coinAddressDecimalsDict = _f.sent();
537
+ coinAddressDecimalsDict = _c.sent();
542
538
  return [4 /*yield*/, getFactoryIsMeta.call(this, swapAddresses)];
543
539
  case 9:
544
- isMeta = _f.sent();
540
+ isMeta = _c.sent();
545
541
  return [4 /*yield*/, getFactoryBasePoolAddresses.call(this, swapAddresses)];
546
542
  case 10:
547
- basePoolAddresses = _f.sent();
543
+ basePoolAddresses = _c.sent();
548
544
  setFactoryZapContracts.call(this);
549
545
  basePoolAddressCoinsDict = this.chainId === 137 ? basePoolAddressCoinsDictPolygon : basePoolAddressCoinsDictEthereum;
550
546
  basePoolAddressNameDict = this.chainId === 137 ? basePoolAddressNameDictPolygon : basePoolAddressNameDictEthereum;
@@ -559,22 +555,19 @@ function getFactoryPoolData() {
559
555
  full_name: poolNames[i],
560
556
  symbol: poolSymbols[i],
561
557
  reference_asset: referenceAssets[i],
562
- N_COINS: coinAddresses[i].length,
563
- underlying_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
564
- decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
565
- use_lending: coinAddresses[i].map(function () { return false; }),
566
- is_plain: coinAddresses[i].map(function () { return true; }),
567
558
  swap_address: swapAddresses[i],
568
559
  token_address: swapAddresses[i],
569
560
  gauge_address: gaugeAddresses[i],
561
+ is_plain: true,
562
+ is_factory: true,
570
563
  underlying_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
571
- coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
564
+ wrapped_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
572
565
  underlying_coin_addresses: coinAddresses[i],
573
- coin_addresses: coinAddresses[i],
566
+ wrapped_coin_addresses: coinAddresses[i],
567
+ underlying_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
568
+ wrapped_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
574
569
  swap_abi: swapABIs[i],
575
570
  gauge_abi: gauge_factory_json_1.default,
576
- is_factory: true,
577
- is_plain_factory: true,
578
571
  };
579
572
  }
580
573
  else {
@@ -583,27 +576,21 @@ function getFactoryPoolData() {
583
576
  full_name: poolNames[i],
584
577
  symbol: poolSymbols[i],
585
578
  reference_asset: referenceAssets[i],
586
- N_COINS: coinAddresses[i].length,
587
- underlying_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
588
- decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
589
- use_lending: coinAddresses[i].map(function () { return false; }),
590
- is_plain: coinAddresses[i].map(function () { return true; }),
591
579
  swap_address: swapAddresses[i],
592
580
  token_address: swapAddresses[i],
593
581
  gauge_address: gaugeAddresses[i],
582
+ deposit_address: basePoolAddressZapDict[basePoolAddresses[i]],
583
+ is_meta: true,
584
+ is_factory: true,
585
+ base_pool: basePoolAddressNameDict[basePoolAddresses[i]],
594
586
  underlying_coins: __spreadArray([coinAddressNameDict[coinAddresses[i][0]]], basePoolAddressCoinsDict[basePoolAddresses[i]], true),
595
- coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
587
+ wrapped_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
596
588
  underlying_coin_addresses: coinAddresses[i],
597
- coin_addresses: coinAddresses[i],
589
+ wrapped_coin_addresses: coinAddresses[i],
590
+ underlying_decimals: __spreadArray([coinAddressDecimalsDict[coinAddresses[i][0]]], basePoolAddressDecimalsDict[basePoolAddresses[i]], true),
591
+ wrapped_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
598
592
  swap_abi: swapABIs[i],
599
593
  gauge_abi: gauge_factory_json_1.default,
600
- is_factory: true,
601
- is_meta_factory: true,
602
- is_meta: true,
603
- base_pool: basePoolAddressNameDict[basePoolAddresses[i]],
604
- meta_coin_addresses: basePoolAddressCoinAddressesDict[basePoolAddresses[i]],
605
- meta_coin_decimals: __spreadArray([coinAddressDecimalsDict[coinAddresses[i][0]]], basePoolAddressDecimalsDict[basePoolAddresses[i]], true),
606
- deposit_address: basePoolAddressZapDict[basePoolAddresses[i]],
607
594
  deposit_abi: deposit_json_1.default,
608
595
  };
609
596
  }
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ethers } from "ethers";
2
2
  import { Networkish } from "@ethersproject/networks";
3
- import { Pool } from "./pools";
3
+ import { PoolTemplate } from "./pools";
4
4
  declare function init(providerType: 'JsonRpc' | 'Web3' | 'Infura' | 'Alchemy', providerSettings: {
5
5
  url?: string;
6
6
  privateKey?: string;
@@ -24,81 +24,64 @@ declare function setCustomFeeData(customFeeData: {
24
24
  }): void;
25
25
  declare const curve: {
26
26
  init: typeof init;
27
+ chainId: number;
28
+ signerAddress: string;
29
+ setCustomFeeData: typeof setCustomFeeData;
27
30
  fetchFactoryPools: typeof fetchFactoryPools;
28
31
  fetchCryptoFactoryPools: typeof fetchCryptoFactoryPools;
29
32
  getPoolList: () => string[];
30
33
  getFactoryPoolList: () => string[];
31
34
  getCryptoFactoryPoolList: () => string[];
35
+ getUserPoolList: (address?: string | undefined) => Promise<string[]>;
36
+ PoolTemplate: typeof PoolTemplate;
37
+ getPool: (poolId: string) => PoolTemplate;
32
38
  getUsdRate: (coin: string) => Promise<number>;
33
39
  getTVL: (chainId?: number) => Promise<number>;
34
- setCustomFeeData: typeof setCustomFeeData;
35
- signerAddress: string;
36
- chainId: number;
37
- Pool: typeof Pool;
38
- getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<string[] | import("./interfaces").DictInterface<string[]>>;
40
+ getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<string[] | import("./interfaces").IDict<string[]>>;
39
41
  getAllowance: (coins: string[], address: string, spender: string) => Promise<string[]>;
40
- hasAllowance: (coins: string[], amounts: string[], address: string, spender: string) => Promise<boolean>;
41
- ensureAllowance: (coins: string[], amounts: string[], spender: string) => Promise<string[]>;
42
- getBestPoolAndOutput: (inputCoin: string, outputCoin: string, amount: string) => Promise<{
43
- poolName: string;
44
- poolAddress: string;
45
- output: string;
46
- }>;
47
- exchangeExpected: (inputCoin: string, outputCoin: string, amount: string) => Promise<string>;
48
- exchangeIsApproved: (inputCoin: string, outputCoin: string, amount: string) => Promise<boolean>;
49
- exchangeApprove: (inputCoin: string, outputCoin: string, amount: string) => Promise<string[]>;
50
- exchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<string>;
51
- crossAssetExchangeAvailable: (inputCoin: string, outputCoin: string) => Promise<boolean>;
52
- crossAssetExchangeOutputAndSlippage: (inputCoin: string, outputCoin: string, amount: string) => Promise<{
53
- slippage: number;
54
- output: string;
55
- }>;
56
- crossAssetExchangeExpected: (inputCoin: string, outputCoin: string, amount: string) => Promise<string>;
57
- crossAssetExchangeIsApproved: (inputCoin: string, amount: string) => Promise<boolean>;
58
- crossAssetExchangeApprove: (inputCoin: string, amount: string) => Promise<string[]>;
59
- crossAssetExchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<string>;
60
- getUserPoolList: (address?: string | undefined) => Promise<string[]>;
61
- getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: string) => Promise<{
62
- route: import("./interfaces").IRouteStep[];
63
- output: string;
64
- }>;
65
- routerExchangeExpected: (inputCoin: string, outputCoin: string, amount: string) => Promise<string>;
66
- routerExchangeIsApproved: (inputCoin: string, amount: string) => Promise<boolean>;
67
- routerExchangeApprove: (inputCoin: string, amount: string) => Promise<string[]>;
68
- routerExchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<string>;
42
+ hasAllowance: (coins: string[], amounts: (string | number)[], address: string, spender: string) => Promise<boolean>;
43
+ ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string) => Promise<string[]>;
69
44
  estimateGas: {
70
- ensureAllowance: (coins: string[], amounts: string[], spender: string) => Promise<number>;
71
- exchangeApprove: (inputCoin: string, outputCoin: string, amount: string) => Promise<number>;
72
- exchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<number>;
73
- crossAssetExchangeApprove: (inputCoin: string, amount: string) => Promise<number>;
74
- crossAssetExchange: (inputCoin: string, outputCoin: string, amount: string, maxSlippage?: number) => Promise<number>;
75
- routerExchangeApprove: (inputCoin: string, amount: string) => Promise<number>;
76
- routerExchange: (inputCoin: string, outputCoin: string, amount: string) => Promise<number>;
45
+ ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string) => Promise<number>;
77
46
  };
78
47
  boosting: {
79
- getCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").DictInterface<string>>;
80
- getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<import("./interfaces").DictInterface<{
48
+ getCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").IDict<string>>;
49
+ getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<import("./interfaces").IDict<{
81
50
  lockedAmount: string;
82
51
  unlockTime: number;
83
52
  }> | {
84
53
  lockedAmount: string;
85
54
  unlockTime: number;
86
55
  }>;
87
- getVeCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").DictInterface<string>>;
88
- getVeCrvPct: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").DictInterface<string>>;
89
- isApproved: (amount: string) => Promise<boolean>;
90
- approve: (amount: string) => Promise<string[]>;
91
- createLock: (amount: string, days: number) => Promise<string>;
92
- increaseAmount: (amount: string) => Promise<string>;
56
+ getVeCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").IDict<string>>;
57
+ getVeCrvPct: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces").IDict<string>>;
58
+ isApproved: (amount: string | number) => Promise<boolean>;
59
+ approve: (amount: string | number) => Promise<string[]>;
60
+ createLock: (amount: string | number, days: number) => Promise<string>;
61
+ increaseAmount: (amount: string | number) => Promise<string>;
93
62
  increaseUnlockTime: (days: number) => Promise<string>;
94
63
  withdrawLockedCrv: () => Promise<string>;
95
64
  estimateGas: {
96
- approve: (amount: string) => Promise<number>;
97
- createLock: (amount: string, days: number) => Promise<number>;
98
- increaseAmount: (amount: string) => Promise<number>;
65
+ approve: (amount: string | number) => Promise<number>;
66
+ createLock: (amount: string | number, days: number) => Promise<number>;
67
+ increaseAmount: (amount: string | number) => Promise<number>;
99
68
  increaseUnlockTime: (days: number) => Promise<number>;
100
69
  withdrawLockedCrv: () => Promise<number>;
101
70
  };
102
71
  };
72
+ router: {
73
+ getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<{
74
+ route: import("./interfaces").IRouteStep[];
75
+ output: string;
76
+ }>;
77
+ expected: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<string>;
78
+ isApproved: (inputCoin: string, amount: string | number) => Promise<boolean>;
79
+ approve: (inputCoin: string, amount: string | number) => Promise<string[]>;
80
+ swap: (inputCoin: string, outputCoin: string, amount: string | number, slippage?: number) => Promise<string>;
81
+ estimateGas: {
82
+ approve: (inputCoin: string, amount: string | number) => Promise<number>;
83
+ swap: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<number>;
84
+ };
85
+ };
103
86
  };
104
87
  export default curve;
package/lib/index.js CHANGED
@@ -37,9 +37,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var pools_1 = require("./pools");
40
+ var utils_1 = require("./pools/utils");
41
+ var router_1 = require("./router");
40
42
  var curve_1 = require("./curve");
41
43
  var boosting_1 = require("./boosting");
42
- var utils_1 = require("./utils");
44
+ var utils_2 = require("./utils");
43
45
  function init(providerType, providerSettings, options) {
44
46
  if (options === void 0) { options = {}; }
45
47
  return __awaiter(this, void 0, void 0, function () {
@@ -88,46 +90,25 @@ function setCustomFeeData(customFeeData) {
88
90
  }
89
91
  var curve = {
90
92
  init: init,
93
+ chainId: 0,
94
+ signerAddress: '',
95
+ setCustomFeeData: setCustomFeeData,
91
96
  fetchFactoryPools: fetchFactoryPools,
92
97
  fetchCryptoFactoryPools: fetchCryptoFactoryPools,
93
98
  getPoolList: utils_1.getPoolList,
94
99
  getFactoryPoolList: utils_1.getFactoryPoolList,
95
100
  getCryptoFactoryPoolList: utils_1.getCryptoFactoryPoolList,
96
- getUsdRate: utils_1.getUsdRate,
97
- getTVL: utils_1.getTVL,
98
- setCustomFeeData: setCustomFeeData,
99
- signerAddress: '',
100
- chainId: 0,
101
- Pool: pools_1.Pool,
102
- getBalances: utils_1.getBalances,
103
- getAllowance: utils_1.getAllowance,
104
- hasAllowance: utils_1.hasAllowance,
105
- ensureAllowance: utils_1.ensureAllowance,
106
- getBestPoolAndOutput: pools_1.getBestPoolAndOutput,
107
- exchangeExpected: pools_1.exchangeExpected,
108
- exchangeIsApproved: pools_1.exchangeIsApproved,
109
- exchangeApprove: pools_1.exchangeApprove,
110
- exchange: pools_1.exchange,
111
- crossAssetExchangeAvailable: pools_1.crossAssetExchangeAvailable,
112
- crossAssetExchangeOutputAndSlippage: pools_1.crossAssetExchangeOutputAndSlippage,
113
- crossAssetExchangeExpected: pools_1.crossAssetExchangeExpected,
114
- crossAssetExchangeIsApproved: pools_1.crossAssetExchangeIsApproved,
115
- crossAssetExchangeApprove: pools_1.crossAssetExchangeApprove,
116
- crossAssetExchange: pools_1.crossAssetExchange,
117
- getUserPoolList: pools_1.getUserPoolList,
118
- getBestRouteAndOutput: pools_1.getBestRouteAndOutput,
119
- routerExchangeExpected: pools_1.routerExchangeExpected,
120
- routerExchangeIsApproved: pools_1.routerExchangeIsApproved,
121
- routerExchangeApprove: pools_1.routerExchangeApprove,
122
- routerExchange: pools_1.routerExchange,
101
+ getUserPoolList: utils_1.getUserPoolList,
102
+ PoolTemplate: pools_1.PoolTemplate,
103
+ getPool: pools_1.getPool,
104
+ getUsdRate: utils_2.getUsdRate,
105
+ getTVL: utils_2.getTVL,
106
+ getBalances: utils_2.getBalances,
107
+ getAllowance: utils_2.getAllowance,
108
+ hasAllowance: utils_2.hasAllowance,
109
+ ensureAllowance: utils_2.ensureAllowance,
123
110
  estimateGas: {
124
- ensureAllowance: utils_1.ensureAllowanceEstimateGas,
125
- exchangeApprove: pools_1.exchangeApproveEstimateGas,
126
- exchange: pools_1.exchangeEstimateGas,
127
- crossAssetExchangeApprove: pools_1.crossAssetExchangeApproveEstimateGas,
128
- crossAssetExchange: pools_1.crossAssetExchangeEstimateGas,
129
- routerExchangeApprove: pools_1.routerExchangeApproveEstimateGas,
130
- routerExchange: pools_1.routerExchangeEstimateGas,
111
+ ensureAllowance: utils_2.ensureAllowanceEstimateGas,
131
112
  },
132
113
  boosting: {
133
114
  getCrv: boosting_1.getCrv,
@@ -148,5 +129,16 @@ var curve = {
148
129
  withdrawLockedCrv: boosting_1.withdrawLockedCrvEstimateGas,
149
130
  },
150
131
  },
132
+ router: {
133
+ getBestRouteAndOutput: router_1.getBestRouteAndOutput,
134
+ expected: router_1.swapExpected,
135
+ isApproved: router_1.swapIsApproved,
136
+ approve: router_1.swapApprove,
137
+ swap: router_1.swap,
138
+ estimateGas: {
139
+ approve: router_1.swapApproveEstimateGas,
140
+ swap: router_1.swapEstimateGas,
141
+ },
142
+ },
151
143
  };
152
144
  exports.default = curve;
@@ -1,6 +1,6 @@
1
1
  import { Contract, ethers } from "ethers";
2
2
  import { Contract as MulticallContract, Provider as MulticallProvider } from "ethcall";
3
- export interface DictInterface<T> {
3
+ export interface IDict<T> {
4
4
  [index: string]: T;
5
5
  }
6
6
  export interface ICurve {
@@ -28,65 +28,40 @@ export interface ICurve {
28
28
  maxFeePerGas?: number | ethers.BigNumber;
29
29
  maxPriorityFeePerGas?: number | ethers.BigNumber;
30
30
  };
31
- constants: DictInterface<any>;
31
+ constants: IDict<any>;
32
32
  }
33
33
  export declare type REFERENCE_ASSET = 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
34
- export interface PoolDataInterface {
34
+ export interface IPoolData {
35
35
  name: string;
36
36
  full_name: string;
37
37
  symbol: string;
38
38
  reference_asset: REFERENCE_ASSET;
39
- N_COINS: number;
40
- underlying_decimals: number[];
41
- decimals: number[];
42
- tethered?: boolean[];
43
- use_lending: boolean[];
44
- is_plain: boolean[];
45
- has_eth?: boolean;
46
- is_aave?: boolean;
47
- is_new_underlying?: boolean;
48
- old_swap_address?: string;
49
39
  swap_address: string;
50
40
  token_address: string;
51
41
  gauge_address: string;
52
- old_token_address?: string;
53
- migration_address?: string;
54
42
  deposit_address?: string;
43
+ sCurveRewards_address?: string;
44
+ reward_contract?: string;
45
+ is_plain?: boolean;
46
+ is_lending?: boolean;
47
+ is_meta?: boolean;
48
+ is_crypto?: boolean;
49
+ is_fake?: boolean;
50
+ is_factory?: boolean;
51
+ base_pool?: string;
55
52
  underlying_coins: string[];
56
- coins: string[];
53
+ wrapped_coins: string[];
57
54
  underlying_coin_addresses: string[];
58
- coin_addresses: string[];
55
+ wrapped_coin_addresses: string[];
56
+ underlying_decimals: number[];
57
+ wrapped_decimals: number[];
58
+ use_lending?: boolean[];
59
+ reward_tokens?: string[];
60
+ reward_decimals?: number[];
59
61
  swap_abi: any;
60
62
  gauge_abi: any;
61
63
  deposit_abi?: any;
62
- old_swap_abi?: any;
63
- is_meta?: boolean;
64
- is_fake?: boolean;
65
- is_crypto?: boolean;
66
- meta_N?: number;
67
- meta_decimals?: number[];
68
- meta_coin_decimals?: number[];
69
- meta_wrapped_decimals?: number[];
70
- base_pool?: string;
71
- meta_coin_addresses?: string[];
72
- all_coin_addresses?: string[];
73
- is_factory?: boolean;
74
- is_plain_factory?: boolean;
75
- is_meta_factory?: boolean;
76
- is_crypto_factory?: boolean;
77
- adapter_abi?: any;
78
- old_adapter_address?: string;
79
- adapter_biconomy_address?: string;
80
- adapter_address?: string;
81
- migration_abi?: any;
82
64
  sCurveRewards_abi?: any;
83
- sCurveRewards_address?: string;
84
- aRewards_abi?: any;
85
- aRewards_address?: string;
86
- reward_token?: string;
87
- reward_tokens?: string[];
88
- pool_type?: string;
89
- reward_contract?: string;
90
65
  }
91
66
  export interface ICoinFromPoolDataApi {
92
67
  address: string;
@@ -117,34 +92,17 @@ export interface IPoolDataFromApi {
117
92
  gaugeRewards?: IReward[];
118
93
  usdTotal: number;
119
94
  }
95
+ export interface ISubgraphPoolData {
96
+ address: string;
97
+ volumeUSD: number;
98
+ latestDailyApy: number;
99
+ latestWeeklyApy: number;
100
+ }
120
101
  export interface IExtendedPoolDataFromApi {
121
102
  poolData: IPoolDataFromApi[];
122
103
  tvl?: number;
123
104
  tvlAll: number;
124
105
  }
125
- export interface IPoolStats {
126
- volume: number;
127
- apy: {
128
- day: number;
129
- week: number;
130
- month: number;
131
- total: number;
132
- };
133
- }
134
- export interface IStats {
135
- [index: string]: IPoolStats;
136
- }
137
- export interface ISinglePoolSwapData {
138
- poolName: string;
139
- poolAddress: string;
140
- i: number;
141
- j: number;
142
- swapType: 1 | 2 | 3 | 4 | 5;
143
- swapAddress: string;
144
- }
145
- export interface ISinglePoolSwapDataAndOutput extends ISinglePoolSwapData {
146
- _output: ethers.BigNumber;
147
- }
148
106
  export interface IRouteStep {
149
107
  poolId: string;
150
108
  poolAddress: string;