@fileverse-dev/formulajs 4.4.14 → 4.4.16
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.
- package/lib/browser/formula.js +44 -29
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +12 -3
- package/lib/esm/index.mjs +12 -3
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -17858,7 +17858,7 @@ async function COINGECKO() {
|
|
|
17858
17858
|
}
|
|
17859
17859
|
const {URL: finalUrl, HEADERS} = getUrlAndHeaders({url, serviceName: 'Coingecko', headers});
|
|
17860
17860
|
|
|
17861
|
-
const res = await fetch(finalUrl, { headers: HEADERS });
|
|
17861
|
+
const res = await fetch(finalUrl + "?refresh=true", { headers: HEADERS });
|
|
17862
17862
|
const json = await res.json();
|
|
17863
17863
|
if (!res.ok) {
|
|
17864
17864
|
const msg = json?.status?.error_message || '';
|
|
@@ -17870,7 +17870,7 @@ async function COINGECKO() {
|
|
|
17870
17870
|
const out = {};
|
|
17871
17871
|
for (const [token, prices] of Object.entries(json))
|
|
17872
17872
|
for (const [cur, val] of Object.entries(prices))
|
|
17873
|
-
out[`${token.
|
|
17873
|
+
out[`${token.toUpperCase()}_${cur.toUpperCase()}`] = val;
|
|
17874
17874
|
return [out]
|
|
17875
17875
|
}
|
|
17876
17876
|
|
|
@@ -18667,7 +18667,13 @@ async function DUNE() {
|
|
|
18667
18667
|
});
|
|
18668
18668
|
|
|
18669
18669
|
const res = await fetch(finalUrl, { method: "GET", headers: HEADERS });
|
|
18670
|
-
if (!res.ok)
|
|
18670
|
+
if (!res.ok) {
|
|
18671
|
+
if(res.status === 400){
|
|
18672
|
+
const data = await res.json();
|
|
18673
|
+
throw new ValidationError(data.message)
|
|
18674
|
+
}
|
|
18675
|
+
throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
|
|
18676
|
+
}
|
|
18671
18677
|
|
|
18672
18678
|
const json = await res.json();
|
|
18673
18679
|
const data =
|
|
@@ -18686,6 +18692,9 @@ async function DUNE() {
|
|
|
18686
18692
|
if(item?.total_supply){
|
|
18687
18693
|
item.total_supply = formatNumber(item?.total_supply, item.decimals);
|
|
18688
18694
|
}
|
|
18695
|
+
if(item?.fully_diluted_value){
|
|
18696
|
+
item.fully_diluted_value = formatNumber(item?.fully_diluted_value, item.decimals);
|
|
18697
|
+
}
|
|
18689
18698
|
}
|
|
18690
18699
|
if(item?.first_acquired){
|
|
18691
18700
|
item.first_acquired = new Intl.DateTimeFormat("en-US", {
|
package/lib/esm/index.mjs
CHANGED
|
@@ -17856,7 +17856,7 @@ async function COINGECKO() {
|
|
|
17856
17856
|
}
|
|
17857
17857
|
const {URL: finalUrl, HEADERS} = getUrlAndHeaders({url, serviceName: 'Coingecko', headers});
|
|
17858
17858
|
|
|
17859
|
-
const res = await fetch(finalUrl, { headers: HEADERS });
|
|
17859
|
+
const res = await fetch(finalUrl + "?refresh=true", { headers: HEADERS });
|
|
17860
17860
|
const json = await res.json();
|
|
17861
17861
|
if (!res.ok) {
|
|
17862
17862
|
const msg = json?.status?.error_message || '';
|
|
@@ -17868,7 +17868,7 @@ async function COINGECKO() {
|
|
|
17868
17868
|
const out = {};
|
|
17869
17869
|
for (const [token, prices] of Object.entries(json))
|
|
17870
17870
|
for (const [cur, val] of Object.entries(prices))
|
|
17871
|
-
out[`${token.
|
|
17871
|
+
out[`${token.toUpperCase()}_${cur.toUpperCase()}`] = val;
|
|
17872
17872
|
return [out]
|
|
17873
17873
|
}
|
|
17874
17874
|
|
|
@@ -18665,7 +18665,13 @@ async function DUNE() {
|
|
|
18665
18665
|
});
|
|
18666
18666
|
|
|
18667
18667
|
const res = await fetch(finalUrl, { method: "GET", headers: HEADERS });
|
|
18668
|
-
if (!res.ok)
|
|
18668
|
+
if (!res.ok) {
|
|
18669
|
+
if(res.status === 400){
|
|
18670
|
+
const data = await res.json();
|
|
18671
|
+
throw new ValidationError(data.message)
|
|
18672
|
+
}
|
|
18673
|
+
throw new NetworkError(SERVICES_API_KEY.DuneSim, res.status);
|
|
18674
|
+
}
|
|
18669
18675
|
|
|
18670
18676
|
const json = await res.json();
|
|
18671
18677
|
const data =
|
|
@@ -18684,6 +18690,9 @@ async function DUNE() {
|
|
|
18684
18690
|
if(item?.total_supply){
|
|
18685
18691
|
item.total_supply = formatNumber(item?.total_supply, item.decimals);
|
|
18686
18692
|
}
|
|
18693
|
+
if(item?.fully_diluted_value){
|
|
18694
|
+
item.fully_diluted_value = formatNumber(item?.fully_diluted_value, item.decimals);
|
|
18695
|
+
}
|
|
18687
18696
|
}
|
|
18688
18697
|
if(item?.first_acquired){
|
|
18689
18698
|
item.first_acquired = new Intl.DateTimeFormat("en-US", {
|