@curvefi/api 2.66.23 → 2.66.24

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.
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import memoize from "memoizee";
11
11
  export const _getPoolsFromApi = memoize((network_1, poolType_1, ...args_1) => __awaiter(void 0, [network_1, poolType_1, ...args_1], void 0, function* (network, poolType, isLiteChain = false) {
12
12
  var _a;
13
- const api = isLiteChain ? "https://dy9z253d96rct.cloudfront.net/v1/" : "https://d3dl9x5bpp6us7.cloudfront.net/api";
13
+ const api = isLiteChain ? "https://api-core.curve.finance/v1/" : "https://api.curve.finance/api";
14
14
  const url = `${api}/getPools/${network}/${poolType}`;
15
15
  return (_a = yield fetchData(url)) !== null && _a !== void 0 ? _a : { poolData: [], tvl: 0, tvlAll: 0 };
16
16
  }), {
@@ -41,7 +41,7 @@ export const _getAllPoolsFromApi = (network_1, ...args_1) => __awaiter(void 0, [
41
41
  });
42
42
  export const _getSubgraphData = memoize((network) => __awaiter(void 0, void 0, void 0, function* () {
43
43
  var _a, _b, _c;
44
- const data = yield fetchData(`https://d3dl9x5bpp6us7.cloudfront.net/api/getSubgraphData/${network}`);
44
+ const data = yield fetchData(`https://api.curve.finance/api/getSubgraphData/${network}`);
45
45
  const poolsData = data.poolList.map((data) => ({
46
46
  address: data.address,
47
47
  volumeUSD: data.volumeUSD,
@@ -60,7 +60,7 @@ export const _getSubgraphData = memoize((network) => __awaiter(void 0, void 0, v
60
60
  });
61
61
  export const _getVolumes = memoize((network) => __awaiter(void 0, void 0, void 0, function* () {
62
62
  var _a, _b, _c;
63
- const { pools, totalVolumes } = yield fetchData(`https://d3dl9x5bpp6us7.cloudfront.net/api/getVolumes/${network}`);
63
+ const { pools, totalVolumes } = yield fetchData(`https://api.curve.finance/api/getVolumes/${network}`);
64
64
  const poolsData = pools.map((data) => ({
65
65
  address: data.address,
66
66
  volumeUSD: data.volumeUSD,
@@ -78,7 +78,7 @@ export const _getVolumes = memoize((network) => __awaiter(void 0, void 0, void 0
78
78
  maxAge: 5 * 60 * 1000, // 5m
79
79
  });
80
80
  export const _getFactoryAPYs = memoize((network) => __awaiter(void 0, void 0, void 0, function* () {
81
- const [stableData, cryptoData] = yield Promise.all(['stable', 'crypto'].map((type) => fetchData(`https://d3dl9x5bpp6us7.cloudfront.net/api/getFactoryAPYs/${network}/${type}`)));
81
+ const [stableData, cryptoData] = yield Promise.all(['stable', 'crypto'].map((type) => fetchData(`https://api.curve.finance/api/getFactoryAPYs/${network}/${type}`)));
82
82
  const stableVolume = stableData.totalVolumeUsd || stableData.totalVolume || 0;
83
83
  const cryptoVolume = cryptoData.totalVolumeUsd || cryptoData.totalVolume || 0;
84
84
  return {
@@ -99,12 +99,12 @@ export const _getFactoryAPYs = memoize((network) => __awaiter(void 0, void 0, vo
99
99
  promise: true,
100
100
  maxAge: 5 * 60 * 1000, // 5m
101
101
  });
102
- export const _getAllGauges = memoize(() => fetchData(`https://d3dl9x5bpp6us7.cloudfront.net/api/getAllGauges`), {
102
+ export const _getAllGauges = memoize(() => fetchData(`https://api.curve.finance/api/getAllGauges`), {
103
103
  promise: true,
104
104
  maxAge: 5 * 60 * 1000, // 5m
105
105
  });
106
106
  export const _getAllGaugesFormatted = memoize(() => __awaiter(void 0, void 0, void 0, function* () {
107
- const data = yield fetchData(`https://d3dl9x5bpp6us7.cloudfront.net/api/getAllGauges`);
107
+ const data = yield fetchData(`https://api.curve.finance/api/getAllGauges`);
108
108
  const gaugesDict = {};
109
109
  Object.values(data).forEach((d) => {
110
110
  var _a, _b;
@@ -118,7 +118,7 @@ export const _getAllGaugesFormatted = memoize(() => __awaiter(void 0, void 0, vo
118
118
  promise: true,
119
119
  maxAge: 60 * 60 * 1000, // 60m
120
120
  });
121
- export const _getHiddenPools = memoize(() => fetchData(`https://d3dl9x5bpp6us7.cloudfront.net/api/getHiddenPools`), {
121
+ export const _getHiddenPools = memoize(() => fetchData(`https://api.curve.finance/api/getHiddenPools`), {
122
122
  promise: true,
123
123
  maxAge: 5 * 60 * 1000, // 5m
124
124
  });
@@ -147,7 +147,7 @@ export const _getDaoProposal = memoize((type, id) => fetchJson(`https://api-py.l
147
147
  export const _getLiteNetworksData = memoize((networkName) => __awaiter(void 0, void 0, void 0, function* () {
148
148
  var _a, _b;
149
149
  try {
150
- const url = `https://dy9z253d96rct.cloudfront.net/v1/getDeployment/${networkName}`;
150
+ const url = `https://api-core.curve.finance/v1/getDeployment/${networkName}`;
151
151
  const response = yield fetch(url);
152
152
  const { data } = (_a = yield response.json()) !== null && _a !== void 0 ? _a : {};
153
153
  if (response.status !== 200 || !data) {
@@ -195,7 +195,7 @@ export const _getLiteNetworksData = memoize((networkName) => __awaiter(void 0, v
195
195
  });
196
196
  export const _getCurveLiteNetworks = memoize(() => __awaiter(void 0, void 0, void 0, function* () {
197
197
  var _a;
198
- const response = yield fetch(`https://dy9z253d96rct.cloudfront.net/v1/getPlatforms`);
198
+ const response = yield fetch(`https://api-core.curve.finance/v1/getPlatforms`);
199
199
  const { data } = (_a = yield response.json()) !== null && _a !== void 0 ? _a : {};
200
200
  if (response.status !== 200 || !(data === null || data === void 0 ? void 0 : data.platforms)) {
201
201
  console.error('Failed to fetch Curve platforms:', response);
package/lib/router.js CHANGED
@@ -216,7 +216,7 @@ const _getBestRoute = memoize((inputCoinAddress, outputCoinAddress, amount) => _
216
216
  const [gasAmounts, outputCoinUsdRate, gasData, ethUsdRate] = yield Promise.all([
217
217
  _estimateGasForDifferentRoutes(routes.map((r) => r.route), inputCoinAddress, outputCoinAddress, _amount),
218
218
  _getUsdRate(outputCoinAddress),
219
- fetch("https://d3dl9x5bpp6us7.cloudfront.net/api/getGas").then((res) => res.json()),
219
+ fetch("https://api.curve.finance/api/getGas").then((res) => res.json()),
220
220
  _getUsdRate(ETH_ADDRESS),
221
221
  ]);
222
222
  const gasPrice = gasData.data.gas.standard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.66.23",
3
+ "version": "2.66.24",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",