@fileverse-dev/formulajs 4.4.11-mod-64-patch-2 → 4.4.11-mod-66
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 -1104
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +255 -531
- package/lib/esm/crypto-constants.mjs +51 -41
- package/lib/esm/index.mjs +254 -532
- 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,170 +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
|
-
console.log('STACK LINE:', stack);
|
|
13312
|
-
|
|
13313
|
-
const match = stack?.match(/at (.+?) \(/);
|
|
13314
|
-
const rawFnName = match?.[1];
|
|
13315
|
-
const parentFunctionName = rawFnName?.split('.').pop() || 'anonymous';
|
|
13316
|
-
|
|
13317
|
-
const paramName = key;
|
|
13318
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_PARAM, paramName, parentFunctionName);
|
|
13319
|
-
}
|
|
13320
|
-
}
|
|
13321
|
-
};
|
|
13322
|
-
|
|
13323
13195
|
async function handleScanRequest({
|
|
13196
|
+
scanKey,
|
|
13197
|
+
baseUrl,
|
|
13324
13198
|
type,
|
|
13199
|
+
chain,
|
|
13325
13200
|
address,
|
|
13326
13201
|
startDate,
|
|
13327
13202
|
endDate,
|
|
13328
13203
|
page = 1,
|
|
13329
|
-
offset = 10
|
|
13330
|
-
apiKey,
|
|
13331
|
-
functionName,
|
|
13332
|
-
chainId,
|
|
13333
|
-
network
|
|
13204
|
+
offset = 10
|
|
13334
13205
|
}) {
|
|
13335
|
-
const
|
|
13336
|
-
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
|
|
13340
|
-
|
|
13341
|
-
if (!isAddress$1.isAddress(address)) {
|
|
13342
|
-
const ensName = address;
|
|
13343
|
-
address = await fromEnsNameToAddress$1.fromEnsNameToAddress(address);
|
|
13344
|
-
if (!address) {
|
|
13345
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.ENS, ensName, functionName)
|
|
13346
|
-
}
|
|
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
|
|
13347
13211
|
}
|
|
13348
13212
|
|
|
13349
|
-
|
|
13350
|
-
|
|
13213
|
+
let chainId = CHAIN_ID_MAP[chain?.toLowerCase()];
|
|
13214
|
+
if (!chainId) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_CHAIN}`
|
|
13215
|
+
|
|
13216
|
+
if (!isAddress(address)) {
|
|
13217
|
+
address = await fromEnsNameToAddress(address);
|
|
13218
|
+
}
|
|
13351
13219
|
|
|
13352
|
-
if (!
|
|
13353
|
-
return
|
|
13354
|
-
message: 'Api not found',
|
|
13355
|
-
reason: ` Api not found for: ${functionName}`
|
|
13356
|
-
}, functionName)
|
|
13220
|
+
if (!address) {
|
|
13221
|
+
return `${address}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13357
13222
|
}
|
|
13358
13223
|
|
|
13359
13224
|
const ACTION_MAP = {
|
|
@@ -13364,40 +13229,41 @@ async function handleScanRequest({
|
|
|
13364
13229
|
};
|
|
13365
13230
|
|
|
13366
13231
|
const action = ACTION_MAP[type];
|
|
13367
|
-
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';
|
|
13368
13236
|
|
|
13369
|
-
let url = `${baseUrl}?chainid=${chainId}&module=account&action=${action}&apikey=${
|
|
13237
|
+
let url = `${baseUrl}?chainid=${chainId}&module=account&action=${action}&apikey=${API_KEY}`;
|
|
13370
13238
|
|
|
13371
13239
|
if (['all-txns', 'token-txns', 'nft-txns'].includes(type)) {
|
|
13240
|
+
if (!address) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_ADDRESS}`
|
|
13372
13241
|
url += `&address=${address}&startblock=0&endblock=99999999&sort=asc`;
|
|
13373
13242
|
|
|
13374
13243
|
if (!isNaN(startDate) && !isNaN(endDate)) {
|
|
13375
13244
|
const [startBlock, endBlock] = await Promise.all([
|
|
13376
|
-
|
|
13377
|
-
|
|
13245
|
+
fromTimeStampToBlock(toTimestamp(startDate), chain, API_KEY),
|
|
13246
|
+
fromTimeStampToBlock(toTimestamp(endDate), chain, API_KEY)
|
|
13378
13247
|
]);
|
|
13379
|
-
url += `&startblock=${startBlock
|
|
13248
|
+
url += `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13380
13249
|
}
|
|
13381
13250
|
url += `&page=${page}&offset=${offset}`;
|
|
13382
13251
|
}
|
|
13383
13252
|
|
|
13384
13253
|
try {
|
|
13385
13254
|
const res = await fetch(url);
|
|
13386
|
-
if (!res.ok) {
|
|
13387
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status, functionName)
|
|
13388
|
-
}
|
|
13255
|
+
if (!res.ok) throw new Error(`HTTP error: ${res.status}`)
|
|
13389
13256
|
const json = await res.json();
|
|
13390
13257
|
|
|
13391
13258
|
if (typeof json.result === 'string') {
|
|
13392
|
-
if (json.result.includes('Invalid API Key'))
|
|
13393
|
-
|
|
13394
|
-
if (json.result.includes('Max rate limit reached'))
|
|
13395
|
-
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}`
|
|
13396
13261
|
}
|
|
13397
13262
|
|
|
13398
13263
|
return json.result
|
|
13399
13264
|
} catch (err) {
|
|
13400
|
-
|
|
13265
|
+
console.error(`[${scanKey}]`, err);
|
|
13266
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13401
13267
|
}
|
|
13402
13268
|
}
|
|
13403
13269
|
|
|
@@ -13415,9 +13281,6 @@ const fromUsernameToFid = async (username, apiKey) => {
|
|
|
13415
13281
|
const user = users.find(user => user.username === username);
|
|
13416
13282
|
return user && user.fid || null;
|
|
13417
13283
|
};
|
|
13418
|
-
var fromUsernameToFid$1 = {
|
|
13419
|
-
fromUsernameToFid
|
|
13420
|
-
};
|
|
13421
13284
|
|
|
13422
13285
|
// remove nested structure from the response
|
|
13423
13286
|
const removeNestedStructure = (json) => {
|
|
@@ -13432,22 +13295,13 @@ const removeNestedStructure = (json) => {
|
|
|
13432
13295
|
});
|
|
13433
13296
|
};
|
|
13434
13297
|
|
|
13435
|
-
/* global window */
|
|
13436
|
-
|
|
13437
13298
|
async function FIREFLY() {
|
|
13438
13299
|
const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13439
|
-
const missingParamsError = checkRequiredParams({ platform, contentType, identifier });
|
|
13440
|
-
|
|
13441
|
-
if (missingParamsError) {
|
|
13442
|
-
return missingParamsError
|
|
13443
|
-
}
|
|
13444
|
-
|
|
13445
13300
|
if (end > MAX_PAGE_LIMIT) {
|
|
13446
|
-
return
|
|
13301
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13447
13302
|
}
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
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}`
|
|
13451
13305
|
|
|
13452
13306
|
const baseUrl = 'https://openapi.firefly.land/v1/fileverse/fetch';
|
|
13453
13307
|
const headers = { 'x-api-key': API_KEY };
|
|
@@ -13463,14 +13317,10 @@ async function FIREFLY() {
|
|
|
13463
13317
|
replies: 'lenspostid'
|
|
13464
13318
|
}
|
|
13465
13319
|
};
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
const platformContentType = platformType[contentType];
|
|
13471
|
-
if (!platformContentType) {
|
|
13472
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { contentType })
|
|
13473
|
-
}
|
|
13320
|
+
|
|
13321
|
+
const platformType = typeMap[platform]?.[contentType];
|
|
13322
|
+
if (!platformType) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13323
|
+
|
|
13474
13324
|
const query = identifier
|
|
13475
13325
|
.split(',')
|
|
13476
13326
|
.map((s) => s.trim())
|
|
@@ -13485,7 +13335,7 @@ async function FIREFLY() {
|
|
|
13485
13335
|
|
|
13486
13336
|
try {
|
|
13487
13337
|
const res = await fetch(url.toString(), { headers });
|
|
13488
|
-
if (!res.ok)
|
|
13338
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
13489
13339
|
|
|
13490
13340
|
const json = await res.json();
|
|
13491
13341
|
if (!Array.isArray(json?.data)) return []
|
|
@@ -13501,21 +13351,19 @@ async function FIREFLY() {
|
|
|
13501
13351
|
return flat
|
|
13502
13352
|
})
|
|
13503
13353
|
} catch (err) {
|
|
13504
|
-
|
|
13354
|
+
console.error('FIREFLY fetch error:', err);
|
|
13355
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13505
13356
|
}
|
|
13506
13357
|
}
|
|
13507
13358
|
|
|
13508
13359
|
async function LENS() {
|
|
13509
13360
|
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13510
|
-
const
|
|
13511
|
-
if (
|
|
13512
|
-
|
|
13513
|
-
}
|
|
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
|
+
|
|
13514
13364
|
if (end > MAX_PAGE_LIMIT) {
|
|
13515
|
-
return
|
|
13365
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13516
13366
|
}
|
|
13517
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
|
|
13518
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Firefly)
|
|
13519
13367
|
|
|
13520
13368
|
const baseUrl = 'https://openapi.firefly.land/v1/fileverse/fetch';
|
|
13521
13369
|
const headers = { 'x-api-key': API_KEY };
|
|
@@ -13524,10 +13372,10 @@ async function LENS() {
|
|
|
13524
13372
|
posts: 'lensid',
|
|
13525
13373
|
replies: 'lenspostid'
|
|
13526
13374
|
};
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
|
|
13375
|
+
|
|
13376
|
+
const platformType = typeMap[contentType];
|
|
13377
|
+
if (!platformType) return `Lens: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13378
|
+
|
|
13531
13379
|
const query = identifier
|
|
13532
13380
|
.split(',')
|
|
13533
13381
|
.map((s) => s.trim())
|
|
@@ -13536,15 +13384,13 @@ async function LENS() {
|
|
|
13536
13384
|
|
|
13537
13385
|
const url = new URL(baseUrl);
|
|
13538
13386
|
url.searchParams.set('query', query);
|
|
13539
|
-
url.searchParams.set('type',
|
|
13387
|
+
url.searchParams.set('type', platformType);
|
|
13540
13388
|
url.searchParams.set('start', String(start));
|
|
13541
13389
|
url.searchParams.set('end', String(end));
|
|
13542
13390
|
|
|
13543
13391
|
try {
|
|
13544
13392
|
const res = await fetch(url.toString(), { headers });
|
|
13545
|
-
if (!res.ok) {
|
|
13546
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
13547
|
-
}
|
|
13393
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
13548
13394
|
|
|
13549
13395
|
const json = await res.json();
|
|
13550
13396
|
if (!Array.isArray(json?.data)) return []
|
|
@@ -13560,21 +13406,18 @@ async function LENS() {
|
|
|
13560
13406
|
return flat
|
|
13561
13407
|
})
|
|
13562
13408
|
} catch (err) {
|
|
13563
|
-
|
|
13409
|
+
console.error('LENS fetch error:', err);
|
|
13410
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13564
13411
|
}
|
|
13565
13412
|
}
|
|
13566
13413
|
|
|
13567
13414
|
async function FARCASTER() {
|
|
13568
13415
|
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13569
|
-
const
|
|
13570
|
-
if (
|
|
13571
|
-
return missingParamsError
|
|
13572
|
-
}
|
|
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}`
|
|
13573
13418
|
if (end > MAX_PAGE_LIMIT) {
|
|
13574
|
-
return
|
|
13419
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13575
13420
|
}
|
|
13576
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Firefly);
|
|
13577
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Firefly)
|
|
13578
13421
|
const baseUrl = 'https://openapi.firefly.land/v1/fileverse/fetch';
|
|
13579
13422
|
const headers = { 'x-api-key': API_KEY };
|
|
13580
13423
|
|
|
@@ -13584,10 +13427,9 @@ async function FARCASTER() {
|
|
|
13584
13427
|
channels: 'farcasterchannels'
|
|
13585
13428
|
};
|
|
13586
13429
|
|
|
13587
|
-
const
|
|
13588
|
-
if (!
|
|
13589
|
-
|
|
13590
|
-
}
|
|
13430
|
+
const platformType = typeMap[contentType];
|
|
13431
|
+
if (!platformType) return `Farcaster: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`
|
|
13432
|
+
|
|
13591
13433
|
const query = identifier
|
|
13592
13434
|
.split(',')
|
|
13593
13435
|
.map((s) => s.trim())
|
|
@@ -13596,13 +13438,13 @@ async function FARCASTER() {
|
|
|
13596
13438
|
|
|
13597
13439
|
const url = new URL(baseUrl);
|
|
13598
13440
|
url.searchParams.set('query', query);
|
|
13599
|
-
url.searchParams.set('type',
|
|
13441
|
+
url.searchParams.set('type', platformType);
|
|
13600
13442
|
url.searchParams.set('start', String(start));
|
|
13601
13443
|
url.searchParams.set('end', String(end));
|
|
13602
13444
|
|
|
13603
13445
|
try {
|
|
13604
13446
|
const res = await fetch(url.toString(), { headers });
|
|
13605
|
-
if (!res.ok)
|
|
13447
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
13606
13448
|
|
|
13607
13449
|
const json = await res.json();
|
|
13608
13450
|
if (!Array.isArray(json?.data)) return []
|
|
@@ -13618,24 +13460,24 @@ async function FARCASTER() {
|
|
|
13618
13460
|
return flat
|
|
13619
13461
|
})
|
|
13620
13462
|
} catch (err) {
|
|
13621
|
-
|
|
13463
|
+
console.error('Farcaster fetch error:', err);
|
|
13464
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
13622
13465
|
}
|
|
13623
13466
|
}
|
|
13624
13467
|
|
|
13625
13468
|
async function BLOCKSCOUT() {
|
|
13626
13469
|
let [address, type, chain, startTimestamp, endTimestamp, page = 1, offset = 10] = argsToArray(arguments);
|
|
13627
|
-
const missingParamsError = checkRequiredParams({ address, type });
|
|
13628
|
-
|
|
13629
|
-
if (missingParamsError) {
|
|
13630
|
-
return missingParamsError
|
|
13631
|
-
}
|
|
13632
13470
|
if (offset > MAX_PAGE_LIMIT) {
|
|
13633
|
-
return
|
|
13471
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13634
13472
|
}
|
|
13635
13473
|
if (!chain) {
|
|
13636
13474
|
chain = 'ethereum';
|
|
13637
13475
|
}
|
|
13638
13476
|
|
|
13477
|
+
if (!type) {
|
|
13478
|
+
return 'TYPE_MISSING'
|
|
13479
|
+
}
|
|
13480
|
+
|
|
13639
13481
|
if (!startTimestamp) {
|
|
13640
13482
|
const currentTimestamp = Date.now();
|
|
13641
13483
|
startTimestamp = currentTimestamp - 30 * 24 * 60 * 60 * 1000;
|
|
@@ -13650,19 +13492,16 @@ async function BLOCKSCOUT() {
|
|
|
13650
13492
|
endTimestamp = toTimestamp(endTimestamp);
|
|
13651
13493
|
}
|
|
13652
13494
|
|
|
13653
|
-
if (!isAddress
|
|
13654
|
-
|
|
13655
|
-
address = await fromEnsNameToAddress$1.fromEnsNameToAddress(address);
|
|
13656
|
-
if (!address) {
|
|
13657
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.ENS, ensName)
|
|
13658
|
-
}
|
|
13495
|
+
if (!isAddress(address)) {
|
|
13496
|
+
address = await fromEnsNameToAddress(address);
|
|
13659
13497
|
}
|
|
13660
|
-
const hostname = BLOCKSCOUT_CHAINS_MAP[chain];
|
|
13661
13498
|
|
|
13662
|
-
if (!
|
|
13663
|
-
return
|
|
13499
|
+
if (!address) {
|
|
13500
|
+
return `${address}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13664
13501
|
}
|
|
13665
13502
|
|
|
13503
|
+
const hostname = BLOCKSCOUT_CHAINS_MAP[chain];
|
|
13504
|
+
|
|
13666
13505
|
let requestUrl;
|
|
13667
13506
|
|
|
13668
13507
|
switch (type) {
|
|
@@ -13676,26 +13515,22 @@ async function BLOCKSCOUT() {
|
|
|
13676
13515
|
requestUrl = `${hostname}/api?module=account&action=tokenlist&address=${address}`;
|
|
13677
13516
|
break
|
|
13678
13517
|
default:
|
|
13679
|
-
return
|
|
13518
|
+
return 'INVALID_TYPE'
|
|
13680
13519
|
}
|
|
13681
13520
|
try {
|
|
13682
13521
|
const response = await fetch(requestUrl);
|
|
13683
13522
|
|
|
13684
13523
|
if (!response.ok) {
|
|
13685
|
-
|
|
13524
|
+
throw new Error(`HTTP error! Status: ${response.status}`)
|
|
13686
13525
|
}
|
|
13687
13526
|
const json = await response.json();
|
|
13527
|
+
|
|
13528
|
+
console.log(json);
|
|
13688
13529
|
if (json?.result?.includes('Invalid parameter(s)')) {
|
|
13689
|
-
return
|
|
13690
|
-
message: 'Invalid parameters',
|
|
13691
|
-
reason: json.result
|
|
13692
|
-
})
|
|
13530
|
+
return `INVALID_REQUEST_PARAMS`
|
|
13693
13531
|
}
|
|
13694
13532
|
if (json?.result?.includes('Not found')) {
|
|
13695
|
-
return
|
|
13696
|
-
message: 'Address information not found',
|
|
13697
|
-
reason: json.result
|
|
13698
|
-
})
|
|
13533
|
+
return `ADDRESS_NOT_FOUND`
|
|
13699
13534
|
}
|
|
13700
13535
|
|
|
13701
13536
|
if (type === 'stat') {
|
|
@@ -13715,75 +13550,52 @@ async function BLOCKSCOUT() {
|
|
|
13715
13550
|
*/
|
|
13716
13551
|
return json.result
|
|
13717
13552
|
} catch (error) {
|
|
13718
|
-
return
|
|
13553
|
+
return 'ERROR IN FETCHING'
|
|
13719
13554
|
}
|
|
13720
13555
|
}
|
|
13721
13556
|
|
|
13722
13557
|
async function BASE() {
|
|
13723
|
-
const [type, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13724
|
-
const missingParamsError = checkRequiredParams({ type, address });
|
|
13725
|
-
|
|
13726
|
-
if (missingParamsError) {
|
|
13727
|
-
return missingParamsError
|
|
13728
|
-
}
|
|
13729
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Basescan);
|
|
13730
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Basescan)
|
|
13731
|
-
if (limit > MAX_PAGE_LIMIT) {
|
|
13732
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT)
|
|
13733
|
-
}
|
|
13558
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13734
13559
|
return handleScanRequest({
|
|
13560
|
+
scanKey: SERVICE_API_KEY.Basescan,
|
|
13561
|
+
baseUrl: 'https://api.basescan.org/api',
|
|
13735
13562
|
type,
|
|
13563
|
+
chain,
|
|
13736
13564
|
address,
|
|
13737
13565
|
startDate,
|
|
13738
13566
|
endDate,
|
|
13739
13567
|
page,
|
|
13740
|
-
offset: limit
|
|
13741
|
-
apiKey: API_KEY,
|
|
13742
|
-
functionName: 'BASE',
|
|
13743
|
-
chainId: CHAIN_ID_MAP.base,
|
|
13744
|
-
network: 'base'
|
|
13568
|
+
offset: limit
|
|
13745
13569
|
})
|
|
13746
13570
|
}
|
|
13747
13571
|
async function GNOSIS() {
|
|
13748
|
-
const [type, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13749
|
-
const missingParamsError = checkRequiredParams({ type, address });
|
|
13750
|
-
|
|
13751
|
-
if (missingParamsError) {
|
|
13752
|
-
return missingParamsError
|
|
13753
|
-
}
|
|
13754
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Gnosisscan);
|
|
13755
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Gnosisscan)
|
|
13756
|
-
if (limit > MAX_PAGE_LIMIT) {
|
|
13757
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT)
|
|
13758
|
-
}
|
|
13572
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13759
13573
|
return handleScanRequest({
|
|
13574
|
+
scanKey: SERVICE_API_KEY.Gnosisscan,
|
|
13575
|
+
baseUrl: 'https://api.gnosisscan.io/api',
|
|
13760
13576
|
type,
|
|
13761
|
-
|
|
13577
|
+
chain,
|
|
13762
13578
|
address,
|
|
13763
13579
|
startDate,
|
|
13764
13580
|
endDate,
|
|
13765
13581
|
page,
|
|
13766
|
-
|
|
13767
|
-
offset: limit,
|
|
13768
|
-
chainId: CHAIN_ID_MAP.gnosis,
|
|
13769
|
-
functionName: 'GNOSIS'
|
|
13582
|
+
offset: limit
|
|
13770
13583
|
})
|
|
13771
13584
|
}
|
|
13772
13585
|
|
|
13773
13586
|
async function NEYNAR() {
|
|
13774
13587
|
const [username] = argsToArray(arguments);
|
|
13775
|
-
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}`
|
|
13776
13590
|
|
|
13777
|
-
if (
|
|
13778
|
-
return
|
|
13591
|
+
if (!username) {
|
|
13592
|
+
return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13779
13593
|
}
|
|
13780
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Neynar);
|
|
13781
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Neynar)
|
|
13782
13594
|
|
|
13783
|
-
const fid = await fromUsernameToFid
|
|
13595
|
+
const fid = await fromUsernameToFid(username, API_KEY);
|
|
13784
13596
|
|
|
13785
13597
|
if (!fid) {
|
|
13786
|
-
return
|
|
13598
|
+
return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13787
13599
|
}
|
|
13788
13600
|
|
|
13789
13601
|
const url = `https://api.neynar.com/v2/farcaster/followers?fid=${fid}`;
|
|
@@ -13795,9 +13607,7 @@ async function NEYNAR() {
|
|
|
13795
13607
|
'x-neynar-experimental': 'false'
|
|
13796
13608
|
}
|
|
13797
13609
|
});
|
|
13798
|
-
if (!response.ok) {
|
|
13799
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, response.status)
|
|
13800
|
-
}
|
|
13610
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`)
|
|
13801
13611
|
const json = await response.json();
|
|
13802
13612
|
if (!json?.users?.length) return []
|
|
13803
13613
|
|
|
@@ -13809,108 +13619,83 @@ async function NEYNAR() {
|
|
|
13809
13619
|
city: user.profile?.location?.address?.city || ''
|
|
13810
13620
|
}))
|
|
13811
13621
|
} catch (err) {
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
}
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
13823
|
-
|
|
13824
|
-
// if (!API_KEY) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13825
|
-
// if (!cardId) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
13826
|
-
// if(limit > MAX_PAGE_LIMIT){
|
|
13827
|
-
// return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
13828
|
-
// }
|
|
13829
|
-
|
|
13830
|
-
// const url = new URL(`https://api.gnosispay.com/cards/${cardId}/transactions`);
|
|
13831
|
-
// url.searchParams.set('limit', limit.toString());
|
|
13832
|
-
// 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
|
+
}
|
|
13833
13634
|
|
|
13834
|
-
|
|
13835
|
-
|
|
13836
|
-
|
|
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());
|
|
13837
13638
|
|
|
13838
|
-
|
|
13839
|
-
|
|
13840
|
-
|
|
13639
|
+
if (!isNaN(toTimestamp(startDate))) {
|
|
13640
|
+
url.searchParams.set('startDate', new Date(startDate * 1000).toISOString());
|
|
13641
|
+
}
|
|
13841
13642
|
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
// Authorization: `Bearer ${API_KEY}`,
|
|
13846
|
-
// 'Content-Type': 'application/json',
|
|
13847
|
-
// },
|
|
13848
|
-
// });
|
|
13849
|
-
|
|
13850
|
-
// if (!res.ok) throw new Error(`HTTP error! Status: ${res.status}`);
|
|
13851
|
-
|
|
13852
|
-
// const json = await res.json();
|
|
13853
|
-
|
|
13854
|
-
// if (!Array.isArray(json)) return [];
|
|
13855
|
-
|
|
13856
|
-
// return json.map(tx => ({
|
|
13857
|
-
// createdAt: tx.createdAt,
|
|
13858
|
-
// clearedAt: tx.clearedAt,
|
|
13859
|
-
// country: tx.country,
|
|
13860
|
-
// merchant: tx.merchant,
|
|
13861
|
-
// billingAmount: tx.billingAmount,
|
|
13862
|
-
// billingCurrency: tx.billingCurrency,
|
|
13863
|
-
// transactionAmount: tx.transactionAmount,
|
|
13864
|
-
// transactionCurrency: tx.transactionCurrency,
|
|
13865
|
-
// transactionType: tx.transactionType,
|
|
13866
|
-
// kind: tx.kind,
|
|
13867
|
-
// status: tx.status || null,
|
|
13868
|
-
// mcc: tx.mcc,
|
|
13869
|
-
// }));
|
|
13870
|
-
// } catch (err) {
|
|
13871
|
-
// console.error('GNOSISPAY_CARD_TXNS error:', err);
|
|
13872
|
-
// return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
13873
|
-
// }
|
|
13874
|
-
// }
|
|
13643
|
+
if (!isNaN(toTimestamp(endDate))) {
|
|
13644
|
+
url.searchParams.set('endDate', new Date(endDate * 1000).toISOString());
|
|
13645
|
+
}
|
|
13875
13646
|
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
|
|
13647
|
+
try {
|
|
13648
|
+
const res = await fetch(url.toString(), {
|
|
13649
|
+
headers: {
|
|
13650
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
13651
|
+
'Content-Type': 'application/json'
|
|
13652
|
+
}
|
|
13653
|
+
});
|
|
13879
13654
|
|
|
13880
|
-
|
|
13881
|
-
return missingParamsError
|
|
13882
|
-
}
|
|
13655
|
+
if (!res.ok) throw new Error(`HTTP error! Status: ${res.status}`)
|
|
13883
13656
|
|
|
13884
|
-
|
|
13657
|
+
const json = await res.json();
|
|
13885
13658
|
|
|
13886
|
-
|
|
13887
|
-
|
|
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
|
|
13888
13678
|
}
|
|
13889
|
-
|
|
13890
|
-
|
|
13679
|
+
}
|
|
13680
|
+
|
|
13681
|
+
async function ETHERSCAN(...args) {
|
|
13682
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13891
13683
|
return handleScanRequest({
|
|
13684
|
+
scanKey: SERVICE_API_KEY.Etherscan,
|
|
13685
|
+
baseUrl: 'https://api.etherscan.io/v2/api',
|
|
13892
13686
|
type,
|
|
13687
|
+
chain,
|
|
13893
13688
|
address,
|
|
13894
13689
|
startDate,
|
|
13895
13690
|
endDate,
|
|
13896
13691
|
page,
|
|
13897
|
-
offset: limit
|
|
13898
|
-
chainId,
|
|
13899
|
-
network: chain,
|
|
13900
|
-
functionName: 'ETHERSCAN',
|
|
13901
|
-
apiKey: API_KEY
|
|
13692
|
+
offset: limit
|
|
13902
13693
|
})
|
|
13903
13694
|
}
|
|
13904
13695
|
|
|
13905
|
-
async function COINGECKO() {
|
|
13906
|
-
const
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
if (missingParamsError) {
|
|
13910
|
-
return missingParamsError
|
|
13911
|
-
}
|
|
13912
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Coingecko);
|
|
13913
|
-
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}`
|
|
13914
13699
|
|
|
13915
13700
|
const headers = {
|
|
13916
13701
|
accept: 'application/json',
|
|
@@ -13925,7 +13710,7 @@ async function COINGECKO() {
|
|
|
13925
13710
|
const token = param1;
|
|
13926
13711
|
const vsCurrencies = param2;
|
|
13927
13712
|
if (!token) {
|
|
13928
|
-
return
|
|
13713
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13929
13714
|
}
|
|
13930
13715
|
url = `https://api.coingecko.com/api/v3/simple/price?vs_currencies=${vsCurrencies ? vsCurrencies : 'usd'}&symbols=${token}`;
|
|
13931
13716
|
break
|
|
@@ -13974,7 +13759,7 @@ async function COINGECKO() {
|
|
|
13974
13759
|
}
|
|
13975
13760
|
|
|
13976
13761
|
default:
|
|
13977
|
-
return
|
|
13762
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
13978
13763
|
}
|
|
13979
13764
|
|
|
13980
13765
|
try {
|
|
@@ -13983,10 +13768,12 @@ async function COINGECKO() {
|
|
|
13983
13768
|
|
|
13984
13769
|
if (!response.ok) {
|
|
13985
13770
|
const message = json?.status?.error_message || '';
|
|
13771
|
+
if (response.status === 429) {
|
|
13772
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
13773
|
+
}
|
|
13986
13774
|
if (message.includes('API Key Missing')) {
|
|
13987
|
-
return
|
|
13775
|
+
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
|
|
13988
13776
|
}
|
|
13989
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, response.status)
|
|
13990
13777
|
}
|
|
13991
13778
|
|
|
13992
13779
|
if (lowerCategory === 'price') {
|
|
@@ -14039,27 +13826,18 @@ async function COINGECKO() {
|
|
|
14039
13826
|
return flat
|
|
14040
13827
|
})
|
|
14041
13828
|
} catch (error) {
|
|
14042
|
-
|
|
13829
|
+
console.error(error);
|
|
13830
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14043
13831
|
}
|
|
14044
13832
|
}
|
|
14045
13833
|
|
|
14046
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}`
|
|
14047
13837
|
let [addresses, category, chains, startTime, endTime, page = 1, offset = 10] = argsToArray(arguments);
|
|
14048
|
-
|
|
14049
|
-
const optionalParams = category === 'balance' ? {} : {startTime, endTime};
|
|
14050
|
-
|
|
14051
|
-
const missingParamsError = checkRequiredParams({ addresses, category, chains, ...optionalParams });
|
|
14052
|
-
|
|
14053
|
-
if (missingParamsError) {
|
|
14054
|
-
return missingParamsError
|
|
14055
|
-
}
|
|
14056
|
-
|
|
14057
13838
|
if (offset > MAX_PAGE_LIMIT) {
|
|
14058
|
-
return
|
|
13839
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
14059
13840
|
}
|
|
14060
|
-
|
|
14061
|
-
const API_KEY = window.localStorage.getItem(SERVICES_API_KEY.Etherscan);
|
|
14062
|
-
if (!API_KEY) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Etherscan)
|
|
14063
13841
|
const INPUTS = addresses
|
|
14064
13842
|
.split(',')
|
|
14065
13843
|
.map((a) => a.trim())
|
|
@@ -14072,21 +13850,21 @@ async function EOA() {
|
|
|
14072
13850
|
// Map: finalAddress => ENS name (if applicable)
|
|
14073
13851
|
const ADDRESS_MAP = {};
|
|
14074
13852
|
for (const input of INPUTS) {
|
|
14075
|
-
if (isAddress
|
|
13853
|
+
if (isAddress(input)) {
|
|
14076
13854
|
ADDRESS_MAP[input.toLowerCase()] = null; // it's a direct address
|
|
14077
13855
|
} else {
|
|
14078
13856
|
try {
|
|
14079
|
-
const resolved = await fromEnsNameToAddress
|
|
13857
|
+
const resolved = await fromEnsNameToAddress(input); // ENS -> address
|
|
14080
13858
|
if (resolved) ADDRESS_MAP[resolved.toLowerCase()] = input;
|
|
14081
13859
|
} catch {
|
|
14082
|
-
return
|
|
13860
|
+
return `${input}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
14083
13861
|
}
|
|
14084
13862
|
}
|
|
14085
13863
|
}
|
|
14086
13864
|
const ADDRS = Object.keys(ADDRESS_MAP);
|
|
14087
13865
|
for (const chain of CHAINS) {
|
|
14088
13866
|
const chainId = CHAIN_ID_MAP[chain];
|
|
14089
|
-
if (!chainId) return
|
|
13867
|
+
if (!chainId) return ERROR_MESSAGES_FLAG.UNSUPPORTED_CHAIN
|
|
14090
13868
|
if (category === 'balance') {
|
|
14091
13869
|
for (let i = 0; i < ADDRS.length; i += 20) {
|
|
14092
13870
|
const slice = ADDRS.slice(i, i + 20).join(',');
|
|
@@ -14096,7 +13874,7 @@ async function EOA() {
|
|
|
14096
13874
|
`&module=account&action=${action}&address=${slice}` +
|
|
14097
13875
|
`&page=${page}&offset=100&apikey=${API_KEY}`;
|
|
14098
13876
|
const data = await fetchJSON(url);
|
|
14099
|
-
if (
|
|
13877
|
+
if (typeof data === 'string') return data
|
|
14100
13878
|
data.forEach((tx) =>
|
|
14101
13879
|
out.push({
|
|
14102
13880
|
chain,
|
|
@@ -14109,14 +13887,8 @@ async function EOA() {
|
|
|
14109
13887
|
continue
|
|
14110
13888
|
}
|
|
14111
13889
|
if (category === 'txns') {
|
|
14112
|
-
const startBlock = await
|
|
14113
|
-
const endBlock = await
|
|
14114
|
-
if (!startBlock?.toString()) {
|
|
14115
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { startTime })
|
|
14116
|
-
}
|
|
14117
|
-
if (!endBlock?.toString()) {
|
|
14118
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { endTime })
|
|
14119
|
-
}
|
|
13890
|
+
const startBlock = await fromTimeStampToBlock(toTimestamp(startTime), chain, API_KEY);
|
|
13891
|
+
const endBlock = await fromTimeStampToBlock(toTimestamp(endTime), chain, API_KEY);
|
|
14120
13892
|
for (const addr of ADDRS) {
|
|
14121
13893
|
const url =
|
|
14122
13894
|
`https://api.etherscan.io/v2/api?chainid=${chainId}` +
|
|
@@ -14124,7 +13896,7 @@ async function EOA() {
|
|
|
14124
13896
|
`&startblock=${startBlock}&endblock=${endBlock}` +
|
|
14125
13897
|
`&page=${page}&offset=${offset}&sort=asc&apikey=${API_KEY}`;
|
|
14126
13898
|
const data = await fetchJSON(url);
|
|
14127
|
-
if (
|
|
13899
|
+
if (typeof data === 'string') return data
|
|
14128
13900
|
data.forEach((tx) =>
|
|
14129
13901
|
out.push({
|
|
14130
13902
|
chain,
|
|
@@ -14136,7 +13908,7 @@ async function EOA() {
|
|
|
14136
13908
|
}
|
|
14137
13909
|
continue
|
|
14138
13910
|
}
|
|
14139
|
-
return
|
|
13911
|
+
return ERROR_MESSAGES_FLAG.INVALID_CATEGORY
|
|
14140
13912
|
}
|
|
14141
13913
|
|
|
14142
13914
|
return out
|
|
@@ -14144,27 +13916,21 @@ async function EOA() {
|
|
|
14144
13916
|
async function fetchJSON(url) {
|
|
14145
13917
|
try {
|
|
14146
13918
|
const res = await fetch(url);
|
|
14147
|
-
if (!res.ok) {
|
|
14148
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
14149
|
-
}
|
|
13919
|
+
if (!res.ok) return `HTTP_${res.status}`
|
|
14150
13920
|
|
|
14151
13921
|
const json = await res.json();
|
|
14152
13922
|
|
|
14153
13923
|
if (json.result?.includes?.('Invalid API Key'))
|
|
14154
|
-
return
|
|
13924
|
+
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
|
|
14155
13925
|
|
|
14156
13926
|
if (json.result?.includes?.('Max rate limit reached'))
|
|
14157
|
-
return
|
|
13927
|
+
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
14158
13928
|
|
|
14159
|
-
if (json.status === '0' && json.message !== 'No transactions found')
|
|
14160
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.CUSTOM, {
|
|
14161
|
-
message: json.message || 'Api Error',
|
|
14162
|
-
reason: json.message || 'json.status === "0" && json.message !== "No transactions found"'
|
|
14163
|
-
})
|
|
13929
|
+
if (json.status === '0' && json.message !== 'No transactions found') return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14164
13930
|
|
|
14165
13931
|
return json.result
|
|
14166
|
-
} catch
|
|
14167
|
-
return
|
|
13932
|
+
} catch {
|
|
13933
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14168
13934
|
}
|
|
14169
13935
|
}
|
|
14170
13936
|
}
|
|
@@ -14180,38 +13946,25 @@ async function FLVURL(token, vs_currencies) {
|
|
|
14180
13946
|
async function SAFE() {
|
|
14181
13947
|
let [address, utility, chain, limit = 10, offset = 0] = argsToArray(arguments);
|
|
14182
13948
|
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
if (
|
|
14186
|
-
return missingParamsError
|
|
14187
|
-
}
|
|
14188
|
-
|
|
14189
|
-
if (offset > MAX_PAGE_LIMIT) {
|
|
14190
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT)
|
|
14191
|
-
}
|
|
14192
|
-
|
|
14193
|
-
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Safe);
|
|
14194
|
-
|
|
14195
|
-
if (!apiKey) return errorMessageHandler(ERROR_MESSAGES_FLAG.MISSING_KEY, SERVICES_API_KEY.Safe)
|
|
14196
|
-
|
|
14197
|
-
if (typeof limit !== 'number' || limit < 0) return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { limit })
|
|
14198
|
-
if (typeof offset !== 'number' || offset < 0)
|
|
14199
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { offset })
|
|
14200
|
-
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'
|
|
14201
13952
|
if (limit > MAX_PAGE_LIMIT) {
|
|
14202
|
-
return
|
|
13953
|
+
return ERROR_MESSAGES_FLAG.MAX_PAGE_LIMIT
|
|
14203
13954
|
}
|
|
14204
13955
|
|
|
13956
|
+
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
|
|
14205
13957
|
const chainIdentifier = SAFE_CHAIN_MAP[chain];
|
|
14206
13958
|
|
|
14207
|
-
if (!
|
|
13959
|
+
if (!apiKey) return `${SERVICE_API_KEY.Safe}_MISSING`
|
|
13960
|
+
if (!chainIdentifier) return 'CHAIN IS NOT SUPPORTED'
|
|
14208
13961
|
|
|
14209
|
-
if (!isAddress
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
}
|
|
13962
|
+
if (!isAddress(address)) {
|
|
13963
|
+
address = await fromEnsNameToAddress(address);
|
|
13964
|
+
}
|
|
13965
|
+
|
|
13966
|
+
if (!address) {
|
|
13967
|
+
return `${address}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`
|
|
14215
13968
|
}
|
|
14216
13969
|
|
|
14217
13970
|
const url = `https://api.safe.global/tx-service/${chainIdentifier}/api/v2/safes/${address}/multisig-transactions?limit=${limit}&offset=${offset}`;
|
|
@@ -14221,29 +13974,23 @@ async function SAFE() {
|
|
|
14221
13974
|
Authorization: `Bearer ${apiKey}`
|
|
14222
13975
|
}
|
|
14223
13976
|
});
|
|
14224
|
-
if (!response.ok) {
|
|
14225
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, response.status)
|
|
14226
|
-
}
|
|
13977
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`)
|
|
14227
13978
|
const json = await response.json();
|
|
14228
13979
|
if (!Array.isArray(json.results)) {
|
|
14229
|
-
return
|
|
13980
|
+
return 'INVALID API RESPONSE'
|
|
14230
13981
|
}
|
|
14231
13982
|
// remove nested structure from the response
|
|
14232
13983
|
return json.results.map(({ confirmations, dataDecoded, ...rest }) => rest)
|
|
14233
13984
|
} catch (e) {
|
|
14234
|
-
|
|
13985
|
+
console.log(e);
|
|
13986
|
+
return 'ERROR IN FETCHING'
|
|
14235
13987
|
}
|
|
14236
13988
|
}
|
|
14237
13989
|
|
|
14238
13990
|
async function DEFILLAMA() {
|
|
14239
13991
|
let [category] = argsToArray(arguments);
|
|
14240
|
-
const
|
|
14241
|
-
|
|
14242
|
-
if (missingParamsError) {
|
|
14243
|
-
return missingParamsError
|
|
14244
|
-
}
|
|
14245
|
-
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.Defillama);
|
|
14246
|
-
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}`
|
|
14247
13994
|
const categoryList = ['protocols', 'yields', 'dex', 'fees'];
|
|
14248
13995
|
const categoryMap = {
|
|
14249
13996
|
[categoryList[0]]: 'https://api.llama.fi/protocols',
|
|
@@ -14255,13 +14002,9 @@ async function DEFILLAMA() {
|
|
|
14255
14002
|
};
|
|
14256
14003
|
let url = categoryMap[category];
|
|
14257
14004
|
|
|
14258
|
-
if (!url) {
|
|
14259
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.INVALID_PARAM, { category })
|
|
14260
|
-
}
|
|
14261
|
-
|
|
14262
14005
|
try {
|
|
14263
14006
|
const response = await fetch(url);
|
|
14264
|
-
if (!response.ok)
|
|
14007
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`)
|
|
14265
14008
|
let json = await response.json();
|
|
14266
14009
|
switch (category) {
|
|
14267
14010
|
case categoryList[0]: {
|
|
@@ -14286,59 +14029,38 @@ async function DEFILLAMA() {
|
|
|
14286
14029
|
|
|
14287
14030
|
return removeNestedStructure(Array.isArray(json) ? json : [json])
|
|
14288
14031
|
} catch (e) {
|
|
14289
|
-
|
|
14032
|
+
console.log(e);
|
|
14033
|
+
return 'ERROR IN FETCHING'
|
|
14290
14034
|
}
|
|
14291
14035
|
}
|
|
14292
14036
|
|
|
14293
14037
|
async function UNISWAP() {
|
|
14294
14038
|
const [graphType, category, param1, param2] = argsToArray(arguments);
|
|
14295
|
-
const missingParamsError = checkRequiredParams({ graphType, category, param1 });
|
|
14296
|
-
|
|
14297
|
-
if (missingParamsError) {
|
|
14298
|
-
return missingParamsError
|
|
14299
|
-
}
|
|
14300
14039
|
const baseUrl = 'https://onchain-proxy.fileverse.io/third-party';
|
|
14301
14040
|
try {
|
|
14302
14041
|
const url = `${baseUrl}?service=uniswap&graphType=${graphType}&category=${category}&input1=${param1}&input2=${param2}`;
|
|
14303
14042
|
const res = await fetch(url);
|
|
14304
|
-
if (!res.ok) {
|
|
14305
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
14306
|
-
}
|
|
14043
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
14307
14044
|
const json = await res.json();
|
|
14308
|
-
|
|
14309
|
-
return removeNestedStructure(json)
|
|
14310
|
-
} else {
|
|
14311
|
-
return json
|
|
14312
|
-
}
|
|
14313
|
-
|
|
14045
|
+
return removeNestedStructure(json)
|
|
14314
14046
|
} catch (err) {
|
|
14315
|
-
|
|
14047
|
+
console.error('UNISWAP fetch error:', err);
|
|
14048
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14316
14049
|
}
|
|
14317
14050
|
}
|
|
14318
14051
|
|
|
14319
14052
|
async function AAVE() {
|
|
14320
14053
|
const [graphType, category, param1, param2] = argsToArray(arguments);
|
|
14321
|
-
const missingParamsError = checkRequiredParams({ graphType, category, param1 });
|
|
14322
|
-
|
|
14323
|
-
if (missingParamsError) {
|
|
14324
|
-
return missingParamsError
|
|
14325
|
-
}
|
|
14326
14054
|
const baseUrl = 'https://onchain-proxy.fileverse.io/third-party';
|
|
14327
14055
|
try {
|
|
14328
14056
|
const url = `${baseUrl}?service=aave&graphType=${graphType}&category=${category}&input1=${param1}&input2=${param2}`;
|
|
14329
14057
|
const res = await fetch(url);
|
|
14330
|
-
if (!res.ok) {
|
|
14331
|
-
return errorMessageHandler(ERROR_MESSAGES_FLAG.NETWORK_ERROR, res.status)
|
|
14332
|
-
}
|
|
14058
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
14333
14059
|
const json = await res.json();
|
|
14334
|
-
|
|
14335
|
-
return removeNestedStructure(json)
|
|
14336
|
-
} else {
|
|
14337
|
-
return json
|
|
14338
|
-
}
|
|
14339
|
-
|
|
14060
|
+
return removeNestedStructure(json)
|
|
14340
14061
|
} catch (err) {
|
|
14341
|
-
|
|
14062
|
+
console.error('AAVE fetch error:', err);
|
|
14063
|
+
return ERROR_MESSAGES_FLAG.DEFAULT
|
|
14342
14064
|
}
|
|
14343
14065
|
}
|
|
14344
14066
|
|
|
@@ -14372,4 +14094,4 @@ function MYANIMELIST() {
|
|
|
14372
14094
|
|
|
14373
14095
|
const utils = { errors, symbols, date };
|
|
14374
14096
|
|
|
14375
|
-
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 };
|