useMintNFTSupply() function
This feature is currently in beta and may change based on feedback that we receive.
Use this to mint a new NFT on your
Example
const Component = () => {
const { contract } = useContract(<ContractAddress>);
const {
mutate: mintNftSupply,
isLoading,
error,
} = useMintNFTSupply(contract);
if (error) {
console.error("failed to mint additional supply", error);
}
return (
<button
disabled={isLoading}
onClick={() => mintNftSupply({ tokenId: 0, additionalSupply: 100, to: "0x..."})}
>
Mint Additional Supply!
</button>
);
};
Signature:
export declare function useMintNFTSupply(
contract: Erc1155,
): import("@tanstack/react-query").UseMutationResult<
import("@thirdweb-dev/sdk").TransactionResultWithId<NFT>,
unknown,
MintNFTSupplyParams,
unknown
>;
Parameters
Parameter | Type | Description |
---|---|---|
contract | Erc1155 | an instance of a |
Returns:
import("@tanstack/react-query").UseMutationResult<import("@thirdweb-dev/sdk").TransactionResultWithId<NFT>, unknown, MintNFTSupplyParams, unknown>
a mutation object that can be used to mint a more supply of a token id to the provided wallet