DOCS

useMultiwrap

Hook for getting an instance of an Multiwrap contract. This contract is an ERC721 in which you can wrap ERC721, ERC1155 and ERC20 tokens.

Example

import { useContract } from '@thirdweb-dev/react'

export default function Component() {
  const { contract } = useContract("<YOUR-CONTRACT-ADDRESS>", "multiwrap")

  // Now you can use the multiwrap contract in the rest of the component

  // For example, this function will let the connected wallet wrap tokens
  async function wrap(tokensToWrap, wrappedNFTMetadata) {
    await contract.wrap(tokensToWrap, wrappedNFTMetadata)
  }

  ...
}

Parameters

Returns