@fileverse-dev/formulajs 4.4.11-mod-64-patch-1 → 4.4.11-mod-65
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 +810 -1102
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +255 -527
- package/lib/esm/crypto-constants.mjs +51 -41
- package/lib/esm/index.mjs +254 -528
- package/package.json +3 -5
- package/types/cjs/index.d.cts +23 -12
- package/types/esm/index.d.mts +23 -12
package/lib/esm/index.mjs
CHANGED
|
@@ -7012,6 +7012,26 @@ function SUM() {
|
|
|
7012
7012
|
return result
|
|
7013
7013
|
}
|
|
7014
7014
|
|
|
7015
|
+
function MINUS$1() {
|
|
7016
|
+
const args = argsToArray(arguments);
|
|
7017
|
+
if (args.length !== 2) {
|
|
7018
|
+
return value; // or some other error message
|
|
7019
|
+
}
|
|
7020
|
+
|
|
7021
|
+
const num1 = args[0];
|
|
7022
|
+
const num2 = args[1];
|
|
7023
|
+
|
|
7024
|
+
if (num1 instanceof Error || num2 instanceof Error) {
|
|
7025
|
+
return num1 instanceof Error ? num1 : num2;
|
|
7026
|
+
}
|
|
7027
|
+
|
|
7028
|
+
if (typeof num1 !== 'number' || typeof num2 !== 'number') {
|
|
7029
|
+
return value; // or some other error message
|
|
7030
|
+
}
|
|
7031
|
+
|
|
7032
|
+
return num1 - num2;
|
|
7033
|
+
}
|
|
7034
|
+
|
|
7015
7035
|
/**
|
|
7016
7036
|
* Adds the values specified by a given criteria.
|
|
7017
7037
|
*
|
|
@@ -13096,19 +13116,15 @@ const SAFE_CHAIN_MAP = {
|
|
|
13096
13116
|
};
|
|
13097
13117
|
|
|
13098
13118
|
const ERROR_MESSAGES_FLAG = {
|
|
13099
|
-
INVALID_API_KEY: '
|
|
13100
|
-
RATE_LIMIT: '
|
|
13101
|
-
DEFAULT: '
|
|
13102
|
-
MISSING_KEY: '
|
|
13103
|
-
INVALID_CHAIN: '
|
|
13104
|
-
INVALID_TYPE: '
|
|
13105
|
-
INVALID_ADDRESS: '
|
|
13106
|
-
INVALID_PARAM: '
|
|
13107
|
-
MAX_PAGE_LIMIT: '
|
|
13108
|
-
NETWORK_ERROR: 'NETWORK_ERROR',
|
|
13109
|
-
ENS: 'ENS',
|
|
13110
|
-
CUSTOM: 'CUSTOM',
|
|
13111
|
-
MISSING_PARAM: 'MISSING_PARAM'
|
|
13119
|
+
INVALID_API_KEY: '_INVALID_KEY',
|
|
13120
|
+
RATE_LIMIT: '_RATE_LIMIT_REACHED',
|
|
13121
|
+
DEFAULT: 'FETCH_ERROR',
|
|
13122
|
+
MISSING_KEY: '_MISSING',
|
|
13123
|
+
INVALID_CHAIN: '_INVALID_CHAIN',
|
|
13124
|
+
INVALID_TYPE: '_INVALID_TYPE',
|
|
13125
|
+
INVALID_ADDRESS: '_INVALID_ADDRESS',
|
|
13126
|
+
INVALID_PARAM: '_INVALID_PARAM',
|
|
13127
|
+
MAX_PAGE_LIMIT: 'Max page limit is 250'
|
|
13112
13128
|
};
|
|
13113
13129
|
|
|
13114
13130
|
const UTILITY = {
|
|
@@ -13116,16 +13132,16 @@ const UTILITY = {
|
|
|
13116
13132
|
};
|
|
13117
13133
|
const MAX_PAGE_LIMIT = 250;
|
|
13118
13134
|
|
|
13119
|
-
const
|
|
13120
|
-
Etherscan: '
|
|
13121
|
-
Coingecko: '
|
|
13122
|
-
Safe: '
|
|
13123
|
-
Basescan: '
|
|
13124
|
-
Gnosisscan: '
|
|
13125
|
-
Firefly: '
|
|
13126
|
-
GnosisPay: '
|
|
13127
|
-
Neynar: '
|
|
13128
|
-
Defillama: '
|
|
13135
|
+
const SERVICE_API_KEY = {
|
|
13136
|
+
Etherscan: 'ETHERSCAN_API_KEY',
|
|
13137
|
+
Coingecko: 'COINGECKO_API_KEY',
|
|
13138
|
+
Safe: 'SAFE_API_KEY',
|
|
13139
|
+
Basescan: 'BASESCAN_API_KEY',
|
|
13140
|
+
Gnosisscan: 'GNOSIS_API_KEY',
|
|
13141
|
+
Firefly: 'FIRE_FLY_API_KEY',
|
|
13142
|
+
GnosisPay: 'GNOSIS_API_KEY',
|
|
13143
|
+
Neynar: 'NEYNAR_API_KEY',
|
|
13144
|
+
Defillama: 'DEFILLAMA_API_KEY'
|
|
13129
13145
|
};
|
|
13130
13146
|
|
|
13131
13147
|
const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
|
|
@@ -13138,10 +13154,6 @@ if(!timestamp || !chain || !apiKey) return
|
|
|
13138
13154
|
|
|
13139
13155
|
};
|
|
13140
13156
|
|
|
13141
|
-
var fromTimestampToBlock = {
|
|
13142
|
-
fromTimeStampToBlock
|
|
13143
|
-
};
|
|
13144
|
-
|
|
13145
13157
|
function toTimestamp(dateStr) {
|
|
13146
13158
|
// Expecting format: "DD/MM/YYYY"
|
|
13147
13159
|
const [day, month, year] = dateStr.split("/").map(Number);
|
|
@@ -13153,16 +13165,6 @@ const isAddress = (input) => {
|
|
|
13153
13165
|
return (/^0x[a-fA-F0-9]{40}$/.test(input))
|
|
13154
13166
|
};
|
|
13155
13167
|
|
|
13156
|
-
var isAddress$1 = {
|
|
13157
|
-
isAddress
|
|
13158
|
-
};
|
|
13159
|
-
|
|
13160
|
-
/* global document */
|
|
13161
|
-
/* global window */
|
|
13162
|
-
/* global ethers */
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
13168
|
async function fromEnsNameToAddress(name) {
|
|
13167
13169
|
if (typeof ethers === 'undefined') {
|
|
13168
13170
|
await new Promise((resolve, reject) => {
|
|
@@ -13190,166 +13192,33 @@ async function fromEnsNameToAddress(name) {
|
|
|
13190
13192
|
}
|
|
13191
13193
|
}
|
|
13192
13194
|
|
|
13193
|
-
var fromEnsNameToAddress$1 = {
|
|
13194
|
-
fromEnsNameToAddress
|
|
13195
|
-
};
|
|
13196
|
-
|
|
13197
|
-
const errorMessageHandler = (errorFlag, input, functionName) => {
|
|
13198
|
-
if (!functionName) {
|
|
13199
|
-
const stack = new Error().stack?.split('\n')[2];
|
|
13200
|
-
const match = stack?.match(/at (\w+)/);
|
|
13201
|
-
functionName = match?.[1];
|
|
13202
|
-
}
|
|
13203
|
-
|
|
13204
|
-
switch (errorFlag) {
|
|
13205
|
-
case ERROR_MESSAGES_FLAG.INVALID_ADDRESS:
|
|
13206
|
-
return {
|
|
13207
|
-
message: `${input} is not a supported address`,
|
|
13208
|
-
functionName,
|
|
13209
|
-
type: errorFlag
|
|
13210
|
-
}
|
|
13211
|
-
|
|
13212
|
-
case ERROR_MESSAGES_FLAG.INVALID_PARAM: {
|
|
13213
|
-
const key = Object.keys(input)[0];
|
|
13214
|
-
const value = input[key];
|
|
13215
|
-
return {
|
|
13216
|
-
message: `${value} is an invalid value for ${key}`,
|
|
13217
|
-
functionName,
|
|
13218
|
-
type: errorFlag
|
|
13219
|
-
}
|
|
13220
|
-
}
|
|
13221
|
-
|
|
13222
|
-
case ERROR_MESSAGES_FLAG.INVALID_CHAIN:
|
|
13223
|
-
return {
|
|
13224
|
-
message: `${input} is not a supported chain for this function `,
|
|
13225
|
-
functionName,
|
|
13226
|
-
type: errorFlag
|
|
13227
|
-
}
|
|
13228
|
-
|
|
13229
|
-
case ERROR_MESSAGES_FLAG.RATE_LIMIT:
|
|
13230
|
-
return {
|
|
13231
|
-
message: `Rate limit for ${input || functionName || 'this api'} has been reached`,
|
|
13232
|
-
functionName,
|
|
13233
|
-
type: errorFlag
|
|
13234
|
-
}
|
|
13235
|
-
|
|
13236
|
-
case ERROR_MESSAGES_FLAG.MISSING_KEY:
|
|
13237
|
-
return {
|
|
13238
|
-
message: `Api key for ${input || functionName || 'this api'} is missing`,
|
|
13239
|
-
functionName,
|
|
13240
|
-
type: errorFlag
|
|
13241
|
-
}
|
|
13242
|
-
|
|
13243
|
-
case ERROR_MESSAGES_FLAG.NETWORK_ERROR:
|
|
13244
|
-
if (input === 429) {
|
|
13245
|
-
return {
|
|
13246
|
-
message: `Rate limit for ${functionName || 'this function'} has been reached`,
|
|
13247
|
-
functionName,
|
|
13248
|
-
type: ERROR_MESSAGES_FLAG.RATE_LIMIT
|
|
13249
|
-
}
|
|
13250
|
-
}
|
|
13251
|
-
return {
|
|
13252
|
-
message: `Api failed with status code ${input}`,
|
|
13253
|
-
functionName,
|
|
13254
|
-
type: errorFlag
|
|
13255
|
-
}
|
|
13256
|
-
|
|
13257
|
-
case ERROR_MESSAGES_FLAG.MISSING_PARAM:
|
|
13258
|
-
return {
|
|
13259
|
-
message: `Missing param: ${input}`,
|
|
13260
|
-
functionName,
|
|
13261
|
-
type: errorFlag
|
|
13262
|
-
}
|
|
13263
|
-
|
|
13264
|
-
case ERROR_MESSAGES_FLAG.ENS:
|
|
13265
|
-
return {
|
|
13266
|
-
message: `${input} is not a supported ens name`,
|
|
13267
|
-
functionName,
|
|
13268
|
-
type: errorFlag
|
|
13269
|
-
}
|
|
13270
|
-
|
|
13271
|
-
case ERROR_MESSAGES_FLAG.CUSTOM:
|
|
13272
|
-
return {
|
|
13273
|
-
message: input.message,
|
|
13274
|
-
functionName,
|
|
13275
|
-
type: errorFlag,
|
|
13276
|
-
reason: input.reason || input.message
|
|
13277
|
-
}
|
|
13278
|
-
|
|
13279
|
-
case ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT:
|
|
13280
|
-
return {
|
|
13281
|
-
message: `Max page limit is ${MAX_PAGE_LIMIT}`,
|
|
13282
|
-
functionName,
|
|
13283
|
-
type: errorFlag
|
|
13284
|
-
}
|
|
13285
|
-
|
|
13286
|
-
case ERROR_MESSAGES_FLAG.INVALID_API_KEY:
|
|
13287
|
-
return {
|
|
13288
|
-
message: `${input}: Invalid API key`,
|
|
13289
|
-
functionName,
|
|
13290
|
-
type: errorFlag
|
|
13291
|
-
}
|
|
13292
|
-
|
|
13293
|
-
default:
|
|
13294
|
-
return {
|
|
13295
|
-
message: 'An unexpected error occured',
|
|
13296
|
-
functionName,
|
|
13297
|
-
type: errorFlag,
|
|
13298
|
-
reason: input
|
|
13299
|
-
}
|
|
13300
|
-
}
|
|
13301
|
-
};
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
const checkRequiredParams = (inputMap) => {
|
|
13308
|
-
for (const key in inputMap) {
|
|
13309
|
-
if (!inputMap[key]) {
|
|
13310
|
-
const stack = new Error().stack?.split('\n')[2];
|
|
13311
|
-
const match = stack?.match(/at (\w+)/);
|
|
13312
|
-
const parentFunctionName = match?.[1];
|
|
13313
|
-
const paramName = key;
|
|
13314
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_PARAM, paramName, parentFunctionName)
|
|
13315
|
-
}
|
|
13316
|
-
}
|
|
13317
|
-
};
|
|
13318
|
-
|
|
13319
13195
|
async function handleScanRequest({
|
|
13196
|
+
scanKey,
|
|
13197
|
+
baseUrl,
|
|
13320
13198
|
type,
|
|
13199
|
+
chain,
|
|
13321
13200
|
address,
|
|
13322
13201
|
startDate,
|
|
13323
13202
|
endDate,
|
|
13324
13203
|
page = 1,
|
|
13325
|
-
offset = 10
|
|
13326
|
-
apiKey,
|
|
13327
|
-
functionName,
|
|
13328
|
-
chainId,
|
|
13329
|
-
network
|
|
13204
|
+
offset = 10
|
|
13330
13205
|
}) {
|
|
13331
|
-
const
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
if (!isAddress$1.isAddress(address)) {
|
|
13338
|
-
const ensName = address;
|
|
13339
|
-
address = await fromEnsNameToAddress$1.fromEnsNameToAddress(address);
|
|
13340
|
-
if (!address) {
|
|
13341
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.ENS, ensName, functionName)
|
|
13342
|
-
}
|
|
13206
|
+
const API_KEY = window.localStorage.getItem(scanKey);
|
|
13207
|
+
if (!API_KEY) return `${scanKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13208
|
+
if (API_KEY === 'xxxx') return `${scanKey}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
13209
|
+
if (offset > MAX_PAGE_LIMIT) {
|
|
13210
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13343
13211
|
}
|
|
13344
13212
|
|
|
13345
|
-
|
|
13346
|
-
|
|
13213
|
+
let chainId = CHAIN_ID_MAP[chain?.toLowerCase()];
|
|
13214
|
+
if (!chainId) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_CHAIN}`
|
|
13347
13215
|
|
|
13348
|
-
if (!
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13216
|
+
if (!isAddress(address)) {
|
|
13217
|
+
address = await fromEnsNameToAddress(address);
|
|
13218
|
+
}
|
|
13219
|
+
|
|
13220
|
+
if (!address) {
|
|
13221
|
+
return `${address}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13353
13222
|
}
|
|
13354
13223
|
|
|
13355
13224
|
const ACTION_MAP = {
|
|
@@ -13360,40 +13229,41 @@ async function handleScanRequest({
|
|
|
13360
13229
|
};
|
|
13361
13230
|
|
|
13362
13231
|
const action = ACTION_MAP[type];
|
|
13363
|
-
if (!action) return
|
|
13232
|
+
if (!action) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13233
|
+
|
|
13234
|
+
if (scanKey === SERVICE_API_KEY.Basescan) chainId = 'base';
|
|
13235
|
+
if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = 'gnosis';
|
|
13364
13236
|
|
|
13365
|
-
let url = `${baseUrl}?chainid=${chainId}&module=account&action=${action}&apikey=${
|
|
13237
|
+
let url = `${baseUrl}?chainid=${chainId}&module=account&action=${action}&apikey=${API_KEY}`;
|
|
13366
13238
|
|
|
13367
13239
|
if (['all-txns', 'token-txns', 'nft-txns'].includes(type)) {
|
|
13240
|
+
if (!address) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_ADDRESS}`
|
|
13368
13241
|
url += `&address=${address}&startblock=0&endblock=99999999&sort=asc`;
|
|
13369
13242
|
|
|
13370
13243
|
if (!isNaN(startDate) && !isNaN(endDate)) {
|
|
13371
13244
|
const [startBlock, endBlock] = await Promise.all([
|
|
13372
|
-
|
|
13373
|
-
|
|
13245
|
+
fromTimeStampToBlock(toTimestamp(startDate), chain, API_KEY),
|
|
13246
|
+
fromTimeStampToBlock(toTimestamp(endDate), chain, API_KEY)
|
|
13374
13247
|
]);
|
|
13375
|
-
url += `&startblock=${startBlock
|
|
13248
|
+
url += `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13376
13249
|
}
|
|
13377
13250
|
url += `&page=${page}&offset=${offset}`;
|
|
13378
13251
|
}
|
|
13379
13252
|
|
|
13380
13253
|
try {
|
|
13381
13254
|
const res = await fetch(url);
|
|
13382
|
-
if (!res.ok) {
|
|
13383
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status, functionName)
|
|
13384
|
-
}
|
|
13255
|
+
if (!res.ok) throw new Error(`HTTP error: ${res.status}`)
|
|
13385
13256
|
const json = await res.json();
|
|
13386
13257
|
|
|
13387
13258
|
if (typeof json.result === 'string') {
|
|
13388
|
-
if (json.result.includes('Invalid API Key'))
|
|
13389
|
-
|
|
13390
|
-
if (json.result.includes('Max rate limit reached'))
|
|
13391
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.RATE_LIMIT, apiInfo.apiKeyName, functionName)
|
|
13259
|
+
if (json.result.includes('Invalid API Key')) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
|
|
13260
|
+
if (json.result.includes('Max rate limit reached')) return `${scanKey}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
13392
13261
|
}
|
|
13393
13262
|
|
|
13394
13263
|
return json.result
|
|
13395
13264
|
} catch (err) {
|
|
13396
|
-
|
|
13265
|
+
console.error(`[${scanKey}]`, err);
|
|
13266
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13397
13267
|
}
|
|
13398
13268
|
}
|
|
13399
13269
|
|
|
@@ -13411,9 +13281,6 @@ const fromUsernameToFid = async (username, apiKey) => {
|
|
|
13411
13281
|
const user = users.find(user => user.username === username);
|
|
13412
13282
|
return user && user.fid || null;
|
|
13413
13283
|
};
|
|
13414
|
-
var fromUsernameToFid$1 = {
|
|
13415
|
-
fromUsernameToFid
|
|
13416
|
-
};
|
|
13417
13284
|
|
|
13418
13285
|
// remove nested structure from the response
|
|
13419
13286
|
const removeNestedStructure = (json) => {
|
|
@@ -13428,22 +13295,13 @@ const removeNestedStructure = (json) => {
|
|
|
13428
13295
|
});
|
|
13429
13296
|
};
|
|
13430
13297
|
|
|
13431
|
-
/* global window */
|
|
13432
|
-
|
|
13433
13298
|
async function FIREFLY() {
|
|
13434
13299
|
const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13435
|
-
const missingParamsError = checkRequiredParams({ platform, contentType, identifier });
|
|
13436
|
-
|
|
13437
|
-
if (missingParamsError) {
|
|
13438
|
-
return missingParamsError
|
|
13439
|
-
}
|
|
13440
|
-
|
|
13441
13300
|
if (end > MAX_PAGE_LIMIT) {
|
|
13442
|
-
return
|
|
13301
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13443
13302
|
}
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Firefly)
|
|
13303
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
13304
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13447
13305
|
|
|
13448
13306
|
const baseUrl = 'https://openapi.firefly.land/v1/fileverse/fetch';
|
|
13449
13307
|
const headers = { 'x-api-key': API_KEY };
|
|
@@ -13459,14 +13317,10 @@ async function FIREFLY() {
|
|
|
13459
13317
|
replies: 'lenspostid'
|
|
13460
13318
|
}
|
|
13461
13319
|
};
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
const platformContentType = platformType[contentType];
|
|
13467
|
-
if (!platformContentType) {
|
|
13468
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { contentType })
|
|
13469
|
-
}
|
|
13320
|
+
|
|
13321
|
+
const platformType = typeMap[platform]?.[contentType];
|
|
13322
|
+
if (!platformType) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13323
|
+
|
|
13470
13324
|
const query = identifier
|
|
13471
13325
|
.split(',')
|
|
13472
13326
|
.map((s) => s.trim())
|
|
@@ -13481,7 +13335,7 @@ async function FIREFLY() {
|
|
|
13481
13335
|
|
|
13482
13336
|
try {
|
|
13483
13337
|
const res = await fetch(url.toString(), { headers });
|
|
13484
|
-
if (!res.ok)
|
|
13338
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
13485
13339
|
|
|
13486
13340
|
const json = await res.json();
|
|
13487
13341
|
if (!Array.isArray(json?.data)) return []
|
|
@@ -13497,21 +13351,19 @@ async function FIREFLY() {
|
|
|
13497
13351
|
return flat
|
|
13498
13352
|
})
|
|
13499
13353
|
} catch (err) {
|
|
13500
|
-
|
|
13354
|
+
console.error('FIREFLY fetch error:', err);
|
|
13355
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13501
13356
|
}
|
|
13502
13357
|
}
|
|
13503
13358
|
|
|
13504
13359
|
async function LENS() {
|
|
13505
13360
|
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13506
|
-
const
|
|
13507
|
-
if (
|
|
13508
|
-
|
|
13509
|
-
}
|
|
13361
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
13362
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13363
|
+
|
|
13510
13364
|
if (end > MAX_PAGE_LIMIT) {
|
|
13511
|
-
return
|
|
13365
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13512
13366
|
}
|
|
13513
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
|
|
13514
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Firefly)
|
|
13515
13367
|
|
|
13516
13368
|
const baseUrl = 'https://openapi.firefly.land/v1/fileverse/fetch';
|
|
13517
13369
|
const headers = { 'x-api-key': API_KEY };
|
|
@@ -13520,10 +13372,10 @@ async function LENS() {
|
|
|
13520
13372
|
posts: 'lensid',
|
|
13521
13373
|
replies: 'lenspostid'
|
|
13522
13374
|
};
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13375
|
+
|
|
13376
|
+
const platformType = typeMap[contentType];
|
|
13377
|
+
if (!platformType) return `Lens: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13378
|
+
|
|
13527
13379
|
const query = identifier
|
|
13528
13380
|
.split(',')
|
|
13529
13381
|
.map((s) => s.trim())
|
|
@@ -13532,15 +13384,13 @@ async function LENS() {
|
|
|
13532
13384
|
|
|
13533
13385
|
const url = new URL(baseUrl);
|
|
13534
13386
|
url.searchParams.set('query', query);
|
|
13535
|
-
url.searchParams.set('type',
|
|
13387
|
+
url.searchParams.set('type', platformType);
|
|
13536
13388
|
url.searchParams.set('start', String(start));
|
|
13537
13389
|
url.searchParams.set('end', String(end));
|
|
13538
13390
|
|
|
13539
13391
|
try {
|
|
13540
13392
|
const res = await fetch(url.toString(), { headers });
|
|
13541
|
-
if (!res.ok) {
|
|
13542
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
13543
|
-
}
|
|
13393
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
13544
13394
|
|
|
13545
13395
|
const json = await res.json();
|
|
13546
13396
|
if (!Array.isArray(json?.data)) return []
|
|
@@ -13556,21 +13406,18 @@ async function LENS() {
|
|
|
13556
13406
|
return flat
|
|
13557
13407
|
})
|
|
13558
13408
|
} catch (err) {
|
|
13559
|
-
|
|
13409
|
+
console.error('LENS fetch error:', err);
|
|
13410
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13560
13411
|
}
|
|
13561
13412
|
}
|
|
13562
13413
|
|
|
13563
13414
|
async function FARCASTER() {
|
|
13564
13415
|
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13565
|
-
const
|
|
13566
|
-
if (
|
|
13567
|
-
return missingParamsError
|
|
13568
|
-
}
|
|
13416
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
13417
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13569
13418
|
if (end > MAX_PAGE_LIMIT) {
|
|
13570
|
-
return
|
|
13419
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13571
13420
|
}
|
|
13572
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
|
|
13573
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Firefly)
|
|
13574
13421
|
const baseUrl = 'https://openapi.firefly.land/v1/fileverse/fetch';
|
|
13575
13422
|
const headers = { 'x-api-key': API_KEY };
|
|
13576
13423
|
|
|
@@ -13580,10 +13427,9 @@ async function FARCASTER() {
|
|
|
13580
13427
|
channels: 'farcasterchannels'
|
|
13581
13428
|
};
|
|
13582
13429
|
|
|
13583
|
-
const
|
|
13584
|
-
if (!
|
|
13585
|
-
|
|
13586
|
-
}
|
|
13430
|
+
const platformType = typeMap[contentType];
|
|
13431
|
+
if (!platformType) return `Farcaster: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13432
|
+
|
|
13587
13433
|
const query = identifier
|
|
13588
13434
|
.split(',')
|
|
13589
13435
|
.map((s) => s.trim())
|
|
@@ -13592,13 +13438,13 @@ async function FARCASTER() {
|
|
|
13592
13438
|
|
|
13593
13439
|
const url = new URL(baseUrl);
|
|
13594
13440
|
url.searchParams.set('query', query);
|
|
13595
|
-
url.searchParams.set('type',
|
|
13441
|
+
url.searchParams.set('type', platformType);
|
|
13596
13442
|
url.searchParams.set('start', String(start));
|
|
13597
13443
|
url.searchParams.set('end', String(end));
|
|
13598
13444
|
|
|
13599
13445
|
try {
|
|
13600
13446
|
const res = await fetch(url.toString(), { headers });
|
|
13601
|
-
if (!res.ok)
|
|
13447
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
13602
13448
|
|
|
13603
13449
|
const json = await res.json();
|
|
13604
13450
|
if (!Array.isArray(json?.data)) return []
|
|
@@ -13614,24 +13460,24 @@ async function FARCASTER() {
|
|
|
13614
13460
|
return flat
|
|
13615
13461
|
})
|
|
13616
13462
|
} catch (err) {
|
|
13617
|
-
|
|
13463
|
+
console.error('Farcaster fetch error:', err);
|
|
13464
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13618
13465
|
}
|
|
13619
13466
|
}
|
|
13620
13467
|
|
|
13621
13468
|
async function BLOCKSCOUT() {
|
|
13622
13469
|
let [address, type, chain, startTimestamp, endTimestamp, page = 1, offset = 10] = argsToArray(arguments);
|
|
13623
|
-
const missingParamsError = checkRequiredParams({ address, type });
|
|
13624
|
-
|
|
13625
|
-
if (missingParamsError) {
|
|
13626
|
-
return missingParamsError
|
|
13627
|
-
}
|
|
13628
13470
|
if (offset > MAX_PAGE_LIMIT) {
|
|
13629
|
-
return
|
|
13471
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13630
13472
|
}
|
|
13631
13473
|
if (!chain) {
|
|
13632
13474
|
chain = 'ethereum';
|
|
13633
13475
|
}
|
|
13634
13476
|
|
|
13477
|
+
if (!type) {
|
|
13478
|
+
return 'TYPE_MISSING'
|
|
13479
|
+
}
|
|
13480
|
+
|
|
13635
13481
|
if (!startTimestamp) {
|
|
13636
13482
|
const currentTimestamp = Date.now();
|
|
13637
13483
|
startTimestamp = currentTimestamp - 30 * 24 * 60 * 60 * 1000;
|
|
@@ -13646,19 +13492,16 @@ async function BLOCKSCOUT() {
|
|
|
13646
13492
|
endTimestamp = toTimestamp(endTimestamp);
|
|
13647
13493
|
}
|
|
13648
13494
|
|
|
13649
|
-
if (!isAddress
|
|
13650
|
-
|
|
13651
|
-
address = await fromEnsNameToAddress$1.fromEnsNameToAddress(address);
|
|
13652
|
-
if (!address) {
|
|
13653
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.ENS, ensName)
|
|
13654
|
-
}
|
|
13495
|
+
if (!isAddress(address)) {
|
|
13496
|
+
address = await fromEnsNameToAddress(address);
|
|
13655
13497
|
}
|
|
13656
|
-
const hostname = BLOCKSCOUT_CHAINS_MAP[chain];
|
|
13657
13498
|
|
|
13658
|
-
if (!
|
|
13659
|
-
return
|
|
13499
|
+
if (!address) {
|
|
13500
|
+
return `${address}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13660
13501
|
}
|
|
13661
13502
|
|
|
13503
|
+
const hostname = BLOCKSCOUT_CHAINS_MAP[chain];
|
|
13504
|
+
|
|
13662
13505
|
let requestUrl;
|
|
13663
13506
|
|
|
13664
13507
|
switch (type) {
|
|
@@ -13672,26 +13515,22 @@ async function BLOCKSCOUT() {
|
|
|
13672
13515
|
requestUrl = `${hostname}/api?module=account&action=tokenlist&address=${address}`;
|
|
13673
13516
|
break
|
|
13674
13517
|
default:
|
|
13675
|
-
return
|
|
13518
|
+
return 'INVALID_TYPE'
|
|
13676
13519
|
}
|
|
13677
13520
|
try {
|
|
13678
13521
|
const response = await fetch(requestUrl);
|
|
13679
13522
|
|
|
13680
13523
|
if (!response.ok) {
|
|
13681
|
-
|
|
13524
|
+
throw new Error(`HTTP error! Status: ${response.status}`)
|
|
13682
13525
|
}
|
|
13683
13526
|
const json = await response.json();
|
|
13527
|
+
|
|
13528
|
+
console.log(json);
|
|
13684
13529
|
if (json?.result?.includes('Invalid parameter(s)')) {
|
|
13685
|
-
return
|
|
13686
|
-
message: 'Invalid parameters',
|
|
13687
|
-
reason: json.result
|
|
13688
|
-
})
|
|
13530
|
+
return `INVALID_REQUEST_PARAMS`
|
|
13689
13531
|
}
|
|
13690
13532
|
if (json?.result?.includes('Not found')) {
|
|
13691
|
-
return
|
|
13692
|
-
message: 'Address information not found',
|
|
13693
|
-
reason: json.result
|
|
13694
|
-
})
|
|
13533
|
+
return `ADDRESS_NOT_FOUND`
|
|
13695
13534
|
}
|
|
13696
13535
|
|
|
13697
13536
|
if (type === 'stat') {
|
|
@@ -13711,75 +13550,52 @@ async function BLOCKSCOUT() {
|
|
|
13711
13550
|
*/
|
|
13712
13551
|
return json.result
|
|
13713
13552
|
} catch (error) {
|
|
13714
|
-
return
|
|
13553
|
+
return 'ERROR IN FETCHING'
|
|
13715
13554
|
}
|
|
13716
13555
|
}
|
|
13717
13556
|
|
|
13718
13557
|
async function BASE() {
|
|
13719
|
-
const [type, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13720
|
-
const missingParamsError = checkRequiredParams({ type, address });
|
|
13721
|
-
|
|
13722
|
-
if (missingParamsError) {
|
|
13723
|
-
return missingParamsError
|
|
13724
|
-
}
|
|
13725
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
|
|
13726
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Basescan)
|
|
13727
|
-
if (limit > MAX_PAGE_LIMIT) {
|
|
13728
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT)
|
|
13729
|
-
}
|
|
13558
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13730
13559
|
return handleScanRequest({
|
|
13560
|
+
scanKey: SERVICE_API_KEY.Basescan,
|
|
13561
|
+
baseUrl: 'https://api.basescan.org/api',
|
|
13731
13562
|
type,
|
|
13563
|
+
chain,
|
|
13732
13564
|
address,
|
|
13733
13565
|
startDate,
|
|
13734
13566
|
endDate,
|
|
13735
13567
|
page,
|
|
13736
|
-
offset: limit
|
|
13737
|
-
apiKey: API_KEY,
|
|
13738
|
-
functionName: 'BASE',
|
|
13739
|
-
chainId: CHAIN_ID_MAP.base,
|
|
13740
|
-
network: 'base'
|
|
13568
|
+
offset: limit
|
|
13741
13569
|
})
|
|
13742
13570
|
}
|
|
13743
13571
|
async function GNOSIS() {
|
|
13744
|
-
const [type, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13745
|
-
const missingParamsError = checkRequiredParams({ type, address });
|
|
13746
|
-
|
|
13747
|
-
if (missingParamsError) {
|
|
13748
|
-
return missingParamsError
|
|
13749
|
-
}
|
|
13750
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Gnosisscan);
|
|
13751
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Gnosisscan)
|
|
13752
|
-
if (limit > MAX_PAGE_LIMIT) {
|
|
13753
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT)
|
|
13754
|
-
}
|
|
13572
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13755
13573
|
return handleScanRequest({
|
|
13574
|
+
scanKey: SERVICE_API_KEY.Gnosisscan,
|
|
13575
|
+
baseUrl: 'https://api.gnosisscan.io/api',
|
|
13756
13576
|
type,
|
|
13757
|
-
|
|
13577
|
+
chain,
|
|
13758
13578
|
address,
|
|
13759
13579
|
startDate,
|
|
13760
13580
|
endDate,
|
|
13761
13581
|
page,
|
|
13762
|
-
|
|
13763
|
-
offset: limit,
|
|
13764
|
-
chainId: CHAIN_ID_MAP.gnosis,
|
|
13765
|
-
functionName: 'GNOSIS'
|
|
13582
|
+
offset: limit
|
|
13766
13583
|
})
|
|
13767
13584
|
}
|
|
13768
13585
|
|
|
13769
13586
|
async function NEYNAR() {
|
|
13770
13587
|
const [username] = argsToArray(arguments);
|
|
13771
|
-
const
|
|
13588
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
|
|
13589
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13772
13590
|
|
|
13773
|
-
if (
|
|
13774
|
-
return
|
|
13591
|
+
if (!username) {
|
|
13592
|
+
return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13775
13593
|
}
|
|
13776
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
|
|
13777
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Neynar)
|
|
13778
13594
|
|
|
13779
|
-
const fid = await fromUsernameToFid
|
|
13595
|
+
const fid = await fromUsernameToFid(username, API_KEY);
|
|
13780
13596
|
|
|
13781
13597
|
if (!fid) {
|
|
13782
|
-
return
|
|
13598
|
+
return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13783
13599
|
}
|
|
13784
13600
|
|
|
13785
13601
|
const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
|
|
@@ -13791,9 +13607,7 @@ async function NEYNAR() {
|
|
|
13791
13607
|
'x-neynar-experimental': 'false'
|
|
13792
13608
|
}
|
|
13793
13609
|
});
|
|
13794
|
-
if (!response.ok) {
|
|
13795
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, response.status)
|
|
13796
|
-
}
|
|
13610
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`)
|
|
13797
13611
|
const json = await response.json();
|
|
13798
13612
|
if (!json?.users?.length) return []
|
|
13799
13613
|
|
|
@@ -13805,108 +13619,83 @@ async function NEYNAR() {
|
|
|
13805
13619
|
city: user.profile?.location?.address?.city || ''
|
|
13806
13620
|
}))
|
|
13807
13621
|
} catch (err) {
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
}
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
// if (!API_KEY) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13821
|
-
// if (!cardId) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
13822
|
-
// if(limit > MAX_PAGE_LIMIT){
|
|
13823
|
-
// return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13824
|
-
// }
|
|
13825
|
-
|
|
13826
|
-
// const url = new URL(`https://api.gnosispay.com/cards/${cardId}/transactions`);
|
|
13827
|
-
// url.searchParams.set('limit', limit.toString());
|
|
13828
|
-
// url.searchParams.set('offset', offset.toString());
|
|
13622
|
+
console.error('NEYNAR_FETCH_FOLLOWERS error:', err);
|
|
13623
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13624
|
+
}
|
|
13625
|
+
}
|
|
13626
|
+
async function GNOSISPAY({ cardId, startDate, endDate, limit = 20, offset = 0 }) {
|
|
13627
|
+
const apiKeyKey = SERVICE_API_KEY.GnosisPay;
|
|
13628
|
+
const API_KEY = window.localStorage.getItem(apiKeyKey);
|
|
13629
|
+
if (!API_KEY) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13630
|
+
if (!cardId) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13631
|
+
if (limit > MAX_PAGE_LIMIT) {
|
|
13632
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13633
|
+
}
|
|
13829
13634
|
|
|
13830
|
-
|
|
13831
|
-
|
|
13832
|
-
|
|
13635
|
+
const url = new URL(`https://api.gnosispay.com/cards/${cardId}/transactions`);
|
|
13636
|
+
url.searchParams.set('limit', limit.toString());
|
|
13637
|
+
url.searchParams.set('offset', offset.toString());
|
|
13833
13638
|
|
|
13834
|
-
|
|
13835
|
-
|
|
13836
|
-
|
|
13639
|
+
if (!isNaN(toTimestamp(startDate))) {
|
|
13640
|
+
url.searchParams.set('startDate', new Date(startDate * 1000).toISOString());
|
|
13641
|
+
}
|
|
13837
13642
|
|
|
13838
|
-
|
|
13839
|
-
|
|
13840
|
-
|
|
13841
|
-
// Authorization: `Bearer ${API_KEY}`,
|
|
13842
|
-
// 'Content-Type': 'application/json',
|
|
13843
|
-
// },
|
|
13844
|
-
// });
|
|
13845
|
-
|
|
13846
|
-
// if (!res.ok) throw new Error(`HTTP error! Status: ${res.status}`);
|
|
13847
|
-
|
|
13848
|
-
// const json = await res.json();
|
|
13849
|
-
|
|
13850
|
-
// if (!Array.isArray(json)) return [];
|
|
13851
|
-
|
|
13852
|
-
// return json.map(tx => ({
|
|
13853
|
-
// createdAt: tx.createdAt,
|
|
13854
|
-
// clearedAt: tx.clearedAt,
|
|
13855
|
-
// country: tx.country,
|
|
13856
|
-
// merchant: tx.merchant,
|
|
13857
|
-
// billingAmount: tx.billingAmount,
|
|
13858
|
-
// billingCurrency: tx.billingCurrency,
|
|
13859
|
-
// transactionAmount: tx.transactionAmount,
|
|
13860
|
-
// transactionCurrency: tx.transactionCurrency,
|
|
13861
|
-
// transactionType: tx.transactionType,
|
|
13862
|
-
// kind: tx.kind,
|
|
13863
|
-
// status: tx.status || null,
|
|
13864
|
-
// mcc: tx.mcc,
|
|
13865
|
-
// }));
|
|
13866
|
-
// } catch (err) {
|
|
13867
|
-
// console.error('GNOSISPAY_CARD_TXNS error:', err);
|
|
13868
|
-
// return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
13869
|
-
// }
|
|
13870
|
-
// }
|
|
13643
|
+
if (!isNaN(toTimestamp(endDate))) {
|
|
13644
|
+
url.searchParams.set('endDate', new Date(endDate * 1000).toISOString());
|
|
13645
|
+
}
|
|
13871
13646
|
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13647
|
+
try {
|
|
13648
|
+
const res = await fetch(url.toString(), {
|
|
13649
|
+
headers: {
|
|
13650
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
13651
|
+
'Content-Type': 'application/json'
|
|
13652
|
+
}
|
|
13653
|
+
});
|
|
13875
13654
|
|
|
13876
|
-
|
|
13877
|
-
return missingParamsError
|
|
13878
|
-
}
|
|
13655
|
+
if (!res.ok) throw new Error(`HTTP error! Status: ${res.status}`)
|
|
13879
13656
|
|
|
13880
|
-
|
|
13657
|
+
const json = await res.json();
|
|
13881
13658
|
|
|
13882
|
-
|
|
13883
|
-
|
|
13659
|
+
if (!Array.isArray(json)) return []
|
|
13660
|
+
|
|
13661
|
+
return json.map((tx) => ({
|
|
13662
|
+
createdAt: tx.createdAt,
|
|
13663
|
+
clearedAt: tx.clearedAt,
|
|
13664
|
+
country: tx.country,
|
|
13665
|
+
merchant: tx.merchant,
|
|
13666
|
+
billingAmount: tx.billingAmount,
|
|
13667
|
+
billingCurrency: tx.billingCurrency,
|
|
13668
|
+
transactionAmount: tx.transactionAmount,
|
|
13669
|
+
transactionCurrency: tx.transactionCurrency,
|
|
13670
|
+
transactionType: tx.transactionType,
|
|
13671
|
+
kind: tx.kind,
|
|
13672
|
+
status: tx.status || null,
|
|
13673
|
+
mcc: tx.mcc
|
|
13674
|
+
}))
|
|
13675
|
+
} catch (err) {
|
|
13676
|
+
console.error('GNOSISPAY_CARD_TXNS error:', err);
|
|
13677
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13884
13678
|
}
|
|
13885
|
-
|
|
13886
|
-
|
|
13679
|
+
}
|
|
13680
|
+
|
|
13681
|
+
async function ETHERSCAN(...args) {
|
|
13682
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13887
13683
|
return handleScanRequest({
|
|
13684
|
+
scanKey: SERVICE_API_KEY.Etherscan,
|
|
13685
|
+
baseUrl: 'https://api.etherscan.io/v2/api',
|
|
13888
13686
|
type,
|
|
13687
|
+
chain,
|
|
13889
13688
|
address,
|
|
13890
13689
|
startDate,
|
|
13891
13690
|
endDate,
|
|
13892
13691
|
page,
|
|
13893
|
-
offset: limit
|
|
13894
|
-
chainId,
|
|
13895
|
-
network: chain,
|
|
13896
|
-
functionName: 'ETHERSCAN',
|
|
13897
|
-
apiKey: API_KEY
|
|
13692
|
+
offset: limit
|
|
13898
13693
|
})
|
|
13899
13694
|
}
|
|
13900
13695
|
|
|
13901
|
-
async function COINGECKO() {
|
|
13902
|
-
const
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
if (missingParamsError) {
|
|
13906
|
-
return missingParamsError
|
|
13907
|
-
}
|
|
13908
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Coingecko);
|
|
13909
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Coingecko)
|
|
13696
|
+
async function COINGECKO(category, param1, param2) {
|
|
13697
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
|
|
13698
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13910
13699
|
|
|
13911
13700
|
const headers = {
|
|
13912
13701
|
accept: 'application/json',
|
|
@@ -13921,7 +13710,7 @@ async function COINGECKO() {
|
|
|
13921
13710
|
const token = param1;
|
|
13922
13711
|
const vsCurrencies = param2;
|
|
13923
13712
|
if (!token) {
|
|
13924
|
-
return
|
|
13713
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13925
13714
|
}
|
|
13926
13715
|
url = `https://api.coingecko.com/api/v3/simple/price?vs_currencies=${vsCurrencies ? vsCurrencies : 'usd'}&symbols=${token}`;
|
|
13927
13716
|
break
|
|
@@ -13970,7 +13759,7 @@ async function COINGECKO() {
|
|
|
13970
13759
|
}
|
|
13971
13760
|
|
|
13972
13761
|
default:
|
|
13973
|
-
return
|
|
13762
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13974
13763
|
}
|
|
13975
13764
|
|
|
13976
13765
|
try {
|
|
@@ -13979,10 +13768,12 @@ async function COINGECKO() {
|
|
|
13979
13768
|
|
|
13980
13769
|
if (!response.ok) {
|
|
13981
13770
|
const message = json?.status?.error_message || '';
|
|
13771
|
+
if (response.status === 429) {
|
|
13772
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
13773
|
+
}
|
|
13982
13774
|
if (message.includes('API Key Missing')) {
|
|
13983
|
-
return
|
|
13775
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
|
|
13984
13776
|
}
|
|
13985
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, response.status)
|
|
13986
13777
|
}
|
|
13987
13778
|
|
|
13988
13779
|
if (lowerCategory === 'price') {
|
|
@@ -14035,27 +13826,18 @@ async function COINGECKO() {
|
|
|
14035
13826
|
return flat
|
|
14036
13827
|
})
|
|
14037
13828
|
} catch (error) {
|
|
14038
|
-
|
|
13829
|
+
console.error(error);
|
|
13830
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14039
13831
|
}
|
|
14040
13832
|
}
|
|
14041
13833
|
|
|
14042
13834
|
async function EOA() {
|
|
13835
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
13836
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
14043
13837
|
let [addresses, category, chains, startTime, endTime, page = 1, offset = 10] = argsToArray(arguments);
|
|
14044
|
-
|
|
14045
|
-
const optionalParams = category === 'balance' ? {} : {startTime, endTime};
|
|
14046
|
-
|
|
14047
|
-
const missingParamsError = checkRequiredParams({ addresses, category, chains, ...optionalParams });
|
|
14048
|
-
|
|
14049
|
-
if (missingParamsError) {
|
|
14050
|
-
return missingParamsError
|
|
14051
|
-
}
|
|
14052
|
-
|
|
14053
13838
|
if (offset > MAX_PAGE_LIMIT) {
|
|
14054
|
-
return
|
|
13839
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
14055
13840
|
}
|
|
14056
|
-
|
|
14057
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
|
|
14058
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Etherscan)
|
|
14059
13841
|
const INPUTS = addresses
|
|
14060
13842
|
.split(',')
|
|
14061
13843
|
.map((a) => a.trim())
|
|
@@ -14068,21 +13850,21 @@ async function EOA() {
|
|
|
14068
13850
|
// Map: finalAddress => ENS name (if applicable)
|
|
14069
13851
|
const ADDRESS_MAP = {};
|
|
14070
13852
|
for (const input of INPUTS) {
|
|
14071
|
-
if (isAddress
|
|
13853
|
+
if (isAddress(input)) {
|
|
14072
13854
|
ADDRESS_MAP[input.toLowerCase()] = null; // it's a direct address
|
|
14073
13855
|
} else {
|
|
14074
13856
|
try {
|
|
14075
|
-
const resolved = await fromEnsNameToAddress
|
|
13857
|
+
const resolved = await fromEnsNameToAddress(input); // ENS -> address
|
|
14076
13858
|
if (resolved) ADDRESS_MAP[resolved.toLowerCase()] = input;
|
|
14077
13859
|
} catch {
|
|
14078
|
-
return
|
|
13860
|
+
return `${input}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
14079
13861
|
}
|
|
14080
13862
|
}
|
|
14081
13863
|
}
|
|
14082
13864
|
const ADDRS = Object.keys(ADDRESS_MAP);
|
|
14083
13865
|
for (const chain of CHAINS) {
|
|
14084
13866
|
const chainId = CHAIN_ID_MAP[chain];
|
|
14085
|
-
if (!chainId) return
|
|
13867
|
+
if (!chainId) return ERROR_MESSAGES_FLAG.UNSUPPORTED_CHAIN
|
|
14086
13868
|
if (category === 'balance') {
|
|
14087
13869
|
for (let i = 0; i < ADDRS.length; i += 20) {
|
|
14088
13870
|
const slice = ADDRS.slice(i, i + 20).join(',');
|
|
@@ -14092,7 +13874,7 @@ async function EOA() {
|
|
|
14092
13874
|
`&module=account&action=${action}&address=${slice}` +
|
|
14093
13875
|
`&page=${page}&offset=100&apikey=${API_KEY}`;
|
|
14094
13876
|
const data = await fetchJSON(url);
|
|
14095
|
-
if (
|
|
13877
|
+
if (typeof data === 'string') return data
|
|
14096
13878
|
data.forEach((tx) =>
|
|
14097
13879
|
out.push({
|
|
14098
13880
|
chain,
|
|
@@ -14105,14 +13887,8 @@ async function EOA() {
|
|
|
14105
13887
|
continue
|
|
14106
13888
|
}
|
|
14107
13889
|
if (category === 'txns') {
|
|
14108
|
-
const startBlock = await
|
|
14109
|
-
const endBlock = await
|
|
14110
|
-
if (!startBlock?.toString()) {
|
|
14111
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { startTime })
|
|
14112
|
-
}
|
|
14113
|
-
if (!endBlock?.toString()) {
|
|
14114
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { endTime })
|
|
14115
|
-
}
|
|
13890
|
+
const startBlock = await fromTimeStampToBlock(toTimestamp(startTime), chain, API_KEY);
|
|
13891
|
+
const endBlock = await fromTimeStampToBlock(toTimestamp(endTime), chain, API_KEY);
|
|
14116
13892
|
for (const addr of ADDRS) {
|
|
14117
13893
|
const url =
|
|
14118
13894
|
`https://api.etherscan.io/v2/api?chainid=${chainId}` +
|
|
@@ -14120,7 +13896,7 @@ async function EOA() {
|
|
|
14120
13896
|
`&startblock=${startBlock}&endblock=${endBlock}` +
|
|
14121
13897
|
`&page=${page}&offset=${offset}&sort=asc&apikey=${API_KEY}`;
|
|
14122
13898
|
const data = await fetchJSON(url);
|
|
14123
|
-
if (
|
|
13899
|
+
if (typeof data === 'string') return data
|
|
14124
13900
|
data.forEach((tx) =>
|
|
14125
13901
|
out.push({
|
|
14126
13902
|
chain,
|
|
@@ -14132,7 +13908,7 @@ async function EOA() {
|
|
|
14132
13908
|
}
|
|
14133
13909
|
continue
|
|
14134
13910
|
}
|
|
14135
|
-
return
|
|
13911
|
+
return ERROR_MESSAGES_FLAG.INVALID_CATEGORY
|
|
14136
13912
|
}
|
|
14137
13913
|
|
|
14138
13914
|
return out
|
|
@@ -14140,27 +13916,21 @@ async function EOA() {
|
|
|
14140
13916
|
async function fetchJSON(url) {
|
|
14141
13917
|
try {
|
|
14142
13918
|
const res = await fetch(url);
|
|
14143
|
-
if (!res.ok) {
|
|
14144
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
14145
|
-
}
|
|
13919
|
+
if (!res.ok) return `HTTP_${res.status}`
|
|
14146
13920
|
|
|
14147
13921
|
const json = await res.json();
|
|
14148
13922
|
|
|
14149
13923
|
if (json.result?.includes?.('Invalid API Key'))
|
|
14150
|
-
return
|
|
13924
|
+
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
|
|
14151
13925
|
|
|
14152
13926
|
if (json.result?.includes?.('Max rate limit reached'))
|
|
14153
|
-
return
|
|
13927
|
+
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
14154
13928
|
|
|
14155
|
-
if (json.status === '0' && json.message !== 'No transactions found')
|
|
14156
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.CUSTOM, {
|
|
14157
|
-
message: json.message || 'Api Error',
|
|
14158
|
-
reason: json.message || 'json.status === "0" && json.message !== "No transactions found"'
|
|
14159
|
-
})
|
|
13929
|
+
if (json.status === '0' && json.message !== 'No transactions found') return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14160
13930
|
|
|
14161
13931
|
return json.result
|
|
14162
|
-
} catch
|
|
14163
|
-
return
|
|
13932
|
+
} catch {
|
|
13933
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14164
13934
|
}
|
|
14165
13935
|
}
|
|
14166
13936
|
}
|
|
@@ -14176,38 +13946,25 @@ async function FLVURL(token, vs_currencies) {
|
|
|
14176
13946
|
async function SAFE() {
|
|
14177
13947
|
let [address, utility, chain, limit = 10, offset = 0] = argsToArray(arguments);
|
|
14178
13948
|
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
if (
|
|
14182
|
-
return missingParamsError
|
|
14183
|
-
}
|
|
14184
|
-
|
|
14185
|
-
if (offset > MAX_PAGE_LIMIT) {
|
|
14186
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT)
|
|
14187
|
-
}
|
|
14188
|
-
|
|
14189
|
-
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Safe);
|
|
14190
|
-
|
|
14191
|
-
if (!apiKey) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Safe)
|
|
14192
|
-
|
|
14193
|
-
if (typeof limit !== 'number' || limit < 0) return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { limit })
|
|
14194
|
-
if (typeof offset !== 'number' || offset < 0)
|
|
14195
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { offset })
|
|
14196
|
-
if (utility !== 'txns') return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { utility })
|
|
13949
|
+
if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT'
|
|
13950
|
+
if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET'
|
|
13951
|
+
if (utility !== 'txns') return 'UTILITY IS NOT SUPPORTED'
|
|
14197
13952
|
if (limit > MAX_PAGE_LIMIT) {
|
|
14198
|
-
return
|
|
13953
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
14199
13954
|
}
|
|
14200
13955
|
|
|
13956
|
+
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
|
|
14201
13957
|
const chainIdentifier = SAFE_CHAIN_MAP[chain];
|
|
14202
13958
|
|
|
14203
|
-
if (!
|
|
13959
|
+
if (!apiKey) return `${SERVICE_API_KEY.Safe}_MISSING`
|
|
13960
|
+
if (!chainIdentifier) return 'CHAIN IS NOT SUPPORTED'
|
|
14204
13961
|
|
|
14205
|
-
if (!isAddress
|
|
14206
|
-
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
}
|
|
13962
|
+
if (!isAddress(address)) {
|
|
13963
|
+
address = await fromEnsNameToAddress(address);
|
|
13964
|
+
}
|
|
13965
|
+
|
|
13966
|
+
if (!address) {
|
|
13967
|
+
return `${address}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
14211
13968
|
}
|
|
14212
13969
|
|
|
14213
13970
|
const url = `https://api.safe.global/tx-service/${chainIdentifier}/api/v2/safes/${address}/multisig-transactions?limit=${limit}&offset=${offset}`;
|
|
@@ -14217,29 +13974,23 @@ async function SAFE() {
|
|
|
14217
13974
|
Authorization: `Bearer ${apiKey}`
|
|
14218
13975
|
}
|
|
14219
13976
|
});
|
|
14220
|
-
if (!response.ok) {
|
|
14221
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, response.status)
|
|
14222
|
-
}
|
|
13977
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`)
|
|
14223
13978
|
const json = await response.json();
|
|
14224
13979
|
if (!Array.isArray(json.results)) {
|
|
14225
|
-
return
|
|
13980
|
+
return 'INVALID API RESPONSE'
|
|
14226
13981
|
}
|
|
14227
13982
|
// remove nested structure from the response
|
|
14228
13983
|
return json.results.map(({ confirmations, dataDecoded, ...rest }) => rest)
|
|
14229
13984
|
} catch (e) {
|
|
14230
|
-
|
|
13985
|
+
console.log(e);
|
|
13986
|
+
return 'ERROR IN FETCHING'
|
|
14231
13987
|
}
|
|
14232
13988
|
}
|
|
14233
13989
|
|
|
14234
13990
|
async function DEFILLAMA() {
|
|
14235
13991
|
let [category] = argsToArray(arguments);
|
|
14236
|
-
const
|
|
14237
|
-
|
|
14238
|
-
if (missingParamsError) {
|
|
14239
|
-
return missingParamsError
|
|
14240
|
-
}
|
|
14241
|
-
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Defillama);
|
|
14242
|
-
if (!apiKey) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Defillama)
|
|
13992
|
+
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Defillama);
|
|
13993
|
+
if (!apiKey) return `${SERVICE_API_KEY.Defillama}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
14243
13994
|
const categoryList = ['protocols', 'yields', 'dex', 'fees'];
|
|
14244
13995
|
const categoryMap = {
|
|
14245
13996
|
[categoryList[0]]: 'https://api.llama.fi/protocols',
|
|
@@ -14251,13 +14002,9 @@ async function DEFILLAMA() {
|
|
|
14251
14002
|
};
|
|
14252
14003
|
let url = categoryMap[category];
|
|
14253
14004
|
|
|
14254
|
-
if (!url) {
|
|
14255
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { category })
|
|
14256
|
-
}
|
|
14257
|
-
|
|
14258
14005
|
try {
|
|
14259
14006
|
const response = await fetch(url);
|
|
14260
|
-
if (!response.ok)
|
|
14007
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`)
|
|
14261
14008
|
let json = await response.json();
|
|
14262
14009
|
switch (category) {
|
|
14263
14010
|
case categoryList[0]: {
|
|
@@ -14282,59 +14029,38 @@ async function DEFILLAMA() {
|
|
|
14282
14029
|
|
|
14283
14030
|
return removeNestedStructure(Array.isArray(json) ? json : [json])
|
|
14284
14031
|
} catch (e) {
|
|
14285
|
-
|
|
14032
|
+
console.log(e);
|
|
14033
|
+
return 'ERROR IN FETCHING'
|
|
14286
14034
|
}
|
|
14287
14035
|
}
|
|
14288
14036
|
|
|
14289
14037
|
async function UNISWAP() {
|
|
14290
14038
|
const [graphType, category, param1, param2] = argsToArray(arguments);
|
|
14291
|
-
const missingParamsError = checkRequiredParams({ graphType, category, param1 });
|
|
14292
|
-
|
|
14293
|
-
if (missingParamsError) {
|
|
14294
|
-
return missingParamsError
|
|
14295
|
-
}
|
|
14296
14039
|
const baseUrl = 'https://onchain-proxy.fileverse.io/third-party';
|
|
14297
14040
|
try {
|
|
14298
14041
|
const url = `${baseUrl}?service=uniswap&graphType=${graphType}&category=${category}&input1=${param1}&input2=${param2}`;
|
|
14299
14042
|
const res = await fetch(url);
|
|
14300
|
-
if (!res.ok) {
|
|
14301
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
14302
|
-
}
|
|
14043
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
14303
14044
|
const json = await res.json();
|
|
14304
|
-
|
|
14305
|
-
return removeNestedStructure(json)
|
|
14306
|
-
} else {
|
|
14307
|
-
return json
|
|
14308
|
-
}
|
|
14309
|
-
|
|
14045
|
+
return removeNestedStructure(json)
|
|
14310
14046
|
} catch (err) {
|
|
14311
|
-
|
|
14047
|
+
console.error('UNISWAP fetch error:', err);
|
|
14048
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14312
14049
|
}
|
|
14313
14050
|
}
|
|
14314
14051
|
|
|
14315
14052
|
async function AAVE() {
|
|
14316
14053
|
const [graphType, category, param1, param2] = argsToArray(arguments);
|
|
14317
|
-
const missingParamsError = checkRequiredParams({ graphType, category, param1 });
|
|
14318
|
-
|
|
14319
|
-
if (missingParamsError) {
|
|
14320
|
-
return missingParamsError
|
|
14321
|
-
}
|
|
14322
14054
|
const baseUrl = 'https://onchain-proxy.fileverse.io/third-party';
|
|
14323
14055
|
try {
|
|
14324
14056
|
const url = `${baseUrl}?service=aave&graphType=${graphType}&category=${category}&input1=${param1}&input2=${param2}`;
|
|
14325
14057
|
const res = await fetch(url);
|
|
14326
|
-
if (!res.ok) {
|
|
14327
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
14328
|
-
}
|
|
14058
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
14329
14059
|
const json = await res.json();
|
|
14330
|
-
|
|
14331
|
-
return removeNestedStructure(json)
|
|
14332
|
-
} else {
|
|
14333
|
-
return json
|
|
14334
|
-
}
|
|
14335
|
-
|
|
14060
|
+
return removeNestedStructure(json)
|
|
14336
14061
|
} catch (err) {
|
|
14337
|
-
|
|
14062
|
+
console.error('AAVE fetch error:', err);
|
|
14063
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14338
14064
|
}
|
|
14339
14065
|
}
|
|
14340
14066
|
|
|
@@ -14368,4 +14094,4 @@ function MYANIMELIST() {
|
|
|
14368
14094
|
|
|
14369
14095
|
const utils = { errors, symbols, date };
|
|
14370
14096
|
|
|
14371
|
-
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, 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, DVAR, DVARP, EDATE, EFFECT, EOA, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, ETHERSCAN, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FARCASTER, 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, LENS, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MEDIAN, MEERKAT, MID, MIN, MINA, MINIFS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, MYANIMELIST, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NETWORKDAYS_INTL, NEYNAR, 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, 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, SERIESSUM, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, 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, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, WORKDAY_INTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, Z, ZTEST, utils };
|
|
14097
|
+
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, 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, DVAR, DVARP, EDATE, EFFECT, EOA, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, ETHERSCAN, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FARCASTER, 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, GNOSISPAY, 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, LENS, 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, NEYNAR, 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, 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, SERIESSUM, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, 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, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, WORKDAY_INTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, Z, ZTEST, utils };
|