@fileverse-dev/formulajs 4.4.11-mod-34 → 4.4.11-mod-36
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 +281 -253
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +65 -26
- package/lib/esm/crypto-constants.mjs +28 -28
- package/lib/esm/index.mjs +65 -26
- package/package.json +1 -1
- package/types/cjs/index.d.cts +7 -13
- package/types/esm/index.d.mts +7 -13
package/lib/cjs/index.cjs
CHANGED
|
@@ -13243,7 +13243,7 @@ if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = 'gnosis';
|
|
|
13243
13243
|
}
|
|
13244
13244
|
}
|
|
13245
13245
|
|
|
13246
|
-
async function FIREFLY(
|
|
13246
|
+
async function FIREFLY() {
|
|
13247
13247
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
13248
13248
|
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13249
13249
|
|
|
@@ -13262,6 +13262,9 @@ async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
|
|
|
13262
13262
|
}
|
|
13263
13263
|
};
|
|
13264
13264
|
|
|
13265
|
+
|
|
13266
|
+
const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13267
|
+
|
|
13265
13268
|
const platformType = typeMap[platform]?.[contentType];
|
|
13266
13269
|
if (!platformType) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
13267
13270
|
|
|
@@ -13305,7 +13308,7 @@ async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
|
|
|
13305
13308
|
|
|
13306
13309
|
|
|
13307
13310
|
|
|
13308
|
-
async function BLOCKSCOUT(
|
|
13311
|
+
async function BLOCKSCOUT() {
|
|
13309
13312
|
if (!chain) {
|
|
13310
13313
|
chain = 'ethereum';
|
|
13311
13314
|
}
|
|
@@ -13314,6 +13317,8 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
|
|
|
13314
13317
|
return 'TYPE_MISSING'
|
|
13315
13318
|
}
|
|
13316
13319
|
|
|
13320
|
+
const [address, type, chain, startTimestamp, endTimestamp, page, offset] = argsToArray(arguments);
|
|
13321
|
+
|
|
13317
13322
|
if (!startTimestamp) {
|
|
13318
13323
|
const currentTimestamp = Date.now();
|
|
13319
13324
|
startTimestamp = currentTimestamp - 30 * 24 * 60 * 60 * 1000;
|
|
@@ -13391,8 +13396,8 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
|
|
|
13391
13396
|
}
|
|
13392
13397
|
}
|
|
13393
13398
|
|
|
13394
|
-
async function BASESCAN(
|
|
13395
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
13399
|
+
async function BASESCAN() {
|
|
13400
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13396
13401
|
return handleScanRequest({
|
|
13397
13402
|
scanKey: SERVICE_API_KEY.Basescan,
|
|
13398
13403
|
baseUrl: 'https://api.basescan.org/api',
|
|
@@ -13405,8 +13410,8 @@ async function BASESCAN(...args) {
|
|
|
13405
13410
|
offset:limit
|
|
13406
13411
|
});
|
|
13407
13412
|
}
|
|
13408
|
-
async function GNOSISSCAN(
|
|
13409
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
13413
|
+
async function GNOSISSCAN() {
|
|
13414
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13410
13415
|
return handleScanRequest({
|
|
13411
13416
|
scanKey: SERVICE_API_KEY.Gnosisscan,
|
|
13412
13417
|
baseUrl: 'https://api.gnosisscan.io/api',
|
|
@@ -13421,16 +13426,18 @@ async function GNOSISSCAN(...args) {
|
|
|
13421
13426
|
}
|
|
13422
13427
|
|
|
13423
13428
|
async function NEYNAR(
|
|
13424
|
-
|
|
13425
|
-
viewerFid,
|
|
13426
|
-
sortType,
|
|
13427
|
-
limit,
|
|
13428
|
-
cursor
|
|
13429
|
+
|
|
13429
13430
|
) {
|
|
13430
13431
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
|
|
13431
13432
|
if (!API_KEY) return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13432
13433
|
|
|
13433
|
-
|
|
13434
|
+
const [
|
|
13435
|
+
fid,
|
|
13436
|
+
viewerFid,
|
|
13437
|
+
sortType,
|
|
13438
|
+
limit,
|
|
13439
|
+
cursor
|
|
13440
|
+
] = argsToArray(arguments);
|
|
13434
13441
|
const url = new URL('https://api.neynar.com/v2/farcaster/followers');
|
|
13435
13442
|
url.searchParams.set('fid', fid.toString());
|
|
13436
13443
|
url.searchParams.set('sort_type', sortType);
|
|
@@ -13461,18 +13468,22 @@ async function NEYNAR(
|
|
|
13461
13468
|
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
13462
13469
|
}
|
|
13463
13470
|
}
|
|
13464
|
-
async function GNOSISPAY(
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
endDate,
|
|
13468
|
-
limit = 20,
|
|
13469
|
-
offset = 0,
|
|
13470
|
-
}) {
|
|
13471
|
+
async function GNOSISPAY(
|
|
13472
|
+
|
|
13473
|
+
) {
|
|
13471
13474
|
const apiKeyKey = SERVICE_API_KEY.GnosisPay;
|
|
13472
13475
|
const API_KEY = window.localStorage.getItem(apiKeyKey);
|
|
13473
13476
|
if (!API_KEY) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13474
13477
|
if (!cardId) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
13475
13478
|
|
|
13479
|
+
|
|
13480
|
+
|
|
13481
|
+
const [ cardId,
|
|
13482
|
+
startDate,
|
|
13483
|
+
endDate,
|
|
13484
|
+
limit = 20,
|
|
13485
|
+
offset = 0] = argsToArray(arguments);
|
|
13486
|
+
|
|
13476
13487
|
const url = new URL(`https://api.gnosispay.com/cards/${cardId}/transactions`);
|
|
13477
13488
|
url.searchParams.set('limit', limit.toString());
|
|
13478
13489
|
url.searchParams.set('offset', offset.toString());
|
|
@@ -13521,8 +13532,8 @@ async function GNOSISPAY({
|
|
|
13521
13532
|
|
|
13522
13533
|
|
|
13523
13534
|
|
|
13524
|
-
async function ETHERSCAN(
|
|
13525
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
13535
|
+
async function ETHERSCAN() {
|
|
13536
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13526
13537
|
return handleScanRequest({
|
|
13527
13538
|
scanKey: SERVICE_API_KEY.Etherscan,
|
|
13528
13539
|
baseUrl: 'https://api.etherscan.io/v2/api',
|
|
@@ -13537,7 +13548,7 @@ async function ETHERSCAN(...args) {
|
|
|
13537
13548
|
}
|
|
13538
13549
|
|
|
13539
13550
|
|
|
13540
|
-
async function COINGECKO(
|
|
13551
|
+
async function COINGECKO() {
|
|
13541
13552
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
|
|
13542
13553
|
if (!API_KEY) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13543
13554
|
|
|
@@ -13547,6 +13558,7 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
|
|
|
13547
13558
|
};
|
|
13548
13559
|
|
|
13549
13560
|
let url = '';
|
|
13561
|
+
const [category, param1, param2, page = 1, perPage = 2 ] = argsToArray(arguments);
|
|
13550
13562
|
const lowerCategory = (category || '').toLowerCase();
|
|
13551
13563
|
|
|
13552
13564
|
switch (lowerCategory) {
|
|
@@ -13652,7 +13664,11 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
|
|
|
13652
13664
|
|
|
13653
13665
|
|
|
13654
13666
|
|
|
13655
|
-
async function EOA(
|
|
13667
|
+
async function EOA() {
|
|
13668
|
+
|
|
13669
|
+
|
|
13670
|
+
|
|
13671
|
+
const [
|
|
13656
13672
|
addresses,
|
|
13657
13673
|
category,
|
|
13658
13674
|
chains,
|
|
@@ -13660,11 +13676,29 @@ async function EOA(
|
|
|
13660
13676
|
endTime,
|
|
13661
13677
|
page = 1,
|
|
13662
13678
|
offset = 10,
|
|
13663
|
-
)
|
|
13679
|
+
] = argsToArray(arguments);
|
|
13680
|
+
|
|
13681
|
+
const someError = anyError(addresses, category, chains, startTime, endTime, page, offset);
|
|
13682
|
+
|
|
13683
|
+
if (someError) {
|
|
13684
|
+
return someError
|
|
13685
|
+
}
|
|
13686
|
+
|
|
13687
|
+
|
|
13664
13688
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
13665
13689
|
if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13666
13690
|
|
|
13667
|
-
|
|
13691
|
+
|
|
13692
|
+
|
|
13693
|
+
let INPUTS;
|
|
13694
|
+
|
|
13695
|
+
if(typeof addresses === 'string'){
|
|
13696
|
+
INPUTS = addresses.split(",").map(a => a.trim()).filter(Boolean);
|
|
13697
|
+
} else if (typeof addresses === 'object'){
|
|
13698
|
+
INPUTS = addresses;
|
|
13699
|
+
}
|
|
13700
|
+
|
|
13701
|
+
|
|
13668
13702
|
const CHAINS = chains.split(",").map(c => c.trim()).filter(Boolean);
|
|
13669
13703
|
const out = [];
|
|
13670
13704
|
|
|
@@ -13776,7 +13810,12 @@ async function FLVURL(token, vs_currencies) {
|
|
|
13776
13810
|
});
|
|
13777
13811
|
}
|
|
13778
13812
|
|
|
13779
|
-
async function SAFE(
|
|
13813
|
+
async function SAFE() {
|
|
13814
|
+
|
|
13815
|
+
|
|
13816
|
+
|
|
13817
|
+
|
|
13818
|
+
const [address, utility, chain, limit, offset] = argsToArray(arguments);
|
|
13780
13819
|
|
|
13781
13820
|
if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT';
|
|
13782
13821
|
if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET';
|
|
@@ -171,14 +171,14 @@ var FUNCTION_LOCALE = [
|
|
|
171
171
|
detail: "Start date (used to resolve block range). Optional, only applies to txns.",
|
|
172
172
|
example: `"01/01/2024"`,
|
|
173
173
|
require: "o",
|
|
174
|
-
type: "
|
|
174
|
+
type: "string"
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
name: "endDate",
|
|
178
178
|
detail: "End date (used to resolve block range). Optional, only applies to txns.",
|
|
179
179
|
example: `"07/07/2024"`,
|
|
180
180
|
require: "o",
|
|
181
|
-
type: "
|
|
181
|
+
type: "string"
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
name: "page",
|
|
@@ -232,14 +232,14 @@ var FUNCTION_LOCALE = [
|
|
|
232
232
|
detail: "Used to resolve starting block for txns.",
|
|
233
233
|
example: `"01/01/2024"`,
|
|
234
234
|
require: "o",
|
|
235
|
-
type: "
|
|
235
|
+
type: "string"
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
name: "endDate",
|
|
239
239
|
detail: "Used to resolve ending block for txns.",
|
|
240
240
|
example: `"14/06/2025"`,
|
|
241
241
|
require: "o",
|
|
242
|
-
type: "
|
|
242
|
+
type: "string"
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
name: "page",
|
|
@@ -355,14 +355,14 @@ var FUNCTION_LOCALE = [
|
|
|
355
355
|
detail: "Used to filter block range.",
|
|
356
356
|
example: `"01/01/2024"`,
|
|
357
357
|
require: "o",
|
|
358
|
-
type: "
|
|
358
|
+
type: "string"
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
361
|
name: "endDate",
|
|
362
362
|
detail: "Used to filter block range.",
|
|
363
363
|
example: `"01/07/2025"`,
|
|
364
364
|
require: "o",
|
|
365
|
-
type: "
|
|
365
|
+
type: "string"
|
|
366
366
|
}
|
|
367
367
|
]
|
|
368
368
|
},
|
|
@@ -400,16 +400,16 @@ var FUNCTION_LOCALE = [
|
|
|
400
400
|
{
|
|
401
401
|
name: "startTime",
|
|
402
402
|
detail: "Used to calculate starting block for transaction queries.",
|
|
403
|
-
example: "01/01/2024"
|
|
403
|
+
example: `"01/01/2024"`,
|
|
404
404
|
require: "m",
|
|
405
|
-
type: "
|
|
405
|
+
type: "string"
|
|
406
406
|
},
|
|
407
407
|
{
|
|
408
408
|
name: "endTime",
|
|
409
409
|
detail: "Used to calculate ending block for transaction queries.",
|
|
410
|
-
example: "01/06/2024"
|
|
410
|
+
example: `"01/06/2024"`,
|
|
411
411
|
require: "m",
|
|
412
|
-
type: "
|
|
412
|
+
type: "string"
|
|
413
413
|
},
|
|
414
414
|
{
|
|
415
415
|
name: "page",
|
|
@@ -598,14 +598,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
598
598
|
detail: "Used to filter block range.",
|
|
599
599
|
example: `"01/01/2024"`,
|
|
600
600
|
require: "o",
|
|
601
|
-
type: "
|
|
601
|
+
type: "string"
|
|
602
602
|
},
|
|
603
603
|
{
|
|
604
604
|
name: "endDate",
|
|
605
605
|
detail: "Used to filter block range.",
|
|
606
606
|
example: `"01/01/2025"`,
|
|
607
607
|
require: "o",
|
|
608
|
-
type: "
|
|
608
|
+
type: "string"
|
|
609
609
|
}
|
|
610
610
|
]
|
|
611
611
|
},
|
|
@@ -645,14 +645,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
645
645
|
detail: "Used to filter block range.",
|
|
646
646
|
example: `"01/01/2024"`,
|
|
647
647
|
require: "o",
|
|
648
|
-
type: "
|
|
648
|
+
type: "string"
|
|
649
649
|
},
|
|
650
650
|
{
|
|
651
651
|
name: "endDate",
|
|
652
652
|
detail: "Used to filter block range.",
|
|
653
653
|
example: `"01/07/2025"`,
|
|
654
654
|
require: "o",
|
|
655
|
-
type: "
|
|
655
|
+
type: "string"
|
|
656
656
|
}
|
|
657
657
|
]
|
|
658
658
|
},
|
|
@@ -692,14 +692,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
692
692
|
detail: "Used to filter block range.",
|
|
693
693
|
example: `"01/01/2024"`,
|
|
694
694
|
require: "o",
|
|
695
|
-
type: "
|
|
695
|
+
type: "string"
|
|
696
696
|
},
|
|
697
697
|
{
|
|
698
698
|
name: "endDate",
|
|
699
699
|
detail: "Used to filter block range.",
|
|
700
700
|
example: `"01/07/2025"`,
|
|
701
701
|
require: "o",
|
|
702
|
-
type: "
|
|
702
|
+
type: "string"
|
|
703
703
|
}
|
|
704
704
|
]
|
|
705
705
|
},
|
|
@@ -739,14 +739,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
739
739
|
detail: "Used to filter block range.",
|
|
740
740
|
example: `"01/01/2024"`,
|
|
741
741
|
require: "o",
|
|
742
|
-
type: "
|
|
742
|
+
type: "string"
|
|
743
743
|
},
|
|
744
744
|
{
|
|
745
745
|
name: "endDate",
|
|
746
746
|
detail: "Used to filter block range.",
|
|
747
747
|
example: `"01/07/2025"`,
|
|
748
748
|
require: "o",
|
|
749
|
-
type: "
|
|
749
|
+
type: "string"
|
|
750
750
|
}
|
|
751
751
|
]
|
|
752
752
|
},
|
|
@@ -786,14 +786,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
786
786
|
detail: "Used to filter block range.",
|
|
787
787
|
example: `"01/01/2024"`,
|
|
788
788
|
require: "o",
|
|
789
|
-
type: "
|
|
789
|
+
type: "string"
|
|
790
790
|
},
|
|
791
791
|
{
|
|
792
792
|
name: "endDate",
|
|
793
793
|
detail: "Used to filter block range.",
|
|
794
794
|
example: `"01/07/2025"`,
|
|
795
795
|
require: "o",
|
|
796
|
-
type: "
|
|
796
|
+
type: "string"
|
|
797
797
|
}
|
|
798
798
|
]
|
|
799
799
|
},
|
|
@@ -833,14 +833,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
833
833
|
detail: "Used to filter block range.",
|
|
834
834
|
example: `"01/01/2024"`,
|
|
835
835
|
require: "o",
|
|
836
|
-
type: "
|
|
836
|
+
type: "string"
|
|
837
837
|
},
|
|
838
838
|
{
|
|
839
839
|
name: "endDate",
|
|
840
840
|
detail: "Used to filter block range.",
|
|
841
841
|
example: `"01/07/2025"`,
|
|
842
842
|
require: "o",
|
|
843
|
-
type: "
|
|
843
|
+
type: "string"
|
|
844
844
|
}
|
|
845
845
|
]
|
|
846
846
|
},
|
|
@@ -866,14 +866,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
866
866
|
detail: "Filters transactions created after this date.",
|
|
867
867
|
example: `"01/01/2024"`,
|
|
868
868
|
require: "o",
|
|
869
|
-
type: "
|
|
869
|
+
type: "string"
|
|
870
870
|
},
|
|
871
871
|
{
|
|
872
872
|
name: "endDate",
|
|
873
873
|
detail: "Filters transactions created before this date.",
|
|
874
874
|
example: `"01/07/2025"`,
|
|
875
875
|
require: "o",
|
|
876
|
-
type: "
|
|
876
|
+
type: "string"
|
|
877
877
|
},
|
|
878
878
|
{
|
|
879
879
|
name: "limit",
|
|
@@ -927,14 +927,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
927
927
|
detail: "Used to filter block range.",
|
|
928
928
|
example: `"01/01/2024"`,
|
|
929
929
|
require: "o",
|
|
930
|
-
type: "
|
|
930
|
+
type: "string"
|
|
931
931
|
},
|
|
932
932
|
{
|
|
933
933
|
name: "endDate",
|
|
934
934
|
detail: "Used to filter block range.",
|
|
935
935
|
example: `"01/07/2025"`,
|
|
936
936
|
require: "o",
|
|
937
|
-
type: "
|
|
937
|
+
type: "string"
|
|
938
938
|
}
|
|
939
939
|
]
|
|
940
940
|
},
|
|
@@ -974,14 +974,14 @@ For "market" and "stablecoins": comma-separated price trend keys (e.g. 1h,24h,7d
|
|
|
974
974
|
detail: "Used to filter block range.",
|
|
975
975
|
example: `"01/01/2024"`,
|
|
976
976
|
require: "o",
|
|
977
|
-
type: "
|
|
977
|
+
type: "string"
|
|
978
978
|
},
|
|
979
979
|
{
|
|
980
980
|
name: "endDate",
|
|
981
981
|
detail: "Used to filter block range.",
|
|
982
982
|
example: `"01/07/2025"`,
|
|
983
983
|
require: "o",
|
|
984
|
-
type: "
|
|
984
|
+
type: "string"
|
|
985
985
|
}
|
|
986
986
|
]
|
|
987
987
|
}
|
package/lib/esm/index.mjs
CHANGED
|
@@ -13241,7 +13241,7 @@ if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = 'gnosis';
|
|
|
13241
13241
|
}
|
|
13242
13242
|
}
|
|
13243
13243
|
|
|
13244
|
-
async function FIREFLY(
|
|
13244
|
+
async function FIREFLY() {
|
|
13245
13245
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
13246
13246
|
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13247
13247
|
|
|
@@ -13260,6 +13260,9 @@ async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
|
|
|
13260
13260
|
}
|
|
13261
13261
|
};
|
|
13262
13262
|
|
|
13263
|
+
|
|
13264
|
+
const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
13265
|
+
|
|
13263
13266
|
const platformType = typeMap[platform]?.[contentType];
|
|
13264
13267
|
if (!platformType) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
13265
13268
|
|
|
@@ -13303,7 +13306,7 @@ async function FIREFLY(platform, contentType, identifier, start = 0, end = 10) {
|
|
|
13303
13306
|
|
|
13304
13307
|
|
|
13305
13308
|
|
|
13306
|
-
async function BLOCKSCOUT(
|
|
13309
|
+
async function BLOCKSCOUT() {
|
|
13307
13310
|
if (!chain) {
|
|
13308
13311
|
chain = 'ethereum';
|
|
13309
13312
|
}
|
|
@@ -13312,6 +13315,8 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
|
|
|
13312
13315
|
return 'TYPE_MISSING'
|
|
13313
13316
|
}
|
|
13314
13317
|
|
|
13318
|
+
const [address, type, chain, startTimestamp, endTimestamp, page, offset] = argsToArray(arguments);
|
|
13319
|
+
|
|
13315
13320
|
if (!startTimestamp) {
|
|
13316
13321
|
const currentTimestamp = Date.now();
|
|
13317
13322
|
startTimestamp = currentTimestamp - 30 * 24 * 60 * 60 * 1000;
|
|
@@ -13389,8 +13394,8 @@ async function BLOCKSCOUT(address, type, chain, startTimestamp, endTimestamp, pa
|
|
|
13389
13394
|
}
|
|
13390
13395
|
}
|
|
13391
13396
|
|
|
13392
|
-
async function BASESCAN(
|
|
13393
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
13397
|
+
async function BASESCAN() {
|
|
13398
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13394
13399
|
return handleScanRequest({
|
|
13395
13400
|
scanKey: SERVICE_API_KEY.Basescan,
|
|
13396
13401
|
baseUrl: 'https://api.basescan.org/api',
|
|
@@ -13403,8 +13408,8 @@ async function BASESCAN(...args) {
|
|
|
13403
13408
|
offset:limit
|
|
13404
13409
|
});
|
|
13405
13410
|
}
|
|
13406
|
-
async function GNOSISSCAN(
|
|
13407
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
13411
|
+
async function GNOSISSCAN() {
|
|
13412
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13408
13413
|
return handleScanRequest({
|
|
13409
13414
|
scanKey: SERVICE_API_KEY.Gnosisscan,
|
|
13410
13415
|
baseUrl: 'https://api.gnosisscan.io/api',
|
|
@@ -13419,16 +13424,18 @@ async function GNOSISSCAN(...args) {
|
|
|
13419
13424
|
}
|
|
13420
13425
|
|
|
13421
13426
|
async function NEYNAR(
|
|
13422
|
-
|
|
13423
|
-
viewerFid,
|
|
13424
|
-
sortType,
|
|
13425
|
-
limit,
|
|
13426
|
-
cursor
|
|
13427
|
+
|
|
13427
13428
|
) {
|
|
13428
13429
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
|
|
13429
13430
|
if (!API_KEY) return `${SERVICE_API_KEY.Neynar}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13430
13431
|
|
|
13431
|
-
|
|
13432
|
+
const [
|
|
13433
|
+
fid,
|
|
13434
|
+
viewerFid,
|
|
13435
|
+
sortType,
|
|
13436
|
+
limit,
|
|
13437
|
+
cursor
|
|
13438
|
+
] = argsToArray(arguments);
|
|
13432
13439
|
const url = new URL('https://api.neynar.com/v2/farcaster/followers');
|
|
13433
13440
|
url.searchParams.set('fid', fid.toString());
|
|
13434
13441
|
url.searchParams.set('sort_type', sortType);
|
|
@@ -13459,18 +13466,22 @@ async function NEYNAR(
|
|
|
13459
13466
|
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
13460
13467
|
}
|
|
13461
13468
|
}
|
|
13462
|
-
async function GNOSISPAY(
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
endDate,
|
|
13466
|
-
limit = 20,
|
|
13467
|
-
offset = 0,
|
|
13468
|
-
}) {
|
|
13469
|
+
async function GNOSISPAY(
|
|
13470
|
+
|
|
13471
|
+
) {
|
|
13469
13472
|
const apiKeyKey = SERVICE_API_KEY.GnosisPay;
|
|
13470
13473
|
const API_KEY = window.localStorage.getItem(apiKeyKey);
|
|
13471
13474
|
if (!API_KEY) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13472
13475
|
if (!cardId) return `${apiKeyKey}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
13473
13476
|
|
|
13477
|
+
|
|
13478
|
+
|
|
13479
|
+
const [ cardId,
|
|
13480
|
+
startDate,
|
|
13481
|
+
endDate,
|
|
13482
|
+
limit = 20,
|
|
13483
|
+
offset = 0] = argsToArray(arguments);
|
|
13484
|
+
|
|
13474
13485
|
const url = new URL(`https://api.gnosispay.com/cards/${cardId}/transactions`);
|
|
13475
13486
|
url.searchParams.set('limit', limit.toString());
|
|
13476
13487
|
url.searchParams.set('offset', offset.toString());
|
|
@@ -13519,8 +13530,8 @@ async function GNOSISPAY({
|
|
|
13519
13530
|
|
|
13520
13531
|
|
|
13521
13532
|
|
|
13522
|
-
async function ETHERSCAN(
|
|
13523
|
-
const [type, chain, address, startDate, endDate, page, limit] =
|
|
13533
|
+
async function ETHERSCAN() {
|
|
13534
|
+
const [type, chain, address, startDate, endDate, page, limit] = argsToArray(arguments);
|
|
13524
13535
|
return handleScanRequest({
|
|
13525
13536
|
scanKey: SERVICE_API_KEY.Etherscan,
|
|
13526
13537
|
baseUrl: 'https://api.etherscan.io/v2/api',
|
|
@@ -13535,7 +13546,7 @@ async function ETHERSCAN(...args) {
|
|
|
13535
13546
|
}
|
|
13536
13547
|
|
|
13537
13548
|
|
|
13538
|
-
async function COINGECKO(
|
|
13549
|
+
async function COINGECKO() {
|
|
13539
13550
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
|
|
13540
13551
|
if (!API_KEY) return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13541
13552
|
|
|
@@ -13545,6 +13556,7 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
|
|
|
13545
13556
|
};
|
|
13546
13557
|
|
|
13547
13558
|
let url = '';
|
|
13559
|
+
const [category, param1, param2, page = 1, perPage = 2 ] = argsToArray(arguments);
|
|
13548
13560
|
const lowerCategory = (category || '').toLowerCase();
|
|
13549
13561
|
|
|
13550
13562
|
switch (lowerCategory) {
|
|
@@ -13650,7 +13662,11 @@ async function COINGECKO(category, param1, param2, page = 1, perPage = 2) {
|
|
|
13650
13662
|
|
|
13651
13663
|
|
|
13652
13664
|
|
|
13653
|
-
async function EOA(
|
|
13665
|
+
async function EOA() {
|
|
13666
|
+
|
|
13667
|
+
|
|
13668
|
+
|
|
13669
|
+
const [
|
|
13654
13670
|
addresses,
|
|
13655
13671
|
category,
|
|
13656
13672
|
chains,
|
|
@@ -13658,11 +13674,29 @@ async function EOA(
|
|
|
13658
13674
|
endTime,
|
|
13659
13675
|
page = 1,
|
|
13660
13676
|
offset = 10,
|
|
13661
|
-
)
|
|
13677
|
+
] = argsToArray(arguments);
|
|
13678
|
+
|
|
13679
|
+
const someError = anyError(addresses, category, chains, startTime, endTime, page, offset);
|
|
13680
|
+
|
|
13681
|
+
if (someError) {
|
|
13682
|
+
return someError
|
|
13683
|
+
}
|
|
13684
|
+
|
|
13685
|
+
|
|
13662
13686
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
13663
13687
|
if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
13664
13688
|
|
|
13665
|
-
|
|
13689
|
+
|
|
13690
|
+
|
|
13691
|
+
let INPUTS;
|
|
13692
|
+
|
|
13693
|
+
if(typeof addresses === 'string'){
|
|
13694
|
+
INPUTS = addresses.split(",").map(a => a.trim()).filter(Boolean);
|
|
13695
|
+
} else if (typeof addresses === 'object'){
|
|
13696
|
+
INPUTS = addresses;
|
|
13697
|
+
}
|
|
13698
|
+
|
|
13699
|
+
|
|
13666
13700
|
const CHAINS = chains.split(",").map(c => c.trim()).filter(Boolean);
|
|
13667
13701
|
const out = [];
|
|
13668
13702
|
|
|
@@ -13774,7 +13808,12 @@ async function FLVURL(token, vs_currencies) {
|
|
|
13774
13808
|
});
|
|
13775
13809
|
}
|
|
13776
13810
|
|
|
13777
|
-
async function SAFE(
|
|
13811
|
+
async function SAFE() {
|
|
13812
|
+
|
|
13813
|
+
|
|
13814
|
+
|
|
13815
|
+
|
|
13816
|
+
const [address, utility, chain, limit, offset] = argsToArray(arguments);
|
|
13778
13817
|
|
|
13779
13818
|
if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT';
|
|
13780
13819
|
if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET';
|
package/package.json
CHANGED
package/types/cjs/index.d.cts
CHANGED
|
@@ -420,7 +420,7 @@ export function BITRSHIFT(number: any, shift_amount: any): number | Error;
|
|
|
420
420
|
* @returns
|
|
421
421
|
*/
|
|
422
422
|
export function BITXOR(number1: any, number2: any): number | Error;
|
|
423
|
-
export function BLOCKSCOUT(
|
|
423
|
+
export function BLOCKSCOUT(...args: any[]): Promise<any>;
|
|
424
424
|
/**
|
|
425
425
|
* Rounds a number to the nearest integer or to the nearest multiple of significance.
|
|
426
426
|
*
|
|
@@ -626,7 +626,7 @@ export function CLEAN(text: any): any;
|
|
|
626
626
|
* @returns
|
|
627
627
|
*/
|
|
628
628
|
export function CODE(text: any): any;
|
|
629
|
-
export function COINGECKO(
|
|
629
|
+
export function COINGECKO(...args: any[]): Promise<string | {}[]>;
|
|
630
630
|
/**
|
|
631
631
|
* Returns the column number of a reference.
|
|
632
632
|
*
|
|
@@ -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(
|
|
1299
|
+
export function EOA(...args: any[]): Promise<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
|
*
|
|
@@ -1529,7 +1529,7 @@ export namespace FINV { }
|
|
|
1529
1529
|
* @returns
|
|
1530
1530
|
*/
|
|
1531
1531
|
export function FINVRT(probability: any, deg_freedom1: any, deg_freedom2: any, ...args: any[]): any;
|
|
1532
|
-
export function FIREFLY(
|
|
1532
|
+
export function FIREFLY(...args: any[]): Promise<any>;
|
|
1533
1533
|
/**
|
|
1534
1534
|
* Returns the Fisher transformation.
|
|
1535
1535
|
*
|
|
@@ -1791,13 +1791,7 @@ export function GEOMEAN(...args: any[]): any;
|
|
|
1791
1791
|
* @returns
|
|
1792
1792
|
*/
|
|
1793
1793
|
export function GESTEP(number: any, step: any): any;
|
|
1794
|
-
export function GNOSISPAY(
|
|
1795
|
-
cardId: any;
|
|
1796
|
-
startDate: any;
|
|
1797
|
-
endDate: any;
|
|
1798
|
-
limit?: number;
|
|
1799
|
-
offset?: number;
|
|
1800
|
-
}): Promise<string | {
|
|
1794
|
+
export function GNOSISPAY(...args: any[]): Promise<string | {
|
|
1801
1795
|
createdAt: any;
|
|
1802
1796
|
clearedAt: any;
|
|
1803
1797
|
country: any;
|
|
@@ -2841,7 +2835,7 @@ export function NETWORKDAYSINTL(start_date: any, end_date: any, weekend: any, ho
|
|
|
2841
2835
|
* @returns
|
|
2842
2836
|
*/
|
|
2843
2837
|
export function NETWORKDAYS_INTL(start_date: any, end_date: any, weekend: any, holidays: any): number | Error;
|
|
2844
|
-
export function NEYNAR(
|
|
2838
|
+
export function NEYNAR(...args: any[]): Promise<any>;
|
|
2845
2839
|
/**
|
|
2846
2840
|
* Returns the annual nominal interest rate.
|
|
2847
2841
|
*
|
|
@@ -3553,7 +3547,7 @@ export function RRI(nper: any, pv: any, fv: any): number | Error;
|
|
|
3553
3547
|
* @returns
|
|
3554
3548
|
*/
|
|
3555
3549
|
export function RSQ(known_y: any, known_x: any): number | Error;
|
|
3556
|
-
export function SAFE(
|
|
3550
|
+
export function SAFE(...args: any[]): Promise<any>;
|
|
3557
3551
|
/**
|
|
3558
3552
|
* Finds one text value within another (not case-sensitive)
|
|
3559
3553
|
*
|