-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
CosmWasm smart contract hooks #51
Conversation
@codingki This is ready for a review! I'm not sure what's failing in the graz-example deploy, as I've not got permissions to view the project on Vercel. |
Dont mind the failing builds, we are currently working on it get it fixed @bigs |
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.
Awesome work @bigs🔥 Thanks for working on this, We are really appreciate your work🫡
There are some comments that needs to be resolved and suggestions before merging💪
We can make the hooks params optional and have a |
@codingki The requested changes were implemented and is ready for review again :) |
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.
Looks good to me! found couples suggestion non blocking the merge. Great job🫡
Sorry for any inconvenience. It's the little things that always escape my mind. That should be everything now :) |
Awesome🔥 |
These will be included in 0.0.28 and up |
Awesome. Thank you guys for the support and quick responses! |
Description
This closes feature request #50.
First, want to highlight that the primary author of this change is @BurntVal and that my role has merely been to review, give advice, and liaise!
This PR introduces four hooks for interacting with CosmWasm smart contracts in React applications. They are:
useInstantiateContract
—a mutator to instantiate a smart contract with a message provided by the caller.useExecuteContract
—a mutator to execute a smart contract, passing it a message provided by the caller.useQueryRaw
anduseQuerySmart
—Hooks to query the state stored within a smart contract.We made our best effort to follow the style and standards of the graz codebase. We generally made an effort to keep the typing as strong as possible, so the mutators are all parameterized by input and output types.
Checklist
Changes
useInstantiateContract
hookuseExecuteContract
hookuseQuerySmart
hookuseQueryRaw
hookScreenshots
n/a
Testing
To test our changes, we locally extended the sample project in
templates/default
to include queries and transactions made to various sample contracts using all of the hooks added in this change request. Through testing in this application setting, we confirmed instantiation, execution, smart queries, and raw queries all worked.Links/References
Notes