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
We want to enable Ethers.js support for the VM. It may be done similarly to NearSocial/viewer#130
To enable Ethers.js we need to get the Provider. In the PR above it was injected using from a hook into a Widget and then given to the VM instance. The hook used a singleton to store the current provider which was coming from the Web3Onboard.
The VM itself shouldn't be enforcing the wallet selection, so it may expect the provider be injected using a singleton like initNear call. Another option is a React context which would wrap the root Widget and provide it this way.
Network switcher
The network switcher is wallet specific. The PR used Web3Onboard and it has its own API to change chainID. For the VM we should expose a new method through the provider hook that would request a wallet to change the network. The viewer is going to be responsible for the implementation of such callback.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We want to enable Ethers.js support for the VM. It may be done similarly to NearSocial/viewer#130
To enable Ethers.js we need to get the Provider. In the PR above it was injected using from a hook into a Widget and then given to the VM instance. The hook used a singleton to store the current provider which was coming from the Web3Onboard.
The VM itself shouldn't be enforcing the wallet selection, so it may expect the provider be injected using a singleton like
initNear
call. Another option is a React context which would wrap the root Widget and provide it this way.Network switcher
The network switcher is wallet specific. The PR used Web3Onboard and it has its own API to change chainID. For the VM we should expose a new method through the provider hook that would request a wallet to change the network. The viewer is going to be responsible for the implementation of such callback.
Beta Was this translation helpful? Give feedback.
All reactions