/* This file is part of web3.js. web3.js is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. web3.js is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with web3.js. If not, see . */ /** * @file index.d.ts * @author Prince Sinha * @author Samuel Furter * @date 2019 */ import {provider} from 'web3-providers'; import {AbstractWeb3Module, Web3ModuleOptions} from 'web3-core'; import * as net from 'net'; export class Debug extends AbstractWeb3Module { constructor(provider: provider, net?: net.Socket | null, options?: Web3ModuleOptions); setBackTraceAt( location: string, callback?: (error: Error, result: null) => void ): Promise; blockProfile( file: string, seconds: number | string, callback?: (error: Error, result: null) => void ): Promise; cpuProfile( file: string, seconds: number | string, callback?: (error: Error, result: null) => void ): Promise; dumpBlock( blockNumber: number | string, callback?: (error: Error, result: WorldState) => void ): Promise; getGCStats( callback?: (error: Error, result: Stats) => void ): Promise; getBlockRlp( blockNumber: number | string, callback?: (error: Error, result: string) => void ): Promise; goTrace( file: string, seconds: number | string, callback?: (error: Error, result: null) => void ): Promise; getMemStats(callback?: (error: Error, result: MemStats) => void): Promise; getSeedHash( blockNumber: number | string, callback?: (error: Error, result: string) => void ): Promise; setBlockProfileRate( rate: number | string, callback?: (error: Error, result: null) => void ): Promise; setHead( blockNumber: number | string, callback?: (error: Error, result: null) => void ): Promise; getStacks(callback?: (error: Error, result: string) => void): Promise; startCPUProfile( file: string, callback?: (error: Error, result: null) => void ): Promise; startGoTrace( file: string, callback?: (error: Error, result: null) => void ): Promise; stopCPUProfile(callback?: (error: Error, result: null) => void): Promise; stopGoTrace(callback?: (error: Error, result: null) => void): Promise; getBlockTrace( blockRlp: string, options?: any, callback?: (error: Error, result: BlockTraceResult) => void ): Promise; getBlockTraceByNumber( blockNumber: number | string, options?: any, callback?: (error: Error, result: BlockTraceResult) => void ): Promise; getBlockTraceByHash( transactionHash: string, options?: any, callback?: (error: Error, result: BlockTraceResult) => void ): Promise; getBlockTraceFromFile( fileName: string, options?: any, callback?: (error: Error, result: BlockTraceResult) => void ): Promise; getTransactionTrace( transactionHash: string, options?: any, callback?: (error: Error, result: TransactionTrace) => void ): Promise; setVerbosity( level: number | string, callback?: (error: Error, result: null) => void ): Promise; setVerbosityPattern( input: string, callback?: (error: Error, result: null) => void ): Promise; writeBlockProfile( file: string, callback?: (error: Error, result: null) => void ): Promise; writeMemProfile( file: string, callback?: (error: Error, result: null) => void ): Promise; } export interface Stats { LastGC: string; NumGC: number; Pause: number[]; PauseEnd: string[]; PauseQuantiles: string; PauseTotal: number; } export interface TransactionTrace { gas: number; returnValue: string; structLogs: StructuredLog[]; } export interface StructuredLog { depth: number; error: string; gas: number; gasCost: number; memory: string[]; op: string; pc: number; stack: string[]; storage: { [account: string]: string } } export interface WorldState { root: string; accounts: { [address: string]: { balance: string; code: string; codeHash: string; nonce: number; root: string; storage: any; } }; } export interface BlockTraceResult { number: number; hash: string; traces: TransactionTrace[] } export interface MemStats { Alloc: number; TotalAlloc: number; Sys: number; Loopups: number; Mallocs: number; Frees: number; HeapAlloc: number; HeapSys: number; HeapIdle: number; HeapInuse: number; HeapReleased: number; HeapObjects: number; StackInuse: number; StackSys: number; MSpanInuse: number; MSpanSys: number; MCacheInuse: number; MCacheSys: number; BuckHashSys: number; GcSys: number; OtherSys: number; NextGC: number; LastGC: number; PauseTotalNs: number; PauseNs: number; PauseEnd: number; NumGC: number; NumForcedGC: number; GcCPUFraction: number; EnableGC: boolean; DebugGC: boolean; BySize: { size: number; mallocs: number; frees: number; }; }