Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ethers.js #44

Merged
merged 6 commits into from
Apr 24, 2023
Merged

Support ethers.js #44

merged 6 commits into from
Apr 24, 2023

Conversation

evgenykuzyakov
Copy link
Contributor

  • Support ethers.js based on [DO NOT MERGE] Add Ethers.js viewer#130
    • Expose Ethers and ethers in the global scope.
    • Add custom Web3Connect component that renders Web3 connect/disconnect button. Currently, the API is heavily influenced by Web3Onboard API.
    • VM now exports EthersProviderContext React context type. A gateway that wants to support Ethers.js should wrap the app with EthersProviderContext.Provider component with the object value {provider}. Provider is Web3 provider that can be used to create an Ethers.js provider.

@evgenykuzyakov evgenykuzyakov merged commit d25338c into dev Apr 24, 2023
evgenykuzyakov pushed a commit to NearSocial/viewer that referenced this pull request Apr 25, 2023
The following change enables `Ethers` and `ethers` using `ethers.js`
from the VM.

To enable Web3 in the VM, the gateway should inject Web3 provider in the
specific react context `EthersProviderContext` given from the VM.

Currently the implementation depends on the Web3Onboard as a wallet
selector.

See NearSocial/VM#44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants