@fileverse-dev/fortune-react 1.0.2-mod-94-patch-1 → 1.0.2-mod-97

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/dist/index.umd.js CHANGED
@@ -37180,7 +37180,26 @@
37180
37180
  }
37181
37181
  }
37182
37182
 
37183
- async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
37183
+ const fromUsernameToFid = async (username) => {
37184
+ if(!username) return null
37185
+ const url = `https://api.neynar.com/v2/farcaster/user/search/`;
37186
+ const res = await fetch(url, {
37187
+ query: {
37188
+ q: username
37189
+ },
37190
+ headers: {
37191
+ 'x-api-key': API_KEY,
37192
+ 'x-neynar-experimental': 'false'
37193
+ }
37194
+ });
37195
+ const json = await res.json();
37196
+ const users = json.result && json.result.users;
37197
+ const user = users.find(user => user.username === username);
37198
+ return user && user.fid || null;
37199
+ };
37200
+
37201
+ async function FIREFLY() {
37202
+ const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
37184
37203
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
37185
37204
  if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37186
37205
 
@@ -37242,7 +37261,8 @@
37242
37261
 
37243
37262
 
37244
37263
 
37245
- async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, page, offset) {
37264
+ async function BLOCKSCOUT() {
37265
+ let [address, type, chain, startTimestamp, endTimestamp, page, offset] = argsToArray(arguments);
37246
37266
  if (!chain) {
37247
37267
  chain = 'ethereum';
37248
37268
  }
@@ -37327,8 +37347,8 @@
37327
37347
  return 'ERROR IN FETCHING'
37328
37348
  }
37329
37349
  }
37330
- async function GNOSIS(...args) {
37331
- const [type, chain, address, startDate, endDate, page, limit] = args;
37350
+ async function GNOSIS() {
37351
+ const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
37332
37352
  return handleScanRequest({
37333
37353
  scanKey: SERVICE_API_KEY.Gnosisscan,
37334
37354
  baseUrl: 'https://api.gnosisscan.io/api',
@@ -37342,26 +37362,27 @@
37342
37362
  });
37343
37363
  }
37344
37364
 
37345
- async function NEYNAR(
37346
- fid,
37347
- viewerFid,
37348
- sortType,
37349
- limit,
37350
- cursor
37351
- ) {
37365
+ async function NEYNAR() {
37366
+ const [
37367
+ username
37368
+ ] = argsToArray(arguments);
37352
37369
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
37353
37370
  if (!API_KEY) return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37354
37371
 
37372
+ if(!username){
37373
+ return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37374
+ }
37355
37375
 
37356
- const url = new URL('https://api.neynar.com/v2/farcaster/followers');
37357
- url.searchParams.set('fid', fid.toString());
37358
- url.searchParams.set('sort_type', sortType);
37359
- url.searchParams.set('limit', limit.toString());
37360
- if (viewerFid !== null) url.searchParams.set('viewer_fid', viewerFid.toString());
37361
- if (cursor) url.searchParams.set('cursor', cursor);
37376
+ const fid = await fromUsernameToFid(username);
37377
+
37378
+ if(!fid){
37379
+ return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37380
+ }
37381
+
37382
+ const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
37362
37383
 
37363
37384
  try {
37364
- const response = await fetch(url.toString(), {
37385
+ const response = await fetch(url, {
37365
37386
  headers: {
37366
37387
  'x-api-key': API_KEY,
37367
37388
  'x-neynar-experimental': 'false'
@@ -37459,7 +37480,7 @@
37459
37480
  }
37460
37481
 
37461
37482
 
37462
- async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
37483
+ async function COINGECKO(category, param1, param2) {
37463
37484
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
37464
37485
  if (!API_KEY) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37465
37486
 
@@ -37500,7 +37521,7 @@
37500
37521
  const categoryVal = ecosystemMap[key] || '';
37501
37522
  const trend = param2 ? `&price_change_percentage=${param2}` : '';
37502
37523
 
37503
- url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=${page}&per_page=${perPage}`;
37524
+ url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100`;
37504
37525
  if (key && !categoryVal) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37505
37526
  if (categoryVal) url += `&category=${categoryVal}`;
37506
37527
  if (trend) url += trend;
@@ -37513,7 +37534,7 @@
37513
37534
  : param1.toLowerCase();
37514
37535
 
37515
37536
  const trend = param2 ? `&price_change_percentage=${param2}` : '';
37516
- url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=${category}&order=market_cap_desc&page=${page}&per_page=${perPage}${trend}`;
37537
+ url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=${category}&order=market_cap_desc&page=1&per_page=100${trend}`;
37517
37538
  break;
37518
37539
  }
37519
37540
 
@@ -37528,7 +37549,7 @@
37528
37549
  }
37529
37550
 
37530
37551
  default:
37531
- return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAMS}`;
37552
+ return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37532
37553
  }
37533
37554
 
37534
37555
  try {
@@ -37584,16 +37605,19 @@
37584
37605
 
37585
37606
 
37586
37607
  async function EOA(
37587
- addresses,
37608
+ ) {
37609
+ const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
37610
+ if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37611
+
37612
+ let [
37613
+ addresses,
37588
37614
  category,
37589
37615
  chains,
37590
37616
  startTime,
37591
37617
  endTime,
37592
37618
  page = 1,
37593
37619
  offset = 10,
37594
- ) {
37595
- const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
37596
- if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37620
+ ] = argsToArray(arguments);
37597
37621
 
37598
37622
  const INPUTS = addresses.split(",").map(a => a.trim()).filter(Boolean);
37599
37623
  const CHAINS = chains.split(",").map(c => c.trim()).filter(Boolean);
@@ -37707,7 +37731,9 @@
37707
37731
  });
37708
37732
  }
37709
37733
 
37710
- async function SAFE(address, utility, chain, limit, offset) {
37734
+ async function SAFE() {
37735
+
37736
+ let [address, utility, chain, limit, offset] = argsToArray(arguments);
37711
37737
 
37712
37738
  if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT';
37713
37739
  if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET';
@@ -37751,27 +37777,32 @@
37751
37777
 
37752
37778
  function POLYMARKET() {
37753
37779
  return "Coming Soon"
37754
- }
37755
-
37756
- function PRIVACYPOOL() {
37780
+ }
37781
+
37782
+
37783
+ function PRIVACYPOOL() {
37757
37784
  return "Coming Soon"
37758
- }
37759
-
37760
- function ROTKI() {
37785
+ }
37786
+
37787
+
37788
+ function ROTKI() {
37761
37789
  return "Coming Soon"
37762
- }
37763
-
37764
- function MEERKAT() {
37790
+ }
37791
+
37792
+
37793
+ function MEERKAT() {
37765
37794
  return "Coming Soon"
37766
- }
37767
-
37768
- function ARTEMIS() {
37795
+ }
37796
+
37797
+
37798
+ function ARTEMIS() {
37769
37799
  return "Coming Soon"
37770
- }
37771
-
37772
- function TALLY() {
37800
+ }
37801
+
37802
+
37803
+ function TALLY() {
37773
37804
  return "Coming Soon"
37774
- }
37805
+ }
37775
37806
 
37776
37807
  const utils = { errors: errors$1, symbols, date };
37777
37808
 
@@ -45907,62 +45938,6 @@ React keys must be passed directly to JSX without using spread:
45907
45938
  )
45908
45939
  ]
45909
45940
  }
45910
- ),
45911
- DSheets: ({ width: e = 16, height: t = 16, ...n }) => /* @__PURE__ */ d$1.jsxs(
45912
- "svg",
45913
- {
45914
- width: e,
45915
- height: t,
45916
- viewBox: "0 0 24 24",
45917
- fill: "none",
45918
- xmlns: "http://www.w3.org/2000/svg",
45919
- ...n,
45920
- children: [
45921
- /* @__PURE__ */ d$1.jsxs("g", { "clip-path": "url(#clip0_3475_901193)", children: [
45922
- /* @__PURE__ */ d$1.jsx(
45923
- "path",
45924
- {
45925
- d: "M0 8C0 3.58172 3.58172 0 8 0H16C20.4183 0 24 3.58172 24 8V16C24 20.4183 20.4183 24 16 24H8C3.58172 24 0 20.4183 0 16V8Z",
45926
- fill: "#FFDF0A",
45927
- stroke: "transparent"
45928
- }
45929
- ),
45930
- /* @__PURE__ */ d$1.jsx(
45931
- "path",
45932
- {
45933
- d: "M7.5 10.068C7.5 9.35311 7.68071 8.91488 7.90865 8.68151C8.11102 8.47432 8.48409 8.29322 9.22074 8.39367C9.67676 8.45586 10.0968 8.13659 10.159 7.68057C10.2212 7.22456 9.90194 6.80447 9.44593 6.74229C8.34925 6.59274 7.38898 6.8283 6.71635 7.51695C6.06929 8.17941 5.83333 9.11619 5.83333 10.068V10.2346H4.33333C3.8731 10.2346 3.5 10.6077 3.5 11.068C3.5 11.5282 3.8731 11.9013 4.33333 11.9013H5.83333V13.568C5.83333 14.2128 5.68799 14.5468 5.52004 14.724C5.36039 14.8925 5.03862 15.068 4.33333 15.068C3.8731 15.068 3.5 15.4411 3.5 15.9013C3.5 16.3616 3.8731 16.7346 4.33333 16.7346C5.29471 16.7346 6.13961 16.4934 6.72996 15.8703C7.31201 15.2559 7.5 14.4232 7.5 13.568V11.9013H9.08333C9.54357 11.9013 9.91667 11.5282 9.91667 11.068C9.91667 10.6077 9.54357 10.2346 9.08333 10.2346H7.5V10.068Z",
45934
- fill: "#363B3F",
45935
- stroke: "transparent"
45936
- }
45937
- ),
45938
- /* @__PURE__ */ d$1.jsx(
45939
- "path",
45940
- {
45941
- d: "M17.8169 10.3823C18.061 10.6264 18.061 11.0221 17.8169 11.2662L16.3839 12.6992L17.8169 14.1323C18.061 14.3764 18.061 14.7721 17.8169 15.0162C17.5729 15.2602 17.1771 15.2602 16.9331 15.0162L15.5 13.5831L14.0669 15.0162C13.8229 15.2602 13.4271 15.2602 13.1831 15.0162C12.939 14.7721 12.939 14.3764 13.1831 14.1323L14.6161 12.6992L13.1831 11.2662C12.939 11.0221 12.939 10.6264 13.1831 10.3823C13.4271 10.1382 13.8229 10.1382 14.0669 10.3823L15.5 11.8153L16.9331 10.3823C17.1771 10.1382 17.5729 10.1382 17.8169 10.3823Z",
45942
- fill: "#363B3F",
45943
- stroke: "transparent"
45944
- }
45945
- ),
45946
- /* @__PURE__ */ d$1.jsx(
45947
- "path",
45948
- {
45949
- d: "M10.3008 12.6997C10.3008 11.6951 10.5044 10.7012 10.8975 9.81687L11.0527 9.49167C11.4357 8.74751 11.9546 8.11 12.5811 7.64011C12.8903 7.40819 13.3286 7.47062 13.5605 7.77976C13.7925 8.08899 13.73 8.52726 13.4209 8.75925C12.9834 9.08741 12.5952 9.55369 12.2979 10.1313L12.1768 10.3862C11.8677 11.0817 11.7012 11.8801 11.7012 12.6997C11.7012 13.5193 11.8677 14.3177 12.1768 15.0132L12.2979 15.268C12.5527 15.7631 12.8743 16.1761 13.2363 16.4907L13.4209 16.6401L13.5254 16.7358C13.7413 16.9794 13.7635 17.349 13.5605 17.6196C13.3575 17.8902 12.9965 17.9719 12.7021 17.8325L12.5811 17.7593L12.3193 17.5483C11.8092 17.1054 11.381 16.5457 11.0527 15.9077L10.8975 15.5825C10.5044 14.6982 10.3008 13.7042 10.3008 12.6997Z",
45950
- fill: "#363B3F",
45951
- stroke: "transparent"
45952
- }
45953
- ),
45954
- /* @__PURE__ */ d$1.jsx(
45955
- "path",
45956
- {
45957
- d: "M20.6992 12.6988C20.6992 13.7033 20.4956 14.6973 20.1025 15.5816L19.9473 15.9068C19.5643 16.6509 19.0454 17.2884 18.4189 17.7583C18.1097 17.9902 17.6714 17.9278 17.4395 17.6187C17.2075 17.3094 17.27 16.8712 17.5791 16.6392C18.0166 16.311 18.4048 15.8447 18.7021 15.2671L18.8232 15.0122C19.1323 14.3168 19.2988 13.5184 19.2988 12.6988C19.2988 11.8791 19.1323 11.0808 18.8232 10.3853L18.7021 10.1304C18.4473 9.63535 18.1257 9.22232 17.7637 8.90774L17.5791 8.75833L17.4746 8.66262C17.2587 8.41902 17.2365 8.04941 17.4395 7.77883C17.6425 7.50823 18.0035 7.42657 18.2979 7.56594L18.4189 7.63918L18.6807 7.85012C19.1908 8.29301 19.619 8.85277 19.9473 9.49075L20.1025 9.81594C20.4956 10.7003 20.6992 11.6942 20.6992 12.6988Z",
45958
- fill: "#363B3F",
45959
- stroke: "transparent"
45960
- }
45961
- )
45962
- ] }),
45963
- /* @__PURE__ */ d$1.jsx("defs", { children: /* @__PURE__ */ d$1.jsx("clipPath", { id: "clip0_3475_901193", children: /* @__PURE__ */ d$1.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })
45964
- ]
45965
- }
45966
45941
  )
45967
45942
  };
45968
45943
  /**