You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow react() abiItemHooks to be a per-contract function
#5237
react({ abiItemHooks }) is a single boolean for every contract. Large ABIs (for example IAssetManager) generate a hook per function and event, while some contracts only need the contract-level hooks (useReadIAssetManager, useWriteIAssetManager, …).
Today the options are:
true (default): item hooks for all contracts
false: item hooks for none
split configs / wrap the plugin to filter contracts yourself
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
react({ abiItemHooks })is a single boolean for every contract. Large ABIs (for exampleIAssetManager) generate a hook per function and event, while some contracts only need the contract-level hooks (useReadIAssetManager,useWriteIAssetManager, …).Today the options are:
true(default): item hooks for all contractsfalse: item hooks for noneProposal
Keep the boolean, and also accept a function:
contractNameis the contractnamefrom config / Foundry / Hardhattrue→ generate per-function and per-event hooks as todayfalse→ contract-level hooks onlytrueThis is backward compatible. Happy to open a PR if this looks good.
All reactions