From c34952abbd2483107d27c5e74b5c68df08e6f8f9 Mon Sep 17 00:00:00 2001 From: shanejonas Date: Wed, 28 Apr 2021 11:55:56 -0700 Subject: [PATCH] fix: rename initializeProvider -> initializeInpageProvider --- src/MetaMaskInpageProvider.ts | 5 ++--- src/index.ts | 2 +- src/{initializeProvider.ts => initializeInpageProvider.ts} | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) rename src/{initializeProvider.ts => initializeInpageProvider.ts} (92%) diff --git a/src/MetaMaskInpageProvider.ts b/src/MetaMaskInpageProvider.ts index 1c9370ae..2b13130f 100644 --- a/src/MetaMaskInpageProvider.ts +++ b/src/MetaMaskInpageProvider.ts @@ -3,7 +3,6 @@ import { JsonRpcRequest, JsonRpcResponse, } from 'json-rpc-engine'; -import { createStreamMiddleware } from 'json-rpc-middleware-stream'; import { ethErrors } from 'eth-rpc-errors'; import sendSiteMetadata from './siteMetadata'; import messages from './messages'; @@ -20,7 +19,7 @@ export interface SendSyncJsonRpcRequest extends JsonRpcRequest { type WarningEventName = keyof SentWarningsState['events']; -export interface MetaMaskProviderOptions extends BaseProviderOptions { +export interface MetaMaskInpageProviderOptions extends BaseProviderOptions { /** * Whether the provider should send page metadata. @@ -88,7 +87,7 @@ export default class MetaMaskInpageProvider extends BaseProvider { logger = console, maxEventListeners = 100, shouldSendMetadata = true, - }: MetaMaskProviderOptions = {}, + }: MetaMaskInpageProviderOptions = {}, ) { super(connectionStream, { jsonRpcStreamName, logger, maxEventListeners }); diff --git a/src/index.ts b/src/index.ts index c9e37f54..6207a1ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import MetaMaskInpageProvider from './MetaMaskInpageProvider'; import BaseProvider from './BaseProvider'; -import { initializeProvider, setGlobalProvider } from './initializeProvider'; +import { initializeProvider, setGlobalProvider } from './initializeInpageProvider'; import shimWeb3 from './shimWeb3'; export { diff --git a/src/initializeProvider.ts b/src/initializeInpageProvider.ts similarity index 92% rename from src/initializeProvider.ts rename to src/initializeInpageProvider.ts index 76a2d8a5..0d9535d6 100644 --- a/src/initializeProvider.ts +++ b/src/initializeInpageProvider.ts @@ -1,8 +1,8 @@ import { Duplex } from 'stream'; -import MetaMaskInpageProvider, { MetaMaskProviderOptions } from './MetaMaskInpageProvider'; +import MetaMaskInpageProvider, { MetaMaskInpageProviderOptions } from './MetaMaskInpageProvider'; import shimWeb3 from './shimWeb3'; -interface InitializeProviderOptions extends MetaMaskProviderOptions { +interface InitializeProviderOptions extends MetaMaskInpageProviderOptions { /** * The stream used to connect to the wallet.