UNPKG

datxweb-core-method

Version:

Handles the JSON-RPC methods. This package is also internally used by datxweb.

67 lines (51 loc) 1.98 kB
/* This file is part of Datxweb.js. Datxweb.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. Datxweb.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 Datxweb.js. If not, see <http://www.gnu.org/licenses/>. */ /** * @file index.d.ts * @author Samuel Furter <samuel@ethereum.org> * @date 2018 */ import {Utils} from 'datxweb-utils'; import {AbstractWeb3Module, PromiEvent} from 'datxweb-core'; import {formatters} from 'datxweb-core-helpers'; export class AbstractMethod { constructor( rpcMethod: string, parametersAmount: number, utils: Utils, formatters: formatters, moduleInstance: AbstractWeb3Module ); utils: Utils; formatters: formatters; promiEvent: PromiEvent<any>; rpcMethod: string; parametersAmount: number; parameters: any[]; getArguments(): any; setArguments(args: any[]): void; isHash(parameter: string): boolean; hasWallets(): boolean; callback(error: string | Error, response: any): void; beforeExecution(moduleInstance: AbstractWeb3Module): void; afterExecution(response: any): any; execute(): Promise<any> | PromiEvent<any> | string; clearSubscriptions(unsubscribeMethod: string): Promise<boolean | Error>; } export class AbstractMethodFactory { constructor(utils: Utils, formatters: formatters); methods: null | object; hasMethod: boolean; createMethod(name: string, moduleInstance: AbstractWeb3Module): AbstractMethod; }