@fileverse-dev/formulajs 4.4.42-yield → 4.4.42-yield-a

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
@@ -18011,7 +18011,7 @@ function toTimestamp(dateStr) {
18011
18011
 
18012
18012
  async function EOA() {
18013
18013
  try {
18014
- const [addresses, category, chains, startTime, endTime, page = 1, offset = 10, columnName = null] =
18014
+ const [addresses, category, chains, startTime, endTime, page = 1, offset = 10, columnName] =
18015
18015
  argsToArray(arguments);
18016
18016
  validateParams(eoaParamsSchema, { addresses, category, chains, startTime, endTime, page, offset, columnName });
18017
18017
 
@@ -18352,7 +18352,7 @@ const coingeckoParamsSchema = discriminatedUnionType('category', [
18352
18352
 
18353
18353
  async function COINGECKO() {
18354
18354
  try {
18355
- const [category, param1, param2, columnName = null] = argsToArray(arguments);
18355
+ const [category, param1, param2, columnName] = argsToArray(arguments);
18356
18356
  validateParams(coingeckoParamsSchema, { category, param1, param2, columnName });
18357
18357
 
18358
18358
  const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Coingecko);
@@ -18446,7 +18446,7 @@ const CATEGORY_URLS = {
18446
18446
 
18447
18447
  async function DEFILLAMA() {
18448
18448
  try {
18449
- const [category, columnName = null] = argsToArray(arguments);
18449
+ const [category, columnName] = argsToArray(arguments);
18450
18450
  validateParams(defillamaParamsSchema, { category, columnName });
18451
18451
  const url = CATEGORY_URLS[category];
18452
18452
  if (!url) throw new ValidationError(`Invalid category: ${category}`)
@@ -18470,6 +18470,7 @@ async function DEFILLAMA() {
18470
18470
  const filterColumnName = columnName?.split(',').map(s => s.trim());
18471
18471
 
18472
18472
  return (Array.isArray(json) ? json : [json]).map(item => {
18473
+ if (!filterColumnName) return item
18473
18474
  const out = {};
18474
18475
  for (const [k, v] of Object.entries(item)) {
18475
18476
  if ((columnName && filterColumnName.includes(k)) && (v === null || typeof v !== 'object')) out[k] = v;
@@ -18512,7 +18513,7 @@ const etherscanParamsSchema = discriminatedUnionType('type', [gasSchema, txnSche
18512
18513
 
18513
18514
  async function ETHERSCAN() {
18514
18515
  try {
18515
- const [type, chain, address, startDate, endDate, page = 1, limit = 10, columnName = null] =
18516
+ const [type, chain, address, startDate, endDate, page = 1, limit = 10, columnName] =
18516
18517
  argsToArray(arguments);
18517
18518
 
18518
18519
 
@@ -19494,7 +19495,7 @@ const yieldParamsSchema = objectType({
19494
19495
  async function YIELD () {
19495
19496
 
19496
19497
  try {
19497
- const [category, columnName = null] = argsToArray(arguments);
19498
+ const [category, columnName] = argsToArray(arguments);
19498
19499
 
19499
19500
  validateParams(yieldParamsSchema, { category, columnName });
19500
19501
 
@@ -1264,6 +1264,13 @@ var YIELD_metadata = {
1264
1264
  example: `"stablecoins"`,
1265
1265
  require: "m",
1266
1266
  type: "string"
1267
+ },
1268
+ {
1269
+ name: "columnsName",
1270
+ detail: "Filter columns by name in output. Comma separated list.",
1271
+ example: `"id,address"`,
1272
+ require: "o",
1273
+ type: "string"
1267
1274
  }
1268
1275
  ],
1269
1276
  examples: [{
package/lib/esm/index.mjs CHANGED
@@ -18009,7 +18009,7 @@ function toTimestamp(dateStr) {
18009
18009
 
18010
18010
  async function EOA() {
18011
18011
  try {
18012
- const [addresses, category, chains, startTime, endTime, page = 1, offset = 10, columnName = null] =
18012
+ const [addresses, category, chains, startTime, endTime, page = 1, offset = 10, columnName] =
18013
18013
  argsToArray(arguments);
18014
18014
  validateParams(eoaParamsSchema, { addresses, category, chains, startTime, endTime, page, offset, columnName });
18015
18015
 
@@ -18350,7 +18350,7 @@ const coingeckoParamsSchema = discriminatedUnionType('category', [
18350
18350
 
18351
18351
  async function COINGECKO() {
18352
18352
  try {
18353
- const [category, param1, param2, columnName = null] = argsToArray(arguments);
18353
+ const [category, param1, param2, columnName] = argsToArray(arguments);
18354
18354
  validateParams(coingeckoParamsSchema, { category, param1, param2, columnName });
18355
18355
 
18356
18356
  const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Coingecko);
@@ -18444,7 +18444,7 @@ const CATEGORY_URLS = {
18444
18444
 
18445
18445
  async function DEFILLAMA() {
18446
18446
  try {
18447
- const [category, columnName = null] = argsToArray(arguments);
18447
+ const [category, columnName] = argsToArray(arguments);
18448
18448
  validateParams(defillamaParamsSchema, { category, columnName });
18449
18449
  const url = CATEGORY_URLS[category];
18450
18450
  if (!url) throw new ValidationError(`Invalid category: ${category}`)
@@ -18468,6 +18468,7 @@ async function DEFILLAMA() {
18468
18468
  const filterColumnName = columnName?.split(',').map(s => s.trim());
18469
18469
 
18470
18470
  return (Array.isArray(json) ? json : [json]).map(item => {
18471
+ if (!filterColumnName) return item
18471
18472
  const out = {};
18472
18473
  for (const [k, v] of Object.entries(item)) {
18473
18474
  if ((columnName && filterColumnName.includes(k)) && (v === null || typeof v !== 'object')) out[k] = v;
@@ -18510,7 +18511,7 @@ const etherscanParamsSchema = discriminatedUnionType('type', [gasSchema, txnSche
18510
18511
 
18511
18512
  async function ETHERSCAN() {
18512
18513
  try {
18513
- const [type, chain, address, startDate, endDate, page = 1, limit = 10, columnName = null] =
18514
+ const [type, chain, address, startDate, endDate, page = 1, limit = 10, columnName] =
18514
18515
  argsToArray(arguments);
18515
18516
 
18516
18517
 
@@ -19492,7 +19493,7 @@ const yieldParamsSchema = objectType({
19492
19493
  async function YIELD () {
19493
19494
 
19494
19495
  try {
19495
- const [category, columnName = null] = argsToArray(arguments);
19496
+ const [category, columnName] = argsToArray(arguments);
19496
19497
 
19497
19498
  validateParams(yieldParamsSchema, { category, columnName });
19498
19499
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.42-yield",
3
+ "version": "4.4.42-yield-a",
4
4
  "description": "JavaScript implementation of most Microsoft Excel formula functions",
5
5
  "author": "Formulajs",
6
6
  "publishConfig": {
@@ -1187,7 +1187,7 @@ declare function DEC2OCT(number: any, places: any): any;
1187
1187
  * @returns
1188
1188
  */
1189
1189
  declare function DECIMAL(text: any, radix: any, ...args: any[]): any;
1190
- declare function DEFILLAMA(...args: any[]): Promise<{
1190
+ declare function DEFILLAMA(...args: any[]): Promise<any[] | {
1191
1191
  message: string;
1192
1192
  functionName: any;
1193
1193
  type: string;
@@ -1205,7 +1205,7 @@ declare function DEFILLAMA(...args: any[]): Promise<{
1205
1205
  type: string;
1206
1206
  reason: any;
1207
1207
  apiKeyName?: undefined;
1208
- } | {}[]>;
1208
+ }>;
1209
1209
  /**
1210
1210
  * Converts radians to degrees.
1211
1211
  *
@@ -1126,7 +1126,7 @@ export function DEC2OCT(number: any, places: any): any;
1126
1126
  * @returns
1127
1127
  */
1128
1128
  export function DECIMAL(text: any, radix: any, ...args: any[]): any;
1129
- export function DEFILLAMA(...args: any[]): Promise<{
1129
+ export function DEFILLAMA(...args: any[]): Promise<any[] | {
1130
1130
  message: string;
1131
1131
  functionName: any;
1132
1132
  type: string;
@@ -1144,7 +1144,7 @@ export function DEFILLAMA(...args: any[]): Promise<{
1144
1144
  type: string;
1145
1145
  reason: any;
1146
1146
  apiKeyName?: undefined;
1147
- } | {}[]>;
1147
+ }>;
1148
1148
  /**
1149
1149
  * Converts radians to degrees.
1150
1150
  *