@curvefi/api 1.25.2 → 2.2.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 (219) hide show
  1. package/README.md +797 -590
  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 +3 -24
  130. package/lib/constants/aliases.js +18 -5
  131. package/lib/constants/coins/avalanche.d.ts +7 -0
  132. package/lib/constants/coins/avalanche.js +32 -0
  133. package/lib/constants/{coins-ethereum.d.ts → coins/ethereum.d.ts} +0 -9
  134. package/lib/constants/{coins-ethereum.js → coins/ethereum.js} +12 -23
  135. package/lib/constants/{coins-polygon.d.ts → coins/polygon.d.ts} +0 -12
  136. package/lib/constants/{coins-polygon.js → coins/polygon.js} +8 -20
  137. package/lib/constants/pools/avalanche.d.ts +4 -0
  138. package/lib/constants/pools/avalanche.js +113 -0
  139. package/lib/constants/pools/ethereum.d.ts +2 -0
  140. package/lib/constants/{abis/abis-ethereum.js → pools/ethereum.js} +517 -1012
  141. package/lib/constants/pools/index.d.ts +4 -0
  142. package/lib/constants/pools/index.js +9 -0
  143. package/lib/constants/pools/polygon.d.ts +4 -0
  144. package/lib/constants/{abis/abis-polygon.js → pools/polygon.js} +52 -80
  145. package/lib/constants/utils.d.ts +5 -0
  146. package/lib/constants/utils.js +69 -0
  147. package/lib/curve.d.ts +13 -31
  148. package/lib/curve.js +204 -232
  149. package/lib/external-api.d.ts +4 -3
  150. package/lib/external-api.js +18 -1
  151. package/lib/factory/common.d.ts +2 -0
  152. package/lib/factory/common.js +45 -0
  153. package/lib/factory/constants.d.ts +16 -16
  154. package/lib/factory/constants.js +79 -77
  155. package/lib/factory/factory-api.d.ts +2 -2
  156. package/lib/factory/factory-api.js +51 -85
  157. package/lib/factory/factory-crypto.d.ts +2 -2
  158. package/lib/factory/factory-crypto.js +30 -35
  159. package/lib/factory/factory.d.ts +2 -2
  160. package/lib/factory/factory.js +60 -205
  161. package/lib/index.d.ts +37 -53
  162. package/lib/index.js +28 -35
  163. package/lib/interfaces.d.ts +51 -83
  164. package/lib/pools/PoolTemplate.d.ts +212 -0
  165. package/lib/pools/PoolTemplate.js +2371 -0
  166. package/lib/pools/index.d.ts +3 -0
  167. package/lib/pools/index.js +7 -0
  168. package/lib/pools/mixins/common.d.ts +3 -0
  169. package/lib/pools/mixins/common.js +77 -0
  170. package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +5 -0
  171. package/lib/pools/mixins/depositBalancedAmountsMixins.js +145 -0
  172. package/lib/pools/mixins/depositBonusMixins.d.ts +5 -0
  173. package/lib/pools/mixins/depositBonusMixins.js +164 -0
  174. package/lib/pools/mixins/depositMixins.d.ts +5 -0
  175. package/lib/pools/mixins/depositMixins.js +373 -0
  176. package/lib/pools/mixins/depositWrappedMixins.d.ts +3 -0
  177. package/lib/pools/mixins/depositWrappedMixins.js +243 -0
  178. package/lib/pools/mixins/poolBalancesMixin.d.ts +4 -0
  179. package/lib/pools/mixins/poolBalancesMixin.js +129 -0
  180. package/lib/pools/mixins/swapMixins.d.ts +4 -0
  181. package/lib/pools/mixins/swapMixins.js +313 -0
  182. package/lib/pools/mixins/swapWrappedMixins.d.ts +4 -0
  183. package/lib/pools/mixins/swapWrappedMixins.js +297 -0
  184. package/lib/pools/mixins/withdrawExpectedMixins.d.ts +6 -0
  185. package/lib/pools/mixins/withdrawExpectedMixins.js +164 -0
  186. package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +5 -0
  187. package/lib/pools/mixins/withdrawImbalanceMixins.js +348 -0
  188. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +3 -0
  189. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +207 -0
  190. package/lib/pools/mixins/withdrawMixins.d.ts +5 -0
  191. package/lib/pools/mixins/withdrawMixins.js +347 -0
  192. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +5 -0
  193. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +104 -0
  194. package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +5 -0
  195. package/lib/pools/mixins/withdrawOneCoinMixins.js +347 -0
  196. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +3 -0
  197. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +72 -0
  198. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +3 -0
  199. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +205 -0
  200. package/lib/pools/mixins/withdrawWrappedMixins.d.ts +3 -0
  201. package/lib/pools/mixins/withdrawWrappedMixins.js +206 -0
  202. package/lib/pools/poolConstructor.d.ts +2 -0
  203. package/lib/pools/poolConstructor.js +228 -0
  204. package/lib/pools/utils.d.ts +4 -0
  205. package/lib/pools/utils.js +85 -0
  206. package/lib/router.d.ts +13 -0
  207. package/lib/router.js +651 -0
  208. package/lib/utils.d.ts +12 -16
  209. package/lib/utils.js +59 -138
  210. package/package.json +1 -1
  211. package/lib/constants/abis/abis-ethereum.d.ts +0 -4
  212. package/lib/constants/abis/abis-polygon.d.ts +0 -4
  213. package/lib/constants/abis/json/aRewards.json +0 -1
  214. package/lib/constants/abis/json/compound/migration.json +0 -57
  215. package/lib/constants/abis/json/compound/oldSwap.json +0 -688
  216. package/lib/constants/abis/json/ren/adapter.json +0 -1
  217. package/lib/constants/abis/json/sbtc/adapter.json +0 -1
  218. package/lib/pools.d.ts +0 -267
  219. package/lib/pools.js +0 -4752
package/lib/boosting.d.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { DictInterface } from "./interfaces";
2
- export declare const getCrv: (...addresses: string[] | string[][]) => Promise<DictInterface<string> | string>;
3
- export declare const getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<DictInterface<{
1
+ import { IDict } from "./interfaces";
2
+ export declare const getCrv: (...addresses: string[] | string[][]) => Promise<IDict<string> | string>;
3
+ export declare const getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<IDict<{
4
4
  lockedAmount: string;
5
5
  unlockTime: number;
6
6
  }> | {
7
7
  lockedAmount: string;
8
8
  unlockTime: number;
9
9
  }>;
10
- export declare const getVeCrv: (...addresses: string[] | string[][]) => Promise<DictInterface<string> | string>;
11
- export declare const getVeCrvPct: (...addresses: string[] | string[][]) => Promise<DictInterface<string> | string>;
12
- export declare const isApproved: (amount: string) => Promise<boolean>;
13
- export declare const approveEstimateGas: (amount: string) => Promise<number>;
14
- export declare const approve: (amount: string) => Promise<string[]>;
15
- export declare const createLockEstimateGas: (amount: string, days: number) => Promise<number>;
16
- export declare const createLock: (amount: string, days: number) => Promise<string>;
17
- export declare const increaseAmountEstimateGas: (amount: string) => Promise<number>;
18
- export declare const increaseAmount: (amount: string) => Promise<string>;
10
+ export declare const getVeCrv: (...addresses: string[] | string[][]) => Promise<IDict<string> | string>;
11
+ export declare const getVeCrvPct: (...addresses: string[] | string[][]) => Promise<IDict<string> | string>;
12
+ export declare const isApproved: (amount: number | string) => Promise<boolean>;
13
+ export declare const approveEstimateGas: (amount: number | string) => Promise<number>;
14
+ export declare const approve: (amount: number | string) => Promise<string[]>;
15
+ export declare const createLockEstimateGas: (amount: number | string, days: number) => Promise<number>;
16
+ export declare const createLock: (amount: number | string, days: number) => Promise<string>;
17
+ export declare const increaseAmountEstimateGas: (amount: number | string) => Promise<number>;
18
+ export declare const increaseAmount: (amount: number | string) => Promise<string>;
19
19
  export declare const increaseUnlockTimeEstimateGas: (days: number) => Promise<number>;
20
20
  export declare const increaseUnlockTime: (days: number) => Promise<string>;
21
21
  export declare const withdrawLockedCrvEstimateGas: () => Promise<number>;
package/lib/boosting.js CHANGED
@@ -63,7 +63,7 @@ var getCrv = function () {
63
63
  switch (_b.label) {
64
64
  case 0:
65
65
  addresses = (0, utils_1._prepareAddresses)(addresses);
66
- return [4 /*yield*/, (0, utils_1._getBalances)([curve_1.ALIASES.crv], addresses)];
66
+ return [4 /*yield*/, (0, utils_1._getBalances)([curve_1.curve.constants.ALIASES.crv], addresses)];
67
67
  case 1:
68
68
  rawBalances = (_b.sent());
69
69
  balances = {};
@@ -88,7 +88,7 @@ var getLockedAmountAndUnlockTime = function () {
88
88
  switch (_a.label) {
89
89
  case 0:
90
90
  addresses = (0, utils_1._prepareAddresses)(addresses);
91
- veContract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].multicallContract;
91
+ veContract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].multicallContract;
92
92
  contractCalls = addresses.map(function (address) { return veContract.locked(address); });
93
93
  return [4 /*yield*/, curve_1.curve.multicallProvider.all(contractCalls)];
94
94
  case 1:
@@ -114,7 +114,7 @@ var getVeCrv = function () {
114
114
  switch (_a.label) {
115
115
  case 0:
116
116
  addresses = (0, utils_1._prepareAddresses)(addresses);
117
- veContract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].multicallContract;
117
+ veContract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].multicallContract;
118
118
  contractCalls = addresses.map(function (address) { return veContract.balanceOf(address); });
119
119
  return [4 /*yield*/, curve_1.curve.multicallProvider.all(contractCalls)];
120
120
  case 1:
@@ -140,7 +140,7 @@ var getVeCrvPct = function () {
140
140
  switch (_c.label) {
141
141
  case 0:
142
142
  addresses = (0, utils_1._prepareAddresses)(addresses);
143
- veContract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].multicallContract;
143
+ veContract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].multicallContract;
144
144
  contractCalls = [veContract.totalSupply()];
145
145
  addresses.forEach(function (address) {
146
146
  contractCalls.push(veContract.balanceOf(address));
@@ -167,7 +167,7 @@ exports.getVeCrvPct = getVeCrvPct;
167
167
  var isApproved = function (amount) { return __awaiter(void 0, void 0, void 0, function () {
168
168
  return __generator(this, function (_a) {
169
169
  switch (_a.label) {
170
- case 0: return [4 /*yield*/, (0, utils_1.hasAllowance)([curve_1.ALIASES.crv], [amount], curve_1.curve.signerAddress, curve_1.ALIASES.voting_escrow)];
170
+ case 0: return [4 /*yield*/, (0, utils_1.hasAllowance)([curve_1.curve.constants.ALIASES.crv], [amount], curve_1.curve.signerAddress, curve_1.curve.constants.ALIASES.voting_escrow)];
171
171
  case 1: return [2 /*return*/, _a.sent()];
172
172
  }
173
173
  });
@@ -176,7 +176,7 @@ exports.isApproved = isApproved;
176
176
  var approveEstimateGas = function (amount) { return __awaiter(void 0, void 0, void 0, function () {
177
177
  return __generator(this, function (_a) {
178
178
  switch (_a.label) {
179
- case 0: return [4 /*yield*/, (0, utils_1.ensureAllowanceEstimateGas)([curve_1.ALIASES.crv], [amount], curve_1.ALIASES.voting_escrow)];
179
+ case 0: return [4 /*yield*/, (0, utils_1.ensureAllowanceEstimateGas)([curve_1.curve.constants.ALIASES.crv], [amount], curve_1.curve.constants.ALIASES.voting_escrow)];
180
180
  case 1: return [2 /*return*/, _a.sent()];
181
181
  }
182
182
  });
@@ -185,7 +185,7 @@ exports.approveEstimateGas = approveEstimateGas;
185
185
  var approve = function (amount) { return __awaiter(void 0, void 0, void 0, function () {
186
186
  return __generator(this, function (_a) {
187
187
  switch (_a.label) {
188
- case 0: return [4 /*yield*/, (0, utils_1.ensureAllowance)([curve_1.ALIASES.crv], [amount], curve_1.ALIASES.voting_escrow)];
188
+ case 0: return [4 /*yield*/, (0, utils_1.ensureAllowance)([curve_1.curve.constants.ALIASES.crv], [amount], curve_1.curve.constants.ALIASES.voting_escrow)];
189
189
  case 1: return [2 /*return*/, _a.sent()];
190
190
  }
191
191
  });
@@ -201,14 +201,14 @@ var createLockEstimateGas = function (amount, days) { return __awaiter(void 0, v
201
201
  if (Number(crvBalance) < Number(amount)) {
202
202
  throw Error("Not enough . Actual: ".concat(crvBalance, ", required: ").concat(amount));
203
203
  }
204
- return [4 /*yield*/, (0, utils_1.hasAllowance)([curve_1.ALIASES.crv], [amount], curve_1.curve.signerAddress, curve_1.ALIASES.voting_escrow)];
204
+ return [4 /*yield*/, (0, utils_1.hasAllowance)([curve_1.curve.constants.ALIASES.crv], [amount], curve_1.curve.signerAddress, curve_1.curve.constants.ALIASES.voting_escrow)];
205
205
  case 2:
206
206
  if (!(_a.sent())) {
207
207
  throw Error("Token allowance is needed to estimate gas");
208
208
  }
209
- _amount = ethers_1.ethers.utils.parseUnits(amount);
209
+ _amount = (0, utils_2.parseUnits)(amount);
210
210
  unlockTime = Math.floor(Date.now() / 1000) + (days * 86400);
211
- return [4 /*yield*/, curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract.estimateGas.create_lock(_amount, unlockTime, curve_1.curve.constantOptions)];
211
+ return [4 /*yield*/, curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract.estimateGas.create_lock(_amount, unlockTime, curve_1.curve.constantOptions)];
212
212
  case 3: return [2 /*return*/, (_a.sent()).toNumber()];
213
213
  }
214
214
  });
@@ -219,12 +219,12 @@ var createLock = function (amount, days) { return __awaiter(void 0, void 0, void
219
219
  return __generator(this, function (_a) {
220
220
  switch (_a.label) {
221
221
  case 0:
222
- _amount = ethers_1.ethers.utils.parseUnits(amount);
222
+ _amount = (0, utils_2.parseUnits)(amount);
223
223
  unlockTime = Math.floor(Date.now() / 1000) + (days * 86400);
224
- return [4 /*yield*/, (0, utils_2._ensureAllowance)([curve_1.ALIASES.crv], [_amount], curve_1.ALIASES.voting_escrow)];
224
+ return [4 /*yield*/, (0, utils_2._ensureAllowance)([curve_1.curve.constants.ALIASES.crv], [_amount], curve_1.curve.constants.ALIASES.voting_escrow)];
225
225
  case 1:
226
226
  _a.sent();
227
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
227
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
228
228
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
229
229
  case 2:
230
230
  _a.sent();
@@ -247,13 +247,13 @@ var increaseAmountEstimateGas = function (amount) { return __awaiter(void 0, voi
247
247
  if (Number(crvBalance) < Number(amount)) {
248
248
  throw Error("Not enough. Actual: ".concat(crvBalance, ", required: ").concat(amount));
249
249
  }
250
- return [4 /*yield*/, (0, utils_1.hasAllowance)([curve_1.ALIASES.crv], [amount], curve_1.curve.signerAddress, curve_1.ALIASES.voting_escrow)];
250
+ return [4 /*yield*/, (0, utils_1.hasAllowance)([curve_1.curve.constants.ALIASES.crv], [amount], curve_1.curve.signerAddress, curve_1.curve.constants.ALIASES.voting_escrow)];
251
251
  case 2:
252
252
  if (!(_a.sent())) {
253
253
  throw Error("Token allowance is needed to estimate gas");
254
254
  }
255
- _amount = ethers_1.ethers.utils.parseUnits(amount);
256
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
255
+ _amount = (0, utils_2.parseUnits)(amount);
256
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
257
257
  return [4 /*yield*/, contract.estimateGas.increase_amount(_amount, curve_1.curve.constantOptions)];
258
258
  case 3: return [2 /*return*/, (_a.sent()).toNumber()];
259
259
  }
@@ -265,11 +265,11 @@ var increaseAmount = function (amount) { return __awaiter(void 0, void 0, void 0
265
265
  return __generator(this, function (_a) {
266
266
  switch (_a.label) {
267
267
  case 0:
268
- _amount = ethers_1.ethers.utils.parseUnits(amount);
269
- return [4 /*yield*/, (0, utils_2._ensureAllowance)([curve_1.ALIASES.crv], [_amount], curve_1.ALIASES.voting_escrow)];
268
+ _amount = (0, utils_2.parseUnits)(amount);
269
+ return [4 /*yield*/, (0, utils_2._ensureAllowance)([curve_1.curve.constants.ALIASES.crv], [_amount], curve_1.curve.constants.ALIASES.voting_escrow)];
270
270
  case 1:
271
271
  _a.sent();
272
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
272
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
273
273
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
274
274
  case 2:
275
275
  _a.sent();
@@ -290,7 +290,7 @@ var increaseUnlockTimeEstimateGas = function (days) { return __awaiter(void 0, v
290
290
  case 1:
291
291
  unlockTime = (_a.sent()).unlockTime;
292
292
  newUnlockTime = Math.floor(unlockTime / 1000) + (days * 86400);
293
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
293
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
294
294
  return [4 /*yield*/, contract.estimateGas.increase_unlock_time(newUnlockTime, curve_1.curve.constantOptions)];
295
295
  case 2: return [2 /*return*/, (_a.sent()).toNumber()];
296
296
  }
@@ -305,7 +305,7 @@ var increaseUnlockTime = function (days) { return __awaiter(void 0, void 0, void
305
305
  case 1:
306
306
  unlockTime = (_a.sent()).unlockTime;
307
307
  newUnlockTime = Math.floor(unlockTime / 1000) + (days * 86400);
308
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
308
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
309
309
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
310
310
  case 2:
311
311
  _a.sent();
@@ -323,7 +323,7 @@ var withdrawLockedCrvEstimateGas = function () { return __awaiter(void 0, void 0
323
323
  return __generator(this, function (_a) {
324
324
  switch (_a.label) {
325
325
  case 0:
326
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
326
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
327
327
  return [4 /*yield*/, contract.estimateGas.withdraw(curve_1.curve.constantOptions)];
328
328
  case 1: return [2 /*return*/, (_a.sent()).toNumber()];
329
329
  }
@@ -335,7 +335,7 @@ var withdrawLockedCrv = function () { return __awaiter(void 0, void 0, void 0, f
335
335
  return __generator(this, function (_a) {
336
336
  switch (_a.label) {
337
337
  case 0:
338
- contract = curve_1.curve.contracts[curve_1.ALIASES.voting_escrow].contract;
338
+ contract = curve_1.curve.contracts[curve_1.curve.constants.ALIASES.voting_escrow].contract;
339
339
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
340
340
  case 1:
341
341
  _a.sent();
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,24 +1,3 @@
1
- export declare const ALIASES_ETHEREUM: {
2
- crv: string;
3
- minter: string;
4
- voting_escrow: string;
5
- gauge_controller: string;
6
- address_provider: string;
7
- router: string;
8
- deposit_and_stake: string;
9
- factory: string;
10
- crypto_factory: string;
11
- registry_exchange: string;
12
- };
13
- export declare const ALIASES_POLYGON: {
14
- crv: string;
15
- minter: string;
16
- voting_escrow: string;
17
- gauge_controller: string;
18
- address_provider: string;
19
- router: string;
20
- deposit_and_stake: string;
21
- factory: string;
22
- crypto_factory: string;
23
- registry_exchange: string;
24
- };
1
+ export declare const ALIASES_ETHEREUM: import("../interfaces").IDict<string>;
2
+ export declare const ALIASES_POLYGON: import("../interfaces").IDict<string>;
3
+ export declare const ALIASES_AVALANCHE: import("../interfaces").IDict<string>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ALIASES_POLYGON = exports.ALIASES_ETHEREUM = void 0;
4
- exports.ALIASES_ETHEREUM = {
3
+ exports.ALIASES_AVALANCHE = exports.ALIASES_POLYGON = exports.ALIASES_ETHEREUM = void 0;
4
+ var utils_1 = require("./utils");
5
+ exports.ALIASES_ETHEREUM = (0, utils_1.lowerCaseValues)({
5
6
  "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52",
6
7
  "minter": "0xd061D61a4d941c39E5453435B6345Dc261C2fcE0",
7
8
  "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
@@ -12,8 +13,8 @@ exports.ALIASES_ETHEREUM = {
12
13
  "factory": '0xb9fc157394af804a3578134a6585c0dc9cc990d4',
13
14
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
14
15
  "registry_exchange": "",
15
- };
16
- exports.ALIASES_POLYGON = {
16
+ });
17
+ exports.ALIASES_POLYGON = (0, utils_1.lowerCaseValues)({
17
18
  "crv": "0x172370d5cd63279efa6d502dab29171933a610af",
18
19
  "minter": "0xd061D61a4d941c39E5453435B6345Dc261C2fcE0",
19
20
  "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
@@ -24,4 +25,16 @@ exports.ALIASES_POLYGON = {
24
25
  "factory": '0x722272d36ef0da72ff51c5a65db7b870e2e8d4ee',
25
26
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
26
27
  "registry_exchange": "",
27
- };
28
+ });
29
+ exports.ALIASES_AVALANCHE = (0, utils_1.lowerCaseValues)({
30
+ "crv": "0x249848BeCA43aC405b8102Ec90Dd5F22CA513c06",
31
+ "minter": "0xd061D61a4d941c39E5453435B6345Dc261C2fcE0",
32
+ "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2",
33
+ "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB",
34
+ "address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383",
35
+ "router": "0xfA9a30350048B2BF66865ee20363067c66f67e58",
36
+ "deposit_and_stake": "0xB7De33440B7171159a9718CBE748086cecDd9685",
37
+ "factory": '0xb17b674D9c5CB2e441F8e196a2f048A81355d031',
38
+ "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
39
+ "registry_exchange": "",
40
+ });
@@ -0,0 +1,7 @@
1
+ export declare const COINS_AVALANCHE: {
2
+ [index: string]: string;
3
+ };
4
+ export declare const cTokensAvalanche: never[];
5
+ export declare const yTokensAvalanche: never[];
6
+ export declare const ycTokensAvalanche: never[];
7
+ export declare const aTokensAvalanche: string[];