@rarcifa/cronos-evm-client
Version:
A Node.js client library for interacting with the Cronos EVM, facilitating operations on both CRC20 and CRC721 tokens.
46 lines (45 loc) • 1.9 kB
TypeScript
import { AxiosInstance } from 'axios';
/**
* Provides utility functions for blockchain data processing.
*
* @namespace txs
*/
export declare const txs: {
/**
* Splits a block range into smaller chunks for easier processing.
*
* @param {number} startBlock - The starting block number.
* @param {number} endBlock - The ending block number.
* @param {number} chunkSize - The size of each chunk.
* @returns {Array<{ start: number, end: number }>} An array of block range objects.
*
* @example
* const ranges = utils.splitBlockRange(1000000, 1100000, 10000);
* console.log(ranges);
*/
splitBlockRange: (startBlock: number, endBlock: number, chunkSize: number) => Array<{
start: number;
end: number;
}>;
/**
* Counts unique transactions for a list of contract addresses within a specified block range.
*
* @param {string[]} contractAddresses - An array of contract addresses to fetch transactions for.
* @param {number} startBlock - The starting block number.
* @param {number} endBlock - The ending block number.
* @param {number} chunkSize - The size of chunks to split the block range into for fetching.
* @param {AxiosInstance} instance - The Axios instance to use for making API requests.
* @returns {Promise<string[]>} A promise that resolves to an array of unique wallet addresses involved in the transactions.
*
* @example
* const uniqueWallets = await utils.countUniqueTransactions(
* ['0xCONTRACT_ADDRESS1', '0xCONTRACT_ADDRESS2'],
* 1000000,
* 1100000,
* 10000,
* axiosInstance
* );
* console.log('Unique wallets:', uniqueWallets);
*/
getUniqueTransactions: (contractAddresses: string[], startBlock: number, endBlock: number, chunkSize: number, instance: AxiosInstance) => Promise<string[]>;
};