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

[Bug]: useActiveClaimCondition with ERC-1155 Requires BigNumber type token ID argument #145

Open jarrodwatts opened 2 years ago

jarrodwatts commented 2 years ago

Code to re-produce:

  const { data: activeClaimCondition } = useActiveClaimCondition(
    editionDrop, 0
  );

Using edition drop prebuilt contract, try to read the active claim condition like this:

  const { data: activeClaimCondition } = useActiveClaimCondition(
    editionDrop, 0
  );

Throws invariant:

Invariant failed: tokenId is required for ERC1155 claim conditions

Even though token id 0 is being passed in. If I change it to this then it works fine:

  const { data: activeClaimCondition } = useActiveClaimCondition(
    editionDrop,
    BigNumber.from(0)
  );