Skip to content

Commit 73e9434

Browse files
committed
When in Status trigger personal_sign instead of eth_sign (#1285).
1 parent 796954f commit 73e9434

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/providers/src.ts/web3-provider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { JsonRpcProvider } from "./json-rpc-provider";
1212
// Exported Types
1313
export type ExternalProvider = {
1414
isMetaMask?: boolean;
15+
isStatus?: boolean;
1516
host?: string;
1617
path?: string;
1718
sendAsync?: (request: { method: string, params?: Array<any> }, callback: (error: any, response: any) => void) => void
@@ -29,7 +30,7 @@ function buildWeb3LegacyFetcher(provider: ExternalProvider, sendFunc: Web3Legacy
2930
return function(method: string, params: Array<any>): Promise<any> {
3031

3132
// Metamask complains about eth_sign (and on some versions hangs)
32-
if (method == "eth_sign" && provider.isMetaMask) {
33+
if (method == "eth_sign" && (provider.isMetaMask || provider.isStatus)) {
3334
// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign
3435
method = "personal_sign";
3536
params = [ params[1], params[0] ];
@@ -64,7 +65,7 @@ function buildEip1193Fetcher(provider: ExternalProvider): JsonRpcFetchFunc {
6465
if (params == null) { params = [ ]; }
6566

6667
// Metamask complains about eth_sign (and on some versions hangs)
67-
if (method == "eth_sign" && provider.isMetaMask) {
68+
if (method == "eth_sign" && (provider.isMetaMask || provider.isStatus)) {
6869
// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign
6970
method = "personal_sign";
7071
params = [ params[1], params[0] ];

0 commit comments

Comments
 (0)