Mint an NFT on Polygon using Onecdot simple RESTful APIs 🚀

Mint an NFT on Polygon using Onecdot simple RESTful APIs 🚀

ZERO -> HERO TUTORIAL

¡

13 min read


Hey everyone 👋! In this article, we'll be exploring Onec-NaaS(NFT As A Service) APIs in-depth and how to use them to mint an nft, check its status, fetch its tokenId, and many more things. But before that, we have to understand how nft works, why it is important, and some important terms. I promise this will be the best in-depth introduction to NFTs, how they actually work and how you can mint one for yourself too using our APIs! 🔥

🤔 What is an NFT?

NFT(Non-fungible tokens) are tokens that we can use to represent ownership of unique items. We can tokenise things like art, collectibles, and even real estate. In simple terms, NFTs are individual tokens with valuable information stored in them. Because they hold a value set by the market and demand or hype, they can be bought and sold just like other physical types of art.

NFTs turn your digital assets into ""one of a kind"" by creating a unique digital signature that defines the ownership of your assets and that can be bought and sold for real money, cryptocurrency or any other asset like a ""non-fungible token"" aka NFT 🤑. It basically creates a blockchain-based digital certificate for your digital collectibles, including games, music, art, and many more. This certificate gives your artwork a unique identity. The Underlying technology and the programming language used by NFTs are the same as other cryptocurrencies ie. Blockchain and the programming language Solidity. On the other hand, NFT is a unique token; therefore, if you try to trade it, you may end up with something completely different in your hands. Cryptopunks is a remarkable example of NFT, it enables you to buy, sell and store 10,000 collectibles with the proof-of-ownership being stored on the Ethereum Blockchain.

NFT has proved itself to be a boon in the lives of many others - like Jack Dorsey, the former CEO and co-founder of Twitter with his very first and famous tweet, "just setting up my Twitter," and Vignesh Sundaresan, famously known as "Metakovan," who bought 69.3 million dollars worth of NFT art on Beeple. Owing to its increasing popularity, people are now willing to pay hundreds of thousands of dollars for NFTs.

NFT has enhanced media exposure and special perks for aspiring artists on social media. This popularity of NFT creates new opportunities for new art platforms, motivating people to buy art from internet platforms and promoting copyright or originality of digital assets. Many experts in the crypto industry say that around 40% of new crypto users will use NFTs as their entry point. As a result of its growing popularity, NFT could represent a more significant part of the digital economy in the future.

🚀 How to Mint an NFT?

There are so many ways by which we can mint an nft but it's not that easy. We have to install some web3 libraries, create a mint-nft.js file, grab contract ABI, configure metadata, and many more. The work is tiresome and can be even confusing for people who are just starting out in this space.

But, what if I say that the whole process can be done in just a matter of 5 minutes using our APIs 👀? Isn't that amazing? You don't need any backend stuff. All of these things we handle for you.

Here comes Onecdot which helps us with that and makes the process very simple and easy to use. Our APIs handle all the backend stuff needed and helps developers and enterprises to integrate NFTs into their applications without any web3 hassle. I'll explain below the steps on how you can mint an nft using Onecdot APIs but I also want you to read the docs atleast once and understand how it works to get a basic understanding.

✨ NFT Terms You Need to Know

  • Metadata -> It is the core of an NFT which defines what the non-fungible token actually is. It is generally hosted by the website that hosts the NFT. ERC-721s specify metadata in a standardized JSON (JavaScript Object Notation) format, that looks something like this:
{
    "title": "Asset Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this NFT represents",
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this NFT represents",
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime-type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive.",
        }
    }
}
  • public_address -> It is the address to which you want to mint an NFT. It has to be a wallet address/ hex string you want an NFT to mint to.

  • contract_address -> It is usually given when a contract is deployed to the blockchain. The address comes from the creator's address and the number of transactions sent from that address (the “nonce”).

  • contract_type -> It is used to choose the token type from ERC 721 and 1155, if not minting on custom contract.

  • Burn -> To burn an NFT essentially means to destroy it. If only 5,000 NFTs are sold in a collection that was intended to consist of 10,000, for instance, the team may decide to ‘burn’ the remaining 5,000. Other projects let their owners ‘burn’ two NFTs to receive a new and more rare one.

  • DAO -> DAO stands for Decentralized Autonomous Organization. When you own an NFT from a project like Head DAO, you and all the other owners have voting rights and control over the future actions and overall direction of the project. Many NFT projects are setting up similar structures to become more community-driven and secure ongoing support.

  • Diamond hands -> ‘Diamond hands’ is one of the most popular slang terms in the world of crypto and NFTs. It’s become its own meme, its own emoji, and even the theme of the whole NFT projects. A person with diamond hands is a person who holds on to an asset through price volatility, negative news, poor market sentiment, and whatever kind of FUD (another abbreviation we’ll cover below) you’ll encounter in this space.

    Diamond hands can also be used as a verb: “She diamond-handed bitcoin through the 2018 bear market.”

  • Floor -> The ‘floor’ or ‘floor price’ of a project is simply the lowest price at which you can buy an NFT from that project on the secondary market. It’s the most popular metric for tracking a project’s performance over time and its relative success compared to others.

  • FUD -> ‘FUD’ stands for Fear, Uncertainty, and Doubt. The term is used in crypto and NFTs alike to describe negative news stories, tweets, Discord messages, etc., that are either inaccurate or completely false. You’ll often see people point to FUD as the reason behind large price drops in cryptocurrencies or NFTs.

  • Gas -> The price for making a transaction on a blockchain is called ‘gas’. When buying NFTs on a blockchain like Solana, gas is negligible. On Ethereum, however, a $50 gas fee is about the lowest you can hope for, and it all depends on the activity on the network. Low activity, low fees. High activity, high fees. This leads me to the next term you need to know…

  • Gas war -> Oh, the dreaded gas wars! These are a common occurrence on Ethereum and somewhat of a rite of passage for newcomers. When a popular NFT collection launches, with 100,000 people fighting for 10,000 NFTs, you need to increase your gas fee and outbid the others for your transaction to go through. This is what’s known as a gas war.

  • Minting -> When you’re buying a completely new NFT from the creator, you’re ‘minting’ it. It’s basically the process of creating that NFT on the blockchain.

  • MM -> MM is shorthand for Metamask, the most popular NFT wallet in the Ethereum ecosystem.

  • OS -> OS is shorthand for OpenSea, the leading NFT marketplace on Ethereum.

  • Paper hands -> ‘Paper hands’ is basically the opposite of ‘diamond hands’ and is another term that isn’t NFT-specific but often used in the space. It refers to someone who sells something, e.g., an NFT or a cryptocurrency, at what is perceived by others as too low of a price.

    Just like ‘diamond handing’, ‘paper hands’ can also be used as a verb: “Someone just paper-handed a Cool Cat for 6 ETH!”

  • Rugpull -> A ‘rugpull’ is something I hope you’ll never experience! It’s essentially a scam where the people behind a seemingly legit project disappear with all the money immediately after launch. You might get an actual NFT in return for what you paid, but it’s most likely worthless and not even tradeable on a secondary marketplace.

    Rugpull is often used as a verb as well, as in “I got rugpulled” or simply “I got rugged”. You’ll also see some people on Discord simply writing ‘rug’, often to spread FUD in the community of a specific project.

  • (Floor) Sweep -> ‘Sweeping’ is another commonly uttered term because of people’s interest in a project’s ‘floor’. To ‘sweep the floor’ means to buy up a large number of the cheapest NFTs in a collection on the secondary market. Teams sometimes do this or are asked by the community to do this, for their own projects. Other times it may be done by a single individual, referred to as a ‘whale’.

  • Whale -> A ‘whale’ is basically someone with a lot of money, either available to invest or already invested in a high-value NFT project. Thus, someone with 1,000 ETH in their account would be considered a whale, just like someone with 200 Bored Apes would. Whales are important because of their power to move markets, either upward by buying a lot from a given collection or downward by selling.

🦄 Bonus: The insider’s abbreviations and intentional misspellings

At first, I wanted to include these in the list above but ended up cutting them to make the terms slightly more serious. But screw that, let’s end on a light note with some silly (but important!) terms that’ll help you become a true NFT insider!🎊

  • Ded. Simply a misspelling of ‘dead’, for instance used to refer to a project that was rugpulled.

  • GM. Truth be told, I don’t know if this is even an NFT thing or rather a super mainstream abbreviation that I just didn’t know about because I’m Danish. In any case, GM is simply short for ‘good morning’ and you’ll see it flooding Twitter and Discord at all times of day because we’re a global — and kind! — community.

  • GN. GN means ‘good night’, feel free to use that as well.

  • GMI. Another very popular abbreviation is GMI, and its offsprings WAGMI and NGMI. GMI means ‘Going to make it’, as in “If you buy and hold on to this awesome NFT, you’re gonna become rich and have a great life!” (more or less). WAGMI, naturally, means ‘We’re all going to make it’. NGMI on the other hand means ‘Not going to make it’. Use these terms as frequently as possible to be perceived as a true NFT insider.

  • Hodl. ‘Hodl’ is really an OG crypto term, a misspelling of ‘hold’ first used by Bitcoin forum member GameKyuubi when they declared “I AM HODLING” in 2013 after a ~40% drop in bitcoin’s price. The term is used by crypto people to say that they’re holding on to their assets through thick and thin, not unlike the diamond-handing we covered earlier. ‘HODL’ has later been assigned the acronym ‘Hold On for Dear Life’ to make it seem less stupid, I guess. I’m personally gonna hodl on to the original version!

  • LFG. ‘LFG’ means ‘Let’s fucking go!’. Pretty self-explanatory. It’s used in excitement about new project launches, big NFT news, etc.

  • Moon. Another general financial market term that’s often used in the NFT space, ‘going to the moon’ or ‘mooning’ refers to an asset’s value increasing by a lot. There’s no clear definition, but a 10% increase certainly won’t cut it for crypto people who saw bitcoin go from $1 to $60k.

  • Ser. ‘Ser’ means ‘sir’ but is usually used ironically. In other words, if someone uses ‘ser’ in a sentence, don’t take the message too seriously.

  • Wen. Get your notebook out, this one’s tricky! Okay, I’m kidding, it’s really not. ‘Wen’ means ‘when’. That’s it. It’s just another silly misspelling used ironically by NFT and crypto people, often in “Wen moon?” which loosely translates to “When will the price of this asset increase exponentially?”

That's it for the introduction part. Now, let's deep-dive into the actual minting process and in the end, you'll be also able to mint your own nft too. 🥳

🚀 Mint an NFT using Onecdot APIs

🛠️ Steps

Let's start by heading to the official website (https://onec.in) and going to the start building section.

  • Create a new project and select the blockchain you want to work with. I'm using polygon-testnet for this one.

Screenshot (600).png

Screenshot (601).png

  • After the project is created, tap on the project name and create an API key for the project itself. Fill the key information field with anything specific you want.

Screenshot (602).png

Screenshot (604).png

  • After submitting, an API key will be shown once which you've to copy for the next steps. Here's an example:- 👇

Screenshot (605).png

  • Now, go to this link and paste the copied API key into the authorize section 👇

Screenshot (607).png

Screenshot (606).png

  • Click on authorize and you'll be done with the initial part 👇

Screenshot (608).png

Tap on close and head over to the mintNFT section. Give it a read. After reading, scroll down to the Request Body part and change the metadata to this👇

Screenshot (615).png

  "metadata_list": [
    {
      "public_address": "0x5b8eba0B8fAfa9d92Ec667d7440D5ac3E9D574cE",
      "metadata": {
"description": "Friendly OpenSea Creature that enjoys long swims in the ocean.", 
  "external_url": "https://openseacreatures.io/3", 
  "image": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png", 
  "name": "Aniketh Paul"
      }
    }
  ],
  "contract_type": 721
}

NOTE:- Make sure to change the public address to your wallet address (you can use metamask wallet, link:- https://www.coindesk.com/learn/how-to-set-up-a-metamask-wallet/). For the metadata part, you can refer to this website https://docs.opensea.io/docs/metadata-standards.

Click execute and you're good to go. It should look like this👇 Screenshot (616).png

Screenshot (617).png

Screenshot (618).png

If I say you've minted an nft, would you believe it? Yes, you did. It's that simple. Onecdot makes it super easy and it's working to provide more ease solutions in the development of NFT-based applications.

But wait, there's something more! 🥳 Scroll down a bit and you can see checkMintStatus section. What it does is that it tracks the nft which was minted with the help of nft_ids. Copy the nft_ids which is in our case is 982 and paste it into the "try it out" section of checkMintStatus. 👇

Screenshot (622).png

Screenshot (623).png

Screenshot (624).png

  • Now, copy the contract address and visit this site https://testnets.opensea.io/get-listed/step-two and paste the contract address over there.

  • Click on submit and you'll be able to see your nft. NOTE:- We have listed our contract on opensea which means it will show all the collections which are minted on Onecdot ERC-721 metadata standard. 👇

Screenshot (626).png

Screenshot (628).png

Sometimes opensea testnet might not show the nft because it's slow most of the time. If the above process is not showing the nft, you can connect your metamask wallet to opensea testnet and click on your profile. Once you visit your profile, check your nft in the hidden section. Most of the time NFT's are minted over there. Here's my nft 👇

Screenshot (582).png

NOTE -> You should choose the Mumbai testnet network of polygon in metamask. If you don't know how to add "mumbai-testnet" in metamask, refer to this article.

👋 Conclusion

I know it's a lot of stuff together but it's worth it. All those who have read the blog post until here might have already minted an nft for themselves and I also hope y'all have learned something new from this blog post.

That's it for this article and in the next articles, we'll be deep-diving into more features by Onecdot and explore them in-depth and utilize these tools to build more cool nft applications. Till then, you can explore our current products:
Onec-NAAS ➡️ https://api.onec.in/docs/
Onec-SDK ➡️ https://www.npmjs.com/package/onec-sdk

STAY TUNED!


CONNECT WITH US👇
Twitter | Discord

Â