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

Feat/use contract #93

Merged
merged 3 commits into from
Dec 13, 2021
Merged

Conversation

swellander
Copy link
Contributor

@swellander swellander commented Dec 11, 2021

Closes #39

Description

This PR adds a useContract hook to allow users quick access to available methods. The hook accepts an address and an abi as arguments and returns an object of the contract's methods.

📝 Additional Information

This does not currently handle automatic typing of the contract returned by the hook. @christiananese and @crondinini have mentioned using the TypeChain library to accomplish this, but I'm not sure how that would work. See this comment and this one for more context.

Screencast

Screen.Recording.2021-12-10.at.6.24.06.PM.mov

@swellander swellander marked this pull request as draft December 11, 2021 02:30
@Dhaiwat10 Dhaiwat10 self-requested a review December 11, 2021 06:59
@Dhaiwat10
Copy link
Member

@swellander thanks, this looks good for now! We can integrate type defs in a separate PR. Should I go ahead and merge this?

@swellander
Copy link
Contributor Author

Hi @Dhaiwat10 sounds good to me, thanks!

@swellander swellander marked this pull request as ready for review December 13, 2021 15:37
@changeset-bot
Copy link

changeset-bot bot commented Dec 13, 2021

🦋 Changeset detected

Latest commit: 2c63a14

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@web3-ui/hooks Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Dhaiwat10 Dhaiwat10 merged commit 94718e7 into Developer-DAO:main Dec 13, 2021
@github-actions github-actions bot mentioned this pull request Dec 13, 2021
@swellander swellander deleted the feat/useContract branch December 13, 2021 17:04
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.

useContract
2 participants