useMultiwrap
Deprecated
This hook is deprecated and will be removed in a future major version. You should use useContract instead.
- const multiwrap = useMultiwrap("0x1234...");
+ const multiwrap = useContract("0x1234...", "multiwrap").contract;
Hook for getting an instance of an Multiwrap
contract. This contract is an ERC721 in which you can wrap ERC721, ERC1155 and ERC20 tokens.
function useMultiwrap(
contractAddress: RequiredParam<string>,
): undefined | Multiwrap;
Parameters
Returns
type ReturnType = undefined | Multiwrap;
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)
}
...
}