diff --git a/packages/providers/src.ts/json-rpc-provider.ts b/packages/providers/src.ts/json-rpc-provider.ts index 332b2363a..3b3df2289 100644 --- a/packages/providers/src.ts/json-rpc-provider.ts +++ b/packages/providers/src.ts/json-rpc-provider.ts @@ -249,6 +249,13 @@ export class JsonRpcSigner extends Signer implements TypedDataSigner { const data = ((typeof(message) === "string") ? toUtf8Bytes(message): message); const address = await this.getAddress(); + return await this.provider.send("personal_sign", [ hexlify(data), address.toLowerCase() ]); + } + + async _legacySignMessage(message: Bytes | string): Promise { + const data = ((typeof(message) === "string") ? toUtf8Bytes(message): message); + const address = await this.getAddress(); + // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign return await this.provider.send("eth_sign", [ address.toLowerCase(), hexlify(data) ]); } @@ -611,7 +618,6 @@ export class JsonRpcProvider extends BaseProvider { super._stopEvent(event); } - // Convert an ethers.js transaction into a JSON-RPC transaction // - gasLimit => gas // - All values hexlified diff --git a/packages/providers/src.ts/web3-provider.ts b/packages/providers/src.ts/web3-provider.ts index 4810bd801..9c337af98 100644 --- a/packages/providers/src.ts/web3-provider.ts +++ b/packages/providers/src.ts/web3-provider.ts @@ -30,14 +30,6 @@ function buildWeb3LegacyFetcher(provider: ExternalProvider, sendFunc: Web3Legacy const fetcher = "Web3LegacyFetcher"; return function(method: string, params: Array): Promise { - - // Metamask complains about eth_sign (and on some versions hangs) - if (method == "eth_sign" && (provider.isMetaMask || provider.isStatus)) { - // https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign - method = "personal_sign"; - params = [ params[1], params[0] ]; - } - const request = { method: method, params: params, @@ -92,13 +84,6 @@ function buildEip1193Fetcher(provider: ExternalProvider): JsonRpcFetchFunc { return function(method: string, params: Array): Promise { if (params == null) { params = [ ]; } - // Metamask complains about eth_sign (and on some versions hangs) - if (method == "eth_sign" && (provider.isMetaMask || provider.isStatus)) { - // https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign - method = "personal_sign"; - params = [ params[1], params[0] ]; - } - const request = { method, params }; this.emit("debug", {