You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to connect the sequence wallet to the bnb network, but the resulting web3 provider object always connects to the polygon network.
This makes it impossible to use the provider directly (which is much simpler to adapt our code to implement the sequence wallet).
Symptoms:
this happens both for testnet or mainnet
every once in a while I will refresh the page and try again and it will connect to the bnb network, this happens apparently randomly, then I refresh again and it connects to polygon again
a wallet_switchEthereumChain to try to switch it to the wanted network always fails with a 4001 code, apparently rejected by the sequence wallet itself (I'm assuming this is by design due to how the sequence wallet handles multinetwork, however makes it impossible to control the provider object in this way) (this was likely a symptom of Events are not triggering #326 , although I'm not sure why I had 4001's, but I can't reproduce those anymore at least)
if I try it directly from the browser console, it always connects to the correct network, which is a bit maddening as it's the exact same code...
Code:
import{sequence}from'0xsequence';letprovider;constgetSequenceName=chainId=>{switch(chainId){case97:
return'bsc-testnet';case56:
default:
return'bsc';}};// For debugging in consoleif(typeofwindow!=='undefined'){window.Oxsequence=sequence;}constconnect=async({ chainId })=>{constname=getSequenceName(chainId);console.log({ chainId, name });provider=awaitsequence.initWallet(name);console.log({ provider, name });try{// const connection = await provider.connect();// The `networkId` parameter in here was me trying to select the network once again, the same thing happens// regardless of if passing it or calling connect without it.constconnection=awaitprovider.connect({networkId: chainId});console.log({ connection });console.log({chainId: awaitprovider?.transport.provider.getChainId()});return!!connection?.connected&&provider?.transport.provider;}catch(ex){// eslint-disable-next-lineconsole.error(ex);returnnull;}};
I try to connect the sequence wallet to the bnb network, but the resulting web3 provider object always connects to the polygon network.
This makes it impossible to use the provider directly (which is much simpler to adapt our code to implement the sequence wallet).
Symptoms:
a(this was likely a symptom of Events are not triggering #326 , although I'm not sure why I had 4001's, but I can't reproduce those anymore at least)wallet_switchEthereumChainto try to switch it to the wanted network always fails with a 4001 code, apparently rejected by the sequence wallet itself (I'm assuming this is by design due to how the sequence wallet handles multinetwork, however makes it impossible to control the provider object in this way)Code:
Result screenshot:
