@fileverse-dev/formulajs 4.4.11-mod-41-patch-1 → 4.4.11-mod-42

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
@@ -13215,7 +13215,26 @@ if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = 'gnosis';
13215
13215
  }
13216
13216
  }
13217
13217
 
13218
- async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
13218
+ const fromUsernameToFid = async (username) => {
13219
+ if(!username) return null
13220
+ const url = `https://api.neynar.com/v2/farcaster/user/search/`;
13221
+ const res = await fetch(url, {
13222
+ query: {
13223
+ q: username
13224
+ },
13225
+ headers: {
13226
+ 'x-api-key': API_KEY,
13227
+ 'x-neynar-experimental': 'false'
13228
+ }
13229
+ });
13230
+ const json = await res.json();
13231
+ const users = json.result && json.result.users;
13232
+ const user = users.find(user => user.username === username);
13233
+ return user && user.fid || null;
13234
+ };
13235
+
13236
+ async function FIREFLY() {
13237
+ const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
13219
13238
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
13220
13239
  if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
13221
13240
 
@@ -13277,7 +13296,8 @@ async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
13277
13296
 
13278
13297
 
13279
13298
 
13280
- async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, page, offset) {
13299
+ async function BLOCKSCOUT() {
13300
+ let [address, type, chain, startTimestamp, endTimestamp, page, offset] = argsToArray(arguments);
13281
13301
  if (!chain) {
13282
13302
  chain = 'ethereum';
13283
13303
  }
@@ -13362,8 +13382,8 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
13362
13382
  return 'ERROR IN FETCHING'
13363
13383
  }
13364
13384
  }
13365
- async function GNOSIS(...args) {
13366
- const [type, chain, address, startDate, endDate, page, limit] = args;
13385
+ async function GNOSIS() {
13386
+ const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
13367
13387
  return handleScanRequest({
13368
13388
  scanKey: SERVICE_API_KEY.Gnosisscan,
13369
13389
  baseUrl: 'https://api.gnosisscan.io/api',
@@ -13378,25 +13398,27 @@ async function GNOSIS(...args) {
13378
13398
  }
13379
13399
 
13380
13400
  async function NEYNAR(
13381
- fid,
13382
- viewerFid,
13383
- sortType,
13384
- limit,
13385
- cursor
13386
13401
  ) {
13402
+ const [
13403
+ username
13404
+ ] = argsToArray(arguments);
13387
13405
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
13388
13406
  if (!API_KEY) return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
13389
13407
 
13408
+ if(!username){
13409
+ return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
13410
+ }
13390
13411
 
13391
- const url = new URL('https://api.neynar.com/v2/farcaster/followers');
13392
- url.searchParams.set('fid', fid.toString());
13393
- url.searchParams.set('sort_type', sortType);
13394
- url.searchParams.set('limit', limit.toString());
13395
- if (viewerFid !== null) url.searchParams.set('viewer_fid', viewerFid.toString());
13396
- if (cursor) url.searchParams.set('cursor', cursor);
13412
+ const fid = await fromUsernameToFid(username);
13413
+
13414
+ if(!fid){
13415
+ return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
13416
+ }
13417
+
13418
+ const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
13397
13419
 
13398
13420
  try {
13399
- const response = await fetch(url.toString(), {
13421
+ const response = await fetch(url, {
13400
13422
  headers: {
13401
13423
  'x-api-key': API_KEY,
13402
13424
  'x-neynar-experimental': 'false'
@@ -13494,7 +13516,7 @@ async function ETHERSCAN(...args) {
13494
13516
  }
13495
13517
 
13496
13518
 
13497
- async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
13519
+ async function COINGECKO(category, param1, param2) {
13498
13520
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
13499
13521
  if (!API_KEY) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
13500
13522
 
@@ -13535,7 +13557,7 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
13535
13557
  const categoryVal = ecosystemMap[key] || '';
13536
13558
  const trend = param2 ? `&price_change_percentage=${param2}` : '';
13537
13559
 
13538
- url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=${page}&per_page=${perPage}`;
13560
+ url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100`;
13539
13561
  if (key && !categoryVal) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
13540
13562
  if (categoryVal) url += `&category=${categoryVal}`;
13541
13563
  if (trend) url += trend;
@@ -13548,7 +13570,7 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
13548
13570
  : param1.toLowerCase();
13549
13571
 
13550
13572
  const trend = param2 ? `&price_change_percentage=${param2}` : '';
13551
- url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=${category}&order=market_cap_desc&page=${page}&per_page=${perPage}${trend}`;
13573
+ url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=${category}&order=market_cap_desc&page=1&per_page=100${trend}`;
13552
13574
  break;
13553
13575
  }
13554
13576
 
@@ -13563,7 +13585,7 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
13563
13585
  }
13564
13586
 
13565
13587
  default:
13566
- return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAMS}`;
13588
+ return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
13567
13589
  }
13568
13590
 
13569
13591
  try {
@@ -13619,16 +13641,19 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
13619
13641
 
13620
13642
 
13621
13643
  async function EOA(
13622
- addresses,
13644
+ ) {
13645
+ const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13646
+ if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
13647
+
13648
+ let [
13649
+ addresses,
13623
13650
  category,
13624
13651
  chains,
13625
13652
  startTime,
13626
13653
  endTime,
13627
13654
  page = 1,
13628
13655
  offset = 10,
13629
- ) {
13630
- const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13631
- if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
13656
+ ] = argsToArray(arguments);
13632
13657
 
13633
13658
  const INPUTS = addresses.split(",").map(a => a.trim()).filter(Boolean);
13634
13659
  const CHAINS = chains.split(",").map(c => c.trim()).filter(Boolean);
@@ -13742,7 +13767,9 @@ async function FLVURL(token, vs_currencies) {
13742
13767
  });
13743
13768
  }
13744
13769
 
13745
- async function SAFE(address, utility, chain, limit, offset) {
13770
+ async function SAFE() {
13771
+
13772
+ let [address, utility, chain, limit, offset] = argsToArray(arguments);
13746
13773
 
13747
13774
  if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT';
13748
13775
  if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET';
@@ -13784,30 +13811,6 @@ async function SAFE(address, utility, chain, limit, offset) {
13784
13811
  }
13785
13812
  }
13786
13813
 
13787
- async function POLYMARKET() {
13788
- return "Coming Soon"
13789
- }
13790
-
13791
- async function PRIVACYPOOL() {
13792
- return "Coming Soon"
13793
- }
13794
-
13795
- async function ROTKI() {
13796
- return "Coming Soon"
13797
- }
13798
-
13799
- async function MEERKAT() {
13800
- return "Coming Soon"
13801
- }
13802
-
13803
- async function ARTEMIS() {
13804
- return "Coming Soon"
13805
- }
13806
-
13807
- async function TALLY() {
13808
- return "Coming Soon"
13809
- }
13810
-
13811
13814
  const utils = { errors, symbols, date };
13812
13815
 
13813
13816
  exports.ABS = ABS;
@@ -13819,7 +13822,6 @@ exports.ACOTH = ACOTH;
13819
13822
  exports.AGGREGATE = AGGREGATE;
13820
13823
  exports.AND = AND;
13821
13824
  exports.ARABIC = ARABIC;
13822
- exports.ARTEMIS = ARTEMIS;
13823
13825
  exports.ASIN = ASIN;
13824
13826
  exports.ASINH = ASINH;
13825
13827
  exports.ATAN = ATAN;
@@ -14048,7 +14050,6 @@ exports.MAX = MAX;
14048
14050
  exports.MAXA = MAXA;
14049
14051
  exports.MAXIFS = MAXIFS;
14050
14052
  exports.MEDIAN = MEDIAN;
14051
- exports.MEERKAT = MEERKAT;
14052
14053
  exports.MID = MID;
14053
14054
  exports.MIN = MIN;
14054
14055
  exports.MINA = MINA;
@@ -14104,11 +14105,9 @@ exports.PMT = PMT;
14104
14105
  exports.PNL = PNL;
14105
14106
  exports.POISSON = POISSON;
14106
14107
  exports.POISSONDIST = POISSONDIST;
14107
- exports.POLYMARKET = POLYMARKET;
14108
14108
  exports.POWER = POWER;
14109
14109
  exports.PPMT = PPMT;
14110
14110
  exports.PRICEDISC = PRICEDISC;
14111
- exports.PRIVACYPOOL = PRIVACYPOOL;
14112
14111
  exports.PROB = PROB;
14113
14112
  exports.PRODUCT = PRODUCT;
14114
14113
  exports.PROPER = PROPER;
@@ -14128,7 +14127,6 @@ exports.REPLACE = REPLACE;
14128
14127
  exports.REPT = REPT;
14129
14128
  exports.RIGHT = RIGHT;
14130
14129
  exports.ROMAN = ROMAN;
14131
- exports.ROTKI = ROTKI;
14132
14130
  exports.ROUND = ROUND;
14133
14131
  exports.ROUNDDOWN = ROUNDDOWN;
14134
14132
  exports.ROUNDUP = ROUNDUP;
@@ -14173,7 +14171,6 @@ exports.SUMXMY2 = SUMXMY2;
14173
14171
  exports.SWITCH = SWITCH;
14174
14172
  exports.SYD = SYD;
14175
14173
  exports.T = T;
14176
- exports.TALLY = TALLY;
14177
14174
  exports.TAN = TAN;
14178
14175
  exports.TANH = TANH;
14179
14176
  exports.TBILLEQ = TBILLEQ;
@@ -458,22 +458,9 @@ If "derivatives": exchange name (e.g., "binance_futures").`,
458
458
  },
459
459
  {
460
460
  name: "param2",
461
- detail: `For "price": target currency(ies) (e.g. "usd").
462
- For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d).`,
461
+ detail: `If "market" and "stablecoins" then eg. "1h", "24h", "7d".`,
463
462
  example: `"1h,24h,7d"`,
464
463
  require: "o"
465
- },
466
- {
467
- name: "page",
468
- detail: 'Page number for pagination (applies to "market", "stablecoins", and global "derivatives").',
469
- example: `1`,
470
- require: "o"
471
- },
472
- {
473
- name: "per_page",
474
- detail: 'Number of items per page (applies to "market", "stablecoins", and global "derivatives").',
475
- example: `2`,
476
- require: "o"
477
464
  }
478
465
  ]
479
466
  },
@@ -754,53 +741,53 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
754
741
  }
755
742
  ]
756
743
  },
757
- // {
758
- // API_KEY: SERVICE_API_KEY.Etherscan,
759
- // LOGO: "https://cdn.prod.website-files.com/6760e87b474d412dfa9a7a68/6760e8ebe8faad5fb985c89a_Frame%201321316795.png",
760
- // BRAND_COLOR: "#f6f4ff",
761
- // BRAND_SECONDARY_COLOR: "#684ff8",
762
- // n: "ARTEMIS",
763
- // t: 20,
764
- // d: "Returns blockchain transaction history for the given address",
765
- // a: "Retrieves blockchain data for a given chain and address from Etherscan, including txns, token/nft transfers, and gas metrics.",
766
- // p: [
767
- // {
768
- // name: "type",
769
- // detail: "The type of data to retrieve. Can be 'all-txns', 'token-txns', 'nft-txns', or 'gas'.",
770
- // example: `"all-txns"`,
771
- // require: "m",
772
- // type: "string"
773
- // },
774
- // {
775
- // name: "chain",
776
- // detail: "The chain name (e.g. 'ethereum', 'base', 'gnosis').",
777
- // example: `"ethereum"`,
778
- // require: "m",
779
- // type: "string"
780
- // },
781
- // {
782
- // name: "address",
783
- // detail: "Wallet address to query",
784
- // example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
785
- // require: "o",
786
- // type: "string"
787
- // },
788
- // {
789
- // name: "startDate",
790
- // detail: "Used to filter block range.",
791
- // example: `"01/01/2024"`,
792
- // require: "o",
793
- // type: "string"
794
- // },
795
- // {
796
- // name: "endDate",
797
- // detail: "Used to filter block range.",
798
- // example: `"01/07/2025"`,
799
- // require: "o",
800
- // type: "string"
801
- // }
802
- // ]
803
- // },
744
+ {
745
+ API_KEY: SERVICE_API_KEY.Etherscan,
746
+ LOGO: "https://cdn.prod.website-files.com/6760e87b474d412dfa9a7a68/6760e8ebe8faad5fb985c89a_Frame%201321316795.png",
747
+ BRAND_COLOR: "#f6f4ff",
748
+ BRAND_SECONDARY_COLOR: "#684ff8",
749
+ n: "ARTEMIS",
750
+ t: 20,
751
+ d: "Returns blockchain transaction history for the given address",
752
+ a: "Retrieves blockchain data for a given chain and address from Etherscan, including txns, token/nft transfers, and gas metrics.",
753
+ p: [
754
+ {
755
+ name: "type",
756
+ detail: "The type of data to retrieve. Can be 'all-txns', 'token-txns', 'nft-txns', or 'gas'.",
757
+ example: `"all-txns"`,
758
+ require: "m",
759
+ type: "string"
760
+ },
761
+ {
762
+ name: "chain",
763
+ detail: "The chain name (e.g. 'ethereum', 'base', 'gnosis').",
764
+ example: `"ethereum"`,
765
+ require: "m",
766
+ type: "string"
767
+ },
768
+ {
769
+ name: "address",
770
+ detail: "Wallet address to query",
771
+ example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
772
+ require: "o",
773
+ type: "string"
774
+ },
775
+ {
776
+ name: "startDate",
777
+ detail: "Used to filter block range.",
778
+ example: `"01/01/2024"`,
779
+ require: "o",
780
+ type: "string"
781
+ },
782
+ {
783
+ name: "endDate",
784
+ detail: "Used to filter block range.",
785
+ example: `"01/07/2025"`,
786
+ require: "o",
787
+ type: "string"
788
+ }
789
+ ]
790
+ },
804
791
  // {
805
792
  // API_KEY: SERVICE_API_KEY.GnosisPay,
806
793
  // LOGO: "https://gnosisscan.io/assets/generic/html/favicon-light.ico",
@@ -848,100 +835,52 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
848
835
  // }
849
836
  // ]
850
837
  // },
851
- // {
852
- // API_KEY: SERVICE_API_KEY.Etherscan,
853
- // LOGO: "https://www.tally.xyz/favicon.ico",
854
- // BRAND_COLOR: "#f9f8ff",
855
- // BRAND_SECONDARY_COLOR: "#725bff",
856
- // n: "TALLY",
857
- // t: 20,
858
- // d: "Returns blockchain transaction history for the given address",
859
- // a: "Retrieves blockchain data for a given chain and address from Etherscan, including txns, token/nft transfers, and gas metrics.",
860
- // p: [
861
- // {
862
- // name: "type",
863
- // detail: "The type of data to retrieve. Can be 'all-txns', 'token-txns', 'nft-txns', or 'gas'.",
864
- // example: `"all-txns"`,
865
- // require: "m",
866
- // type: "string"
867
- // },
868
- // {
869
- // name: "chain",
870
- // detail: "The chain name (e.g. 'ethereum', 'base', 'gnosis').",
871
- // example: `"ethereum"`,
872
- // require: "m",
873
- // type: "string"
874
- // },
875
- // {
876
- // name: "address",
877
- // detail: "Wallet address to query",
878
- // example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
879
- // require: "o",
880
- // type: "string"
881
- // },
882
- // {
883
- // name: "startDate",
884
- // detail: "Used to filter block range.",
885
- // example: `"01/01/2024"`,
886
- // require: "o",
887
- // type: "string"
888
- // },
889
- // {
890
- // name: "endDate",
891
- // detail: "Used to filter block range.",
892
- // example: `"01/07/2025"`,
893
- // require: "o",
894
- // type: "string"
895
- // }
896
- // ]
897
- // },
898
- {
899
- LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/ploymarket.png",
900
- n: "POLYMARKET",
901
- t: 20,
902
- d: "Get Polymarket predictions information.(Comming soon)",
903
- a: "Get Polymarket predictions information.(Comming soon)",
904
- p: []
905
- },
906
- {
907
- LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/privacy.png",
908
- n: "PRIVACYPOOL",
909
- t: 20,
910
- d: "Fetch data from Privacypool.(Comming soon)",
911
- a: "Fetch data from Privacypool.(Comming soon)",
912
- p: []
913
- },
914
838
  {
915
- LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/rotki.png",
916
- n: "ROTKI",
917
- t: 20,
918
- d: "Fetch analytics data from Rotki.(Comming soon)",
919
- a: "Fetch analytics data from Rotki.(Comming soon)",
920
- p: []
921
- },
922
- {
923
- LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/meerkat.png",
924
- n: "MEERKAT",
925
- t: 20,
926
- d: "Fetch data from Meerkat.(Comming soon)",
927
- a: "Fetch data from Meerkat.(Comming soon)",
928
- p: []
929
- },
930
- {
931
- LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/artemis.png",
932
- n: "ARTEMIS",
933
- t: 20,
934
- d: "Fetch data from Artemis.(Comming soon)",
935
- a: "Fetch data from Artemis.(Comming soon)",
936
- p: []
937
- },
938
- {
939
- LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/tally.png",
839
+ API_KEY: SERVICE_API_KEY.Etherscan,
840
+ LOGO: "https://www.tally.xyz/favicon.ico",
841
+ BRAND_COLOR: "#f9f8ff",
842
+ BRAND_SECONDARY_COLOR: "#725bff",
940
843
  n: "TALLY",
941
844
  t: 20,
942
- d: "Fetch data from Tally.(Comming soon)",
943
- a: "Fetch data from Tally.(Comming soon)",
944
- p: []
845
+ d: "Returns blockchain transaction history for the given address",
846
+ a: "Retrieves blockchain data for a given chain and address from Etherscan, including txns, token/nft transfers, and gas metrics.",
847
+ p: [
848
+ {
849
+ name: "type",
850
+ detail: "The type of data to retrieve. Can be 'all-txns', 'token-txns', 'nft-txns', or 'gas'.",
851
+ example: `"all-txns"`,
852
+ require: "m",
853
+ type: "string"
854
+ },
855
+ {
856
+ name: "chain",
857
+ detail: "The chain name (e.g. 'ethereum', 'base', 'gnosis').",
858
+ example: `"ethereum"`,
859
+ require: "m",
860
+ type: "string"
861
+ },
862
+ {
863
+ name: "address",
864
+ detail: "Wallet address to query",
865
+ example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
866
+ require: "o",
867
+ type: "string"
868
+ },
869
+ {
870
+ name: "startDate",
871
+ detail: "Used to filter block range.",
872
+ example: `"01/01/2024"`,
873
+ require: "o",
874
+ type: "string"
875
+ },
876
+ {
877
+ name: "endDate",
878
+ detail: "Used to filter block range.",
879
+ example: `"01/07/2025"`,
880
+ require: "o",
881
+ type: "string"
882
+ }
883
+ ]
945
884
  }
946
885
  ];
947
886
  export {