Is there a way to connect a signer to another network (provider)?
See original GitHub issueIn 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:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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. 😃