@fileverse-dev/fortune-react 1.0.2-mod-97 → 1.0.2-mod-98
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.esm.js +3 -1
- package/dist/index.js +3 -1
- package/dist/index.umd.js +158 -10
- package/dist/index.umd.min.js +7 -7
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1564,7 +1564,9 @@ var InputBox = function InputBox() {
|
|
|
1564
1564
|
if (!e) return;
|
|
1565
1565
|
var kcode = e.keyCode;
|
|
1566
1566
|
if (!kcode) return;
|
|
1567
|
-
|
|
1567
|
+
if (!document.getElementById("luckysheet-formula-search-c")) {
|
|
1568
|
+
setShowCryptoModal(!document.getElementById("luckysheet-formula-search-c"));
|
|
1569
|
+
}
|
|
1568
1570
|
if (!(kcode >= 112 && kcode <= 123 || kcode <= 46 || kcode === 144 || kcode === 108 || e.ctrlKey || e.altKey || e.shiftKey && (kcode === 37 || kcode === 38 || kcode === 39 || kcode === 40)) || kcode === 8 || kcode === 32 || kcode === 46 || e.ctrlKey && kcode === 86) {
|
|
1569
1571
|
setContext(function (draftCtx) {
|
|
1570
1572
|
if ((draftCtx.formulaCache.rangestart || draftCtx.formulaCache.rangedrag_column_start || draftCtx.formulaCache.rangedrag_row_start || israngeseleciton(draftCtx)) && isBlur) return;
|
package/dist/index.js
CHANGED
|
@@ -1574,7 +1574,9 @@ var InputBox = function InputBox() {
|
|
|
1574
1574
|
if (!e) return;
|
|
1575
1575
|
var kcode = e.keyCode;
|
|
1576
1576
|
if (!kcode) return;
|
|
1577
|
-
|
|
1577
|
+
if (!document.getElementById("luckysheet-formula-search-c")) {
|
|
1578
|
+
setShowCryptoModal(!document.getElementById("luckysheet-formula-search-c"));
|
|
1579
|
+
}
|
|
1578
1580
|
if (!(kcode >= 112 && kcode <= 123 || kcode <= 46 || kcode === 144 || kcode === 108 || e.ctrlKey || e.altKey || e.shiftKey && (kcode === 37 || kcode === 38 || kcode === 39 || kcode === 40)) || kcode === 8 || kcode === 32 || kcode === 46 || e.ctrlKey && kcode === 86) {
|
|
1579
1581
|
setContext(function (draftCtx) {
|
|
1580
1582
|
if ((draftCtx.formulaCache.rangestart || draftCtx.formulaCache.rangedrag_column_start || draftCtx.formulaCache.rangedrag_row_start || fortuneCore.israngeseleciton(draftCtx)) && isBlur) return;
|
package/dist/index.umd.js
CHANGED
|
@@ -37056,7 +37056,8 @@
|
|
|
37056
37056
|
Gnosisscan: "GNOSIS_API_KEY",
|
|
37057
37057
|
Firefly: "FIRE_FLY_API_KEY",
|
|
37058
37058
|
GnosisPay: 'GNOSIS_API_KEY',
|
|
37059
|
-
Neynar: 'NEYNAR_API_KEY'
|
|
37059
|
+
Neynar: 'NEYNAR_API_KEY',
|
|
37060
|
+
Defillama: 'DEFILLAMA_API_KEY'
|
|
37060
37061
|
};
|
|
37061
37062
|
|
|
37062
37063
|
const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
|
|
@@ -37198,6 +37199,19 @@
|
|
|
37198
37199
|
return user && user.fid || null;
|
|
37199
37200
|
};
|
|
37200
37201
|
|
|
37202
|
+
// remove nested structure from the response
|
|
37203
|
+
const removeNestedStructure = (json) => {
|
|
37204
|
+
return json.map(item => {
|
|
37205
|
+
const flat = {};
|
|
37206
|
+
for (const [key, value] of Object.entries(item)) {
|
|
37207
|
+
if (typeof value !== 'object' || value === null) {
|
|
37208
|
+
flat[key] = value;
|
|
37209
|
+
}
|
|
37210
|
+
}
|
|
37211
|
+
return flat;
|
|
37212
|
+
});
|
|
37213
|
+
};
|
|
37214
|
+
|
|
37201
37215
|
async function FIREFLY() {
|
|
37202
37216
|
const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
37203
37217
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
@@ -37257,9 +37271,110 @@
|
|
|
37257
37271
|
}
|
|
37258
37272
|
}
|
|
37259
37273
|
|
|
37274
|
+
async function LENS() {
|
|
37275
|
+
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
37276
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
37277
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
37278
|
+
|
|
37279
|
+
const baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
|
|
37280
|
+
const headers = { "x-api-key": API_KEY };
|
|
37281
|
+
|
|
37282
|
+
const typeMap = {
|
|
37283
|
+
posts: "lensid",
|
|
37284
|
+
replies: "lenspostid",
|
|
37285
|
+
};
|
|
37286
|
+
|
|
37287
|
+
const platformType = typeMap[contentType];
|
|
37288
|
+
if (!platformType) return `Lens: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
37289
|
+
|
|
37290
|
+
const query = identifier
|
|
37291
|
+
.split(",")
|
|
37292
|
+
.map(s => s.trim())
|
|
37293
|
+
.filter(Boolean)
|
|
37294
|
+
.join(",");
|
|
37295
|
+
|
|
37296
|
+
const url = new URL(baseUrl);
|
|
37297
|
+
url.searchParams.set("query", query);
|
|
37298
|
+
url.searchParams.set("type", platformType);
|
|
37299
|
+
url.searchParams.set("start", String(start));
|
|
37300
|
+
url.searchParams.set("end", String(end));
|
|
37301
|
+
|
|
37302
|
+
try {
|
|
37303
|
+
const res = await fetch(url.toString(), { headers });
|
|
37304
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37305
|
+
|
|
37306
|
+
const json = await res.json();
|
|
37307
|
+
if (!Array.isArray(json?.data)) return [];
|
|
37308
|
+
|
|
37309
|
+
return json.data.map(item => {
|
|
37310
|
+
const flat = {};
|
|
37311
|
+
for (const [key, value] of Object.entries(item)) {
|
|
37312
|
+
if (typeof value !== "object" || value === null) {
|
|
37313
|
+
flat[key] = value;
|
|
37314
|
+
}
|
|
37315
|
+
}
|
|
37316
|
+
flat.platform = platform;
|
|
37317
|
+
return flat;
|
|
37318
|
+
});
|
|
37319
|
+
|
|
37320
|
+
} catch (err) {
|
|
37321
|
+
console.error("LENS fetch error:", err);
|
|
37322
|
+
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
37323
|
+
}
|
|
37324
|
+
}
|
|
37325
|
+
|
|
37326
|
+
async function FARCASTER() {
|
|
37327
|
+
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
37328
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
37329
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
37330
|
+
|
|
37331
|
+
const baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
|
|
37332
|
+
const headers = { "x-api-key": API_KEY };
|
|
37260
37333
|
|
|
37334
|
+
const typeMap = {
|
|
37335
|
+
posts: "farcasterid",
|
|
37336
|
+
replies: "farcasterpostid",
|
|
37337
|
+
channels: "farcasterchannels",
|
|
37338
|
+
};
|
|
37261
37339
|
|
|
37340
|
+
const platformType = typeMap[contentType];
|
|
37341
|
+
if (!platformType) return `Farcaster: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
37262
37342
|
|
|
37343
|
+
const query = identifier
|
|
37344
|
+
.split(",")
|
|
37345
|
+
.map(s => s.trim())
|
|
37346
|
+
.filter(Boolean)
|
|
37347
|
+
.join(",");
|
|
37348
|
+
|
|
37349
|
+
const url = new URL(baseUrl);
|
|
37350
|
+
url.searchParams.set("query", query);
|
|
37351
|
+
url.searchParams.set("type", platformType);
|
|
37352
|
+
url.searchParams.set("start", String(start));
|
|
37353
|
+
url.searchParams.set("end", String(end));
|
|
37354
|
+
|
|
37355
|
+
try {
|
|
37356
|
+
const res = await fetch(url.toString(), { headers });
|
|
37357
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37358
|
+
|
|
37359
|
+
const json = await res.json();
|
|
37360
|
+
if (!Array.isArray(json?.data)) return [];
|
|
37361
|
+
|
|
37362
|
+
return json.data.map(item => {
|
|
37363
|
+
const flat = {};
|
|
37364
|
+
for (const [key, value] of Object.entries(item)) {
|
|
37365
|
+
if (typeof value !== "object" || value === null) {
|
|
37366
|
+
flat[key] = value;
|
|
37367
|
+
}
|
|
37368
|
+
}
|
|
37369
|
+
flat.platform = platform;
|
|
37370
|
+
return flat;
|
|
37371
|
+
});
|
|
37372
|
+
|
|
37373
|
+
} catch (err) {
|
|
37374
|
+
console.error("Farcaster fetch error:", err);
|
|
37375
|
+
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
37376
|
+
}
|
|
37377
|
+
}
|
|
37263
37378
|
|
|
37264
37379
|
async function BLOCKSCOUT() {
|
|
37265
37380
|
let [address, type, chain, startTimestamp, endTimestamp, page, offset] = argsToArray(arguments);
|
|
@@ -37494,9 +37609,9 @@
|
|
|
37494
37609
|
|
|
37495
37610
|
switch (lowerCategory) {
|
|
37496
37611
|
case 'price': {
|
|
37497
|
-
const
|
|
37498
|
-
const
|
|
37499
|
-
if (!token
|
|
37612
|
+
const token = param1;
|
|
37613
|
+
const vsCurrencies = param2;
|
|
37614
|
+
if (!token) {
|
|
37500
37615
|
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
37501
37616
|
}
|
|
37502
37617
|
url = `https://api.coingecko.com/api/v3/simple/price?vs_currencies=${vsCurrencies ? vsCurrencies : 'usd' }&symbols=${token}`;
|
|
@@ -37577,11 +37692,14 @@
|
|
|
37577
37692
|
return [output];
|
|
37578
37693
|
}
|
|
37579
37694
|
|
|
37580
|
-
|
|
37695
|
+
let data = json;
|
|
37581
37696
|
|
|
37582
37697
|
if (lowerCategory === 'derivatives') {
|
|
37698
|
+
if (json.length > 200) {
|
|
37699
|
+
data = json.slice(0, 200);
|
|
37700
|
+
}
|
|
37583
37701
|
if (json && json.tickers && json.tickers.tickers) {
|
|
37584
|
-
data = json.tickers.tickers;
|
|
37702
|
+
data = json.tickers.tickers.slice(0, 200);
|
|
37585
37703
|
}
|
|
37586
37704
|
}
|
|
37587
37705
|
|
|
@@ -37601,9 +37719,6 @@
|
|
|
37601
37719
|
}
|
|
37602
37720
|
}
|
|
37603
37721
|
|
|
37604
|
-
|
|
37605
|
-
|
|
37606
|
-
|
|
37607
37722
|
async function EOA(
|
|
37608
37723
|
) {
|
|
37609
37724
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
@@ -37775,6 +37890,34 @@
|
|
|
37775
37890
|
}
|
|
37776
37891
|
}
|
|
37777
37892
|
|
|
37893
|
+
async function DEFILLAMA() {
|
|
37894
|
+
let [category, param1] = argsToArray(arguments);
|
|
37895
|
+
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Defillama);
|
|
37896
|
+
if (!apiKey) return `${SERVICE_API_KEY.Defillama}_MISSING`;
|
|
37897
|
+
const baseUrl = 'https://api.llama.fi/';
|
|
37898
|
+
const categoryList = ['protocols', 'yields', 'dex'];
|
|
37899
|
+
const categoryMap = {
|
|
37900
|
+
[categoryList[0]]: 'protocols',
|
|
37901
|
+
[categoryList[1]]: 'pools',
|
|
37902
|
+
[categoryList[2]]: 'overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true'
|
|
37903
|
+
};
|
|
37904
|
+
let url = `${baseUrl}/${categoryMap[category]}`;
|
|
37905
|
+
if(categoryMap[category] === categoryList[0] && param1){
|
|
37906
|
+
url += `/${param1}`;
|
|
37907
|
+
}
|
|
37908
|
+
try {
|
|
37909
|
+
const response = await fetch(url);
|
|
37910
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
|
|
37911
|
+
let json = await response.json();
|
|
37912
|
+
if(json.length > 300){
|
|
37913
|
+
json = json.slice(0, 300);
|
|
37914
|
+
}
|
|
37915
|
+
return removeNestedStructure(json);
|
|
37916
|
+
} catch (e) {
|
|
37917
|
+
console.log(e);
|
|
37918
|
+
return "ERROR IN FETCHING";
|
|
37919
|
+
}
|
|
37920
|
+
}
|
|
37778
37921
|
function POLYMARKET() {
|
|
37779
37922
|
return "Coming Soon"
|
|
37780
37923
|
}
|
|
@@ -37904,6 +38047,7 @@
|
|
|
37904
38047
|
DEC2HEX: DEC2HEX,
|
|
37905
38048
|
DEC2OCT: DEC2OCT,
|
|
37906
38049
|
DECIMAL: DECIMAL,
|
|
38050
|
+
DEFILLAMA: DEFILLAMA,
|
|
37907
38051
|
DEGREES: DEGREES,
|
|
37908
38052
|
DELTA: DELTA,
|
|
37909
38053
|
DEVSQ: DEVSQ,
|
|
@@ -37939,6 +38083,7 @@
|
|
|
37939
38083
|
FACT: FACT,
|
|
37940
38084
|
FACTDOUBLE: FACTDOUBLE,
|
|
37941
38085
|
FALSE: FALSE,
|
|
38086
|
+
FARCASTER: FARCASTER,
|
|
37942
38087
|
FDIST: FDIST,
|
|
37943
38088
|
FDISTRT: FDISTRT,
|
|
37944
38089
|
FIND: FIND,
|
|
@@ -38030,6 +38175,7 @@
|
|
|
38030
38175
|
LCM: LCM,
|
|
38031
38176
|
LEFT: LEFT,
|
|
38032
38177
|
LEN: LEN,
|
|
38178
|
+
LENS: LENS,
|
|
38033
38179
|
LINEST: LINEST,
|
|
38034
38180
|
LN: LN,
|
|
38035
38181
|
LOG: LOG,
|
|
@@ -106168,7 +106314,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
106168
106314
|
if (!e) return;
|
|
106169
106315
|
var kcode = e.keyCode;
|
|
106170
106316
|
if (!kcode) return;
|
|
106171
|
-
|
|
106317
|
+
if (!document.getElementById("luckysheet-formula-search-c")) {
|
|
106318
|
+
setShowCryptoModal(!document.getElementById("luckysheet-formula-search-c"));
|
|
106319
|
+
}
|
|
106172
106320
|
if (!(kcode >= 112 && kcode <= 123 || kcode <= 46 || kcode === 144 || kcode === 108 || e.ctrlKey || e.altKey || e.shiftKey && (kcode === 37 || kcode === 38 || kcode === 39 || kcode === 40)) || kcode === 8 || kcode === 32 || kcode === 46 || e.ctrlKey && kcode === 86) {
|
|
106173
106321
|
setContext(function (draftCtx) {
|
|
106174
106322
|
if ((draftCtx.formulaCache.rangestart || draftCtx.formulaCache.rangedrag_column_start || draftCtx.formulaCache.rangedrag_row_start || israngeseleciton(draftCtx)) && isBlur) return;
|