This pull request integrates the Wagmi CLI for contract management and introduces a custom plugin to facilitate React suspense queries. Changes:
Installation and Configuration of wagmi-cli
Added and configured wagmi-cli to facilitate the generation of contract-based hooks.
Contract Configuration
Created a new constant for defining the contracts used by the dapp.
This configuration uses the same structure as the contracts array needed for configuring the wagmi CLI.
Added a getContract function to retrieve the ABI and address of a contract by passing the name and chainId.
New reactSuspenseRead Plugin
Developed a new plugin for the wagmi CLI called reactSuspenseRead. This plugin automatically generates React hooks using useSuspenseQuery from tanstackQuery and wagmi core actions. The default wagmi-react hooks are not adapted for use with suspense.
New Scripts Added to package.json
Added two new scripts: wagmi-generate to generate the hooks and postinstall to run after installed dependencies.
Ignored Auto-Generated Files
Configured the auto-generated file to be ignored by Prettier, git, and eslint.
Added an example ABI (ENSRegistry) to use in the configuration.
Steps:
(Required steps to reproduce or test the fix / feature)
Type of change:
[x] New feature
[ ] Bug fix
[ ] Breaking change
[ ] Enhancement
[ ] Refactoring
[x] Chore
How Has This Been Tested?
[ ] Manual testing
[ ] Automated tests
[ ] Other (explain)
Remember to check that:
Your code follows the style guidelines of this project
You have performed a self-review of your code
You have commented your code in hard-to-understand areas
You have made corresponding changes to the documentation
Your changes generate no new warnings
Screenshots
(Add screenshots or videos to help test this pull request)
Closes #152
Description:
This pull request integrates the Wagmi CLI for contract management and introduces a custom plugin to facilitate React suspense queries. Changes:
Installation and Configuration of
wagmi-cli
wagmi-cli
to facilitate the generation of contract-based hooks.Contract Configuration
wagmi
CLI.getContract
function to retrieve the ABI and address of a contract by passing the name and chainId.New
reactSuspenseRead
Pluginwagmi
CLI calledreactSuspenseRead
. This plugin automatically generates React hooks usinguseSuspenseQuery
fromtanstackQuery
andwagmi
core actions. The defaultwagmi-react
hooks are not adapted for use with suspense.New Scripts Added to
package.json
wagmi-generate
to generate the hooks andpostinstall
to run after installed dependencies.Ignored Auto-Generated Files
Added an example ABI (ENSRegistry) to use in the configuration.
Steps:
(Required steps to reproduce or test the fix / feature)
Type of change:
How Has This Been Tested?
Remember to check that:
Screenshots
(Add screenshots or videos to help test this pull request)