diff --git a/index.d.ts b/index.d.ts index fd2c7a1..39017a7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -10,6 +10,16 @@ declare module '@metamask/eth-query' { | symbol | undefined; + type Json = + | null + | boolean + | number + | string + | Json[] + | { [prop: string]: Json }; + + type JsonRpcParams = Json[] | Record; + type ProviderSendAsyncResponse = { error?: { message: string }; result?: Result; @@ -21,13 +31,13 @@ declare module '@metamask/eth-query' { ) => void; type Provider = { - sendAsync( + sendAsync( payload: SendAsyncPayload, callback: ProviderSendAsyncCallback, ): void; }; - type SendAsyncPayload = { + type SendAsyncPayload = { id: number; jsonrpc: '2.0'; method: string; @@ -43,7 +53,7 @@ declare module '@metamask/eth-query' { export default class EthQuery { constructor(provider: Provider); - sendAsync( + sendAsync( opts: Partial>, callback: SendAsyncCallback, ): void;