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

Add web3 #27

Merged
merged 9 commits into from
Jul 2, 2024
Merged

Add web3 #27

merged 9 commits into from
Jul 2, 2024

Conversation

bb-face
Copy link
Collaborator

@bb-face bb-face commented Jun 24, 2024

Resolves #21

@elliotBraem
Copy link
Contributor

elliotBraem commented Jun 30, 2024

We should add to README:

## Configuring Ethers

Since [NearSocial/VM v1.3.0](https://github.com/NearSocial/VM/blob/master/CHANGELOG.md#130), the VM has exposed Ethers and ethers in the global scope, as well as a Web3Connect custom element for bringing up wallet connect.

There already exists support for most common EVM chains, but to add a new chain to your web3 provider, find your chain on [ChainList](https://chainlist.org/) and then add the necessary details to the [chains.json](./src/utils/web4/chains.json). Be sure to include a testnet configuration as well. This will enable you to connect to the specified chain when using `<Web3Connect />` within a widget running inside your custom web component.

You can configure the projectId and appMetadata in [ethersProvider.js](./src/utils/web4/ethersProvider.js) as well.

For more information on how to utilize [Ethers.js](https://docs.ethers.org/v6/) in your widgets, see [NEAR for Ethereum developers](https://docs.near.org/tutorials/near-components/ethers-js). To see a list of existing EVM components built by the community, see [here](https://near.social/hackerhouse.near/widget/EVMComponents).

@elliotBraem elliotBraem marked this pull request as ready for review July 1, 2024 21:16
Copy link
Collaborator

@petersalomonsen petersalomonsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thanks!

@bb-face bb-face merged commit 9608b0a into main Jul 2, 2024
1 check passed
@elliotBraem elliotBraem mentioned this pull request Jul 2, 2024
4 tasks
elliotBraem added a commit that referenced this pull request Jul 3, 2024
* Working web3 hook

* Create test

* Move chains to a separate file

* fix test

* Centralised web3 functionality

* Update readme

---------

Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com>
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.

Support ethers
3 participants