@fileverse-dev/formulajs 4.4.11-mod-24 → 4.4.11-mod-26
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 +116 -99
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +22 -11
- package/lib/esm/crypto-constants.mjs +157 -54
- package/lib/esm/index.mjs +22 -11
- package/package.json +1 -1
- package/types/cjs/index.d.cts +1 -1
- package/types/esm/index.d.mts +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -13135,12 +13135,14 @@ async function handleScanRequest({
|
|
|
13135
13135
|
address,
|
|
13136
13136
|
startDate,
|
|
13137
13137
|
endDate,
|
|
13138
|
+
page = 1,
|
|
13139
|
+
offset = 10,
|
|
13138
13140
|
}) {
|
|
13139
13141
|
const API_KEY = window.localStorage.getItem(scanKey);
|
|
13140
13142
|
if (!API_KEY) return `${scanKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13141
13143
|
if (API_KEY === 'xxxx') return `${scanKey}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`;
|
|
13142
13144
|
|
|
13143
|
-
|
|
13145
|
+
let chainId = CHAIN_ID_MAP[chain?.toLowerCase()];
|
|
13144
13146
|
if (!chainId) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_CHAIN}`;
|
|
13145
13147
|
|
|
13146
13148
|
const ACTION_MAP = {
|
|
@@ -13153,6 +13155,10 @@ async function handleScanRequest({
|
|
|
13153
13155
|
const action = ACTION_MAP[type];
|
|
13154
13156
|
if (!action) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
13155
13157
|
|
|
13158
|
+
|
|
13159
|
+
if (scanKey === SERVICE_API_KEY.Basescan) chainId = 'base';
|
|
13160
|
+
if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = 'gnosis';
|
|
13161
|
+
|
|
13156
13162
|
let url = `${baseUrl}?chainid=${chainId}&module=account&action=${action}&apikey=${API_KEY}`;
|
|
13157
13163
|
|
|
13158
13164
|
if (['all-txns', 'token-txns', 'nft-txns'].includes(type)) {
|
|
@@ -13166,6 +13172,7 @@ async function handleScanRequest({
|
|
|
13166
13172
|
]);
|
|
13167
13173
|
url += `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13168
13174
|
}
|
|
13175
|
+
url += `&page=${page}&offset=${offset}`;
|
|
13169
13176
|
}
|
|
13170
13177
|
|
|
13171
13178
|
try {
|
|
@@ -13322,7 +13329,7 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
|
|
|
13322
13329
|
}
|
|
13323
13330
|
|
|
13324
13331
|
async function BASESCAN(...args) {
|
|
13325
|
-
const [type, chain, address, startDate, endDate] = args;
|
|
13332
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13326
13333
|
return handleScanRequest({
|
|
13327
13334
|
scanKey: SERVICE_API_KEY.Basescan,
|
|
13328
13335
|
baseUrl: 'https://api.basescan.org/api',
|
|
@@ -13331,10 +13338,12 @@ async function BASESCAN(...args) {
|
|
|
13331
13338
|
address,
|
|
13332
13339
|
startDate,
|
|
13333
13340
|
endDate,
|
|
13341
|
+
page,
|
|
13342
|
+
offset:limit
|
|
13334
13343
|
});
|
|
13335
13344
|
}
|
|
13336
13345
|
async function GNOSISSCAN(...args) {
|
|
13337
|
-
const [type, chain, address, startDate, endDate] = args;
|
|
13346
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13338
13347
|
return handleScanRequest({
|
|
13339
13348
|
scanKey: SERVICE_API_KEY.Gnosisscan,
|
|
13340
13349
|
baseUrl: 'https://api.gnosisscan.io/api',
|
|
@@ -13343,6 +13352,8 @@ async function GNOSISSCAN(...args) {
|
|
|
13343
13352
|
address,
|
|
13344
13353
|
startDate,
|
|
13345
13354
|
endDate,
|
|
13355
|
+
page,
|
|
13356
|
+
offset:limit
|
|
13346
13357
|
});
|
|
13347
13358
|
}
|
|
13348
13359
|
|
|
@@ -13448,7 +13459,7 @@ async function GNOSIS({
|
|
|
13448
13459
|
|
|
13449
13460
|
|
|
13450
13461
|
async function ETHERSCAN(...args) {
|
|
13451
|
-
const [type, chain, address, startDate, endDate] = args;
|
|
13462
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13452
13463
|
return handleScanRequest({
|
|
13453
13464
|
scanKey: SERVICE_API_KEY.Etherscan,
|
|
13454
13465
|
baseUrl: 'https://api.etherscan.io/v2/api',
|
|
@@ -13457,6 +13468,8 @@ async function ETHERSCAN(...args) {
|
|
|
13457
13468
|
address,
|
|
13458
13469
|
startDate,
|
|
13459
13470
|
endDate,
|
|
13471
|
+
page,
|
|
13472
|
+
offset:limit
|
|
13460
13473
|
});
|
|
13461
13474
|
}
|
|
13462
13475
|
|
|
@@ -13502,7 +13515,7 @@ async function COINGECKO(token, vs_currencies) {
|
|
|
13502
13515
|
}
|
|
13503
13516
|
}
|
|
13504
13517
|
|
|
13505
|
-
async function EOA(addresses, category, chains, startTime, endTime) {
|
|
13518
|
+
async function EOA(addresses, category, chains, startTime, endTime, page = 1, offset = 10) {
|
|
13506
13519
|
try {
|
|
13507
13520
|
const ADDRESSES = addresses.split(',').map(a => a.trim());
|
|
13508
13521
|
const CHAINS = typeof chains === 'string' ? chains.split(',').map(c => c.trim()) : chains;
|
|
@@ -13523,18 +13536,16 @@ async function EOA(addresses, category, chains, startTime, endTime) {
|
|
|
13523
13536
|
if (category === 'txns') {
|
|
13524
13537
|
const startBlock = await fromTimeStampToBlock(startTime, chain, API_KEY);
|
|
13525
13538
|
const endBlock = await fromTimeStampToBlock(endTime, chain, API_KEY);
|
|
13526
|
-
timeQuery = `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13539
|
+
timeQuery = `&startblock=${startBlock}&endblock=${endBlock}&page=${page}&offset=${offset}&sort=asc`;
|
|
13527
13540
|
} else {
|
|
13528
13541
|
timeQuery = `&tag=latest`;
|
|
13529
13542
|
}
|
|
13530
13543
|
|
|
13531
|
-
const url = `https://api.etherscan.io/v2/api?module=${action.split('.')[0]}&action=${action.split('.')[1]}&address=${address}&
|
|
13544
|
+
const url = `https://api.etherscan.io/v2/api?module=${action.split('.')[0]}&action=${action.split('.')[1]}&address=${address}&chainid=${chainId}&apikey=${API_KEY}${timeQuery}`;
|
|
13532
13545
|
|
|
13533
13546
|
try {
|
|
13534
13547
|
const response = await fetch(url);
|
|
13535
|
-
if (!response.ok) {
|
|
13536
|
-
return `HTTP_${response.status}`;
|
|
13537
|
-
}
|
|
13548
|
+
if (!response.ok) return `HTTP_${response.status}`;
|
|
13538
13549
|
|
|
13539
13550
|
const json = await response.json();
|
|
13540
13551
|
|
|
@@ -13550,7 +13561,6 @@ async function EOA(addresses, category, chains, startTime, endTime) {
|
|
|
13550
13561
|
for (const entry of entries) {
|
|
13551
13562
|
flatResults.push({ chain, address, ...entry });
|
|
13552
13563
|
}
|
|
13553
|
-
|
|
13554
13564
|
} catch (e) {
|
|
13555
13565
|
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
13556
13566
|
}
|
|
@@ -13567,6 +13577,7 @@ async function EOA(addresses, category, chains, startTime, endTime) {
|
|
|
13567
13577
|
|
|
13568
13578
|
|
|
13569
13579
|
|
|
13580
|
+
|
|
13570
13581
|
async function FLVURL(token, vs_currencies) {
|
|
13571
13582
|
return new Promise((resolve) => {
|
|
13572
13583
|
setTimeout(() => {
|
|
@@ -120,19 +120,62 @@ var FUNCTION_LOCALE = [
|
|
|
120
120
|
{
|
|
121
121
|
API_KEY: SERVICE_API_KEY.Basescan,
|
|
122
122
|
LOGO: "https://raw.githubusercontent.com/mritunjayz/github-storage/refs/heads/main/1689874988430.jpeg",
|
|
123
|
-
// public Base logo
|
|
124
123
|
BRAND_COLOR: "#f1f5ff",
|
|
125
124
|
BRAND_SECONDARY_COLOR: "#2752ff",
|
|
126
125
|
n: "BASESCAN",
|
|
127
126
|
t: 20,
|
|
128
127
|
d: "Fetches Base network data via Basescan: native txns, ERC-20 transfers, ERC-721 transfers, and gas metrics.",
|
|
129
|
-
a: "Pulls on-chain activity for Base (chainid 8453) using Basescan\u2019s API \u2014 supports full tx history, token/NFT transfers,
|
|
128
|
+
a: "Pulls on-chain activity for Base (chainid 8453) using Basescan\u2019s API \u2014 supports full tx history, token/NFT transfers, gas prices, and pagination.",
|
|
130
129
|
p: [
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
{
|
|
131
|
+
name: "type",
|
|
132
|
+
detail: "Data category: 'all-txns' | 'token-txns' | 'nft-txns' | 'gas'.",
|
|
133
|
+
example: `"token-txns"`,
|
|
134
|
+
require: "m",
|
|
135
|
+
type: "string"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "chain",
|
|
139
|
+
detail: "Must be 'base'.",
|
|
140
|
+
example: `"base"`,
|
|
141
|
+
require: "m",
|
|
142
|
+
type: "string"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "address",
|
|
146
|
+
detail: "Target wallet address (only required for txns, token, and nft queries). Not needed for 'gas'.",
|
|
147
|
+
example: `"0x7FD624f3f97A7dd36195E8379F28dB6147C270ff"`,
|
|
148
|
+
require: "o",
|
|
149
|
+
type: "string"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "startDate",
|
|
153
|
+
detail: "Start UNIX timestamp in seconds (used to resolve block range). Optional, only applies to txns.",
|
|
154
|
+
example: `"1704067200"`,
|
|
155
|
+
require: "o",
|
|
156
|
+
type: "rangenumber"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "endDate",
|
|
160
|
+
detail: "End UNIX timestamp in seconds (used to resolve block range). Optional, only applies to txns.",
|
|
161
|
+
example: `"20250614"`,
|
|
162
|
+
require: "o",
|
|
163
|
+
type: "rangenumber"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "page",
|
|
167
|
+
detail: "Page number for paginated results. Only applies to txns/token/nft queries.",
|
|
168
|
+
example: `"1"`,
|
|
169
|
+
require: "o",
|
|
170
|
+
type: "number"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "offset",
|
|
174
|
+
detail: "Number of items per page (limit). Only applies to txns/token/nft queries.",
|
|
175
|
+
example: `"25"`,
|
|
176
|
+
require: "o",
|
|
177
|
+
type: "number"
|
|
178
|
+
}
|
|
136
179
|
]
|
|
137
180
|
},
|
|
138
181
|
{
|
|
@@ -142,14 +185,58 @@ var FUNCTION_LOCALE = [
|
|
|
142
185
|
BRAND_SECONDARY_COLOR: "#133629",
|
|
143
186
|
n: "GNOSISSCAN",
|
|
144
187
|
t: 20,
|
|
145
|
-
d: "Fetches Gnosis Chain data via Gnosisscan:
|
|
146
|
-
a: "Queries Gnosis Chain (chainid 100) through Gnosisscan\u2019s API to return
|
|
188
|
+
d: "Fetches Gnosis Chain data via Gnosisscan: native transactions, ERC-20 token transfers, ERC-721 NFT transfers, and gas metrics.",
|
|
189
|
+
a: "Queries Gnosis Chain (chainid 100) through Gnosisscan\u2019s API to return transaction history, token/NFT transfers, or gas price information. Supports pagination and time-based filtering for transaction types.",
|
|
147
190
|
p: [
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
191
|
+
{
|
|
192
|
+
name: "type",
|
|
193
|
+
detail: "Data category to fetch. Options: 'all-txns', 'token-txns', 'nft-txns', or 'gas'.",
|
|
194
|
+
example: `"nft-txns"`,
|
|
195
|
+
require: "m",
|
|
196
|
+
type: "string"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "chain",
|
|
200
|
+
detail: "Must be 'gnosis'.",
|
|
201
|
+
example: `"gnosis"`,
|
|
202
|
+
require: "m",
|
|
203
|
+
type: "string"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "address",
|
|
207
|
+
detail: "Wallet address to query. Required for all types except 'gas'.",
|
|
208
|
+
example: `"0x90830Ed558f12D826370DC52E9D87947A7F18De9"`,
|
|
209
|
+
require: "o",
|
|
210
|
+
type: "string"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "startDate",
|
|
214
|
+
detail: "Start timestamp in UNIX seconds. Used to resolve starting block for txns.",
|
|
215
|
+
example: `"1704067200"`,
|
|
216
|
+
require: "o",
|
|
217
|
+
type: "rangenumber"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "endDate",
|
|
221
|
+
detail: "End timestamp in UNIX seconds. Used to resolve ending block for txns.",
|
|
222
|
+
example: `"20250614"`,
|
|
223
|
+
require: "o",
|
|
224
|
+
type: "rangenumber"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: "page",
|
|
228
|
+
detail: "Page number for paginated transaction results. Applies only to 'txns', 'token-txns', and 'nft-txns'.",
|
|
229
|
+
example: `"1"`,
|
|
230
|
+
require: "o",
|
|
231
|
+
type: "number"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "offset",
|
|
235
|
+
detail: "Number of results per page (limit). Applies only to 'txns', 'token-txns', and 'nft-txns'.",
|
|
236
|
+
example: `"50"`,
|
|
237
|
+
require: "o",
|
|
238
|
+
type: "number"
|
|
239
|
+
}
|
|
153
240
|
]
|
|
154
241
|
},
|
|
155
242
|
{
|
|
@@ -164,7 +251,7 @@ var FUNCTION_LOCALE = [
|
|
|
164
251
|
{
|
|
165
252
|
name: "address",
|
|
166
253
|
detail: "The address string representing the addresses to check for balance",
|
|
167
|
-
example: `"
|
|
254
|
+
example: `"0xe9A6378d8FD4983C2999DB0735f258397E8C2253"`,
|
|
168
255
|
require: "m",
|
|
169
256
|
type: "string"
|
|
170
257
|
},
|
|
@@ -178,21 +265,21 @@ var FUNCTION_LOCALE = [
|
|
|
178
265
|
{
|
|
179
266
|
name: "chain",
|
|
180
267
|
detail: "The blockchain to query. By default on Ethereum mainnet.",
|
|
181
|
-
example: `"
|
|
268
|
+
example: `"gnosis"`,
|
|
182
269
|
require: "o",
|
|
183
270
|
type: "string"
|
|
184
271
|
},
|
|
185
272
|
{
|
|
186
273
|
name: "startTimestamp",
|
|
187
274
|
detail: 'The Unix timestamp marking the start of the transaction search range. Work with type === "txns"',
|
|
188
|
-
example: "
|
|
275
|
+
example: "1721174400",
|
|
189
276
|
require: "o",
|
|
190
277
|
type: "rangenumber"
|
|
191
278
|
},
|
|
192
279
|
{
|
|
193
280
|
name: "endTimestamp",
|
|
194
281
|
detail: 'The Unix timestamp marking the end of the transaction search range. Work with type === "txns"',
|
|
195
|
-
example: "
|
|
282
|
+
example: "20250614",
|
|
196
283
|
require: "o",
|
|
197
284
|
type: "rangenumber"
|
|
198
285
|
},
|
|
@@ -269,12 +356,12 @@ var FUNCTION_LOCALE = [
|
|
|
269
356
|
n: "EOA",
|
|
270
357
|
t: 20,
|
|
271
358
|
d: "Fetches address data like transactions, balances, or portfolio info from multiple supported chains.",
|
|
272
|
-
a: "Dynamically queries blockchain data such as transactions
|
|
359
|
+
a: "Dynamically queries blockchain data such as transactions and balances by resolving time ranges to block ranges and supporting pagination.",
|
|
273
360
|
p: [
|
|
274
361
|
{
|
|
275
362
|
name: "addresses",
|
|
276
|
-
detail: "One or more
|
|
277
|
-
example: `"
|
|
363
|
+
detail: "One or more addresses (comma-separated) to query.",
|
|
364
|
+
example: `"0xe9A6378d8FD4983C2999DB0735f258397E8C2253, 0x50Aa3435E310d5a2d15a989Bc353ce7f5682E1d4"`,
|
|
278
365
|
require: "m",
|
|
279
366
|
type: "string"
|
|
280
367
|
},
|
|
@@ -282,27 +369,43 @@ var FUNCTION_LOCALE = [
|
|
|
282
369
|
name: "categories",
|
|
283
370
|
detail: `Type of data to fetch. Supported values: "txns", "balance".`,
|
|
284
371
|
example: `"txns"`,
|
|
285
|
-
require: "m"
|
|
372
|
+
require: "m",
|
|
373
|
+
type: "string"
|
|
286
374
|
},
|
|
287
375
|
{
|
|
288
376
|
name: "chain",
|
|
289
|
-
detail: `Blockchain network to query. Supported values: "ethereum", "gnosis", "base".`,
|
|
290
|
-
example: `"ethereum"`,
|
|
291
|
-
require: "m"
|
|
377
|
+
detail: `Blockchain network(s) to query. Supported values: "ethereum", "gnosis", "base". Accepts comma-separated values.`,
|
|
378
|
+
example: `"ethereum, gnosis"`,
|
|
379
|
+
require: "m",
|
|
380
|
+
type: "string"
|
|
292
381
|
},
|
|
293
382
|
{
|
|
294
383
|
name: "startTime",
|
|
295
|
-
detail: "Start time in UNIX timestamp (seconds).
|
|
296
|
-
example: "
|
|
384
|
+
detail: "Start time in UNIX timestamp (seconds). Used to calculate starting block for transaction queries.",
|
|
385
|
+
example: "1721174400",
|
|
297
386
|
require: "m",
|
|
298
387
|
type: "rangenumber"
|
|
299
388
|
},
|
|
300
389
|
{
|
|
301
390
|
name: "endTime",
|
|
302
|
-
detail: "End time in UNIX timestamp (seconds).
|
|
303
|
-
example: "
|
|
391
|
+
detail: "End time in UNIX timestamp (seconds). Used to calculate ending block for transaction queries.",
|
|
392
|
+
example: "1722988800",
|
|
304
393
|
require: "m",
|
|
305
394
|
type: "rangenumber"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "page",
|
|
398
|
+
detail: "The page number for paginated transaction results. Only used when category is 'txns'.",
|
|
399
|
+
example: "1",
|
|
400
|
+
require: "o",
|
|
401
|
+
type: "number"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: "offset",
|
|
405
|
+
detail: "The number of results to return per page (limit). Only used when category is 'txns'.",
|
|
406
|
+
example: "25",
|
|
407
|
+
require: "o",
|
|
408
|
+
type: "number"
|
|
306
409
|
}
|
|
307
410
|
]
|
|
308
411
|
},
|
|
@@ -363,7 +466,7 @@ var FUNCTION_LOCALE = [
|
|
|
363
466
|
{
|
|
364
467
|
name: "address",
|
|
365
468
|
detail: "The address to query, in hexadecimal format.",
|
|
366
|
-
example: `"
|
|
469
|
+
example: `"0xe9A6378d8FD4983C2999DB0735f258397E8C2253"`,
|
|
367
470
|
require: "m"
|
|
368
471
|
},
|
|
369
472
|
{
|
|
@@ -375,13 +478,13 @@ var FUNCTION_LOCALE = [
|
|
|
375
478
|
{
|
|
376
479
|
name: "chain",
|
|
377
480
|
detail: "The chain to query, supported values: 'ethereum', 'gnosis'.",
|
|
378
|
-
example: `"
|
|
481
|
+
example: `"gnosis"`,
|
|
379
482
|
require: "m"
|
|
380
483
|
},
|
|
381
484
|
{
|
|
382
485
|
name: "limit",
|
|
383
486
|
detail: "The number of transactions to return, default is 100.",
|
|
384
|
-
example: `
|
|
487
|
+
example: `10`,
|
|
385
488
|
require: "o",
|
|
386
489
|
repeat: "n"
|
|
387
490
|
},
|
|
@@ -701,49 +804,49 @@ var FUNCTION_LOCALE = [
|
|
|
701
804
|
]
|
|
702
805
|
},
|
|
703
806
|
{
|
|
704
|
-
API_KEY: SERVICE_API_KEY.
|
|
807
|
+
API_KEY: SERVICE_API_KEY.GnosisPay,
|
|
705
808
|
LOGO: "https://gnosisscan.io/assets/generic/html/favicon-light.ico",
|
|
706
809
|
BRAND_COLOR: "#f6f7f6",
|
|
707
810
|
BRAND_SECONDARY_COLOR: "#133629",
|
|
708
811
|
n: "GNOSIS",
|
|
709
812
|
t: 20,
|
|
710
|
-
d: "Fetches
|
|
711
|
-
a: "Retrieves
|
|
813
|
+
d: "Fetches Gnosis Pay card transaction history, including merchant, amount, and currency info.",
|
|
814
|
+
a: "Retrieves card transactions from Gnosis Pay\u2019s API for a specific card ID, filtered by date range and paginated via limit/offset.",
|
|
712
815
|
p: [
|
|
713
816
|
{
|
|
714
|
-
name: "
|
|
715
|
-
detail: "The
|
|
716
|
-
example: `"
|
|
717
|
-
require: "m",
|
|
718
|
-
type: "string"
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
name: "chain",
|
|
722
|
-
detail: "The chain name (e.g. 'ethereum', 'base', 'gnosis').",
|
|
723
|
-
example: `"ethereum"`,
|
|
817
|
+
name: "cardId",
|
|
818
|
+
detail: "The Gnosis Pay card ID to fetch transactions for.",
|
|
819
|
+
example: `"card_9f8f8b3a56"`,
|
|
724
820
|
require: "m",
|
|
725
821
|
type: "string"
|
|
726
822
|
},
|
|
727
|
-
{
|
|
728
|
-
name: "address",
|
|
729
|
-
detail: "The wallet address to fetch data for (not required for 'gas').",
|
|
730
|
-
example: `"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"`,
|
|
731
|
-
require: "o",
|
|
732
|
-
type: "string"
|
|
733
|
-
},
|
|
734
823
|
{
|
|
735
824
|
name: "startDate",
|
|
736
|
-
detail: "Start timestamp in seconds (
|
|
825
|
+
detail: "Start timestamp in seconds (UNIX). Filters transactions created after this date.",
|
|
737
826
|
example: `"1704067200"`,
|
|
738
827
|
require: "o",
|
|
739
828
|
type: "rangenumber"
|
|
740
829
|
},
|
|
741
830
|
{
|
|
742
831
|
name: "endDate",
|
|
743
|
-
detail: "End timestamp in seconds (
|
|
832
|
+
detail: "End timestamp in seconds (UNIX). Filters transactions created before this date.",
|
|
744
833
|
example: `"1706659200"`,
|
|
745
834
|
require: "o",
|
|
746
835
|
type: "rangenumber"
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
name: "limit",
|
|
839
|
+
detail: "Number of transactions to return per page.",
|
|
840
|
+
example: `"20"`,
|
|
841
|
+
require: "o",
|
|
842
|
+
type: "number"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
name: "offset",
|
|
846
|
+
detail: "Offset for pagination (i.e., how many records to skip).",
|
|
847
|
+
example: `"0"`,
|
|
848
|
+
require: "o",
|
|
849
|
+
type: "number"
|
|
747
850
|
}
|
|
748
851
|
]
|
|
749
852
|
},
|
package/lib/esm/index.mjs
CHANGED
|
@@ -13133,12 +13133,14 @@ async function handleScanRequest({
|
|
|
13133
13133
|
address,
|
|
13134
13134
|
startDate,
|
|
13135
13135
|
endDate,
|
|
13136
|
+
page = 1,
|
|
13137
|
+
offset = 10,
|
|
13136
13138
|
}) {
|
|
13137
13139
|
const API_KEY = window.localStorage.getItem(scanKey);
|
|
13138
13140
|
if (!API_KEY) return `${scanKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13139
13141
|
if (API_KEY === 'xxxx') return `${scanKey}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`;
|
|
13140
13142
|
|
|
13141
|
-
|
|
13143
|
+
let chainId = CHAIN_ID_MAP[chain?.toLowerCase()];
|
|
13142
13144
|
if (!chainId) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_CHAIN}`;
|
|
13143
13145
|
|
|
13144
13146
|
const ACTION_MAP = {
|
|
@@ -13151,6 +13153,10 @@ async function handleScanRequest({
|
|
|
13151
13153
|
const action = ACTION_MAP[type];
|
|
13152
13154
|
if (!action) return `${scanKey}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
13153
13155
|
|
|
13156
|
+
|
|
13157
|
+
if (scanKey === SERVICE_API_KEY.Basescan) chainId = 'base';
|
|
13158
|
+
if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = 'gnosis';
|
|
13159
|
+
|
|
13154
13160
|
let url = `${baseUrl}?chainid=${chainId}&module=account&action=${action}&apikey=${API_KEY}`;
|
|
13155
13161
|
|
|
13156
13162
|
if (['all-txns', 'token-txns', 'nft-txns'].includes(type)) {
|
|
@@ -13164,6 +13170,7 @@ async function handleScanRequest({
|
|
|
13164
13170
|
]);
|
|
13165
13171
|
url += `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13166
13172
|
}
|
|
13173
|
+
url += `&page=${page}&offset=${offset}`;
|
|
13167
13174
|
}
|
|
13168
13175
|
|
|
13169
13176
|
try {
|
|
@@ -13320,7 +13327,7 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
|
|
|
13320
13327
|
}
|
|
13321
13328
|
|
|
13322
13329
|
async function BASESCAN(...args) {
|
|
13323
|
-
const [type, chain, address, startDate, endDate] = args;
|
|
13330
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13324
13331
|
return handleScanRequest({
|
|
13325
13332
|
scanKey: SERVICE_API_KEY.Basescan,
|
|
13326
13333
|
baseUrl: 'https://api.basescan.org/api',
|
|
@@ -13329,10 +13336,12 @@ async function BASESCAN(...args) {
|
|
|
13329
13336
|
address,
|
|
13330
13337
|
startDate,
|
|
13331
13338
|
endDate,
|
|
13339
|
+
page,
|
|
13340
|
+
offset:limit
|
|
13332
13341
|
});
|
|
13333
13342
|
}
|
|
13334
13343
|
async function GNOSISSCAN(...args) {
|
|
13335
|
-
const [type, chain, address, startDate, endDate] = args;
|
|
13344
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13336
13345
|
return handleScanRequest({
|
|
13337
13346
|
scanKey: SERVICE_API_KEY.Gnosisscan,
|
|
13338
13347
|
baseUrl: 'https://api.gnosisscan.io/api',
|
|
@@ -13341,6 +13350,8 @@ async function GNOSISSCAN(...args) {
|
|
|
13341
13350
|
address,
|
|
13342
13351
|
startDate,
|
|
13343
13352
|
endDate,
|
|
13353
|
+
page,
|
|
13354
|
+
offset:limit
|
|
13344
13355
|
});
|
|
13345
13356
|
}
|
|
13346
13357
|
|
|
@@ -13446,7 +13457,7 @@ async function GNOSIS({
|
|
|
13446
13457
|
|
|
13447
13458
|
|
|
13448
13459
|
async function ETHERSCAN(...args) {
|
|
13449
|
-
const [type, chain, address, startDate, endDate] = args;
|
|
13460
|
+
const [type, chain, address, startDate, endDate, page, limit] = args;
|
|
13450
13461
|
return handleScanRequest({
|
|
13451
13462
|
scanKey: SERVICE_API_KEY.Etherscan,
|
|
13452
13463
|
baseUrl: 'https://api.etherscan.io/v2/api',
|
|
@@ -13455,6 +13466,8 @@ async function ETHERSCAN(...args) {
|
|
|
13455
13466
|
address,
|
|
13456
13467
|
startDate,
|
|
13457
13468
|
endDate,
|
|
13469
|
+
page,
|
|
13470
|
+
offset:limit
|
|
13458
13471
|
});
|
|
13459
13472
|
}
|
|
13460
13473
|
|
|
@@ -13500,7 +13513,7 @@ async function COINGECKO(token, vs_currencies) {
|
|
|
13500
13513
|
}
|
|
13501
13514
|
}
|
|
13502
13515
|
|
|
13503
|
-
async function EOA(addresses, category, chains, startTime, endTime) {
|
|
13516
|
+
async function EOA(addresses, category, chains, startTime, endTime, page = 1, offset = 10) {
|
|
13504
13517
|
try {
|
|
13505
13518
|
const ADDRESSES = addresses.split(',').map(a => a.trim());
|
|
13506
13519
|
const CHAINS = typeof chains === 'string' ? chains.split(',').map(c => c.trim()) : chains;
|
|
@@ -13521,18 +13534,16 @@ async function EOA(addresses, category, chains, startTime, endTime) {
|
|
|
13521
13534
|
if (category === 'txns') {
|
|
13522
13535
|
const startBlock = await fromTimeStampToBlock(startTime, chain, API_KEY);
|
|
13523
13536
|
const endBlock = await fromTimeStampToBlock(endTime, chain, API_KEY);
|
|
13524
|
-
timeQuery = `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13537
|
+
timeQuery = `&startblock=${startBlock}&endblock=${endBlock}&page=${page}&offset=${offset}&sort=asc`;
|
|
13525
13538
|
} else {
|
|
13526
13539
|
timeQuery = `&tag=latest`;
|
|
13527
13540
|
}
|
|
13528
13541
|
|
|
13529
|
-
const url = `https://api.etherscan.io/v2/api?module=${action.split('.')[0]}&action=${action.split('.')[1]}&address=${address}&
|
|
13542
|
+
const url = `https://api.etherscan.io/v2/api?module=${action.split('.')[0]}&action=${action.split('.')[1]}&address=${address}&chainid=${chainId}&apikey=${API_KEY}${timeQuery}`;
|
|
13530
13543
|
|
|
13531
13544
|
try {
|
|
13532
13545
|
const response = await fetch(url);
|
|
13533
|
-
if (!response.ok) {
|
|
13534
|
-
return `HTTP_${response.status}`;
|
|
13535
|
-
}
|
|
13546
|
+
if (!response.ok) return `HTTP_${response.status}`;
|
|
13536
13547
|
|
|
13537
13548
|
const json = await response.json();
|
|
13538
13549
|
|
|
@@ -13548,7 +13559,6 @@ async function EOA(addresses, category, chains, startTime, endTime) {
|
|
|
13548
13559
|
for (const entry of entries) {
|
|
13549
13560
|
flatResults.push({ chain, address, ...entry });
|
|
13550
13561
|
}
|
|
13551
|
-
|
|
13552
13562
|
} catch (e) {
|
|
13553
13563
|
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
13554
13564
|
}
|
|
@@ -13565,6 +13575,7 @@ async function EOA(addresses, category, chains, startTime, endTime) {
|
|
|
13565
13575
|
|
|
13566
13576
|
|
|
13567
13577
|
|
|
13578
|
+
|
|
13568
13579
|
async function FLVURL(token, vs_currencies) {
|
|
13569
13580
|
return new Promise((resolve) => {
|
|
13570
13581
|
setTimeout(() => {
|
package/package.json
CHANGED
package/types/cjs/index.d.cts
CHANGED
|
@@ -1296,7 +1296,7 @@ export function EDATE(start_date: any, months: any): any;
|
|
|
1296
1296
|
* @returns
|
|
1297
1297
|
*/
|
|
1298
1298
|
export function EFFECT(nominal_rate: any, npery: any): number | Error;
|
|
1299
|
-
export function EOA(addresses: any, category: any, chains: any, startTime: any, endTime: any): Promise<string | any[]>;
|
|
1299
|
+
export function EOA(addresses: any, category: any, chains: any, startTime: any, endTime: any, page?: number, offset?: number): Promise<string | any[]>;
|
|
1300
1300
|
/**
|
|
1301
1301
|
* Returns the serial number of the last day of the month before or after a specified number of months.
|
|
1302
1302
|
*
|
package/types/esm/index.d.mts
CHANGED
|
@@ -1296,7 +1296,7 @@ export function EDATE(start_date: any, months: any): any;
|
|
|
1296
1296
|
* @returns
|
|
1297
1297
|
*/
|
|
1298
1298
|
export function EFFECT(nominal_rate: any, npery: any): number | Error;
|
|
1299
|
-
export function EOA(addresses: any, category: any, chains: any, startTime: any, endTime: any): Promise<string | any[]>;
|
|
1299
|
+
export function EOA(addresses: any, category: any, chains: any, startTime: any, endTime: any, page?: number, offset?: number): Promise<string | any[]>;
|
|
1300
1300
|
/**
|
|
1301
1301
|
* Returns the serial number of the last day of the month before or after a specified number of months.
|
|
1302
1302
|
*
|