Minting with Rarible

Rarible is a multichain NFT protocol and marketplace that provides SDKs and APIs to build NFT apps across several EVM networks.

For NFT minting, the Rarible Multichain SDK lets you mint into your own or shared collections and immediately create sell orders.

Because the Rarible SDK doesn't handle IPFS upload, our examples here use Pinata as an IPFS host. You will need a Pinata account in order to obtain a JWT key.

They will also require you to have:

  • An already-deployed ERC-721 contract on Chiliz Chain. You need to deploy an OpenZeppelin ERC-721 contract on Chiliz Chain yourself. Remix IDE gives you an in-browser to do it. Don't forget to verify the contract using a block explorer!

  • A Rarible API key. See their Getting Started on how to obtain one:

To use the Rarible SDK, we need a few installations:

Minting a collection of NFTs

First, build your .env file:

Our workflow of choice is:

  1. Upload media to IPFS via Pinata

  2. Build & upload metadata file

  3. Rarible SDK + on-chain mint

Here is the full sample script which you can get inspiration from:

Lazy-minting an NFT collection

Lazy Minting is an option for those who don't want the upfront cost of minting an NFT before putting it on sale. They can list their NFT for purchase, then mint it only when it is purchased or transferred. The gas fees are therefore part of the minting process, and paid-for by the buyer.

In short, lazy-minting means putting the NFT on the blockchain only when someone buys the NFT, not before.

You'll need a properly defined .env file:

And now the sample code to lazy-mint your project:

Last updated

Was this helpful?