question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to connect a signer to another network (provider)?

See original GitHub issue

In ethers.js is it possible to connect a signer from one network to another network? So metamask is connected to mainnet - and you use an rpc provider connected to another sidechain but using the same private keys.

The use case is when using the gas station network (gsn: https://opengsn.org), you may have a side chain that is connected to a different network using gsn, but using the same account/private key.

When I use the .connect method on a signer that is already connected to another network I get this error: Error: cannot alter JSON-RPC Signer connection (operation="connect", code=UNSUPPORTED_OPERATION, version=providers/5.0.10)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yuetloocommented, Oct 7, 2020

Yeah, I think it would work with metamask. I tested it with a random wallet, not with metamask. But, I can confirm later. Keep in mind that this GsnSigner only supports GSN v1.0, not the latest v2.0.

The GsnSigner was implemented to take another signer as input in the constructor and overrides the sendTransaction() method to send the signed transaction to the GSN network.

1reaction
ricmoocommented, Oct 7, 2020

Cool cool.

Yeah, gsn works fine since it just uses signed EIP-191 payloads with the personal message profile (I think?) which MetaMask does support.

@yuetloo can comment more on that though. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signers - ethers
A Signer in ethers is an abstraction of an Ethereum Account, which can be used to sign messages and transactions and send signed...
Read more >
Providers & Signers - Scaffold-eth | Docs
Providers. Providers are your connections to different blockchains. Scaffold-eth uses ethers.js providers. The frontend has three different providers that ...
Read more >
Can jsonRpcProvider.getSigner() take any address as an ...
The provider.getSigner(address) in ethers.js, takes in an address and creates a JsonRpcSigner instance, which uses the appropriate methods ...
Read more >
Other signing actions - DocuSign Support
Assign to Someone Else: Reassign the signing responsibility to another person. You must provide the new signer's name, email address, ...
Read more >
How to connect ethers.js library with Rinkeby programmatically?
getSigner () for InfuraProvider doesn't work, use this: const infuraProvider = new ethers.providers.InfuraProvider(network, API_KEY); const ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found