// '{'jsonrpc':'2.0','method':'eth_sendTransaction','params':[{see above}],'id':1}' export declare interface JsonRPCRequest { jsonrpc: string; method: string; params: any[]; id: number; } export declare interface JsonRPCResponse { jsonrpc: string; id: number; result?: any; error?: string; } export type Callback = (error: Error, result: T) => void; export type ABIDataTypes = 'uint256' | 'boolean' | 'string' | 'bytes' | string; export type PromiEventType = 'transactionHash' | 'receipt' | 'confirmation' | 'error'; export declare interface PromiEvent extends Promise { once(type: 'transactionHash', handler: (receipt: string) => void): PromiEvent; once(type: 'receipt', handler: (receipt: TransactionReceipt) => void): PromiEvent; once(type: 'confirmation', handler: (confNumber: number, receipt: TransactionReceipt) => void): PromiEvent; once(type: 'error', handler: (error: Error) => void): PromiEvent; once(type: 'error' | 'confirmation' | 'receipt' | 'transactionHash', handler: (error: Error | TransactionReceipt | string) => void): PromiEvent; on(type: 'transactionHash', handler: (receipt: string) => void): PromiEvent; on(type: 'receipt', handler: (receipt: TransactionReceipt) => void): PromiEvent; on(type: 'confirmation', handler: (confNumber: number, receipt: TransactionReceipt) => void): PromiEvent; on(type: 'error', handler: (error: Error) => void): PromiEvent; on(type: 'error' | 'confirmation' | 'receipt' | 'transactionHash', handler: (error: Error | TransactionReceipt | string) => void): PromiEvent; } export declare interface EventEmitter { on(type: 'data', handler: (event: EventLog) => void): EventEmitter; on(type: 'changed', handler: (receipt: EventLog) => void): EventEmitter; on(type: 'error', handler: (error: Error) => void): EventEmitter; on(type: 'error' | 'data' | 'changed', handler: (error: Error | TransactionReceipt | string) => void): EventEmitter; } export declare interface TransactionObject { arguments: any[]; call(tx?: Tx): Promise; send(tx?: Tx): PromiEvent; estimateGas(tx?: Tx): Promise; encodeABI(): string; } export declare interface ABIDefinition { constant?: boolean; payable?: boolean; anonymous?: boolean; inputs?: Array<{ name: string, type: ABIDataTypes, indexed?: boolean }>; name?: string; outputs?: Array<{ name: string, type: ABIDataTypes }>; type: 'function' | 'constructor' | 'event' | 'fallback'; } export declare interface CompileResult { code: string; info: { source: string; language: string; languageVersion: string; compilerVersion: string; abiDefinition: Array; }; userDoc: { methods: object }; developerDoc: { methods: object }; } export declare interface Transaction { hash: string; nonce: number; blockHash: string; blockNumber: number; transactionIndex: number; from: string; to: string; value: string; gasPrice: string; gas: number; input: string; v?: string; r?: string; s?: string; } export declare interface EventLog { event: string; address: string; returnValues: object; logIndex: number; transactionIndex: number; transactionHash: string; blockHash: string; blockNumber: number; raw?: { data: string, topics: string[] }; } export declare interface TransactionReceipt { transactionHash: string; transactionIndex: number; blockHash: string; blockNumber: number; from: string; to: string; contractAddress: string; cumulativeGasUsed: number; gasUsed: number; logs?: Array; events?: { [eventName: string]: EventLog; }; status: string; } export declare interface EncodedTransaction { raw: string; tx: { nonce: string, gasPrice: string, gas: string, to: string, value: string, input: string, v: string, r: string, s: string, hash: string }; } export declare interface BlockHeader { number: number; hash: string; parentHash: string; nonce: string; sha3Uncles: string; logsBloom: string; transactionRoot: string; stateRoot: string; receiptRoot: string; miner: string; extraData: string; gasLimit: number; gasUsed: number; timestamp: number; } export declare interface Block extends BlockHeader { transactions: Array; size: number; difficulty: number; totalDifficulty: number; uncles: Array; } export declare interface Logs { fromBlock?: number; address?: string; topics?: Array; } export declare interface Log { address: string; data: string; topics: Array; logIndex: number; transactionHash: string; transactionIndex: number; blockHash: string; blockNumber: number; } export declare interface Subscribe { subscription: { id: string; arguments: object; subscribe(callback?: Callback>): Subscribe; unsubscribe(callback?: Callback): void | boolean; }; /* on(type: 'data' , handler:(data:Transaction)=>void): void on(type: 'changed' , handler:(data:Logs)=>void): void on(type: 'error' , handler:(data:Error)=>void): void on(type: 'block' , handler:(data:BlockHeader)=>void): void */ on(type: 'data' | 'changed', handler: (data: T) => void): void; on(type: 'error', handler: (data: Error) => void): void; } export declare interface Account { address: string; privateKey: string; publicKey: string; } export declare interface PrivateKey { address: string; Crypto: { cipher: string, ciphertext: string, cipherparams: { iv: string; }; kdf: string; kdfparams: { dklen: number; n: number; p: number; r: number; salt: string; }, mac: string; }; id: string; version: number; } export declare interface Signature { message: string; hash: string; r: string; s: string; v: string; } export declare interface Tx { nonce?: string | number; chainId?: string | number; from?: string; to?: string; data?: string; value?: string | number; gas?: string | number; gasPrice?: string | number; } export declare interface IProvider { send(payload: JsonRPCRequest, callback: (e: Error, val: JsonRPCResponse) => void); } export declare interface WebsocketProvider extends IProvider { responseCallbacks: object; notificationCallbacks: [() => any]; connection: { onclose(e: any): void, onmessage(e: any): void, onerror(e?: any): void }; addDefaultEvents: () => void; on(type: string, callback: () => any): void; removeListener(type: string, callback: () => any): void; removeAllListeners(type: string): void; reset(): void; } export declare interface HttpProvider extends IProvider { responseCallbacks: undefined; notificationCallbacks: undefined; connection: undefined; addDefaultEvents: undefined; on(type: string, callback: () => any): undefined; removeListener(type: string, callback: () => any): undefined; removeAllListeners(type: string): undefined; reset(): undefined; } export declare interface IpcProvider extends IProvider { responseCallbacks: undefined; notificationCallbacks: undefined; connection: undefined; addDefaultEvents: undefined; on(type: string, callback: () => any): undefined; removeListener(type: string, callback: () => any): undefined; removeAllListeners(type: string): undefined; reset(): undefined; } export type Provider = WebsocketProvider | IpcProvider | HttpProvider; export type Unit = 'kwei' | 'femtoether' | 'babbage' | 'mwei' | 'picoether' | 'lovelace' | 'qwei' | 'nanoether' | 'shannon' | 'microether' | 'szabo' | 'nano' | 'micro' | 'milliether' | 'finney' | 'milli' | 'ether' | 'kether' | 'grand' | 'mether' | 'gether' | 'tether'; export type BlockType = 'latest' | 'pending' | 'genesis' | number; export declare interface Iban { null; } export declare interface Utils { BN: any; unitMap: any; _: any; // _: us.UnderscoreStatic; isBN(any): boolean; isany(any): boolean; isAddress(any): boolean; isHex(any): boolean; asciiToHex(val: string): string; hexToAscii(val: string): string; bytesToHex(val: number[]): string; numberToHex(val: number | any): string; checkAddressChecksum(address: string): boolean; fromAscii(val: string): string; fromDecimal(val: string | number | any): string; fromUtf8(val: string): string; fromWei(val: string | number | any, unit: Unit): string | any; hexToBytes(val: string): number[]; hexToNumber(val: string | number | any): number; hexToNumberString(val: string | number | any): string; hexToString(val: string): string; hexToUtf8(val: string): string; keccak256(val: string): string; leftPad(string: string, chars: number, sign: string): string; padLeft(string: string, chars: number, sign: string): string; rightPad(string: string, chars: number, sign: string): string; padRight(string: string, chars: number, sign: string): string; sha3(val: string, val2?: string, val3?: string, val4?: string, val5?: string): string; soliditySha3(val: string): string; randomHex(bytes: number): string; stringToHex(val: string): string; toAscii(hex: string): string; toBN(any): any; toChecksumAddress(val: string): string; toDecimal(val: any): number; toHex(val: any): string; toUtf8(val: any): string; toWei(val: string | number | any, unit: Unit): string | any; } export declare interface Contract { options: { address: string; jsonInterface: ABIDefinition[]; data: string; from: string gasPrice: string; gas: number; }; methods: { [fnName: string]: (...args) => TransactionObject; }; events: { [eventName: string]: (options?: { filter?: object; fromBlock?: BlockType; topics?: string[]; }, cb?: Callback) => EventEmitter; allEvents: (options?: { filter?: object, fromBlock?: BlockType, topics?: string[] }, cb?: Callback) => EventEmitter; }; deploy(options: { data: string; arguments: any[]; }): TransactionObject; getPastEvents( event: string, options?: { filter?: object, fromBlock?: BlockType, toBlock?: BlockType, topics?: string[]; }, cb?: Callback ): Promise; } export declare interface Request { null; } export declare interface Providers { WebsocketProvider: new (host: string, timeout?: number) => WebsocketProvider; HttpProvider: new (host: string, timeout?: number) => HttpProvider; IpcProvider: new (path: string, net: any) => IpcProvider; } export declare interface Eth { defaultAccount: string; defaultBlock: BlockType; BatchRequest: new () => BatchRequest; Iban: new (address: string) => Iban; Contract: new (jsonInterface: any[], address?: string, options?: { from?: string; gas?: string | number | any; gasPrice?: number; data?: string; }) => Contract; abi: { decodeLog(inputs: object, hexString: string, topics: string[]): object; encodeParameter(type: string, parameter: any): string; encodeParameters(types: string[], paramaters: any[]): string; encodeEventSignature(name: string | object): string; encodeFunctionCall(jsonInterface: object, parameters: any[]): string; encodeFunctionSignature(name: string | object): string; decodeParameter(type: string, hex: string): any; decodeParameters(types: string[], hex: string): any; }; accounts: { wallet: { 'new'(numberOfAccounts: number, entropy: string): Account[] add(account: string | Account): any; remove(account: string | number): any; save(password: string, keyname?: string): string; load(password: string, keyname: string): any; clear(): any; }; 'new'(entropy?: string): Account; privateKeyToAccount(privKey: string): Account; publicToAddress(key: string): string; signTransaction(tx: Tx, privateKey: string, returnSignature?: boolean, cb?: (err: Error, result: string | Signature) => void): Promise | Signature; recoverTransaction(signature: string | Signature): string; sign(data: string, privateKey: string, returnSignature?: boolean): string | Signature; recover(sigOrHash: string | Signature, sigOrV?: string, r?: string, s?: string): string; encrypt(privateKey: string, password: string): PrivateKey; decrypt(privateKey: PrivateKey, password: string): Account; }; compile: { solidity(source: string, callback?: Callback): Promise; lll(source: string, callback?: Callback): Promise; serpent(source: string, callback?: Callback): Promise; }; currentProvider: Provider; givenProvider: Provider; net: Net; personal: Personal; call(callObject: Tx, defaultBloc?: BlockType, callBack?: Callback): Promise; clearSubscriptions(): boolean; subscribe(type: 'logs', options?: Logs, callback?: Callback>): Promise>; subscribe(type: 'syncing', callback?: Callback>): Promise>; subscribe(type: 'newBlockHeaders', callback?: Callback>): Promise>; subscribe(type: 'pendingTransactions', callback?: Callback>): Promise>; subscribe(type: 'pendingTransactions' | 'newBlockHeaders' | 'syncing' | 'logs', options?: Logs, callback?: Callback>): Promise>; unsubscribe(callBack: Callback): void | boolean; estimateGas(tx: Tx, callback?: Callback): Promise; getAccounts(cb?: Callback>): Promise>; getBalance(address: string, defaultBlock?: BlockType, cb?: Callback): Promise; getBlock(number: BlockType, returnTransactionObjects?: boolean, cb?: Callback): Promise; getBlockNumber(callback?: Callback): Promise; getBlockTransactionCount(number: BlockType | string, cb?: Callback): Promise; getBlockUncleCount(number: BlockType | string, cb?: Callback): Promise; getCode(address: string, defaultBlock?: BlockType, cb?: Callback): Promise; getCoinbase(cb?: Callback): Promise; getCompilers(cb?: Callback): Promise; getGasPrice(cb?: Callback): Promise; getHashrate(cb?: Callback): Promise; getPastLogs(options: { fromBlock?: BlockType; toBlock?: BlockType; address: string; topics?: Array>; }, cb?: Callback>): Promise>; getProtocolVersion(cb?: Callback): Promise; getStorageAt(address: string, defaultBlock?: BlockType, cb?: Callback): Promise; getTransactionReceipt(hash: string, cb?: Callback): Promise; getTransaction(hash: string, cb?: Callback): Promise; getTransactionCount(address: string, defaultBlock?: BlockType, cb?: Callback): Promise; getTransactionFromBlock(block: BlockType, index: number, cb?: Callback): Promise; getUncle(blockHashOrBlockNumber: BlockType | string, uncleIndex: number, returnTransactionObjects?: boolean, cb?: Callback): Promise; getWork(cb?: Callback>): Promise>; isMining(cb?: Callback): Promise; isSyncing(cb?: Callback): Promise; signTransaction(tx: Tx, address?: string, cb?: Callback): Promise; sendSignedTransaction(data: string, cb?: Callback): PromiEvent; sendTransaction(tx: Tx, cb?: Callback): PromiEvent; submitWork(nonce: string, powHash: string, digest: string, cb?: Callback): Promise; sign(address: string, dataToSign: string, cb?: Callback): Promise; } export declare class Net { getId(cb?: Callback): Promise; isListening(cb?: Callback): Promise; getPeerCount(cb?: Callback): Promise; } export declare class Personal { newAccount(password: string, cb?: Callback): Promise; getAccounts(cb?: Callback>): Promise>; importRawKey(); lockAccount(address: string): boolean; unlockAccount(address: string, password?: string, duration?: number): boolean; sign(message: string, account: string, password: string): string; } export declare class Shh { } export declare class Bzz { } export declare class BatchRequest { constructor() add(request: Request): void; execute(): void; }