@fileverse-dev/formulajs 4.4.11-mod-55 → 4.4.11-mod-56
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/cjs/index.cjs
CHANGED
|
@@ -13669,7 +13669,6 @@ async function COINGECKO(category, param1, param2) {
|
|
|
13669
13669
|
const trend = param2 ? `&price_change_percentage=${param2}` : '';
|
|
13670
13670
|
|
|
13671
13671
|
url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100`;
|
|
13672
|
-
if (key && !categoryVal) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
13673
13672
|
if (categoryVal) url += `&category=${categoryVal}`;
|
|
13674
13673
|
if (trend) url += trend;
|
|
13675
13674
|
break;
|
|
@@ -13928,11 +13927,12 @@ async function DEFILLAMA() {
|
|
|
13928
13927
|
let [category] = argsToArray(arguments);
|
|
13929
13928
|
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Defillama);
|
|
13930
13929
|
if (!apiKey) return `${SERVICE_API_KEY.Defillama}_MISSING`;
|
|
13931
|
-
const categoryList = ['protocols', 'yields', 'dex'];
|
|
13930
|
+
const categoryList = ['protocols', 'yields', 'dex', 'fees'];
|
|
13932
13931
|
const categoryMap = {
|
|
13933
13932
|
[categoryList[0]]: 'https://api.llama.fi/protocols',
|
|
13934
13933
|
[categoryList[1]]: 'https://yields.llama.fi/pools',
|
|
13935
|
-
[categoryList[2]]: 'https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true'
|
|
13934
|
+
[categoryList[2]]: 'https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true',
|
|
13935
|
+
[categoryList[3]]: 'https://api.llama.fi/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyFees'
|
|
13936
13936
|
};
|
|
13937
13937
|
let url = categoryMap[category];
|
|
13938
13938
|
|
|
@@ -13955,6 +13955,10 @@ async function DEFILLAMA() {
|
|
|
13955
13955
|
json = json.protocols.slice(0, 500);
|
|
13956
13956
|
break;
|
|
13957
13957
|
}
|
|
13958
|
+
case categoryList[3]: {
|
|
13959
|
+
json = json.protocols.slice(0, 500);
|
|
13960
|
+
break;
|
|
13961
|
+
}
|
|
13958
13962
|
}
|
|
13959
13963
|
|
|
13960
13964
|
return removeNestedStructure(Array.isArray(json) ? json : [json]);
|
|
@@ -191,17 +191,10 @@ If "derivatives": exchange name (e.g., "binance_futures").`,
|
|
|
191
191
|
p: [
|
|
192
192
|
{
|
|
193
193
|
name: "category",
|
|
194
|
-
detail: "Type of content to fetch. Supports 'protocols', 'yields', or '
|
|
194
|
+
detail: "Type of content to fetch. Supports 'protocols', 'yields', 'dex', or 'fees'.",
|
|
195
195
|
example: `"protocols"`,
|
|
196
196
|
require: "m",
|
|
197
197
|
type: "string"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: "param1",
|
|
201
|
-
detail: "For protocols, it's the protocol name. (optional)",
|
|
202
|
-
example: `"aave"`,
|
|
203
|
-
require: "m",
|
|
204
|
-
type: "string"
|
|
205
198
|
}
|
|
206
199
|
]
|
|
207
200
|
},
|
package/lib/esm/index.mjs
CHANGED
|
@@ -13667,7 +13667,6 @@ async function COINGECKO(category, param1, param2) {
|
|
|
13667
13667
|
const trend = param2 ? `&price_change_percentage=${param2}` : '';
|
|
13668
13668
|
|
|
13669
13669
|
url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100`;
|
|
13670
|
-
if (key && !categoryVal) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
13671
13670
|
if (categoryVal) url += `&category=${categoryVal}`;
|
|
13672
13671
|
if (trend) url += trend;
|
|
13673
13672
|
break;
|
|
@@ -13926,11 +13925,12 @@ async function DEFILLAMA() {
|
|
|
13926
13925
|
let [category] = argsToArray(arguments);
|
|
13927
13926
|
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Defillama);
|
|
13928
13927
|
if (!apiKey) return `${SERVICE_API_KEY.Defillama}_MISSING`;
|
|
13929
|
-
const categoryList = ['protocols', 'yields', 'dex'];
|
|
13928
|
+
const categoryList = ['protocols', 'yields', 'dex', 'fees'];
|
|
13930
13929
|
const categoryMap = {
|
|
13931
13930
|
[categoryList[0]]: 'https://api.llama.fi/protocols',
|
|
13932
13931
|
[categoryList[1]]: 'https://yields.llama.fi/pools',
|
|
13933
|
-
[categoryList[2]]: 'https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true'
|
|
13932
|
+
[categoryList[2]]: 'https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true',
|
|
13933
|
+
[categoryList[3]]: 'https://api.llama.fi/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyFees'
|
|
13934
13934
|
};
|
|
13935
13935
|
let url = categoryMap[category];
|
|
13936
13936
|
|
|
@@ -13953,6 +13953,10 @@ async function DEFILLAMA() {
|
|
|
13953
13953
|
json = json.protocols.slice(0, 500);
|
|
13954
13954
|
break;
|
|
13955
13955
|
}
|
|
13956
|
+
case categoryList[3]: {
|
|
13957
|
+
json = json.protocols.slice(0, 500);
|
|
13958
|
+
break;
|
|
13959
|
+
}
|
|
13956
13960
|
}
|
|
13957
13961
|
|
|
13958
13962
|
return removeNestedStructure(Array.isArray(json) ? json : [json]);
|