From b95d93a43b3020e1ebf4f319d78d918ea0fe8802 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 16 Aug 2017 23:22:24 -0500 Subject: Add JSONRPCPayload type and remove unused import --- src/subproviders/empty_wallet_subprovider.ts | 6 +++--- src/types.ts | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/subproviders/empty_wallet_subprovider.ts b/src/subproviders/empty_wallet_subprovider.ts index 40d3d418d..0d037042d 100644 --- a/src/subproviders/empty_wallet_subprovider.ts +++ b/src/subproviders/empty_wallet_subprovider.ts @@ -1,5 +1,5 @@ -import * as _ from 'lodash'; -import Web3 = require('web3'); +import * as Web3 from 'web3'; +import {JSONRPCPayload} from '../types'; /* * This class implements the web3-provider-engine subprovider interface and returns @@ -7,7 +7,7 @@ import Web3 = require('web3'); * Source: https://github.com/MetaMask/provider-engine/blob/master/subproviders/subprovider.js */ export class EmptyWalletSubProvider { - public handleRequest(payload: any, next: () => void, end: (err: Error|null, result: any) => void) { + public handleRequest(payload: JSONRPCPayload, next: () => void, end: (err: Error|null, result: any) => void) { switch (payload.method) { case 'eth_accounts': end(null, []); diff --git a/src/types.ts b/src/types.ts index ee45acf11..851995cf7 100644 --- a/src/types.ts +++ b/src/types.ts @@ -368,3 +368,8 @@ export interface ContractArtifact { }; }; } + +export interface JSONRPCPayload { + params: any[]; + method: string; +} -- cgit v1.2.3