use-ink/useink

Align Hook Naming

Closed this issue ยท 5 comments

useCall vs useContractCall
useTx vs useContractTx
useDryRun vs useContractDryRun

->

  • useCall
  • useTx
  • useEvents
  • useWallet instead of useExtension (extension is just a type of wallet)

As of now we prefer the simpler version, it could clash with potential substrate/runtime hooks down the line but maybe these are handled differently anyways and are more advanced.

We can use other naming conventions such as useChainCall or useRuntimeCall for calling the runtime vs a contract. I like that we can make contract dev-ex as ergonomic as possible.

I think that useEvents should be the subscription version. Then we add useEventsAt as mentioned here.

We can use other naming conventions such as useChainCall or useRuntimeCall for calling the runtime vs a contract. I like that we can make contract dev-ex as ergonomic as possible.

I like that! Maybe even back to useContractCall as well? So I guess useChainCall will be more for generic extrinsics and useContractCall a more opinionated version for convenient use?

I like useChainCall(), but useCall is short and sweet. I think we should make contract development first class