@fileverse-dev/fortune-react 1.0.2-mod-94 → 1.0.2-mod-95
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 +52 -25
- package/dist/index.umd.min.js +7 -7
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -37180,7 +37180,26 @@
|
|
|
37180
37180
|
}
|
|
37181
37181
|
}
|
|
37182
37182
|
|
|
37183
|
-
|
|
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(
|
|
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(
|
|
37331
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
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
|
|
37357
|
-
|
|
37358
|
-
|
|
37359
|
-
|
|
37360
|
-
|
|
37361
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
|
|
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(
|
|
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';
|