Learn how to register, protect, and monetize Stability AI-Generated images on Story.
.env
file:.env
file:.env
file:.env
file. You can just use the public default one we provide:main.ts
file and add the following code:
uploadToIpfs.ts
, create a function uploadBlobToIPFS
that uploads our buffer to IPFS:
uploadBlobToIPFS
function to store our image:
utils.ts
file, add the following code:
uploadToIpfs.ts
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. For simplicity, you can use a public collection we have created for you on Aeneid testnet: 0xc32A8a0FF3beDDDa58393d022aF433e78739FAbc
.
Creating your own custom ERC-721 collection
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.