@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
@@ -0,0 +1,373 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.depositPlainMixin = exports.depositLendingOrCryptoMixin = exports.depositZapMixin = exports.depositMetaFactoryMixin = void 0;
51
+ var utils_1 = require("../../utils");
52
+ var curve_1 = require("../../curve");
53
+ var ethers_1 = require("ethers");
54
+ // @ts-ignore
55
+ function _depositCheck(amounts, estimateGas) {
56
+ if (estimateGas === void 0) { estimateGas = false; }
57
+ return __awaiter(this, void 0, void 0, function () {
58
+ var balances, _a, _b, i, _c;
59
+ var _this = this;
60
+ return __generator(this, function (_d) {
61
+ switch (_d.label) {
62
+ case 0:
63
+ if (amounts.length !== this.underlyingCoinAddresses.length) {
64
+ throw Error("".concat(this.name, " pool has ").concat(this.underlyingCoinAddresses.length, " coins (amounts provided for ").concat(amounts.length, ")"));
65
+ }
66
+ _b = (_a = Object).values;
67
+ return [4 /*yield*/, this.wallet.underlyingCoinBalances()];
68
+ case 1:
69
+ balances = _b.apply(_a, [_d.sent()]);
70
+ for (i = 0; i < balances.length; i++) {
71
+ if (Number(balances[i]) < Number(amounts[i])) {
72
+ throw Error("Not enough ".concat(this.underlyingCoins[i], ". Actual: ").concat(balances[i], ", required: ").concat(amounts[i]));
73
+ }
74
+ }
75
+ _c = estimateGas;
76
+ if (!_c) return [3 /*break*/, 3];
77
+ return [4 /*yield*/, (0, utils_1.hasAllowance)(this.underlyingCoinAddresses, amounts, curve_1.curve.signerAddress, this.zap || this.address)];
78
+ case 2:
79
+ _c = !(_d.sent());
80
+ _d.label = 3;
81
+ case 3:
82
+ if (_c) {
83
+ throw Error("Token allowance is needed to estimate gas");
84
+ }
85
+ if (!!estimateGas) return [3 /*break*/, 5];
86
+ return [4 /*yield*/, curve_1.curve.updateFeeData()];
87
+ case 4:
88
+ _d.sent();
89
+ _d.label = 5;
90
+ case 5: return [2 /*return*/, amounts.map(function (amount, i) { return (0, utils_1.parseUnits)(amount, _this.underlyingDecimals[i]); })];
91
+ }
92
+ });
93
+ });
94
+ }
95
+ function _depositMinAmount(_amounts, slippage) {
96
+ if (slippage === void 0) { slippage = 0.5; }
97
+ return __awaiter(this, void 0, void 0, function () {
98
+ var _expectedLpTokenAmount, minAmountBN;
99
+ return __generator(this, function (_a) {
100
+ switch (_a.label) {
101
+ case 0: return [4 /*yield*/, this._calcLpTokenAmount(_amounts)];
102
+ case 1:
103
+ _expectedLpTokenAmount = _a.sent();
104
+ minAmountBN = (0, utils_1.toBN)(_expectedLpTokenAmount).times(100 - slippage).div(100);
105
+ return [2 /*return*/, (0, utils_1.fromBN)(minAmountBN)];
106
+ }
107
+ });
108
+ });
109
+ }
110
+ // @ts-ignore
111
+ exports.depositMetaFactoryMixin = {
112
+ // @ts-ignore
113
+ _deposit: function (_amounts, slippage, estimateGas) {
114
+ if (estimateGas === void 0) { estimateGas = false; }
115
+ return __awaiter(this, void 0, void 0, function () {
116
+ var _minMintAmount, ethIndex, value, contract, gas, gasLimit;
117
+ return __generator(this, function (_a) {
118
+ switch (_a.label) {
119
+ case 0:
120
+ if (!!estimateGas) return [3 /*break*/, 2];
121
+ return [4 /*yield*/, (0, utils_1._ensureAllowance)(this.underlyingCoinAddresses, _amounts, this.zap)];
122
+ case 1:
123
+ _a.sent();
124
+ _a.label = 2;
125
+ case 2: return [4 /*yield*/, _depositMinAmount.call(this, _amounts, slippage)];
126
+ case 3:
127
+ _minMintAmount = _a.sent();
128
+ ethIndex = (0, utils_1.getEthIndex)(this.underlyingCoinAddresses);
129
+ value = _amounts[ethIndex] || ethers_1.ethers.BigNumber.from(0);
130
+ contract = curve_1.curve.contracts[this.zap].contract;
131
+ return [4 /*yield*/, contract.estimateGas.add_liquidity(this.address, _amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
132
+ case 4:
133
+ gas = _a.sent();
134
+ if (estimateGas)
135
+ return [2 /*return*/, gas.toNumber()];
136
+ gasLimit = gas.mul(130).div(100);
137
+ return [4 /*yield*/, contract.add_liquidity(this.address, _amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
138
+ case 5: return [2 /*return*/, (_a.sent()).hash];
139
+ }
140
+ });
141
+ });
142
+ },
143
+ depositEstimateGas: function (amounts) {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var _amounts;
146
+ return __generator(this, function (_a) {
147
+ switch (_a.label) {
148
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts, true)];
149
+ case 1:
150
+ _amounts = _a.sent();
151
+ return [4 /*yield*/, this._deposit(_amounts, 0.1, true)];
152
+ case 2:
153
+ // @ts-ignore
154
+ return [2 /*return*/, _a.sent()];
155
+ }
156
+ });
157
+ });
158
+ },
159
+ deposit: function (amounts, slippage) {
160
+ return __awaiter(this, void 0, void 0, function () {
161
+ var _amounts;
162
+ return __generator(this, function (_a) {
163
+ switch (_a.label) {
164
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts)];
165
+ case 1:
166
+ _amounts = _a.sent();
167
+ return [4 /*yield*/, this._deposit(_amounts, slippage)];
168
+ case 2:
169
+ // @ts-ignore
170
+ return [2 /*return*/, _a.sent()];
171
+ }
172
+ });
173
+ });
174
+ },
175
+ };
176
+ // @ts-ignore
177
+ exports.depositZapMixin = {
178
+ // @ts-ignore
179
+ _deposit: function (_amounts, slippage, estimateGas) {
180
+ if (estimateGas === void 0) { estimateGas = false; }
181
+ return __awaiter(this, void 0, void 0, function () {
182
+ var _minMintAmount, ethIndex, value, contract, gas, gasLimit;
183
+ return __generator(this, function (_a) {
184
+ switch (_a.label) {
185
+ case 0:
186
+ if (!!estimateGas) return [3 /*break*/, 2];
187
+ return [4 /*yield*/, (0, utils_1._ensureAllowance)(this.underlyingCoinAddresses, _amounts, this.zap)];
188
+ case 1:
189
+ _a.sent();
190
+ _a.label = 2;
191
+ case 2: return [4 /*yield*/, _depositMinAmount.call(this, _amounts, slippage)];
192
+ case 3:
193
+ _minMintAmount = _a.sent();
194
+ ethIndex = (0, utils_1.getEthIndex)(this.underlyingCoinAddresses);
195
+ value = _amounts[ethIndex] || ethers_1.ethers.BigNumber.from(0);
196
+ contract = curve_1.curve.contracts[this.zap].contract;
197
+ return [4 /*yield*/, contract.estimateGas.add_liquidity(_amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
198
+ case 4:
199
+ gas = _a.sent();
200
+ if (estimateGas)
201
+ return [2 /*return*/, gas.toNumber()];
202
+ gasLimit = gas.mul(130).div(100);
203
+ return [4 /*yield*/, contract.add_liquidity(_amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
204
+ case 5: return [2 /*return*/, (_a.sent()).hash];
205
+ }
206
+ });
207
+ });
208
+ },
209
+ depositEstimateGas: function (amounts) {
210
+ return __awaiter(this, void 0, void 0, function () {
211
+ var _amounts;
212
+ return __generator(this, function (_a) {
213
+ switch (_a.label) {
214
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts, true)];
215
+ case 1:
216
+ _amounts = _a.sent();
217
+ return [4 /*yield*/, this._deposit(_amounts, 0.1, true)];
218
+ case 2:
219
+ // @ts-ignore
220
+ return [2 /*return*/, _a.sent()];
221
+ }
222
+ });
223
+ });
224
+ },
225
+ deposit: function (amounts, slippage) {
226
+ return __awaiter(this, void 0, void 0, function () {
227
+ var _amounts;
228
+ return __generator(this, function (_a) {
229
+ switch (_a.label) {
230
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts)];
231
+ case 1:
232
+ _amounts = _a.sent();
233
+ return [4 /*yield*/, this._deposit(_amounts, slippage)];
234
+ case 2:
235
+ // @ts-ignore
236
+ return [2 /*return*/, _a.sent()];
237
+ }
238
+ });
239
+ });
240
+ },
241
+ };
242
+ // @ts-ignore
243
+ exports.depositLendingOrCryptoMixin = {
244
+ // @ts-ignore
245
+ _deposit: function (_amounts, slippage, estimateGas) {
246
+ if (estimateGas === void 0) { estimateGas = false; }
247
+ return __awaiter(this, void 0, void 0, function () {
248
+ var _minMintAmount, ethIndex, value, contract, gas, gasLimit;
249
+ return __generator(this, function (_a) {
250
+ switch (_a.label) {
251
+ case 0:
252
+ if (!!estimateGas) return [3 /*break*/, 2];
253
+ return [4 /*yield*/, (0, utils_1._ensureAllowance)(this.underlyingCoinAddresses, _amounts, this.address)];
254
+ case 1:
255
+ _a.sent();
256
+ _a.label = 2;
257
+ case 2: return [4 /*yield*/, _depositMinAmount.call(this, _amounts, slippage)];
258
+ case 3:
259
+ _minMintAmount = _a.sent();
260
+ ethIndex = (0, utils_1.getEthIndex)(this.underlyingCoinAddresses);
261
+ value = _amounts[ethIndex] || ethers_1.ethers.BigNumber.from(0);
262
+ contract = curve_1.curve.contracts[this.address].contract;
263
+ return [4 /*yield*/, contract.estimateGas.add_liquidity(_amounts, _minMintAmount, true, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
264
+ case 4:
265
+ gas = _a.sent();
266
+ if (estimateGas)
267
+ return [2 /*return*/, gas.toNumber()];
268
+ gasLimit = gas.mul(130).div(100);
269
+ return [4 /*yield*/, contract.add_liquidity(_amounts, _minMintAmount, true, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
270
+ case 5: return [2 /*return*/, (_a.sent()).hash];
271
+ }
272
+ });
273
+ });
274
+ },
275
+ depositEstimateGas: function (amounts) {
276
+ return __awaiter(this, void 0, void 0, function () {
277
+ var _amounts;
278
+ return __generator(this, function (_a) {
279
+ switch (_a.label) {
280
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts, true)];
281
+ case 1:
282
+ _amounts = _a.sent();
283
+ return [4 /*yield*/, this._deposit(_amounts, 0.1, true)];
284
+ case 2:
285
+ // @ts-ignore
286
+ return [2 /*return*/, _a.sent()];
287
+ }
288
+ });
289
+ });
290
+ },
291
+ deposit: function (amounts, slippage) {
292
+ return __awaiter(this, void 0, void 0, function () {
293
+ var _amounts;
294
+ return __generator(this, function (_a) {
295
+ switch (_a.label) {
296
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts)];
297
+ case 1:
298
+ _amounts = _a.sent();
299
+ return [4 /*yield*/, this._deposit(_amounts, slippage)];
300
+ case 2:
301
+ // @ts-ignore
302
+ return [2 /*return*/, _a.sent()];
303
+ }
304
+ });
305
+ });
306
+ },
307
+ };
308
+ // @ts-ignore
309
+ exports.depositPlainMixin = {
310
+ // @ts-ignore
311
+ _deposit: function (_amounts, slippage, estimateGas) {
312
+ if (estimateGas === void 0) { estimateGas = false; }
313
+ return __awaiter(this, void 0, void 0, function () {
314
+ var _minMintAmount, ethIndex, value, contract, gas, gasLimit;
315
+ return __generator(this, function (_a) {
316
+ switch (_a.label) {
317
+ case 0:
318
+ if (!!estimateGas) return [3 /*break*/, 2];
319
+ return [4 /*yield*/, (0, utils_1._ensureAllowance)(this.wrappedCoinAddresses, _amounts, this.address)];
320
+ case 1:
321
+ _a.sent();
322
+ _a.label = 2;
323
+ case 2: return [4 /*yield*/, _depositMinAmount.call(this, _amounts, slippage)];
324
+ case 3:
325
+ _minMintAmount = _a.sent();
326
+ ethIndex = (0, utils_1.getEthIndex)(this.wrappedCoinAddresses);
327
+ value = _amounts[ethIndex] || ethers_1.ethers.BigNumber.from(0);
328
+ contract = curve_1.curve.contracts[this.address].contract;
329
+ return [4 /*yield*/, contract.estimateGas.add_liquidity(_amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
330
+ case 4:
331
+ gas = _a.sent();
332
+ if (estimateGas)
333
+ return [2 /*return*/, gas.toNumber()];
334
+ gasLimit = gas.mul(130).div(100);
335
+ return [4 /*yield*/, contract.add_liquidity(_amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
336
+ case 5: return [2 /*return*/, (_a.sent()).hash];
337
+ }
338
+ });
339
+ });
340
+ },
341
+ depositEstimateGas: function (amounts) {
342
+ return __awaiter(this, void 0, void 0, function () {
343
+ var _amounts;
344
+ return __generator(this, function (_a) {
345
+ switch (_a.label) {
346
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts, true)];
347
+ case 1:
348
+ _amounts = _a.sent();
349
+ return [4 /*yield*/, this._deposit(_amounts, 0.1, true)];
350
+ case 2:
351
+ // @ts-ignore
352
+ return [2 /*return*/, _a.sent()];
353
+ }
354
+ });
355
+ });
356
+ },
357
+ deposit: function (amounts, slippage) {
358
+ return __awaiter(this, void 0, void 0, function () {
359
+ var _amounts;
360
+ return __generator(this, function (_a) {
361
+ switch (_a.label) {
362
+ case 0: return [4 /*yield*/, _depositCheck.call(this, amounts)];
363
+ case 1:
364
+ _amounts = _a.sent();
365
+ return [4 /*yield*/, this._deposit(_amounts, slippage)];
366
+ case 2:
367
+ // @ts-ignore
368
+ return [2 /*return*/, _a.sent()];
369
+ }
370
+ });
371
+ });
372
+ },
373
+ };
@@ -0,0 +1,3 @@
1
+ import { PoolTemplate } from "../PoolTemplate";
2
+ export declare const depositWrapped2argsMixin: PoolTemplate;
3
+ export declare const depositWrapped3argsMixin: PoolTemplate;
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.depositWrapped3argsMixin = exports.depositWrapped2argsMixin = void 0;
51
+ var utils_1 = require("../../utils");
52
+ var curve_1 = require("../../curve");
53
+ var ethers_1 = require("ethers");
54
+ function _depositWrappedCheck(amounts, estimateGas) {
55
+ if (estimateGas === void 0) { estimateGas = false; }
56
+ return __awaiter(this, void 0, void 0, function () {
57
+ var balances, _a, _b, i, _c;
58
+ var _this = this;
59
+ return __generator(this, function (_d) {
60
+ switch (_d.label) {
61
+ case 0:
62
+ if (this.isFake) {
63
+ throw Error("depositWrappedExpected method doesn't exist for pool ".concat(this.name, " (id: ").concat(this.name, ")"));
64
+ }
65
+ if (amounts.length !== this.wrappedCoinAddresses.length) {
66
+ throw Error("".concat(this.name, " pool has ").concat(this.wrappedCoinAddresses.length, " coins (amounts provided for ").concat(amounts.length, ")"));
67
+ }
68
+ _b = (_a = Object).values;
69
+ return [4 /*yield*/, this.wallet.wrappedCoinBalances()];
70
+ case 1:
71
+ balances = _b.apply(_a, [_d.sent()]);
72
+ for (i = 0; i < balances.length; i++) {
73
+ if (Number(balances[i]) < Number(amounts[i])) {
74
+ throw Error("Not enough ".concat(this.wrappedCoins[i], ". Actual: ").concat(balances[i], ", required: ").concat(amounts[i]));
75
+ }
76
+ }
77
+ _c = estimateGas;
78
+ if (!_c) return [3 /*break*/, 3];
79
+ return [4 /*yield*/, (0, utils_1.hasAllowance)(this.wrappedCoinAddresses, amounts, curve_1.curve.signerAddress, this.address)];
80
+ case 2:
81
+ _c = !(_d.sent());
82
+ _d.label = 3;
83
+ case 3:
84
+ if (_c) {
85
+ throw Error("Token allowance is needed to estimate gas");
86
+ }
87
+ if (!!estimateGas) return [3 /*break*/, 5];
88
+ return [4 /*yield*/, curve_1.curve.updateFeeData()];
89
+ case 4:
90
+ _d.sent();
91
+ _d.label = 5;
92
+ case 5: return [2 /*return*/, amounts.map(function (amount, i) { return (0, utils_1.parseUnits)(amount, _this.wrappedDecimals[i]); })];
93
+ }
94
+ });
95
+ });
96
+ }
97
+ function _depositWrappedMinAmount(_amounts, slippage) {
98
+ if (slippage === void 0) { slippage = 0.5; }
99
+ return __awaiter(this, void 0, void 0, function () {
100
+ var _expectedLpTokenAmount, minAmountBN;
101
+ return __generator(this, function (_a) {
102
+ switch (_a.label) {
103
+ case 0: return [4 /*yield*/, this._calcLpTokenAmount(_amounts, true, false)];
104
+ case 1:
105
+ _expectedLpTokenAmount = _a.sent();
106
+ minAmountBN = (0, utils_1.toBN)(_expectedLpTokenAmount).times(100 - slippage).div(100);
107
+ return [2 /*return*/, (0, utils_1.fromBN)(minAmountBN)];
108
+ }
109
+ });
110
+ });
111
+ }
112
+ // @ts-ignore
113
+ exports.depositWrapped2argsMixin = {
114
+ // @ts-ignore
115
+ _depositWrapped: function (_amounts, slippage, estimateGas) {
116
+ if (estimateGas === void 0) { estimateGas = false; }
117
+ return __awaiter(this, void 0, void 0, function () {
118
+ var _minMintAmount, ethIndex, value, contract, gas, gasLimit;
119
+ return __generator(this, function (_a) {
120
+ switch (_a.label) {
121
+ case 0:
122
+ if (!!estimateGas) return [3 /*break*/, 2];
123
+ return [4 /*yield*/, (0, utils_1._ensureAllowance)(this.wrappedCoinAddresses, _amounts, this.address)];
124
+ case 1:
125
+ _a.sent();
126
+ _a.label = 2;
127
+ case 2: return [4 /*yield*/, _depositWrappedMinAmount.call(this, _amounts, slippage)];
128
+ case 3:
129
+ _minMintAmount = _a.sent();
130
+ ethIndex = (0, utils_1.getEthIndex)(this.wrappedCoinAddresses);
131
+ value = _amounts[ethIndex] || ethers_1.ethers.BigNumber.from(0);
132
+ contract = curve_1.curve.contracts[this.address].contract;
133
+ return [4 /*yield*/, contract.estimateGas.add_liquidity(_amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
134
+ case 4:
135
+ gas = _a.sent();
136
+ if (estimateGas)
137
+ return [2 /*return*/, gas.toNumber()];
138
+ gasLimit = gas.mul(130).div(100);
139
+ return [4 /*yield*/, contract.add_liquidity(_amounts, _minMintAmount, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
140
+ case 5: return [2 /*return*/, (_a.sent()).hash];
141
+ }
142
+ });
143
+ });
144
+ },
145
+ depositWrappedEstimateGas: function (amounts) {
146
+ return __awaiter(this, void 0, void 0, function () {
147
+ var _amounts;
148
+ return __generator(this, function (_a) {
149
+ switch (_a.label) {
150
+ case 0: return [4 /*yield*/, _depositWrappedCheck.call(this, amounts, true)];
151
+ case 1:
152
+ _amounts = _a.sent();
153
+ return [4 /*yield*/, this._depositWrapped(_amounts, 0.1, true)];
154
+ case 2:
155
+ // @ts-ignore
156
+ return [2 /*return*/, _a.sent()];
157
+ }
158
+ });
159
+ });
160
+ },
161
+ depositWrapped: function (amounts, slippage) {
162
+ return __awaiter(this, void 0, void 0, function () {
163
+ var _amounts;
164
+ return __generator(this, function (_a) {
165
+ switch (_a.label) {
166
+ case 0: return [4 /*yield*/, _depositWrappedCheck.call(this, amounts)];
167
+ case 1:
168
+ _amounts = _a.sent();
169
+ return [4 /*yield*/, this._depositWrapped(_amounts, slippage)];
170
+ case 2:
171
+ // @ts-ignore
172
+ return [2 /*return*/, _a.sent()];
173
+ }
174
+ });
175
+ });
176
+ },
177
+ };
178
+ // @ts-ignore
179
+ exports.depositWrapped3argsMixin = {
180
+ // @ts-ignore
181
+ _depositWrapped: function (_amounts, slippage, estimateGas) {
182
+ if (estimateGas === void 0) { estimateGas = false; }
183
+ return __awaiter(this, void 0, void 0, function () {
184
+ var _minMintAmount, ethIndex, value, contract, gas, gasLimit;
185
+ return __generator(this, function (_a) {
186
+ switch (_a.label) {
187
+ case 0:
188
+ if (!!estimateGas) return [3 /*break*/, 2];
189
+ return [4 /*yield*/, (0, utils_1._ensureAllowance)(this.wrappedCoinAddresses, _amounts, this.address)];
190
+ case 1:
191
+ _a.sent();
192
+ _a.label = 2;
193
+ case 2: return [4 /*yield*/, _depositWrappedMinAmount.call(this, _amounts, slippage)];
194
+ case 3:
195
+ _minMintAmount = _a.sent();
196
+ ethIndex = (0, utils_1.getEthIndex)(this.wrappedCoinAddresses);
197
+ value = _amounts[ethIndex] || ethers_1.ethers.BigNumber.from(0);
198
+ contract = curve_1.curve.contracts[this.address].contract;
199
+ return [4 /*yield*/, contract.estimateGas.add_liquidity(_amounts, _minMintAmount, false, __assign(__assign({}, curve_1.curve.constantOptions), { value: value }))];
200
+ case 4:
201
+ gas = _a.sent();
202
+ if (estimateGas)
203
+ return [2 /*return*/, gas.toNumber()];
204
+ gasLimit = gas.mul(130).div(100);
205
+ return [4 /*yield*/, contract.add_liquidity(_amounts, _minMintAmount, false, __assign(__assign({}, curve_1.curve.options), { gasLimit: gasLimit, value: value }))];
206
+ case 5: return [2 /*return*/, (_a.sent()).hash];
207
+ }
208
+ });
209
+ });
210
+ },
211
+ depositWrappedEstimateGas: function (amounts) {
212
+ return __awaiter(this, void 0, void 0, function () {
213
+ var _amounts;
214
+ return __generator(this, function (_a) {
215
+ switch (_a.label) {
216
+ case 0: return [4 /*yield*/, _depositWrappedCheck.call(this, amounts, true)];
217
+ case 1:
218
+ _amounts = _a.sent();
219
+ return [4 /*yield*/, this._depositWrapped(_amounts, 0.1, true)];
220
+ case 2:
221
+ // @ts-ignore
222
+ return [2 /*return*/, _a.sent()];
223
+ }
224
+ });
225
+ });
226
+ },
227
+ depositWrapped: function (amounts, slippage) {
228
+ return __awaiter(this, void 0, void 0, function () {
229
+ var _amounts;
230
+ return __generator(this, function (_a) {
231
+ switch (_a.label) {
232
+ case 0: return [4 /*yield*/, _depositWrappedCheck.call(this, amounts)];
233
+ case 1:
234
+ _amounts = _a.sent();
235
+ return [4 /*yield*/, this._depositWrapped(_amounts, slippage)];
236
+ case 2:
237
+ // @ts-ignore
238
+ return [2 /*return*/, _a.sent()];
239
+ }
240
+ });
241
+ });
242
+ },
243
+ };
@@ -0,0 +1,4 @@
1
+ import { PoolTemplate } from "../PoolTemplate";
2
+ export declare const poolBalancesAtricrypto3Mixin: PoolTemplate;
3
+ export declare const poolBalancesMetaMixin: PoolTemplate;
4
+ export declare const poolBalancesLendingMixin: PoolTemplate;