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