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

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',
@@ -37343,25 +37363,27 @@
37343
37363
  }
37344
37364
 
37345
37365
  async function NEYNAR(
37346
- fid,
37347
- viewerFid,
37348
- sortType,
37349
- limit,
37350
- cursor
37351
37366
  ) {
37367
+ const [
37368
+ username
37369
+ ] = argsToArray(arguments);
37352
37370
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
37353
37371
  if (!API_KEY) return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37354
37372
 
37373
+ if(!username){
37374
+ return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37375
+ }
37355
37376
 
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);
37377
+ const fid = await fromUsernameToFid(username);
37378
+
37379
+ if(!fid){
37380
+ return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37381
+ }
37382
+
37383
+ const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
37362
37384
 
37363
37385
  try {
37364
- const response = await fetch(url.toString(), {
37386
+ const response = await fetch(url, {
37365
37387
  headers: {
37366
37388
  'x-api-key': API_KEY,
37367
37389
  'x-neynar-experimental': 'false'
@@ -37459,7 +37481,7 @@
37459
37481
  }
37460
37482
 
37461
37483
 
37462
- async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
37484
+ async function COINGECKO(category, param1, param2) {
37463
37485
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
37464
37486
  if (!API_KEY) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37465
37487
 
@@ -37500,7 +37522,7 @@
37500
37522
  const categoryVal = ecosystemMap[key] || '';
37501
37523
  const trend = param2 ? `&price_change_percentage=${param2}` : '';
37502
37524
 
37503
- url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=${page}&per_page=${perPage}`;
37525
+ url = `https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100`;
37504
37526
  if (key && !categoryVal) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37505
37527
  if (categoryVal) url += `&category=${categoryVal}`;
37506
37528
  if (trend) url += trend;
@@ -37513,7 +37535,7 @@
37513
37535
  : param1.toLowerCase();
37514
37536
 
37515
37537
  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}`;
37538
+ 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
37539
  break;
37518
37540
  }
37519
37541
 
@@ -37528,7 +37550,7 @@
37528
37550
  }
37529
37551
 
37530
37552
  default:
37531
- return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAMS}`;
37553
+ return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
37532
37554
  }
37533
37555
 
37534
37556
  try {
@@ -37584,16 +37606,19 @@
37584
37606
 
37585
37607
 
37586
37608
  async function EOA(
37587
- addresses,
37609
+ ) {
37610
+ const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
37611
+ if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
37612
+
37613
+ let [
37614
+ addresses,
37588
37615
  category,
37589
37616
  chains,
37590
37617
  startTime,
37591
37618
  endTime,
37592
37619
  page = 1,
37593
37620
  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}`;
37621
+ ] = argsToArray(arguments);
37597
37622
 
37598
37623
  const INPUTS = addresses.split(",").map(a => a.trim()).filter(Boolean);
37599
37624
  const CHAINS = chains.split(",").map(c => c.trim()).filter(Boolean);
@@ -37707,7 +37732,9 @@
37707
37732
  });
37708
37733
  }
37709
37734
 
37710
- async function SAFE(address, utility, chain, limit, offset) {
37735
+ async function SAFE() {
37736
+
37737
+ let [address, utility, chain, limit, offset] = argsToArray(arguments);
37711
37738
 
37712
37739
  if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT';
37713
37740
  if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET';
@@ -37751,27 +37778,32 @@
37751
37778
 
37752
37779
  function POLYMARKET() {
37753
37780
  return "Coming Soon"
37754
- }
37755
-
37756
- function PRIVACYPOOL() {
37781
+ }
37782
+
37783
+
37784
+ function PRIVACYPOOL() {
37757
37785
  return "Coming Soon"
37758
- }
37759
-
37760
- function ROTKI() {
37786
+ }
37787
+
37788
+
37789
+ function ROTKI() {
37761
37790
  return "Coming Soon"
37762
- }
37763
-
37764
- function MEERKAT() {
37791
+ }
37792
+
37793
+
37794
+ function MEERKAT() {
37765
37795
  return "Coming Soon"
37766
- }
37767
-
37768
- function ARTEMIS() {
37796
+ }
37797
+
37798
+
37799
+ function ARTEMIS() {
37769
37800
  return "Coming Soon"
37770
- }
37771
-
37772
- function TALLY() {
37801
+ }
37802
+
37803
+
37804
+ function TALLY() {
37773
37805
  return "Coming Soon"
37774
- }
37806
+ }
37775
37807
 
37776
37808
  const utils = { errors: errors$1, symbols, date };
37777
37809
 
@@ -45907,62 +45939,6 @@ React keys must be passed directly to JSX without using spread:
45907
45939
  )
45908
45940
  ]
45909
45941
  }
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
45942
  )
45967
45943
  };
45968
45944
  /**