Skip to main content

useMultiwrap() function

Warning: This API is now obsolete.

use useContract() instead

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 { useMultiwrap } from '@thirdweb-dev/react'

export default function Component() {
const multiwrap = useMultiwrap("<YOUR-CONTRACT-ADDRESS>")

// 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 multiwrap.wrap(tokensToWrap, wrappedNFTMetadata)
}

...
}

Signature:

export declare function useMultiwrap(
contractAddress?: string,
): Multiwrap | undefined;

Parameters

ParameterTypeDescription
contractAddressstring(Optional) the address of the Multiwrap contract, found in your thirdweb dashboard

Returns:

Multiwrap | undefined