thirdweb-dev / react

Ultimate collection of React hooks for your web3 apps
https://docs.thirdweb.com/react
Apache License 2.0
80 stars 29 forks source link

[WIP] support claim conditions contract extensions #105

Closed joaquim-verges closed 2 years ago

joaquim-verges commented 2 years ago

Starting the change to make all our relevant hooks also accept a SmartContract as the input contract.

Ideal API:

const { contract } = useContract(...);
const { nfts } = useNFTs(contract);
const { mutation } = useClaimNFTs(contract);
const { cc } = useClaimConditions(contract);

it should resolve under the hood for the user (doing instance checks and extracting out the subclasses from SmartContract. Similar to what i did for useClaimNFT or useClaimCondition in this PR.

Let's start with just the NFT hooks for now, and expand to the rest