@fileverse-dev/formulajs 4.4.11-mod-68-patch-4 → 4.4.11-mod-68-patch-6
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 +43 -35
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +9 -0
- package/lib/esm/index.mjs +9 -0
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -13252,14 +13252,19 @@ function getUrlAndHeaders({ url, serviceName, headers = {} }) {
|
|
|
13252
13252
|
}
|
|
13253
13253
|
|
|
13254
13254
|
const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
|
|
13255
|
+
console.log('fromTimeStampToBlock', timestamp, chain, apiKey);
|
|
13255
13256
|
if (!timestamp || !chain || !apiKey) return
|
|
13256
13257
|
const chainId = CHAIN_ID_MAP[chain];
|
|
13258
|
+
console.log('chainId', chainId);
|
|
13257
13259
|
const url = `https://api.etherscan.io/v2/api?module=block&action=getblocknobytime×tamp=${timestamp}&closest=before&apikey=${apiKey}&chainId=${chainId}`;
|
|
13260
|
+
console.log('url', url, getUrlAndHeaders);
|
|
13258
13261
|
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({ url, serviceName: 'Etherscan', headers: {} });
|
|
13262
|
+
console.log('finalUrl', finalUrl, HEADERS);
|
|
13259
13263
|
const res = await fetch(finalUrl, {
|
|
13260
13264
|
method: 'GET',
|
|
13261
13265
|
headers: HEADERS,
|
|
13262
13266
|
});
|
|
13267
|
+
console.log('res', res, finalUrl, HEADERS);
|
|
13263
13268
|
const json = await res.json();
|
|
13264
13269
|
return parseInt(json.result);
|
|
13265
13270
|
|
|
@@ -18282,8 +18287,11 @@ async function EOA() {
|
|
|
18282
18287
|
console.log('chain', chain);
|
|
18283
18288
|
const chainId = CHAIN_ID_MAP[chain];
|
|
18284
18289
|
if (!chainId) throw new ValidationError(`Invalid chain: ${chain}`)
|
|
18290
|
+
console.log('chain', chain);
|
|
18291
|
+
|
|
18285
18292
|
|
|
18286
18293
|
if (category === 'balance') {
|
|
18294
|
+
console.log('balance');
|
|
18287
18295
|
// chunk 20
|
|
18288
18296
|
for (let i = 0; i < ADDRS.length; i += 20) {
|
|
18289
18297
|
const slice = ADDRS.slice(i, i + 20).join(',');
|
|
@@ -18297,6 +18305,7 @@ async function EOA() {
|
|
|
18297
18305
|
}
|
|
18298
18306
|
} else {
|
|
18299
18307
|
// txns
|
|
18308
|
+
console.log('startTime', startTime, 'endTime', endTime, chain, apiKey);
|
|
18300
18309
|
const sb = await fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
|
|
18301
18310
|
const eb = await fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
|
|
18302
18311
|
console.log('sb', sb, 'eb', eb);
|
package/lib/esm/index.mjs
CHANGED
|
@@ -13250,14 +13250,19 @@ function getUrlAndHeaders({ url, serviceName, headers = {} }) {
|
|
|
13250
13250
|
}
|
|
13251
13251
|
|
|
13252
13252
|
const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
|
|
13253
|
+
console.log('fromTimeStampToBlock', timestamp, chain, apiKey);
|
|
13253
13254
|
if (!timestamp || !chain || !apiKey) return
|
|
13254
13255
|
const chainId = CHAIN_ID_MAP[chain];
|
|
13256
|
+
console.log('chainId', chainId);
|
|
13255
13257
|
const url = `https://api.etherscan.io/v2/api?module=block&action=getblocknobytime×tamp=${timestamp}&closest=before&apikey=${apiKey}&chainId=${chainId}`;
|
|
13258
|
+
console.log('url', url, getUrlAndHeaders);
|
|
13256
13259
|
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({ url, serviceName: 'Etherscan', headers: {} });
|
|
13260
|
+
console.log('finalUrl', finalUrl, HEADERS);
|
|
13257
13261
|
const res = await fetch(finalUrl, {
|
|
13258
13262
|
method: 'GET',
|
|
13259
13263
|
headers: HEADERS,
|
|
13260
13264
|
});
|
|
13265
|
+
console.log('res', res, finalUrl, HEADERS);
|
|
13261
13266
|
const json = await res.json();
|
|
13262
13267
|
return parseInt(json.result);
|
|
13263
13268
|
|
|
@@ -18280,8 +18285,11 @@ async function EOA() {
|
|
|
18280
18285
|
console.log('chain', chain);
|
|
18281
18286
|
const chainId = CHAIN_ID_MAP[chain];
|
|
18282
18287
|
if (!chainId) throw new ValidationError(`Invalid chain: ${chain}`)
|
|
18288
|
+
console.log('chain', chain);
|
|
18289
|
+
|
|
18283
18290
|
|
|
18284
18291
|
if (category === 'balance') {
|
|
18292
|
+
console.log('balance');
|
|
18285
18293
|
// chunk 20
|
|
18286
18294
|
for (let i = 0; i < ADDRS.length; i += 20) {
|
|
18287
18295
|
const slice = ADDRS.slice(i, i + 20).join(',');
|
|
@@ -18295,6 +18303,7 @@ async function EOA() {
|
|
|
18295
18303
|
}
|
|
18296
18304
|
} else {
|
|
18297
18305
|
// txns
|
|
18306
|
+
console.log('startTime', startTime, 'endTime', endTime, chain, apiKey);
|
|
18298
18307
|
const sb = await fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(startTime), chain, apiKey);
|
|
18299
18308
|
const eb = await fromTimestampToBlock.fromTimeStampToBlock(toTimestamp(endTime), chain, apiKey);
|
|
18300
18309
|
console.log('sb', sb, 'eb', eb);
|
package/package.json
CHANGED