diff --git a/packages/providers/src.ts/ipc-provider.ts b/packages/providers/src.ts/ipc-provider.ts index 5bb279e3a..878549aab 100644 --- a/packages/providers/src.ts/ipc-provider.ts +++ b/packages/providers/src.ts/ipc-provider.ts @@ -29,7 +29,7 @@ export class IpcProvider extends JsonRpcProvider { // @TODO: Create a connection to the IPC path and use filters instead of polling for block - send(method: string, params: any): Promise { + send(method: string, params: Array): Promise { // This method is very simple right now. We create a new socket // connection each time, which may be slower, but the main // advantage we are aiming for now is security. This simplifies diff --git a/packages/providers/src.ts/json-rpc-provider.ts b/packages/providers/src.ts/json-rpc-provider.ts index 2321756a3..48c1c3ef0 100644 --- a/packages/providers/src.ts/json-rpc-provider.ts +++ b/packages/providers/src.ts/json-rpc-provider.ts @@ -290,7 +290,7 @@ export class JsonRpcProvider extends BaseProvider { }); } - send(method: string, params: any): Promise { + send(method: string, params: Array): Promise { let request = { method: method, params: params, diff --git a/packages/providers/src.ts/web3-provider.ts b/packages/providers/src.ts/web3-provider.ts index 035a19020..c4e3b08a7 100644 --- a/packages/providers/src.ts/web3-provider.ts +++ b/packages/providers/src.ts/web3-provider.ts @@ -19,14 +19,6 @@ export type AsyncSendable = { send?: (request: any, callback: (error: any, response: any) => void) => void } -/* -@TODO -utils.defineProperty(Web3Signer, "onchange", { - -}); - -*/ - export class Web3Provider extends JsonRpcProvider { readonly provider: AsyncSendable; private _sendAsync: (request: any, callback: (error: any, response: any) => void) => void; @@ -45,14 +37,14 @@ export class Web3Provider extends JsonRpcProvider { } } - if (!web3Provider || !this._sendAsync) { + if (!this._sendAsync) { logger.throwArgumentError("invalid web3Provider", "web3Provider", web3Provider); } defineReadOnly(this, "provider", web3Provider); } - send(method: string, params: any): Promise { + send(method: string, params: Array): Promise { // Metamask complains about eth_sign (and on some versions hangs) if (method == "eth_sign" && this.provider.isMetaMask) { @@ -65,7 +57,7 @@ export class Web3Provider extends JsonRpcProvider { const request = { method: method, params: params, - id: 42, + id: (this._nextId++), jsonrpc: "2.0" };