UNPKG

noob-ethereum

Version:
56 lines 2.51 kB
import { HttpClient } from '../../abstract/http'; declare class Provider extends HttpClient { private static instance; protected readonly config: { headers: { 'Content-Type': string; }; }; url: string; private constructor(); static init(url?: string): Provider; /** * Fetch raw block by number via JSON-RPC * @param {string} blockNumber - 12396599 * @param {boolean} verbose - true * @returns {Promise<IRawBlock>} */ getBlockByNumber(blockNumber: number, verbose?: boolean): Promise<IRawBlock>; getLogs(address: string, topics: string[], blockHash: string): Promise<RawTransactionLogItem[]>; /** * Fetch latest raw block via JSON-RPC * @param {boolean} verbose - true * @returns {Promise<IRawBlock>} */ getLatestBlock(verbose?: boolean): Promise<IRawBlock>; /** * Fetch transaction receipt by transaction hash * @param {string} hash - transaction hash * @returns {Promise<IRawBlock>} */ getTransactionReceipt(hash: string): Promise<RawTransactionReceipt>; /** * Generate JSON file of latest block * @param {boolean} verbose - flag to specify fetching full tx objects or just their hashes * @param {string} path - optional parameter to specify path from project root where to save JSON file */ seedLatestBlock(verbose?: boolean, path?: string): Promise<void>; /** * Generate JSON file for a specific block * @param {number} num - decimal number of a block * @param {boolean} verbose - flag to specify fetching full tx objects or just their hashes * @param {string} path - optional parameter to specify path from project root where to save JSON file */ seedBlockByNumber(verbose: boolean | undefined, num: number, path?: string): Promise<void>; private _prepareBlockRangeQuery; private _fetchFullTransactionBodies; private _fetchTransactionsOverBlockRange; private _fetchTransactionsOverBlocksByInteraction; fetchTransactionsOverBlockRange(startingBlock: number, total: number | 'latest', limit: number): Promise<any[][]>; fetchTransactionsOverBlocksByInteraction(startingBlock: number, total: number | 'latest', limit: number, from: string, to: string): Promise<any[][]>; private fetchMultipleRequests; fetchBatchReceipts(batchArr: any[], limit: number): Promise<any[]>; private _standardizeTransactionReceipt; } export { Provider }; //# sourceMappingURL=index.d.ts.map