Learn how to Register an NFT as an IP Asset in TypeScript.
.env
file:pinata-web3
dependency:uploadToIpfs
file, create a function to upload your IP & NFT Metadata objects to IPFS:
mintAndRegisterIp
function to mint an NFT and register it as an IP Asset in the same transaction.
This function needs an SPG NFT Contract to mint from.
0xc32A8a0FF3beDDDa58393d022aF433e78739FAbc
. On Mainnet, or even when testing a real scenario on Aeneid, you should create your own contract as described in the “Using a custom ERC-721 contract” section below.
Using a custom ERC-721 contract
nftContract
and tokenId
- instead of using the mintAndRegisterIp
function. See a working code example here. This is helpful if you already have a custom NFT contract that has your own custom logic, or if your IPs themselves are NFTs.mintAndRegisterIp
function, you can register IP + create terms + attach terms all in the same step with the following functions: