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

Standard web3 global API interface #81

Closed
pkieltyka opened this issue Nov 29, 2017 · 5 comments
Closed

Standard web3 global API interface #81

pkieltyka opened this issue Nov 29, 2017 · 5 comments
Assignees
Labels
enhancement New feature or improvement.

Comments

@pkieltyka
Copy link

pkieltyka commented Nov 29, 2017

Hello,

I haven't dabbled with ethers.js just yet, but I intend to try it on my next dapp project. So forgive me if my question isn't relevant.

I was wondering if ethers.js is planning an interface compatible with web3.currentProvider ?

as described in https://github.com/MetaMask/faq/blob/master/detecting_metamask.md#web3-deprecation where MetaMask is deprecating web3.js injection, and instead will allow dapps to bring their own clients, but use a smaller but standard interface of web3 - does ethers.js plan to fit this kind of support as well?

@pkieltyka pkieltyka changed the title Standard web3.currentProvider interface Standard web3 global API interface Nov 29, 2017
@ricmoo
Copy link
Member

ricmoo commented Nov 29, 2017

I'm in the process of adding a web3 bridge right now that will allow web3 apps to work on top of ethers.js. It will be allow full support in Ethers Wallet (iOS) for Web3 apps. The API calls may change, and I welcome suggestions or concerns, but I'm thinking it will look like:

// To go from ethers.js to Web3 API
var web3 = new Web3(ethers.providers.bridgeToWeb3(providerOrSigner))

// To go from Web3 to ethers.js API.
var signer = ethers.providers.brigdeWeb3Signer(web3);
var provider = new ethers.providers.Web3BridgeProvider(web3.currentProvider);

This will make it easier for anyone with an existing web3 app to "just use" ethers.js, while they migrate.

It is mostly straight forward, the difficulties come from the JSON-RPC/Web3 Events API which has lots of internal state to maintain, which is what the ethers.js providers specifically attempted to prevent.

It's coming. :)

@ricmoo ricmoo self-assigned this Nov 29, 2017
@ricmoo ricmoo added the enhancement New feature or improvement. label Nov 29, 2017
@pkieltyka
Copy link
Author

awesome @ricmoo ! thanks. Please update whenever you push a branch with the work I can try on a dapp

@pkieltyka
Copy link
Author

hi @ricmoo I was just wondering if you had any progress on the MM bridge or an alpha version? I'm eager to use ethers in my next project but without any MM support I can't move forward. thank you and happy holidays!!

@ricmoo
Copy link
Member

ricmoo commented Dec 30, 2017

This has been added in EthersWallet-iOS. It is just a matter of posting it over to ethers.js, which I'm hoping to get to this week.

@pkieltyka
Copy link
Author

as of ethers v2.2.3 the web3.currentProvider surface API is supported!

see #59 (comment) for usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement.
Projects
None yet
Development

No branches or pull requests

2 participants