@curvefi/api 2.62.0 → 2.63.1

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 (83) hide show
  1. package/lib/boosting.js +247 -645
  2. package/lib/constants/L2Networks.js +1 -1
  3. package/lib/constants/aliases.js +31 -31
  4. package/lib/constants/coins/arbitrum.js +5 -5
  5. package/lib/constants/coins/aurora.js +5 -5
  6. package/lib/constants/coins/avalanche.js +6 -6
  7. package/lib/constants/coins/base.js +5 -5
  8. package/lib/constants/coins/bsc.js +5 -5
  9. package/lib/constants/coins/celo.js +5 -5
  10. package/lib/constants/coins/ethereum.js +9 -9
  11. package/lib/constants/coins/fantom.js +7 -7
  12. package/lib/constants/coins/fraxtal.js +5 -5
  13. package/lib/constants/coins/kava.js +5 -5
  14. package/lib/constants/coins/mantle.js +5 -5
  15. package/lib/constants/coins/moonbeam.js +5 -5
  16. package/lib/constants/coins/optimism.js +5 -5
  17. package/lib/constants/coins/polygon.js +6 -6
  18. package/lib/constants/coins/xdai.js +5 -5
  19. package/lib/constants/coins/xlayer.js +5 -5
  20. package/lib/constants/coins/zksync.js +5 -5
  21. package/lib/constants/pools/arbitrum.js +1 -1
  22. package/lib/constants/pools/aurora.js +1 -1
  23. package/lib/constants/pools/avalanche.js +1 -1
  24. package/lib/constants/pools/base.js +1 -1
  25. package/lib/constants/pools/bsc.js +1 -1
  26. package/lib/constants/pools/celo.js +1 -1
  27. package/lib/constants/pools/ethereum.js +2 -2
  28. package/lib/constants/pools/fantom.js +1 -1
  29. package/lib/constants/pools/fraxtal.js +1 -1
  30. package/lib/constants/pools/kava.js +1 -1
  31. package/lib/constants/pools/mantle.js +1 -1
  32. package/lib/constants/pools/moonbeam.js +1 -1
  33. package/lib/constants/pools/optimism.js +1 -1
  34. package/lib/constants/pools/polygon.js +1 -1
  35. package/lib/constants/pools/xdai.js +1 -1
  36. package/lib/constants/pools/xlayer.js +1 -1
  37. package/lib/constants/pools/zksync.js +1 -1
  38. package/lib/constants/tricryptoDeployImplementations.js +3 -3
  39. package/lib/constants/utils.js +18 -19
  40. package/lib/constants/volumeNetworks.js +1 -1
  41. package/lib/curve.d.ts +3 -1
  42. package/lib/curve.js +534 -909
  43. package/lib/dao.js +351 -705
  44. package/lib/external-api.js +127 -256
  45. package/lib/factory/common.js +4 -4
  46. package/lib/factory/constants-crypto.js +33 -33
  47. package/lib/factory/constants.js +36 -46
  48. package/lib/factory/deploy.js +542 -907
  49. package/lib/factory/factory-api.js +205 -269
  50. package/lib/factory/factory-crypto.js +202 -342
  51. package/lib/factory/factory-tricrypto.js +164 -286
  52. package/lib/factory/factory-twocrypto.js +151 -269
  53. package/lib/factory/factory.js +245 -385
  54. package/lib/index.js +109 -198
  55. package/lib/interfaces.d.ts +1 -6
  56. package/lib/pools/PoolTemplate.js +1773 -3025
  57. package/lib/pools/gaugePool.js +112 -251
  58. package/lib/pools/mixins/common.js +22 -93
  59. package/lib/pools/mixins/depositBalancedAmountsMixins.js +52 -118
  60. package/lib/pools/mixins/depositMixins.js +160 -386
  61. package/lib/pools/mixins/depositWrappedMixins.js +79 -205
  62. package/lib/pools/mixins/poolBalancesMixin.js +24 -87
  63. package/lib/pools/mixins/swapMixins.js +139 -324
  64. package/lib/pools/mixins/swapWrappedMixins.js +111 -265
  65. package/lib/pools/mixins/withdrawExpectedMixins.js +27 -91
  66. package/lib/pools/mixins/withdrawImbalanceMixins.js +111 -293
  67. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +58 -169
  68. package/lib/pools/mixins/withdrawMixins.js +139 -359
  69. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +20 -75
  70. package/lib/pools/mixins/withdrawOneCoinMixins.js +140 -360
  71. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +10 -51
  72. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +60 -167
  73. package/lib/pools/mixins/withdrawWrappedMixins.js +57 -167
  74. package/lib/pools/poolConstructor.js +5 -25
  75. package/lib/pools/utils.js +301 -469
  76. package/lib/route-finder.worker.d.ts +9 -0
  77. package/lib/route-finder.worker.js +112 -0
  78. package/lib/route-graph.worker.d.ts +11 -0
  79. package/lib/route-graph.worker.js +334 -0
  80. package/lib/router.js +323 -912
  81. package/lib/utils.d.ts +5 -4
  82. package/lib/utils.js +539 -906
  83. package/package.json +1 -1
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -18,42 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
19
8
  });
20
9
  };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- 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;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
- if (ar || !(i in from)) {
51
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
52
- ar[i] = from[i];
53
- }
54
- }
55
- return to.concat(ar || Array.prototype.slice.call(from));
56
- };
57
10
  import { Contract as MulticallContract } from "@curvefi/ethcall";
58
11
  import { curve } from "../curve.js";
59
12
  import ERC20ABI from "../constants/abis/ERC20.json" assert { type: 'json' };
@@ -62,7 +15,7 @@ import gaugeChildABI from "../constants/abis/gauge_child.json" assert { type: 'j
62
15
  import { getPoolIdByAddress, setFactoryZapContracts } from "./common.js";
63
16
  import { FACTORY_CONSTANTS } from "./constants.js";
64
17
  import { getPoolName, isStableNgPool } from "../utils.js";
65
- export var BLACK_LIST = {
18
+ export const BLACK_LIST = {
66
19
  1: [
67
20
  "0x066b6e1e93fa7dcd3f0eb7f8bac7d5a747ce0bf9",
68
21
  "0xc61557c5d177bd7dc889a3b621eec333e168f68a",
@@ -76,110 +29,70 @@ export var BLACK_LIST = {
76
29
  "0xd7bb79aee866672419999a0496d99c54741d67b5",
77
30
  ],
78
31
  };
79
- var deepFlatten = function (arr) { return [].concat.apply([], arr.map(function (v) { return (Array.isArray(v) ? deepFlatten(v) : v); })); };
32
+ const deepFlatten = (arr) => [].concat(...arr.map((v) => (Array.isArray(v) ? deepFlatten(v) : v)));
80
33
  export function getBasePools(factoryAddress, rawSwapAddresses, tmpPools) {
81
- return __awaiter(this, void 0, void 0, function () {
82
- var factoryMulticallContract, calls, _i, rawSwapAddresses_1, addr, result, basePoolIds, basePoolAddresses;
83
- return __generator(this, function (_a) {
84
- switch (_a.label) {
85
- case 0:
86
- factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
87
- calls = [];
88
- for (_i = 0, rawSwapAddresses_1 = rawSwapAddresses; _i < rawSwapAddresses_1.length; _i++) {
89
- addr = rawSwapAddresses_1[_i];
90
- calls.push(factoryMulticallContract.get_base_pool(addr));
91
- }
92
- return [4 /*yield*/, this.multicallProvider.all(calls)];
93
- case 1:
94
- result = _a.sent();
95
- basePoolIds = [];
96
- basePoolAddresses = [];
97
- result.forEach(function (item) {
98
- if (item !== '0x0000000000000000000000000000000000000000') {
99
- basePoolIds.push(getPoolIdByAddress(tmpPools, item));
100
- basePoolAddresses.push(item);
101
- }
102
- else {
103
- basePoolIds.push('');
104
- basePoolAddresses.push(item);
105
- }
106
- });
107
- return [2 /*return*/, {
108
- ids: basePoolIds,
109
- addresses: basePoolAddresses,
110
- }];
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
36
+ const calls = [];
37
+ for (const addr of rawSwapAddresses) {
38
+ calls.push(factoryMulticallContract.get_base_pool(addr));
39
+ }
40
+ const result = yield this.multicallProvider.all(calls);
41
+ const basePoolIds = [];
42
+ const basePoolAddresses = [];
43
+ result.forEach((item) => {
44
+ if (item !== '0x0000000000000000000000000000000000000000') {
45
+ basePoolIds.push(getPoolIdByAddress(tmpPools, item));
46
+ basePoolAddresses.push(item);
47
+ }
48
+ else {
49
+ basePoolIds.push('');
50
+ basePoolAddresses.push(item);
111
51
  }
112
52
  });
53
+ return {
54
+ ids: basePoolIds,
55
+ addresses: basePoolAddresses,
56
+ };
113
57
  });
114
58
  }
115
59
  function getRecentlyCreatedPoolId(swapAddress, factoryAddress) {
116
- return __awaiter(this, void 0, void 0, function () {
117
- var factoryContract, prefix, poolCount, _a, _b, _c, i, address;
118
- return __generator(this, function (_e) {
119
- switch (_e.label) {
120
- case 0:
121
- factoryContract = this.contracts[factoryAddress].contract;
122
- prefix = factoryAddress === this.constants.ALIASES.factory ? 'factory-v2' : 'factory-stable-ng';
123
- _a = Number;
124
- _c = (_b = curve).formatUnits;
125
- return [4 /*yield*/, factoryContract.pool_count(this.constantOptions)];
126
- case 1:
127
- poolCount = _a.apply(void 0, [_c.apply(_b, [_e.sent(), 0])]);
128
- i = 1;
129
- _e.label = 2;
130
- case 2:
131
- if (!(i <= poolCount)) return [3 /*break*/, 5];
132
- return [4 /*yield*/, factoryContract.pool_list(poolCount - i)];
133
- case 3:
134
- address = _e.sent();
135
- if (address.toLowerCase() === swapAddress.toLowerCase())
136
- return [2 /*return*/, "".concat(prefix, "-").concat(poolCount - i)];
137
- _e.label = 4;
138
- case 4:
139
- i++;
140
- return [3 /*break*/, 2];
141
- case 5: throw Error("Unknown pool");
142
- }
143
- });
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const factoryContract = this.contracts[factoryAddress].contract;
62
+ const prefix = factoryAddress === this.constants.ALIASES.factory ? 'factory-v2' : 'factory-stable-ng';
63
+ const poolCount = Number(curve.formatUnits(yield factoryContract.pool_count(this.constantOptions), 0));
64
+ for (let i = 1; i <= poolCount; i++) {
65
+ const address = yield factoryContract.pool_list(poolCount - i);
66
+ if (address.toLowerCase() === swapAddress.toLowerCase())
67
+ return `${prefix}-${poolCount - i}`;
68
+ }
69
+ throw Error("Unknown pool");
144
70
  });
145
71
  }
146
- function getFactoryIdsAndSwapAddresses(fromIdx, factoryAddress) {
72
+ function getFactoryIdsAndSwapAddresses(fromIdx = 0, factoryAddress) {
147
73
  var _a;
148
- if (fromIdx === void 0) { fromIdx = 0; }
149
- return __awaiter(this, void 0, void 0, function () {
150
- var factoryContract, factoryMulticallContract, poolCount, _b, _c, _e, calls, i, prefix, factories, swapAddresses, blacklist;
151
- return __generator(this, function (_f) {
152
- switch (_f.label) {
153
- case 0:
154
- factoryContract = this.contracts[factoryAddress].contract;
155
- factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
156
- _b = Number;
157
- _e = (_c = curve).formatUnits;
158
- return [4 /*yield*/, factoryContract.pool_count(this.constantOptions)];
159
- case 1:
160
- poolCount = _b.apply(void 0, [_e.apply(_c, [_f.sent(), 0])]);
161
- calls = [];
162
- for (i = fromIdx; i < poolCount; i++) {
163
- calls.push(factoryMulticallContract.pool_list(i));
164
- }
165
- if (calls.length === 0)
166
- return [2 /*return*/, [[], []]];
167
- prefix = factoryAddress === this.constants.ALIASES.factory ? "factory-v2-" :
168
- factoryAddress === this.constants.ALIASES.crvusd_factory ? "factory-crvusd-" :
169
- factoryAddress === this.constants.ALIASES.stable_ng_factory ? "factory-stable-ng-" : "factory-eywa-";
170
- return [4 /*yield*/, this.multicallProvider.all(calls)];
171
- case 2:
172
- factories = (_f.sent()).map(function (addr, i) { return ({ id: prefix + (fromIdx + i), address: addr.toLowerCase() }); });
173
- swapAddresses = Object.values(this.constants.POOLS_DATA).map(function (pool) { return pool.swap_address.toLowerCase(); });
174
- blacklist = (_a = BLACK_LIST[this.chainId]) !== null && _a !== void 0 ? _a : [];
175
- factories = factories.filter(function (f) { return !swapAddresses.includes(f.address) && !blacklist.includes(f.address); });
176
- return [2 /*return*/, [factories.map(function (f) { return f.id; }), factories.map(function (f) { return f.address; })]];
177
- }
178
- });
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ const factoryContract = this.contracts[factoryAddress].contract;
76
+ const factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
77
+ const poolCount = Number(curve.formatUnits(yield factoryContract.pool_count(this.constantOptions), 0));
78
+ const calls = [];
79
+ for (let i = fromIdx; i < poolCount; i++) {
80
+ calls.push(factoryMulticallContract.pool_list(i));
81
+ }
82
+ if (calls.length === 0)
83
+ return [[], []];
84
+ const prefix = factoryAddress === this.constants.ALIASES.factory ? "factory-v2-" :
85
+ factoryAddress === this.constants.ALIASES.crvusd_factory ? "factory-crvusd-" :
86
+ factoryAddress === this.constants.ALIASES.stable_ng_factory ? "factory-stable-ng-" : "factory-eywa-";
87
+ let factories = (yield this.multicallProvider.all(calls)).map((addr, i) => ({ id: prefix + (fromIdx + i), address: addr.toLowerCase() }));
88
+ const swapAddresses = Object.values(this.constants.POOLS_DATA).map((pool) => pool.swap_address.toLowerCase());
89
+ const blacklist = (_a = BLACK_LIST[this.chainId]) !== null && _a !== void 0 ? _a : [];
90
+ factories = factories.filter((f) => !swapAddresses.includes(f.address) && !blacklist.includes(f.address));
91
+ return [factories.map((f) => f.id), factories.map((f) => f.address)];
179
92
  });
180
93
  }
181
94
  function _handleReferenceAssets(referenceAssets) {
182
- return referenceAssets.map(function (t) {
95
+ return referenceAssets.map((t) => {
183
96
  return {
184
97
  0: "USD",
185
98
  1: "ETH",
@@ -188,287 +101,234 @@ function _handleReferenceAssets(referenceAssets) {
188
101
  });
189
102
  }
190
103
  function _handleCoinAddresses(coinAddresses) {
191
- var _this = this;
192
- return coinAddresses.map(function (addresses) { return addresses
193
- .filter(function (addr) { return addr !== curve.constants.ZERO_ADDRESS; })
194
- .map(function (addr) { return _this.chainId === 137 && addr === "0x0000000000000000000000000000000000001010" ? _this.constants.NATIVE_TOKEN.address : addr.toLowerCase(); }); });
104
+ return coinAddresses.map((addresses) => addresses
105
+ .filter((addr) => addr !== curve.constants.ZERO_ADDRESS)
106
+ .map((addr) => this.chainId === 137 && addr === "0x0000000000000000000000000000000000001010" ? this.constants.NATIVE_TOKEN.address : addr.toLowerCase()));
195
107
  }
196
108
  function getPoolsData(factorySwapAddresses, factoryAddress) {
197
- return __awaiter(this, void 0, void 0, function () {
198
- var factoryMulticallContract, isFactoryGaugeNull, isStableNgFactory, factoryGaugeContract, calls, _i, factorySwapAddresses_1, addr, tempSwapContract, res, index, index, implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses;
199
- return __generator(this, function (_a) {
200
- switch (_a.label) {
201
- case 0:
202
- factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
203
- isFactoryGaugeNull = this.constants.ALIASES.gauge_factory === '0x0000000000000000000000000000000000000000';
204
- isStableNgFactory = factoryAddress === this.constants.ALIASES['stable_ng_factory'];
205
- factoryGaugeContract = this.contracts[this.constants.ALIASES.gauge_factory].multicallContract;
206
- calls = [];
207
- for (_i = 0, factorySwapAddresses_1 = factorySwapAddresses; _i < factorySwapAddresses_1.length; _i++) {
208
- addr = factorySwapAddresses_1[_i];
209
- tempSwapContract = new MulticallContract(addr, ERC20ABI);
210
- calls.push(factoryMulticallContract.get_implementation_address(addr));
211
- if (this.chainId === 1) {
212
- calls.push(factoryMulticallContract.get_gauge(addr));
213
- }
214
- else if (!isFactoryGaugeNull) {
215
- calls.push(factoryGaugeContract.get_gauge_from_lp_token(addr));
216
- }
217
- if (!isStableNgFactory) {
218
- calls.push(factoryMulticallContract.get_pool_asset_type(addr));
219
- }
220
- calls.push(tempSwapContract.symbol());
221
- calls.push(tempSwapContract.name());
222
- calls.push(factoryMulticallContract.is_meta(addr));
223
- calls.push(factoryMulticallContract.get_coins(addr));
224
- }
225
- return [4 /*yield*/, this.multicallProvider.all(calls)];
226
- case 1:
227
- res = _a.sent();
228
- if (isFactoryGaugeNull) {
229
- for (index = 0; index < res.length; index++) {
230
- if (index % 7 == 1) {
231
- res.splice(index, 0, '0x0000000000000000000000000000000000000000');
232
- }
233
- }
234
- }
235
- if (isStableNgFactory) {
236
- for (index = 0; index < res.length; index++) {
237
- if (index % 7 == 2) {
238
- res.splice(index, 0, -1);
239
- }
240
- }
241
- }
242
- implememntationAddresses = res.filter(function (a, i) { return i % 7 == 0; }).map(function (a) { return a.toLowerCase(); });
243
- gaugeAddresses = res.filter(function (a, i) { return i % 7 == 1; }).map(function (a) { return a.toLowerCase(); });
244
- referenceAssets = _handleReferenceAssets(res.filter(function (a, i) { return i % 7 == 2; }));
245
- symbols = res.filter(function (a, i) { return i % 7 == 3; });
246
- names = res.filter(function (a, i) { return i % 7 == 4; });
247
- isMeta = res.filter(function (a, i) { return i % 7 == 5; });
248
- coinAddresses = _handleCoinAddresses.call(this, res.filter(function (a, i) { return i % 7 == 6; }));
249
- return [2 /*return*/, [implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses]];
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ const factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
111
+ const isFactoryGaugeNull = this.constants.ALIASES.gauge_factory === '0x0000000000000000000000000000000000000000';
112
+ const isStableNgFactory = factoryAddress === this.constants.ALIASES['stable_ng_factory'];
113
+ const factoryGaugeContract = this.contracts[this.constants.ALIASES.gauge_factory].multicallContract;
114
+ const calls = [];
115
+ for (const addr of factorySwapAddresses) {
116
+ const tempSwapContract = new MulticallContract(addr, ERC20ABI);
117
+ calls.push(factoryMulticallContract.get_implementation_address(addr));
118
+ if (this.chainId === 1) {
119
+ calls.push(factoryMulticallContract.get_gauge(addr));
250
120
  }
251
- });
121
+ else if (!isFactoryGaugeNull) {
122
+ calls.push(factoryGaugeContract.get_gauge_from_lp_token(addr));
123
+ }
124
+ if (!isStableNgFactory) {
125
+ calls.push(factoryMulticallContract.get_pool_asset_type(addr));
126
+ }
127
+ calls.push(tempSwapContract.symbol());
128
+ calls.push(tempSwapContract.name());
129
+ calls.push(factoryMulticallContract.is_meta(addr));
130
+ calls.push(factoryMulticallContract.get_coins(addr));
131
+ }
132
+ const res = yield this.multicallProvider.all(calls);
133
+ if (isFactoryGaugeNull) {
134
+ for (let index = 0; index < res.length; index++) {
135
+ if (index % 7 == 1) {
136
+ res.splice(index, 0, '0x0000000000000000000000000000000000000000');
137
+ }
138
+ }
139
+ }
140
+ if (isStableNgFactory) {
141
+ for (let index = 0; index < res.length; index++) {
142
+ if (index % 7 == 2) {
143
+ res.splice(index, 0, -1);
144
+ }
145
+ }
146
+ }
147
+ const implememntationAddresses = res.filter((a, i) => i % 7 == 0).map((a) => a.toLowerCase());
148
+ const gaugeAddresses = res.filter((a, i) => i % 7 == 1).map((a) => a.toLowerCase());
149
+ const referenceAssets = _handleReferenceAssets(res.filter((a, i) => i % 7 == 2));
150
+ const symbols = res.filter((a, i) => i % 7 == 3);
151
+ const names = res.filter((a, i) => i % 7 == 4);
152
+ const isMeta = res.filter((a, i) => i % 7 == 5);
153
+ const coinAddresses = _handleCoinAddresses.call(this, res.filter((a, i) => i % 7 == 6));
154
+ return [implememntationAddresses, gaugeAddresses, referenceAssets, symbols, names, isMeta, coinAddresses];
252
155
  });
253
156
  }
254
157
  function setFactorySwapContracts(factorySwapAddresses, factorySwapABIs) {
255
- var _this = this;
256
- factorySwapAddresses.forEach(function (addr, i) {
257
- _this.setContract(addr, factorySwapABIs[i]);
158
+ factorySwapAddresses.forEach((addr, i) => {
159
+ this.setContract(addr, factorySwapABIs[i]);
258
160
  });
259
161
  }
260
162
  function setFactoryGaugeContracts(factoryGaugeAddresses) {
261
- var _this = this;
262
- factoryGaugeAddresses.filter(function (addr) { return addr !== curve.constants.ZERO_ADDRESS; }).forEach(function (addr, i) {
263
- _this.setContract(addr, _this.chainId === 1 ? factoryGaugeABI : gaugeChildABI);
163
+ factoryGaugeAddresses.filter((addr) => addr !== curve.constants.ZERO_ADDRESS).forEach((addr, i) => {
164
+ this.setContract(addr, this.chainId === 1 ? factoryGaugeABI : gaugeChildABI);
264
165
  });
265
166
  }
266
167
  function setFactoryCoinsContracts(coinAddresses) {
267
- var flattenedCoinAddresses = Array.from(new Set(deepFlatten(coinAddresses)));
268
- for (var _i = 0, flattenedCoinAddresses_1 = flattenedCoinAddresses; _i < flattenedCoinAddresses_1.length; _i++) {
269
- var addr = flattenedCoinAddresses_1[_i];
168
+ const flattenedCoinAddresses = Array.from(new Set(deepFlatten(coinAddresses)));
169
+ for (const addr of flattenedCoinAddresses) {
270
170
  if (addr in this.contracts)
271
171
  continue;
272
172
  this.setContract(addr, ERC20ABI);
273
173
  }
274
174
  }
275
175
  function getExistingCoinAddressNameDict() {
276
- var dict = {};
277
- var _loop_1 = function (poolData) {
278
- poolData.wrapped_coin_addresses.forEach(function (addr, i) {
176
+ const dict = {};
177
+ for (const poolData of Object.values(this.constants.POOLS_DATA)) {
178
+ poolData.wrapped_coin_addresses.forEach((addr, i) => {
279
179
  if (!(addr.toLowerCase() in dict)) {
280
180
  dict[addr.toLowerCase()] = poolData.wrapped_coins[i];
281
181
  }
282
182
  });
283
- poolData.underlying_coin_addresses.forEach(function (addr, i) {
183
+ poolData.underlying_coin_addresses.forEach((addr, i) => {
284
184
  if (!(addr.toLowerCase() in dict)) {
285
185
  dict[addr.toLowerCase()] = poolData.underlying_coins[i];
286
186
  }
287
187
  });
288
- };
289
- for (var _i = 0, _a = Object.values(this.constants.POOLS_DATA); _i < _a.length; _i++) {
290
- var poolData = _a[_i];
291
- _loop_1(poolData);
292
188
  }
293
189
  dict[this.constants.NATIVE_TOKEN.address] = this.constants.NATIVE_TOKEN.symbol;
294
190
  return dict;
295
191
  }
296
192
  function getCoinsData(coinAddresses, existingCoinAddrNameDict, existingCoinAddrDecimalsDict) {
297
- return __awaiter(this, void 0, void 0, function () {
298
- var flattenedCoinAddresses, newCoinAddresses, coinAddrNamesDict, coinAddrDecimalsDict, _i, flattenedCoinAddresses_2, addr, calls, _a, newCoinAddresses_1, addr, res, symbols, decimals;
299
- return __generator(this, function (_b) {
300
- switch (_b.label) {
301
- case 0:
302
- flattenedCoinAddresses = Array.from(new Set(deepFlatten(coinAddresses)));
303
- newCoinAddresses = [];
304
- coinAddrNamesDict = {};
305
- coinAddrDecimalsDict = {};
306
- for (_i = 0, flattenedCoinAddresses_2 = flattenedCoinAddresses; _i < flattenedCoinAddresses_2.length; _i++) {
307
- addr = flattenedCoinAddresses_2[_i];
308
- if (addr in existingCoinAddrNameDict) {
309
- coinAddrNamesDict[addr] = existingCoinAddrNameDict[addr];
310
- coinAddrDecimalsDict[addr] = existingCoinAddrDecimalsDict[addr];
311
- }
312
- else {
313
- newCoinAddresses.push(addr);
314
- }
315
- }
316
- calls = [];
317
- for (_a = 0, newCoinAddresses_1 = newCoinAddresses; _a < newCoinAddresses_1.length; _a++) {
318
- addr = newCoinAddresses_1[_a];
319
- calls.push(this.contracts[addr].multicallContract.symbol());
320
- calls.push(this.contracts[addr].multicallContract.decimals());
321
- }
322
- return [4 /*yield*/, this.multicallProvider.all(calls)];
323
- case 1:
324
- res = _b.sent();
325
- symbols = res.filter(function (a, i) { return i % 2 == 0; });
326
- decimals = res.filter(function (a, i) { return i % 2 == 1; }).map(function (_d) { return Number(curve.formatUnits(_d, 0)); });
327
- newCoinAddresses.forEach(function (addr, i) {
328
- coinAddrNamesDict[addr] = symbols[i];
329
- coinAddrDecimalsDict[addr] = decimals[i];
330
- });
331
- return [2 /*return*/, [coinAddrNamesDict, coinAddrDecimalsDict]];
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ const flattenedCoinAddresses = Array.from(new Set(deepFlatten(coinAddresses)));
195
+ const newCoinAddresses = [];
196
+ const coinAddrNamesDict = {};
197
+ const coinAddrDecimalsDict = {};
198
+ for (const addr of flattenedCoinAddresses) {
199
+ if (addr in existingCoinAddrNameDict) {
200
+ coinAddrNamesDict[addr] = existingCoinAddrNameDict[addr];
201
+ coinAddrDecimalsDict[addr] = existingCoinAddrDecimalsDict[addr];
202
+ }
203
+ else {
204
+ newCoinAddresses.push(addr);
332
205
  }
206
+ }
207
+ const calls = [];
208
+ for (const addr of newCoinAddresses) {
209
+ calls.push(this.contracts[addr].multicallContract.symbol());
210
+ calls.push(this.contracts[addr].multicallContract.decimals());
211
+ }
212
+ const res = yield this.multicallProvider.all(calls);
213
+ const symbols = res.filter((a, i) => i % 2 == 0);
214
+ const decimals = res.filter((a, i) => i % 2 == 1).map((_d) => Number(curve.formatUnits(_d, 0)));
215
+ newCoinAddresses.forEach((addr, i) => {
216
+ coinAddrNamesDict[addr] = symbols[i];
217
+ coinAddrDecimalsDict[addr] = decimals[i];
333
218
  });
219
+ return [coinAddrNamesDict, coinAddrDecimalsDict];
334
220
  });
335
221
  }
336
- export function getFactoryPoolData(fromIdx, swapAddress, factoryAddress) {
337
- if (fromIdx === void 0) { fromIdx = 0; }
338
- if (factoryAddress === void 0) { factoryAddress = curve.constants.ALIASES.factory; }
339
- return __awaiter(this, void 0, void 0, function () {
340
- var _a, rawPoolIds, rawSwapAddresses, _b, _c, rawImplementations, rawGauges, rawReferenceAssets, rawPoolSymbols, rawPoolNames, rawIsMeta, rawCoinAddresses, poolIds, swapAddresses, implementations, gaugeAddresses, referenceAssets, poolSymbols, poolNames, isMeta, coinAddresses, implementationABIDict, i, swapABIs, _e, coinAddressNameDict, coinAddressDecimalsDict, tmpPools, basePools, FACTORY_POOLS_DATA, _loop_2, this_1, i;
341
- return __generator(this, function (_f) {
342
- switch (_f.label) {
343
- case 0:
344
- if (!swapAddress) return [3 /*break*/, 2];
345
- return [4 /*yield*/, getRecentlyCreatedPoolId.call(this, swapAddress, factoryAddress)];
346
- case 1:
347
- _b = [[_f.sent()], [swapAddress.toLowerCase()]];
348
- return [3 /*break*/, 4];
349
- case 2: return [4 /*yield*/, getFactoryIdsAndSwapAddresses.call(this, fromIdx, factoryAddress)];
350
- case 3:
351
- _b = _f.sent();
352
- _f.label = 4;
353
- case 4:
354
- _a = _b, rawPoolIds = _a[0], rawSwapAddresses = _a[1];
355
- if (rawPoolIds.length === 0)
356
- return [2 /*return*/, {}];
357
- return [4 /*yield*/, getPoolsData.call(this, rawSwapAddresses, factoryAddress)];
358
- case 5:
359
- _c = _f.sent(), rawImplementations = _c[0], rawGauges = _c[1], rawReferenceAssets = _c[2], rawPoolSymbols = _c[3], rawPoolNames = _c[4], rawIsMeta = _c[5], rawCoinAddresses = _c[6];
360
- poolIds = [];
361
- swapAddresses = [];
362
- implementations = [];
363
- gaugeAddresses = [];
364
- referenceAssets = [];
365
- poolSymbols = [];
366
- poolNames = [];
367
- isMeta = [];
368
- coinAddresses = [];
369
- implementationABIDict = FACTORY_CONSTANTS[this.chainId].implementationABIDict;
370
- for (i = 0; i < rawPoolIds.length; i++) {
371
- if (rawImplementations[i] in implementationABIDict) {
372
- poolIds.push(rawPoolIds[i]);
373
- swapAddresses.push(rawSwapAddresses[i]);
374
- implementations.push(rawImplementations[i]);
375
- gaugeAddresses.push(rawGauges[i]);
376
- referenceAssets.push(rawReferenceAssets[i]);
377
- poolSymbols.push(rawPoolSymbols[i]);
378
- poolNames.push(rawPoolNames[i]);
379
- isMeta.push(rawIsMeta[i]);
380
- coinAddresses.push(rawCoinAddresses[i]);
381
- }
382
- }
383
- swapABIs = implementations.map(function (addr) { return implementationABIDict[addr]; });
384
- setFactorySwapContracts.call(this, swapAddresses, swapABIs);
385
- setFactoryGaugeContracts.call(this, gaugeAddresses);
386
- setFactoryCoinsContracts.call(this, coinAddresses);
387
- setFactoryZapContracts.call(this, false);
388
- return [4 /*yield*/, getCoinsData.call(this, coinAddresses, getExistingCoinAddressNameDict.call(this), this.constants.DECIMALS)];
389
- case 6:
390
- _e = _f.sent(), coinAddressNameDict = _e[0], coinAddressDecimalsDict = _e[1];
391
- tmpPools = [];
392
- poolIds.forEach(function (item, index) {
393
- tmpPools.push({
394
- id: item,
395
- address: swapAddresses[index],
396
- });
397
- });
398
- return [4 /*yield*/, getBasePools.call(this, factoryAddress, swapAddresses, tmpPools)];
399
- case 7:
400
- basePools = _f.sent();
401
- FACTORY_POOLS_DATA = {};
402
- _loop_2 = function (i) {
403
- if (!isMeta[i]) {
404
- FACTORY_POOLS_DATA[poolIds[i]] = {
405
- name: getPoolName(poolNames[i]),
406
- full_name: poolNames[i],
407
- symbol: poolSymbols[i],
408
- reference_asset: referenceAssets[i],
409
- swap_address: swapAddresses[i],
410
- token_address: swapAddresses[i],
411
- gauge_address: gaugeAddresses[i],
412
- implementation_address: implementations[i],
413
- is_plain: true,
414
- is_factory: true,
415
- underlying_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
416
- wrapped_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
417
- underlying_coin_addresses: coinAddresses[i],
418
- wrapped_coin_addresses: coinAddresses[i],
419
- underlying_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
420
- wrapped_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
421
- swap_abi: swapABIs[i],
422
- gauge_abi: this_1.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
423
- is_ng: factoryAddress === curve.constants.ALIASES.stable_ng_factory,
424
- };
425
- }
426
- else {
427
- var allPoolsData_1 = __assign(__assign(__assign({}, this_1.constants.POOLS_DATA), this_1.constants.FACTORY_POOLS_DATA), FACTORY_POOLS_DATA);
428
- // @ts-ignore
429
- var basePoolIdCoinsDict = Object.fromEntries(basePools.ids.map(function (poolId) { var _a; return [poolId, (_a = allPoolsData_1[poolId]) === null || _a === void 0 ? void 0 : _a.underlying_coins]; }));
430
- // @ts-ignore
431
- var basePoolIdCoinAddressesDict = Object.fromEntries(basePools.ids.map(function (poolId) { var _a; return [poolId, (_a = allPoolsData_1[poolId]) === null || _a === void 0 ? void 0 : _a.underlying_coin_addresses]; }));
432
- // @ts-ignore
433
- var basePoolIdDecimalsDict = Object.fromEntries(basePools.ids.map(function (poolId) { var _a; return [poolId, (_a = allPoolsData_1[poolId]) === null || _a === void 0 ? void 0 : _a.underlying_decimals]; }));
434
- var basePoolIdZapDict = FACTORY_CONSTANTS[this_1.chainId].basePoolIdZapDict;
435
- this_1.constants.BASE_POOLS[basePools.ids[i]] = this_1.constants.BASE_POOLS[basePools.ids[i]] ? this_1.constants.BASE_POOLS[basePools.ids[i]] + 1 : 1;
436
- var basePoolZap = isStableNgPool(basePools.ids[i]) ? FACTORY_CONSTANTS[this_1.chainId].stableNgBasePoolZap : basePoolIdZapDict[basePools.ids[i]];
437
- if (isStableNgPool(basePools.ids[i])) {
438
- this_1.setContract(FACTORY_CONSTANTS[this_1.chainId].stableNgBasePoolZap.address, FACTORY_CONSTANTS[this_1.chainId].stableNgBasePoolZap.ABI);
439
- }
440
- FACTORY_POOLS_DATA[poolIds[i]] = {
441
- name: getPoolName(poolNames[i]),
442
- full_name: poolNames[i],
443
- symbol: poolSymbols[i],
444
- reference_asset: referenceAssets[i],
445
- swap_address: swapAddresses[i],
446
- token_address: swapAddresses[i],
447
- gauge_address: gaugeAddresses[i],
448
- deposit_address: basePoolZap.address,
449
- implementation_address: implementations[i],
450
- is_meta: true,
451
- is_factory: true,
452
- base_pool: basePools.ids[i],
453
- underlying_coins: __spreadArray([coinAddressNameDict[coinAddresses[i][0]]], basePoolIdCoinsDict[basePools.ids[i]], true),
454
- wrapped_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
455
- underlying_coin_addresses: __spreadArray([coinAddresses[i][0]], basePoolIdCoinAddressesDict[basePools.ids[i]], true),
456
- wrapped_coin_addresses: coinAddresses[i],
457
- underlying_decimals: __spreadArray([coinAddressDecimalsDict[coinAddresses[i][0]]], basePoolIdDecimalsDict[basePools.ids[i]], true),
458
- wrapped_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
459
- swap_abi: swapABIs[i],
460
- gauge_abi: this_1.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
461
- deposit_abi: basePoolZap.ABI,
462
- is_ng: factoryAddress === curve.constants.ALIASES.stable_ng_factory,
463
- };
464
- }
465
- };
466
- this_1 = this;
467
- for (i = 0; i < poolIds.length; i++) {
468
- _loop_2(i);
469
- }
470
- return [2 /*return*/, FACTORY_POOLS_DATA];
222
+ export function getFactoryPoolData(fromIdx = 0, swapAddress, factoryAddress = curve.constants.ALIASES.factory) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ const [rawPoolIds, rawSwapAddresses] = swapAddress ?
225
+ [[yield getRecentlyCreatedPoolId.call(this, swapAddress, factoryAddress)], [swapAddress.toLowerCase()]]
226
+ : yield getFactoryIdsAndSwapAddresses.call(this, fromIdx, factoryAddress);
227
+ if (rawPoolIds.length === 0)
228
+ return {};
229
+ const [rawImplementations, rawGauges, rawReferenceAssets, rawPoolSymbols, rawPoolNames, rawIsMeta, rawCoinAddresses] = yield getPoolsData.call(this, rawSwapAddresses, factoryAddress);
230
+ const poolIds = [];
231
+ const swapAddresses = [];
232
+ const implementations = [];
233
+ const gaugeAddresses = [];
234
+ const referenceAssets = [];
235
+ const poolSymbols = [];
236
+ const poolNames = [];
237
+ const isMeta = [];
238
+ const coinAddresses = [];
239
+ const implementationABIDict = FACTORY_CONSTANTS[this.chainId].implementationABIDict;
240
+ for (let i = 0; i < rawPoolIds.length; i++) {
241
+ if (rawImplementations[i] in implementationABIDict) {
242
+ poolIds.push(rawPoolIds[i]);
243
+ swapAddresses.push(rawSwapAddresses[i]);
244
+ implementations.push(rawImplementations[i]);
245
+ gaugeAddresses.push(rawGauges[i]);
246
+ referenceAssets.push(rawReferenceAssets[i]);
247
+ poolSymbols.push(rawPoolSymbols[i]);
248
+ poolNames.push(rawPoolNames[i]);
249
+ isMeta.push(rawIsMeta[i]);
250
+ coinAddresses.push(rawCoinAddresses[i]);
471
251
  }
252
+ }
253
+ const swapABIs = implementations.map((addr) => implementationABIDict[addr]);
254
+ setFactorySwapContracts.call(this, swapAddresses, swapABIs);
255
+ setFactoryGaugeContracts.call(this, gaugeAddresses);
256
+ setFactoryCoinsContracts.call(this, coinAddresses);
257
+ setFactoryZapContracts.call(this, false);
258
+ const [coinAddressNameDict, coinAddressDecimalsDict] = yield getCoinsData.call(this, coinAddresses, getExistingCoinAddressNameDict.call(this), this.constants.DECIMALS);
259
+ const tmpPools = [];
260
+ poolIds.forEach((item, index) => {
261
+ tmpPools.push({
262
+ id: item,
263
+ address: swapAddresses[index],
264
+ });
472
265
  });
266
+ const basePools = yield getBasePools.call(this, factoryAddress, swapAddresses, tmpPools);
267
+ const FACTORY_POOLS_DATA = {};
268
+ for (let i = 0; i < poolIds.length; i++) {
269
+ if (!isMeta[i]) {
270
+ FACTORY_POOLS_DATA[poolIds[i]] = {
271
+ name: getPoolName(poolNames[i]),
272
+ full_name: poolNames[i],
273
+ symbol: poolSymbols[i],
274
+ reference_asset: referenceAssets[i],
275
+ swap_address: swapAddresses[i],
276
+ token_address: swapAddresses[i],
277
+ gauge_address: gaugeAddresses[i],
278
+ implementation_address: implementations[i],
279
+ is_plain: true,
280
+ is_factory: true,
281
+ underlying_coins: [...coinAddresses[i].map((addr) => coinAddressNameDict[addr])],
282
+ wrapped_coins: [...coinAddresses[i].map((addr) => coinAddressNameDict[addr])],
283
+ underlying_coin_addresses: coinAddresses[i],
284
+ wrapped_coin_addresses: coinAddresses[i],
285
+ underlying_decimals: [...coinAddresses[i].map((addr) => coinAddressDecimalsDict[addr])],
286
+ wrapped_decimals: [...coinAddresses[i].map((addr) => coinAddressDecimalsDict[addr])],
287
+ swap_abi: swapABIs[i],
288
+ gauge_abi: this.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
289
+ is_ng: factoryAddress === curve.constants.ALIASES.stable_ng_factory,
290
+ };
291
+ }
292
+ else {
293
+ const allPoolsData = Object.assign(Object.assign(Object.assign({}, this.constants.POOLS_DATA), this.constants.FACTORY_POOLS_DATA), FACTORY_POOLS_DATA);
294
+ // @ts-ignore
295
+ const basePoolIdCoinsDict = Object.fromEntries(basePools.ids.map((poolId) => { var _a; return [poolId, (_a = allPoolsData[poolId]) === null || _a === void 0 ? void 0 : _a.underlying_coins]; }));
296
+ // @ts-ignore
297
+ const basePoolIdCoinAddressesDict = Object.fromEntries(basePools.ids.map((poolId) => { var _a; return [poolId, (_a = allPoolsData[poolId]) === null || _a === void 0 ? void 0 : _a.underlying_coin_addresses]; }));
298
+ // @ts-ignore
299
+ const basePoolIdDecimalsDict = Object.fromEntries(basePools.ids.map((poolId) => { var _a; return [poolId, (_a = allPoolsData[poolId]) === null || _a === void 0 ? void 0 : _a.underlying_decimals]; }));
300
+ const basePoolIdZapDict = FACTORY_CONSTANTS[this.chainId].basePoolIdZapDict;
301
+ this.constants.BASE_POOLS[basePools.ids[i]] = this.constants.BASE_POOLS[basePools.ids[i]] ? this.constants.BASE_POOLS[basePools.ids[i]] + 1 : 1;
302
+ const basePoolZap = isStableNgPool(basePools.ids[i]) ? FACTORY_CONSTANTS[this.chainId].stableNgBasePoolZap : basePoolIdZapDict[basePools.ids[i]];
303
+ if (isStableNgPool(basePools.ids[i])) {
304
+ this.setContract(FACTORY_CONSTANTS[this.chainId].stableNgBasePoolZap.address, FACTORY_CONSTANTS[this.chainId].stableNgBasePoolZap.ABI);
305
+ }
306
+ FACTORY_POOLS_DATA[poolIds[i]] = {
307
+ name: getPoolName(poolNames[i]),
308
+ full_name: poolNames[i],
309
+ symbol: poolSymbols[i],
310
+ reference_asset: referenceAssets[i],
311
+ swap_address: swapAddresses[i],
312
+ token_address: swapAddresses[i],
313
+ gauge_address: gaugeAddresses[i],
314
+ deposit_address: basePoolZap.address,
315
+ implementation_address: implementations[i],
316
+ is_meta: true,
317
+ is_factory: true,
318
+ base_pool: basePools.ids[i],
319
+ underlying_coins: [coinAddressNameDict[coinAddresses[i][0]], ...basePoolIdCoinsDict[basePools.ids[i]]],
320
+ wrapped_coins: [...coinAddresses[i].map((addr) => coinAddressNameDict[addr])],
321
+ underlying_coin_addresses: [coinAddresses[i][0], ...basePoolIdCoinAddressesDict[basePools.ids[i]]],
322
+ wrapped_coin_addresses: coinAddresses[i],
323
+ underlying_decimals: [coinAddressDecimalsDict[coinAddresses[i][0]], ...basePoolIdDecimalsDict[basePools.ids[i]]],
324
+ wrapped_decimals: [...coinAddresses[i].map((addr) => coinAddressDecimalsDict[addr])],
325
+ swap_abi: swapABIs[i],
326
+ gauge_abi: this.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
327
+ deposit_abi: basePoolZap.ABI,
328
+ is_ng: factoryAddress === curve.constants.ALIASES.stable_ng_factory,
329
+ };
330
+ }
331
+ }
332
+ return FACTORY_POOLS_DATA;
473
333
  });
474
334
  }