-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enhancement/ethers support #147
Conversation
calling
|
@@ -253,8 +330,25 @@ export function getAccountBalance() { | |||
}) | |||
} | |||
|
|||
export function getContractMethod({ contractObj, methodName, overloadKey }) { | |||
return state.legacyWeb3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can take me a while to internalise nested ternary, I reckon it might be quicker for new eyes to understand what's happening here if it was written with conditionals instead?
Closing this for the moment, can revisit once ethers v5 is out |
This PR adds support for projects using
ethers.js
. Devs can now pass inethers.js
in the config instead ofweb3.js
and also decorateethers.js
instantiated contracts with ourContract
function.This needs some thorough testing as there are some pretty major changes that can affect existing projects that are using
web3
.ethers
contracts require that the whole contract object (not just the method be passed down in to our preflight checks, which required some architectural changes.I am intermittently getting an issue with MetaMask where the
txPromise
doesn't resolve until the transaction has been mined as opposed to when a transaction hash is available upon user approval, which causes problems with out notification system. This is issue is referenced here: ethers-io/ethers.js#372I am not sure that there is anything that we can do about this. But would like to see if @cmeisl and @liamaharon experience the same issue.
Also something to consider would be to find an open source dapp frontend that is currently using
ethers.js
and invest some time integrating this version ofassist
to see if there is anything that this PR is missing.