ethereum-emissions-calculator
Advanced tools
Comparing version 3.0.5 to 3.0.6
import { CalculatorOptions } from "../types"; | ||
export declare const ETHERSCAN_API_URL = "https://api.etherscan.io/api"; | ||
export declare const ETHERSCAN_RESULT_MAX_LENGTH = 5000; | ||
export declare const constructEtherscanURL: (options: CalculatorOptions & { | ||
isContract?: boolean; | ||
}) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.constructEtherscanURL = exports.ETHERSCAN_API_URL = void 0; | ||
exports.constructEtherscanURL = exports.ETHERSCAN_RESULT_MAX_LENGTH = exports.ETHERSCAN_API_URL = void 0; | ||
exports.ETHERSCAN_API_URL = "https://api.etherscan.io/api"; | ||
exports.ETHERSCAN_RESULT_MAX_LENGTH = 5000; | ||
const constructEtherscanURL = (options) => { | ||
@@ -17,2 +18,4 @@ var _a, _b; | ||
apikey: etherscanAPIKey, | ||
page: "1", | ||
offset: exports.ETHERSCAN_RESULT_MAX_LENGTH.toString(), | ||
}; | ||
@@ -19,0 +22,0 @@ for (const property in params) { |
@@ -13,4 +13,4 @@ "use strict"; | ||
exports.getAddressTransactions = void 0; | ||
const constructEtherscanURL_1 = require("./constructEtherscanURL"); | ||
const fetchTransactions_1 = require("./fetchTransactions"); | ||
const ETHERSCAN_RESULT_MAX_LENGTH = 10000; | ||
/** | ||
@@ -23,3 +23,3 @@ * Fetch the most recent transactions, descending order (highest block # first) | ||
const transactions = yield (0, fetchTransactions_1.fetchTransactions)(options); | ||
if (transactions.length < ETHERSCAN_RESULT_MAX_LENGTH) { | ||
if (transactions.length < constructEtherscanURL_1.ETHERSCAN_RESULT_MAX_LENGTH) { | ||
return { done: true, transactions }; | ||
@@ -26,0 +26,0 @@ } |
{ | ||
"name": "ethereum-emissions-calculator", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "TypeScript utils to calculate the CO2 emissions of an Ethereum wallet. Powered by the Etherscan.io API.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44322
1289