@fileverse-dev/formulajs 4.4.46 → 4.4.47
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/browser/formula.js +958 -1293
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +0 -244
- package/lib/esm/crypto-constants.mjs +0 -143
- package/lib/esm/index.mjs +1 -242
- package/package.json +1 -1
- package/types/cjs/index.d.cts +1 -44
- package/types/esm/index.d.mts +0 -43
package/lib/cjs/index.cjs
CHANGED
|
@@ -18554,88 +18554,6 @@ async function ETHERSCAN() {
|
|
|
18554
18554
|
}
|
|
18555
18555
|
}
|
|
18556
18556
|
|
|
18557
|
-
const farcasterParamsSchema = objectType({
|
|
18558
|
-
contentType: enumType(['posts', 'replies', 'channels']),
|
|
18559
|
-
identifier: stringType().nonempty(),
|
|
18560
|
-
start: numberType().int().nonnegative().default(0),
|
|
18561
|
-
end: numberType().int().nonnegative().max(MAX_PAGE_LIMIT, {message: `"end" must be less than or equal to ${MAX_PAGE_LIMIT}`}).default(10),
|
|
18562
|
-
});
|
|
18563
|
-
|
|
18564
|
-
/* global window */
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
async function FARCASTER() {
|
|
18574
|
-
try {
|
|
18575
|
-
const [contentType, identifier, start = 0, end = 10] =
|
|
18576
|
-
argsToArray(arguments);
|
|
18577
|
-
validateParams(farcasterParamsSchema, {
|
|
18578
|
-
contentType,
|
|
18579
|
-
identifier,
|
|
18580
|
-
start,
|
|
18581
|
-
end,
|
|
18582
|
-
});
|
|
18583
|
-
|
|
18584
|
-
const apiKey = window.localStorage.getItem(
|
|
18585
|
-
SERVICES_API_KEY.Firefly
|
|
18586
|
-
);
|
|
18587
|
-
|
|
18588
|
-
const url = new URL(
|
|
18589
|
-
'https://openapi.firefly.land/v1/fileverse/fetch'
|
|
18590
|
-
);
|
|
18591
|
-
url.searchParams.set(
|
|
18592
|
-
'query',
|
|
18593
|
-
identifier
|
|
18594
|
-
.split(',')
|
|
18595
|
-
.map(s => s.trim())
|
|
18596
|
-
.filter(Boolean)
|
|
18597
|
-
.join(',')
|
|
18598
|
-
);
|
|
18599
|
-
const typeMap = {
|
|
18600
|
-
posts: 'farcasterid',
|
|
18601
|
-
replies: 'farcasterpostid',
|
|
18602
|
-
channels: 'farcasterchannels',
|
|
18603
|
-
};
|
|
18604
|
-
url.searchParams.set('type', typeMap[contentType]);
|
|
18605
|
-
url.searchParams.set('start', String(start));
|
|
18606
|
-
url.searchParams.set('end', String(end));
|
|
18607
|
-
|
|
18608
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({ url: url.toString(), serviceName: 'Firefly', headers: { 'x-api-key': apiKey } });
|
|
18609
|
-
|
|
18610
|
-
const response = await fetch(finalUrl, {
|
|
18611
|
-
method: 'GET',
|
|
18612
|
-
headers: HEADERS,
|
|
18613
|
-
});
|
|
18614
|
-
if (!response.ok) {
|
|
18615
|
-
throw new NetworkError(
|
|
18616
|
-
SERVICES_API_KEY.Firefly,
|
|
18617
|
-
response.status
|
|
18618
|
-
)
|
|
18619
|
-
}
|
|
18620
|
-
|
|
18621
|
-
const { data } = await response.json();
|
|
18622
|
-
if (!Array.isArray(data)) return []
|
|
18623
|
-
|
|
18624
|
-
return data.map(item => {
|
|
18625
|
-
const flat = {};
|
|
18626
|
-
for (const [k, v] of Object.entries(item)) {
|
|
18627
|
-
if (v == null || typeof v !== 'object') {
|
|
18628
|
-
flat[k] = v;
|
|
18629
|
-
}
|
|
18630
|
-
}
|
|
18631
|
-
flat.platform = 'farcaster';
|
|
18632
|
-
return flat
|
|
18633
|
-
})
|
|
18634
|
-
} catch (err) {
|
|
18635
|
-
return errorMessageHandler(err, 'FARCASTER')
|
|
18636
|
-
}
|
|
18637
|
-
}
|
|
18638
|
-
|
|
18639
18557
|
const farcasterSchema = objectType({
|
|
18640
18558
|
platform: literalType('farcaster'),
|
|
18641
18559
|
contentType: enumType(['posts', 'replies', 'channels']),
|
|
@@ -18774,165 +18692,6 @@ async function GNOSIS() {
|
|
|
18774
18692
|
}
|
|
18775
18693
|
}
|
|
18776
18694
|
|
|
18777
|
-
const lensParamsSchema = objectType({
|
|
18778
|
-
contentType: enumType(['posts', 'replies']),
|
|
18779
|
-
identifier: stringType().nonempty(),
|
|
18780
|
-
start: numberType().int().nonnegative().default(0),
|
|
18781
|
-
end: numberType().int().nonnegative().max(MAX_PAGE_LIMIT, {message: `"end" must be less than or equal to ${MAX_PAGE_LIMIT}`}).default(10),
|
|
18782
|
-
});
|
|
18783
|
-
|
|
18784
|
-
/* global window */
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
async function LENS() {
|
|
18791
|
-
try {
|
|
18792
|
-
const [contentType, identifier, start = 0, end = 10] =
|
|
18793
|
-
argsToArray(arguments);
|
|
18794
|
-
|
|
18795
|
-
validateParams(lensParamsSchema, {
|
|
18796
|
-
contentType,
|
|
18797
|
-
identifier,
|
|
18798
|
-
start,
|
|
18799
|
-
end,
|
|
18800
|
-
});
|
|
18801
|
-
|
|
18802
|
-
const apiKey = window.localStorage.getItem(
|
|
18803
|
-
SERVICES_API_KEY.Firefly
|
|
18804
|
-
);
|
|
18805
|
-
|
|
18806
|
-
const url = new URL(
|
|
18807
|
-
'https://openapi.firefly.land/v1/fileverse/fetch'
|
|
18808
|
-
);
|
|
18809
|
-
url.searchParams.set(
|
|
18810
|
-
'query',
|
|
18811
|
-
identifier
|
|
18812
|
-
.split(',')
|
|
18813
|
-
.map((s) => s.trim())
|
|
18814
|
-
.filter(Boolean)
|
|
18815
|
-
.join(',')
|
|
18816
|
-
);
|
|
18817
|
-
const typeMap = {
|
|
18818
|
-
posts: 'lensid',
|
|
18819
|
-
replies: 'lenspostid',
|
|
18820
|
-
};
|
|
18821
|
-
url.searchParams.set('type', typeMap[contentType]);
|
|
18822
|
-
url.searchParams.set('start', String(start));
|
|
18823
|
-
url.searchParams.set('end', String(end));
|
|
18824
|
-
|
|
18825
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({ url: url.toString(), serviceName: 'Firefly', headers: { 'x-api-key': apiKey } });
|
|
18826
|
-
|
|
18827
|
-
const response = await fetch(finalUrl, {
|
|
18828
|
-
method: 'GET',
|
|
18829
|
-
headers: HEADERS,
|
|
18830
|
-
});
|
|
18831
|
-
if (!response.ok) {
|
|
18832
|
-
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status)
|
|
18833
|
-
}
|
|
18834
|
-
|
|
18835
|
-
const { data } = await response.json();
|
|
18836
|
-
if (!Array.isArray(data)) return []
|
|
18837
|
-
|
|
18838
|
-
return data.map((item) => {
|
|
18839
|
-
const flat = {};
|
|
18840
|
-
for (const [key, value] of Object.entries(item)) {
|
|
18841
|
-
if (value == null || typeof value !== 'object') {
|
|
18842
|
-
flat[key] = value;
|
|
18843
|
-
}
|
|
18844
|
-
}
|
|
18845
|
-
flat.platform = 'lens';
|
|
18846
|
-
return flat
|
|
18847
|
-
})
|
|
18848
|
-
} catch (err) {
|
|
18849
|
-
return errorMessageHandler(err, 'LENS')
|
|
18850
|
-
}
|
|
18851
|
-
}
|
|
18852
|
-
|
|
18853
|
-
const neynarParamsSchema = objectType({
|
|
18854
|
-
username: stringType().nonempty()
|
|
18855
|
-
});
|
|
18856
|
-
|
|
18857
|
-
const fromUsernameToFid = async (username, apiKey) => {
|
|
18858
|
-
if (!username) return null
|
|
18859
|
-
const url = `https://api.neynar.com/v2/farcaster/user/search/?q=${username}&limit=5`;
|
|
18860
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({
|
|
18861
|
-
url, serviceName: 'Neynar', headers: {
|
|
18862
|
-
'x-api-key': apiKey,
|
|
18863
|
-
'x-neynar-experimental': 'false'
|
|
18864
|
-
}
|
|
18865
|
-
});
|
|
18866
|
-
|
|
18867
|
-
const res = await fetch(finalUrl, {
|
|
18868
|
-
method: 'GET',
|
|
18869
|
-
headers: HEADERS,
|
|
18870
|
-
});
|
|
18871
|
-
const json = await res.json();
|
|
18872
|
-
const users = json.result ? json.result.users : [];
|
|
18873
|
-
const user = users.find(user => user.username === username);
|
|
18874
|
-
return user && user.fid || null;
|
|
18875
|
-
};
|
|
18876
|
-
var fromUsernameToFid$1 = {
|
|
18877
|
-
fromUsernameToFid
|
|
18878
|
-
};
|
|
18879
|
-
|
|
18880
|
-
/* global window */
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
async function NEYNAR() {
|
|
18889
|
-
try {
|
|
18890
|
-
|
|
18891
|
-
|
|
18892
|
-
const [username] = argsToArray(arguments);
|
|
18893
|
-
|
|
18894
|
-
validateParams(neynarParamsSchema, { username });
|
|
18895
|
-
|
|
18896
|
-
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
|
|
18897
|
-
|
|
18898
|
-
const fid = await fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
|
|
18899
|
-
if (!fid) throw new ValidationError(`Invalid username: ${username}`)
|
|
18900
|
-
|
|
18901
|
-
const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
|
|
18902
|
-
|
|
18903
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({
|
|
18904
|
-
url: url.toString(), serviceName: 'Neynar',
|
|
18905
|
-
headers: {
|
|
18906
|
-
'x-api-key': apiKey,
|
|
18907
|
-
'x-neynar-experimental': 'false'
|
|
18908
|
-
}
|
|
18909
|
-
|
|
18910
|
-
});
|
|
18911
|
-
|
|
18912
|
-
const response = await fetch(finalUrl, {
|
|
18913
|
-
method: 'GET',
|
|
18914
|
-
headers: HEADERS,
|
|
18915
|
-
});
|
|
18916
|
-
if (!response.ok) {
|
|
18917
|
-
throw new NetworkError(SERVICES_API_KEY.Neynar, response.status)
|
|
18918
|
-
}
|
|
18919
|
-
|
|
18920
|
-
const json = await response.json();
|
|
18921
|
-
const users = json?.users || [];
|
|
18922
|
-
if (!users.length) return []
|
|
18923
|
-
|
|
18924
|
-
return users.map(({ user }) => ({
|
|
18925
|
-
username: user.username,
|
|
18926
|
-
custody_address: user.custody_address,
|
|
18927
|
-
follower_count: user.follower_count,
|
|
18928
|
-
country: user.profile?.location?.address?.country || '',
|
|
18929
|
-
city: user.profile?.location?.address?.city || '',
|
|
18930
|
-
}))
|
|
18931
|
-
} catch (err) {
|
|
18932
|
-
return errorMessageHandler(err, 'NEYNAR')
|
|
18933
|
-
}
|
|
18934
|
-
}
|
|
18935
|
-
|
|
18936
18695
|
const safeParamsSchema = objectType({
|
|
18937
18696
|
address: stringType().nonempty(),
|
|
18938
18697
|
utility: literalType('txns'),
|
|
@@ -30203,7 +29962,6 @@ exports.F = F;
|
|
|
30203
29962
|
exports.FACT = FACT;
|
|
30204
29963
|
exports.FACTDOUBLE = FACTDOUBLE;
|
|
30205
29964
|
exports.FALSE = FALSE;
|
|
30206
|
-
exports.FARCASTER = FARCASTER;
|
|
30207
29965
|
exports.FDIST = FDIST;
|
|
30208
29966
|
exports.FDISTRT = FDISTRT;
|
|
30209
29967
|
exports.FIND = FIND;
|
|
@@ -30294,7 +30052,6 @@ exports.LARGE = LARGE;
|
|
|
30294
30052
|
exports.LCM = LCM;
|
|
30295
30053
|
exports.LEFT = LEFT;
|
|
30296
30054
|
exports.LEN = LEN;
|
|
30297
|
-
exports.LENS = LENS;
|
|
30298
30055
|
exports.LINEST = LINEST;
|
|
30299
30056
|
exports.LN = LN;
|
|
30300
30057
|
exports.LOG = LOG;
|
|
@@ -30336,7 +30093,6 @@ exports.NEGBINOMDIST = NEGBINOMDIST;
|
|
|
30336
30093
|
exports.NETWORKDAYS = NETWORKDAYS;
|
|
30337
30094
|
exports.NETWORKDAYSINTL = NETWORKDAYSINTL;
|
|
30338
30095
|
exports.NETWORKDAYS_INTL = NETWORKDAYS_INTL;
|
|
30339
|
-
exports.NEYNAR = NEYNAR;
|
|
30340
30096
|
exports.NOMINAL = NOMINAL;
|
|
30341
30097
|
exports.NORM = NORM;
|
|
30342
30098
|
exports.NORMDIST = NORMDIST;
|
|
@@ -824,116 +824,6 @@ var AAVE_metadata = {
|
|
|
824
824
|
]
|
|
825
825
|
};
|
|
826
826
|
|
|
827
|
-
// src/crypto/lens/metadata.js
|
|
828
|
-
var LENS_metadata = {
|
|
829
|
-
API_KEY: SERVICES_API_KEY.Firefly,
|
|
830
|
-
LOGO: "https://tse3.mm.bing.net/th?id=OIP.1TANdvYNcEadCk6CO1bCcgAAAA&r=0&w=440&h=440&c=7",
|
|
831
|
-
SECONDARY_LOGO: "https://firefly.social/android-chrome-192x192.png",
|
|
832
|
-
BRAND_COLOR: "#f8f5fc",
|
|
833
|
-
BRAND_SECONDARY_COLOR: "#855dcd",
|
|
834
|
-
n: "LENS",
|
|
835
|
-
t: 20,
|
|
836
|
-
d: "Fetches content from Lens.",
|
|
837
|
-
a: "Retrieves posts or replies from Lens by usernames, IDs, or hashes.",
|
|
838
|
-
p: [
|
|
839
|
-
{
|
|
840
|
-
name: "contentType",
|
|
841
|
-
detail: "Type of content to fetch. Supports 'posts' or 'replies'.",
|
|
842
|
-
example: `"posts"`,
|
|
843
|
-
require: "m",
|
|
844
|
-
type: "string"
|
|
845
|
-
},
|
|
846
|
-
{
|
|
847
|
-
name: "identifier",
|
|
848
|
-
detail: "Comma-separated usernames, IDs, or post hashes depending on platform and contentType.",
|
|
849
|
-
example: `"toka,miroyato"`,
|
|
850
|
-
require: "m",
|
|
851
|
-
type: "string"
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
name: "start",
|
|
855
|
-
detail: "Pagination start index (default is 0).",
|
|
856
|
-
example: `0`,
|
|
857
|
-
require: "o",
|
|
858
|
-
type: "number"
|
|
859
|
-
},
|
|
860
|
-
{
|
|
861
|
-
name: "end",
|
|
862
|
-
detail: "Pagination end index (default is 10).",
|
|
863
|
-
example: `10`,
|
|
864
|
-
require: "o",
|
|
865
|
-
type: "number"
|
|
866
|
-
}
|
|
867
|
-
],
|
|
868
|
-
examples: [
|
|
869
|
-
{
|
|
870
|
-
title: "LENS",
|
|
871
|
-
argumentString: '"posts", "toka,miroyato"',
|
|
872
|
-
description: "returns posts made by the users with the usernames toka and miroyato on Lens."
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
title: "LENS",
|
|
876
|
-
argumentString: '"replies", "0x123abc456def789ghi012jkl345mno678pqr901stu234vwx567yz890abc123d"',
|
|
877
|
-
description: "returns replies to the post with the specified hash on Lens."
|
|
878
|
-
}
|
|
879
|
-
]
|
|
880
|
-
};
|
|
881
|
-
|
|
882
|
-
// src/crypto/farcaster/metadata.js
|
|
883
|
-
var FARCASTER_metadata = {
|
|
884
|
-
API_KEY: SERVICES_API_KEY.Firefly,
|
|
885
|
-
LOGO: "https://farcaster.xyz/favicon.ico",
|
|
886
|
-
SECONDARY_LOGO: "https://firefly.social/android-chrome-192x192.png",
|
|
887
|
-
BRAND_COLOR: "#f8f5fc",
|
|
888
|
-
BRAND_SECONDARY_COLOR: "#855dcd",
|
|
889
|
-
n: "FARCASTER",
|
|
890
|
-
t: 20,
|
|
891
|
-
d: "Fetches content from Farcaster.",
|
|
892
|
-
a: "Retrieves posts, replies, or channels from Farcaster by usernames, IDs, or hashes.",
|
|
893
|
-
p: [
|
|
894
|
-
{
|
|
895
|
-
name: "contentType",
|
|
896
|
-
detail: "Type of content to fetch. Supports 'posts', 'replies', and 'channels'.",
|
|
897
|
-
example: `"posts"`,
|
|
898
|
-
require: "m",
|
|
899
|
-
type: "string"
|
|
900
|
-
},
|
|
901
|
-
{
|
|
902
|
-
name: "identifier",
|
|
903
|
-
detail: "Comma-separated usernames, IDs, or post hashes depending on contentType.",
|
|
904
|
-
example: `"miroyato"`,
|
|
905
|
-
require: "m",
|
|
906
|
-
type: "string"
|
|
907
|
-
},
|
|
908
|
-
{
|
|
909
|
-
name: "start",
|
|
910
|
-
detail: "Pagination start index (default is 0).",
|
|
911
|
-
example: `0`,
|
|
912
|
-
require: "o",
|
|
913
|
-
type: "number"
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
name: "end",
|
|
917
|
-
detail: "Pagination end index (default is 10).",
|
|
918
|
-
example: `10`,
|
|
919
|
-
require: "o",
|
|
920
|
-
type: "number"
|
|
921
|
-
}
|
|
922
|
-
],
|
|
923
|
-
examples: [
|
|
924
|
-
{
|
|
925
|
-
title: "FARCASTER",
|
|
926
|
-
argumentString: '"posts", "miroyato"',
|
|
927
|
-
description: "returns posts made by the user with the username miroyato."
|
|
928
|
-
},
|
|
929
|
-
{
|
|
930
|
-
title: "FARCASTER",
|
|
931
|
-
argumentString: '"replies", "0x123abc456def789ghi012jkl345mno678pqr901stu234vwx567yz890abc123d"',
|
|
932
|
-
description: "returns replies to the post with the specified hash."
|
|
933
|
-
}
|
|
934
|
-
]
|
|
935
|
-
};
|
|
936
|
-
|
|
937
827
|
// src/crypto/firefly/metadata.js
|
|
938
828
|
var FIREFLY_metadata = {
|
|
939
829
|
API_KEY: SERVICES_API_KEY.Firefly,
|
|
@@ -995,36 +885,6 @@ var FIREFLY_metadata = {
|
|
|
995
885
|
]
|
|
996
886
|
};
|
|
997
887
|
|
|
998
|
-
// src/crypto/neynar/metadata.js
|
|
999
|
-
var Neynar_metadata = {
|
|
1000
|
-
API_KEY: SERVICES_API_KEY.Neynar,
|
|
1001
|
-
LOGO: "https://framerusercontent.com/images/OS5YeZ2Y7DmszAxL6Zf06pXtKzc.svg",
|
|
1002
|
-
BRAND_COLOR: "#e8e6ff",
|
|
1003
|
-
BRAND_SECONDARY_COLOR: "#28204A",
|
|
1004
|
-
n: "NEYNAR",
|
|
1005
|
-
t: 20,
|
|
1006
|
-
d: "Fetches followers for a given Farcaster username using Neynar's API.",
|
|
1007
|
-
a: "Retrieves followers of a Farcaster user, with support for sorting, pagination, and optional viewer context.",
|
|
1008
|
-
p: [
|
|
1009
|
-
{
|
|
1010
|
-
name: "username",
|
|
1011
|
-
detail: "The Farcaster username whose followers should be fetched.",
|
|
1012
|
-
example: `"miroyato"`,
|
|
1013
|
-
require: "m",
|
|
1014
|
-
type: "number"
|
|
1015
|
-
}
|
|
1016
|
-
],
|
|
1017
|
-
examples: [{
|
|
1018
|
-
title: "NEYNAR",
|
|
1019
|
-
argumentString: '"miroyato"',
|
|
1020
|
-
description: "returns followers for the Farcaster user with the username miroyato."
|
|
1021
|
-
}, {
|
|
1022
|
-
title: "NEYNAR",
|
|
1023
|
-
argumentString: '"alice"',
|
|
1024
|
-
description: "returns followers for the Farcaster user with the username alice."
|
|
1025
|
-
}]
|
|
1026
|
-
};
|
|
1027
|
-
|
|
1028
888
|
// src/crypto/smart-contract/metadata.js
|
|
1029
889
|
var SMARTCONTRACT_metadata = {
|
|
1030
890
|
n: "SMARTCONTRACT",
|
|
@@ -1343,10 +1203,7 @@ var FUNCTION_LOCALE = [
|
|
|
1343
1203
|
SAFE_metadata,
|
|
1344
1204
|
BLOCKSCOUT_metadata,
|
|
1345
1205
|
AAVE_metadata,
|
|
1346
|
-
LENS_metadata,
|
|
1347
|
-
FARCASTER_metadata,
|
|
1348
1206
|
FIREFLY_metadata,
|
|
1349
|
-
Neynar_metadata,
|
|
1350
1207
|
SMARTCONTRACT_metadata,
|
|
1351
1208
|
TALLY_metadata,
|
|
1352
1209
|
DUNESIM_metadata,
|
package/lib/esm/index.mjs
CHANGED
|
@@ -18552,88 +18552,6 @@ async function ETHERSCAN() {
|
|
|
18552
18552
|
}
|
|
18553
18553
|
}
|
|
18554
18554
|
|
|
18555
|
-
const farcasterParamsSchema = objectType({
|
|
18556
|
-
contentType: enumType(['posts', 'replies', 'channels']),
|
|
18557
|
-
identifier: stringType().nonempty(),
|
|
18558
|
-
start: numberType().int().nonnegative().default(0),
|
|
18559
|
-
end: numberType().int().nonnegative().max(MAX_PAGE_LIMIT, {message: `"end" must be less than or equal to ${MAX_PAGE_LIMIT}`}).default(10),
|
|
18560
|
-
});
|
|
18561
|
-
|
|
18562
|
-
/* global window */
|
|
18563
|
-
|
|
18564
|
-
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18571
|
-
async function FARCASTER() {
|
|
18572
|
-
try {
|
|
18573
|
-
const [contentType, identifier, start = 0, end = 10] =
|
|
18574
|
-
argsToArray(arguments);
|
|
18575
|
-
validateParams(farcasterParamsSchema, {
|
|
18576
|
-
contentType,
|
|
18577
|
-
identifier,
|
|
18578
|
-
start,
|
|
18579
|
-
end,
|
|
18580
|
-
});
|
|
18581
|
-
|
|
18582
|
-
const apiKey = window.localStorage.getItem(
|
|
18583
|
-
SERVICES_API_KEY.Firefly
|
|
18584
|
-
);
|
|
18585
|
-
|
|
18586
|
-
const url = new URL(
|
|
18587
|
-
'https://openapi.firefly.land/v1/fileverse/fetch'
|
|
18588
|
-
);
|
|
18589
|
-
url.searchParams.set(
|
|
18590
|
-
'query',
|
|
18591
|
-
identifier
|
|
18592
|
-
.split(',')
|
|
18593
|
-
.map(s => s.trim())
|
|
18594
|
-
.filter(Boolean)
|
|
18595
|
-
.join(',')
|
|
18596
|
-
);
|
|
18597
|
-
const typeMap = {
|
|
18598
|
-
posts: 'farcasterid',
|
|
18599
|
-
replies: 'farcasterpostid',
|
|
18600
|
-
channels: 'farcasterchannels',
|
|
18601
|
-
};
|
|
18602
|
-
url.searchParams.set('type', typeMap[contentType]);
|
|
18603
|
-
url.searchParams.set('start', String(start));
|
|
18604
|
-
url.searchParams.set('end', String(end));
|
|
18605
|
-
|
|
18606
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({ url: url.toString(), serviceName: 'Firefly', headers: { 'x-api-key': apiKey } });
|
|
18607
|
-
|
|
18608
|
-
const response = await fetch(finalUrl, {
|
|
18609
|
-
method: 'GET',
|
|
18610
|
-
headers: HEADERS,
|
|
18611
|
-
});
|
|
18612
|
-
if (!response.ok) {
|
|
18613
|
-
throw new NetworkError(
|
|
18614
|
-
SERVICES_API_KEY.Firefly,
|
|
18615
|
-
response.status
|
|
18616
|
-
)
|
|
18617
|
-
}
|
|
18618
|
-
|
|
18619
|
-
const { data } = await response.json();
|
|
18620
|
-
if (!Array.isArray(data)) return []
|
|
18621
|
-
|
|
18622
|
-
return data.map(item => {
|
|
18623
|
-
const flat = {};
|
|
18624
|
-
for (const [k, v] of Object.entries(item)) {
|
|
18625
|
-
if (v == null || typeof v !== 'object') {
|
|
18626
|
-
flat[k] = v;
|
|
18627
|
-
}
|
|
18628
|
-
}
|
|
18629
|
-
flat.platform = 'farcaster';
|
|
18630
|
-
return flat
|
|
18631
|
-
})
|
|
18632
|
-
} catch (err) {
|
|
18633
|
-
return errorMessageHandler(err, 'FARCASTER')
|
|
18634
|
-
}
|
|
18635
|
-
}
|
|
18636
|
-
|
|
18637
18555
|
const farcasterSchema = objectType({
|
|
18638
18556
|
platform: literalType('farcaster'),
|
|
18639
18557
|
contentType: enumType(['posts', 'replies', 'channels']),
|
|
@@ -18772,165 +18690,6 @@ async function GNOSIS() {
|
|
|
18772
18690
|
}
|
|
18773
18691
|
}
|
|
18774
18692
|
|
|
18775
|
-
const lensParamsSchema = objectType({
|
|
18776
|
-
contentType: enumType(['posts', 'replies']),
|
|
18777
|
-
identifier: stringType().nonempty(),
|
|
18778
|
-
start: numberType().int().nonnegative().default(0),
|
|
18779
|
-
end: numberType().int().nonnegative().max(MAX_PAGE_LIMIT, {message: `"end" must be less than or equal to ${MAX_PAGE_LIMIT}`}).default(10),
|
|
18780
|
-
});
|
|
18781
|
-
|
|
18782
|
-
/* global window */
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
async function LENS() {
|
|
18789
|
-
try {
|
|
18790
|
-
const [contentType, identifier, start = 0, end = 10] =
|
|
18791
|
-
argsToArray(arguments);
|
|
18792
|
-
|
|
18793
|
-
validateParams(lensParamsSchema, {
|
|
18794
|
-
contentType,
|
|
18795
|
-
identifier,
|
|
18796
|
-
start,
|
|
18797
|
-
end,
|
|
18798
|
-
});
|
|
18799
|
-
|
|
18800
|
-
const apiKey = window.localStorage.getItem(
|
|
18801
|
-
SERVICES_API_KEY.Firefly
|
|
18802
|
-
);
|
|
18803
|
-
|
|
18804
|
-
const url = new URL(
|
|
18805
|
-
'https://openapi.firefly.land/v1/fileverse/fetch'
|
|
18806
|
-
);
|
|
18807
|
-
url.searchParams.set(
|
|
18808
|
-
'query',
|
|
18809
|
-
identifier
|
|
18810
|
-
.split(',')
|
|
18811
|
-
.map((s) => s.trim())
|
|
18812
|
-
.filter(Boolean)
|
|
18813
|
-
.join(',')
|
|
18814
|
-
);
|
|
18815
|
-
const typeMap = {
|
|
18816
|
-
posts: 'lensid',
|
|
18817
|
-
replies: 'lenspostid',
|
|
18818
|
-
};
|
|
18819
|
-
url.searchParams.set('type', typeMap[contentType]);
|
|
18820
|
-
url.searchParams.set('start', String(start));
|
|
18821
|
-
url.searchParams.set('end', String(end));
|
|
18822
|
-
|
|
18823
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({ url: url.toString(), serviceName: 'Firefly', headers: { 'x-api-key': apiKey } });
|
|
18824
|
-
|
|
18825
|
-
const response = await fetch(finalUrl, {
|
|
18826
|
-
method: 'GET',
|
|
18827
|
-
headers: HEADERS,
|
|
18828
|
-
});
|
|
18829
|
-
if (!response.ok) {
|
|
18830
|
-
throw new NetworkError(SERVICES_API_KEY.Firefly, response.status)
|
|
18831
|
-
}
|
|
18832
|
-
|
|
18833
|
-
const { data } = await response.json();
|
|
18834
|
-
if (!Array.isArray(data)) return []
|
|
18835
|
-
|
|
18836
|
-
return data.map((item) => {
|
|
18837
|
-
const flat = {};
|
|
18838
|
-
for (const [key, value] of Object.entries(item)) {
|
|
18839
|
-
if (value == null || typeof value !== 'object') {
|
|
18840
|
-
flat[key] = value;
|
|
18841
|
-
}
|
|
18842
|
-
}
|
|
18843
|
-
flat.platform = 'lens';
|
|
18844
|
-
return flat
|
|
18845
|
-
})
|
|
18846
|
-
} catch (err) {
|
|
18847
|
-
return errorMessageHandler(err, 'LENS')
|
|
18848
|
-
}
|
|
18849
|
-
}
|
|
18850
|
-
|
|
18851
|
-
const neynarParamsSchema = objectType({
|
|
18852
|
-
username: stringType().nonempty()
|
|
18853
|
-
});
|
|
18854
|
-
|
|
18855
|
-
const fromUsernameToFid = async (username, apiKey) => {
|
|
18856
|
-
if (!username) return null
|
|
18857
|
-
const url = `https://api.neynar.com/v2/farcaster/user/search/?q=${username}&limit=5`;
|
|
18858
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({
|
|
18859
|
-
url, serviceName: 'Neynar', headers: {
|
|
18860
|
-
'x-api-key': apiKey,
|
|
18861
|
-
'x-neynar-experimental': 'false'
|
|
18862
|
-
}
|
|
18863
|
-
});
|
|
18864
|
-
|
|
18865
|
-
const res = await fetch(finalUrl, {
|
|
18866
|
-
method: 'GET',
|
|
18867
|
-
headers: HEADERS,
|
|
18868
|
-
});
|
|
18869
|
-
const json = await res.json();
|
|
18870
|
-
const users = json.result ? json.result.users : [];
|
|
18871
|
-
const user = users.find(user => user.username === username);
|
|
18872
|
-
return user && user.fid || null;
|
|
18873
|
-
};
|
|
18874
|
-
var fromUsernameToFid$1 = {
|
|
18875
|
-
fromUsernameToFid
|
|
18876
|
-
};
|
|
18877
|
-
|
|
18878
|
-
/* global window */
|
|
18879
|
-
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
async function NEYNAR() {
|
|
18887
|
-
try {
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
const [username] = argsToArray(arguments);
|
|
18891
|
-
|
|
18892
|
-
validateParams(neynarParamsSchema, { username });
|
|
18893
|
-
|
|
18894
|
-
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
|
|
18895
|
-
|
|
18896
|
-
const fid = await fromUsernameToFid$1.fromUsernameToFid(username, apiKey);
|
|
18897
|
-
if (!fid) throw new ValidationError(`Invalid username: ${username}`)
|
|
18898
|
-
|
|
18899
|
-
const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
|
|
18900
|
-
|
|
18901
|
-
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({
|
|
18902
|
-
url: url.toString(), serviceName: 'Neynar',
|
|
18903
|
-
headers: {
|
|
18904
|
-
'x-api-key': apiKey,
|
|
18905
|
-
'x-neynar-experimental': 'false'
|
|
18906
|
-
}
|
|
18907
|
-
|
|
18908
|
-
});
|
|
18909
|
-
|
|
18910
|
-
const response = await fetch(finalUrl, {
|
|
18911
|
-
method: 'GET',
|
|
18912
|
-
headers: HEADERS,
|
|
18913
|
-
});
|
|
18914
|
-
if (!response.ok) {
|
|
18915
|
-
throw new NetworkError(SERVICES_API_KEY.Neynar, response.status)
|
|
18916
|
-
}
|
|
18917
|
-
|
|
18918
|
-
const json = await response.json();
|
|
18919
|
-
const users = json?.users || [];
|
|
18920
|
-
if (!users.length) return []
|
|
18921
|
-
|
|
18922
|
-
return users.map(({ user }) => ({
|
|
18923
|
-
username: user.username,
|
|
18924
|
-
custody_address: user.custody_address,
|
|
18925
|
-
follower_count: user.follower_count,
|
|
18926
|
-
country: user.profile?.location?.address?.country || '',
|
|
18927
|
-
city: user.profile?.location?.address?.city || '',
|
|
18928
|
-
}))
|
|
18929
|
-
} catch (err) {
|
|
18930
|
-
return errorMessageHandler(err, 'NEYNAR')
|
|
18931
|
-
}
|
|
18932
|
-
}
|
|
18933
|
-
|
|
18934
18693
|
const safeParamsSchema = objectType({
|
|
18935
18694
|
address: stringType().nonempty(),
|
|
18936
18695
|
utility: literalType('txns'),
|
|
@@ -30064,4 +29823,4 @@ function MYANIMELIST() {
|
|
|
30064
29823
|
|
|
30065
29824
|
const utils = { errors, symbols, date };
|
|
30066
29825
|
|
|
30067
|
-
export { AAVE, ABS, ACCRINT, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AND, ARABIC, ARTEMIS, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, BLOCKSCOUT, CEILING, CEILINGMATH, CEILINGPRECISE, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CIRCLES, CLEAN, CODE, COINGECKO, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYS, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEFILLAMA, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DUNE, DVAR, DVARP, EDATE, EFFECT, EOA, EOMONTH, EPOCHTODATE, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, ETHERSCAN, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE,
|
|
29826
|
+
export { AAVE, ABS, ACCRINT, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AND, ARABIC, ARTEMIS, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, BLOCKSCOUT, CEILING, CEILINGMATH, CEILINGPRECISE, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CIRCLES, CLEAN, CODE, COINGECKO, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYS, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEFILLAMA, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DUNE, DVAR, DVARP, EDATE, EFFECT, EOA, EOMONTH, EPOCHTODATE, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, ETHERSCAN, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FDIST, FDISTRT, FIND, FINV, FINVRT, FIREFLY, FISHER, FISHERINV, FIXED, FLOOR, FLOORMATH, FLOORPRECISE, FLVURL, FORECAST, FREQUENCY, FTEST, FV, FVSCHEDULE, GAMMA, GAMMADIST, GAMMAINV, GAMMALN, GAMMALNPRECISE, GAUSS, GCD, GEOMEAN, GESTEP, GNOSIS, GROWTH, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, HOUR, HYPGEOM, HYPGEOMDIST, IF, IFERROR, IFNA, IFS, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, INDEX, INT, INTERCEPT, IPMT, IRR, ISBLANK, ISDATE, ISERR, ISERROR, ISEVEN, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISO, ISODD, ISOWEEKNUM, ISPMT, ISTEXT, KURT, LARGE, LCM, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MEDIAN, MEERKAT, MID, MIN, MINA, MINIFS, MINUS$1 as MINUS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, MYANIMELIST, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NETWORKDAYS_INTL, NOMINAL, NORM, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV, NUMBERVALUE, OCT2BIN, OCT2DEC, OCT2HEX, ODD, OR, PDURATION, PEARSON, PERCENTILE, PERCENTILEEXC, PERCENTILEINC, PERCENTRANK, PERCENTRANKEXC, PERCENTRANKINC, PERMUT, PERMUTATIONA, PHI, PI, PMT, PNL, POISSON, POISSONDIST, POLYMARKET, POWER, PPMT, PRICE, PRICEDISC, PRIVACYPOOL, PROB, PRODUCT, PROPER, PV, QUARTILE, QUARTILEEXC, QUARTILEINC, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANK, RANKAVG, RANKEQ, RATE, REPLACE, REPT, RIGHT, ROMAN, ROTKI, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RRI, RSQ, SAFE, SEARCH, SEC, SECH, SECOND, SEQUENCE, SERIESSUM, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, SMARTCONTRACT, SORT, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STDEVS, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SWITCH, SYD, T, TALLY, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TDISTRT, TEXT, TEXTJOIN, TIME, TIMEVALUE, TINV, TODAY, TRANSPOSE, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE, UNICHAR, UNICODE, UNIQUE, UNISWAP, UPPER, VALUE, VAR, VARA, VARP, VARPA, VARS, VLOOKUP, WALLET, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, WORKDAY_INTL, XIRR, XLOOKUP, XNPV, XOR, YEAR, YEARFRAC, YIELD, Z, ZTEST, utils };
|