NFT | Minting
Minting an NFT on a blockchain allows the creator to prove ownership and authenticity of the digital asset
Mint NFT
API Doc
Swagger Doc | ReDoc
Curl call example
curl -X POST "http://0.0.0.0:7000/v2/nftkit/nft/near/chain/{chain}/contract/{contract_id}/mint"
-H "Content-Type: application/json"
-d "{"account_id": "string","token_id": "string","title": "string","description": "string","media": "string","media_hash": "string","reference": "string","reference_hash": "string","receiver_id": "string"}"
Path parameters:
chain
:[string] chain to work with. Either testnet
or mainnet
.
contract_id
:[string] smart contract account .
Body parameters:
{
"account_id": "string",
"token_id": "string",
"title": "string",
"description": "string",
"media": "string",
"media_hash": "string",
"reference": "string",
"reference_hash": "string",
"receiver_id": "string"
}
account_id
: Your account id.
token_id
: The token ID , must be unique.
title
: The name of this specific token.
description
: A longer description of the token.
media
: URL to associated media. Preferably to decentralized, content-addressed storage.
media_hash
: The base64-encoded sha256 hash of content referenced by the media
field. This is to guard against off-chain tampering.
reference
: URL to an off-chain JSON file with more info.
reference_hash
: Base64-encoded sha256 hash of JSON from reference field. Required if reference
is included.
receiver_id
: The account that's receiving the token.
Example:
curl -X POST "http://0.0.0.0:7000/v2/nftkit/nft/near/chain/testnet/contract/nft.waltid.testnet/mint"
-H "Content-Type: application/json"
-d "{"account_id": "waltid.testnet","token_id": "0","title": "Walt.id NFT Art","description": "Waltid NFT Kit Example","media": "https://avatars.githubusercontent.com/u/84637756","media_hash": "","reference": "","reference_hash": "","receiver_id": "nft.waltid.testnet"}"
val accountId = "waltid.testnet"
val contractId = "nft.waltid.testnet"
val receiverId = "waltid.testnet"
val chain = "testnet"
val result = NearNftService.mintNftToken(
account_id = accountId,
contract_id = contractId,
token_id = "1",
title = "waltid",
description = "My NFT",
media = "https://waltid.net",
media_hash = "",
reference = "",
reference_hash = "",
receiver_id = receiverId,
chain = chain,
)
println("operation result: $result")