import { Client } from './client'; export interface IEthReceipt { transactionHash: string; transactionIndex: string; blockHash: string; blockNumber: string; gasUsed: string; cumulativeGasUsed: string; contractAddress: string; logs: Array; status: string; } export interface IEthTransaction { hash: string; nonce: string; blockHash: string; blockNumber: string; transactionIndex: string; from: string; to: string; value: string; gasPrice: string; gas: string; input: string; } export interface IEthBlock { blockNumber: string; transactionHash: string; parentHash: string; logsBloom: string; timestamp: number; transactions: Array; } export interface IEthRPCPayload { id: number; method: string; params: Array; } export interface IEthFilterLog { removed: boolean; logIndex: string; transactionIndex: string; transactionHash: string; blockHash: string; blockNumber: string; address: string; data: string; topics: Array; } /** * Web3 provider that interacts with EVM contracts deployed on Loom DAppChains. */ export declare class LoomProvider { private _client; protected notificationCallbacks: Array; readonly accounts: Map; readonly accountsAddrList: Array; /** * Constructs the LoomProvider to bridges communication between Web3 and Loom DappChains * * @param client Client from LoomJS * @param privateKey Account private key */ constructor(client: Client, privateKey: Uint8Array); /** * Creates new accounts by passing the private key array * * Accounts will be available on public properties accounts and accountsAddrList * * @param accountsPrivateKey Array of private keys to create new accounts */ addAccounts(accountsPrivateKey: Array): void; on(type: string, callback: any): void; addDefaultEvents(): void; removeListener(type: string, callback: (...args: any[]) => void): void; removeAllListeners(type: string, callback: Function): void; reset(): void; disconnect(): void; sendAsync(payload: any, callback?: Function): Promise; /** * Should be used to make async request * This method is used internally by web3, so we adapt it to be used with loom contract * when we are wrapping the evm on a DAppChain * @param payload JSON payload generated by web3 which will be translated to loom transaction/call * @param callback Triggered on end with (err, result) */ send(payload: any, callback: Function): Promise; private _ethAccounts; private _ethBlockNumber; private _ethCall; private _ethEstimateGas; private _ethGasPrice; private _ethGetBlockByHash; private _ethGetBlockByNumber; private _ethGetCode; private _ethGetFilterChanges; private _ethGetLogs; private _ethGetTransactionByHash; private _ethGetTransactionReceipt; private _ethNewBlockFilter; private _ethNewFilter; private _ethNewPendingTransactionFilter; private _ethSendTransaction; private _ethSubscribe; private _ethUninstallFilter; private _ethUnsubscribe; private _netVersion; private _deployAsync; private _callAsync; private _callStaticAsync; private _createBlockInfo; private _createReceiptResult; private _getTransaction; private _getReceipt; private _createLogResult; private _getLogs; private _onWebSocketMessage; private _commitTransaction; private _okResponse; }