Skip to main content

NFT 721

Welcome to the documentation of the ERC721 API! This versatile API provides developers with essential functionalities for working with Non-Fungible Tokens (NFTs). With this API, you can easily deploy ERC721 contracts, check token balances, retrieve token metadata URIs, find the owner of a specific token, mint new NFTs, and perform smooth token transfers. Let's get started!

Endpoints​

Deploy​

This endpoint deploys an ERC-721 smart contract. The call that must be performed is:

POST https://api.vottun.tech/erc/v1/erc721/deploy

Request

The request must include a JSON body with the following fields:

NameTypeRequiredDescriptionExample
namestringyesThe name of the smart contract, which will be assigned in the blockchain.Vottun 721 contract
symbolstringyesThe symbol of the smart contract, which will be assigned in the blockchain and will represent the assets.VTN721
networkintyesThe chain id of the network where the contract will be deployed.80001
gasLimitintnothe maximum amount of work you estimate a validator will do for the transaction. It this field is not set, the platform will estimate the gas in background before sending the transaction.4000000
aliasstringnoThe name that will be assigned to this deployed contract in the Vottun platform."My first 721 contract"

Example

{
"name": "Vottun 721 contract",
"symbol": "VTN721",
"network": 80001,
"gasLimit": 6000000,
"alias": "My first 721 contract"
}

Response

The deploy endpoint will return a JSON with the following information:

NameTypeDescriptionExample
contractAddressstringThe address assigned to the contract in the blockchain0x9a89cef53a044..2acfc3a66153408adf
txHashstringThe transaction Hash0xb3ba0828ac232..63ddfef73b5d6860a82a6

Example

{
"contractAddress": "0x9a89cef53a044..2acfc3a66153408adf",
"txHash": "0xb3ba0828ac232c48b69bb3..63ddfef73b5d6860a82a6"
}

Mint​

This endpoint mints an NFT with the provided metadata to the given address. The operation is performed in the given contract and network. The call that must be performed is:

POST https://api.vottun.tech/erc/v1/erc721/mint

Request

The request must include a JSON body with the following fields:

NameTypeRequiredDescriptionExample
recipientAddressstringyesThe address that will receive the royalties of sales from the NFT.0xa4750976879ef2..59abd3ac1ab78873a0
tokenIdintyesThe id of the NFT that will be minted.1
ipfsUristringyesThe uri that points to the metadata of the NFT, usually in a JSON format.https://ipfsgw.vottun.tech/ipfs/QmZX4xbbqx2..HUGJurLqZ95NVv97
ipfsHashstringyesThe IPFS hash of the metadata of the NFT, used for checking duplicates.QmZX4xbbqx2..HUGJurLqZ95NVv97
networkintyesThe chain id of the network where the contract resides.80001
contractAddressstringyesThe address of the smart contract.0x6412bdbDf58634..f6805cb83613B2B1
royaltyPercentageintnoThe value (in percentage) of the royalty that will be paid to the royaltyRecipient for each sale of the NFT.10
gasLimitintnothe maximum amount of work you estimate a validator will do for the transaction. It this field is not set, the platform will estimate the gas in background before sending the transaction.4000000

Example

{
"recipientAddress": "0xa4750976879ef2..59abd3ac1ab78873a0",
"tokenId": 1,
"ipfsUri": "https://ipfsgw.vottun.tech/ipfs/QmZX4xbbqx2..HUGJurLqZ95NVv97",
"ipfsHash": "QmZX4xbbqx2..HUGJurLqZ95NVv97",
"network": 80001,
"contractAddress": "0x6412bdbDf58634..f6805cb83613B2B1",
"royaltyPercentage": 10,
"gasLimit": 3000000
}

Response

The mint endpoint will return a JSON with the following information:

NameTypeDescriptionExample
txHashstringThe transaction Hash0xb3ba0828ac232..63ddfef73b5d6860a82a6
nonceintthe transaction number from the account27

Example

{
"txHash": "0xb3ba0828ac232c48b69bb3..63ddfef73b5d6860a82a6",
"nonce": 27
}

Transfer​

This endpoint transfers an NFT to the given address. The operation is performed in the given contract and network. The call that must be performed is:

POST https://api.vottun.tech/erc/v1/erc721/transfer

Request

The request must include a JSON body with the following fields:

NameTypeRequiredDescriptionExample
contractAddressstringyesThe address of the smart contract.0x6412bdbDf..1Cf6805cb83613B2B1
networkintyesThe chain id of the network where the contract resides.80001
idintyesThe id of the NFT that will be transferred.1
fromstringyesThe address that originally owns the NFTs.0xa47509768..59abd3ac1ab78873a0
tostringyesThe id of the NFT that will be transferred.0x8C437496D4..6a34CD47863732165A3

Example

{
"contractAddress": "0x6412bdbDf..1Cf6805cb83613B2B1",
"network": 80001,
"id": 1,
"from": "0xa47509768..59abd3ac1ab78873a0",
"to": "0x8C437496D4..6a34CD47863732165A3"
}

Response

The transfer endpoint will return a JSON with the following information:

NameTypeDescriptionExample
txHashstringThe transaction Hash0xb3ba0828ac232..63ddfef73b5d6860a82a6
nonceintthe transaction number from the account27

Example

{
"txHash": "0xb3ba0828ac232c48b69bb3..63ddfef73b5d6860a82a6",
"nonce": 27
}

Balance Of​

This endpoint retrieves the balance of the given address in the specified smart contract and network. The call that must be performed is:

GET|POST https://api.vottun.tech/erc/v1/erc721/balanceOf

Request

The request must include a JSON body with the following fields:

NameTypeRequiredDescriptionExample
contractAddressstringyesThe address of the smart contract.0x6412bdbDf5863..f6805cb83613B2B1
networkintyesThe chain id of the network where the contract resides.80001
addressstringyesThe address for which you want to check the NFT balance.0x8C437496D4b311..06a34CD47863732165A3

Example

{
"contractAddress": "0x6412bdbDf5863..f6805cb83613B2B1",
"network": 80001,
"address": "0x8C437496D4b311..06a34CD47863732165A3"
}

Response

The balanceOf endpoint will return a JSON with the following information:

NameTypeDescriptionExample
balanceintThe amount of NFTs from the contract that the address owns3

Example

{
"balance": 3
}

Token Uri​

This endpoint retrieves the uri of the metadata of the given NFT from the given contract. Usually resolves to a JSON object that contains the information about the NFT. The call that must be performed is:

GET|POST https://api.vottun.tech/erc/v1/erc721/tokenUri

Request

The request must include a JSON body with the following fields:

NameTypeRequiredDescriptionExample
contractAddressstringyesThe address of the smart contract.0x6412bdbDf5863..f6805cb83613B2B1
networkintyesThe chain id of the network where the contract resides.80001
idintyesThe id of the NFT.1

Example

{
"contractAddress": "0x6412bdbDf5863..f6805cb83613B2B1",
"network": 80001,
"id": 1
}

Response

The tokenUri endpoint will return a JSON with the following information:

NameTypeDescriptionExample
uriintThe uri pointing to the NFT metadata, usually stored in IPFS.https://ipfsgw.vottun.tech/ipfs/QmSdQEwYVjQc..kZBDp62XLyzrZE/3.json

Example

{
"uri": "https://ipfsgw.vottun.tech/ipfs/QmSdQEwYVjQc..kZBDp62XLyzrZE/3.json"
}

Owner Of​

This endpoint retrieves the address of the owner of an NFT for the given smart contract and network. The call that must be performed is:

GET|POST https://api.vottun.tech/erc/v1/erc721/ownerOf

Request

The request must include a JSON body with the following fields:

NameTypeRequiredDescriptionExample
contractAddressstringyesThe address of the smart contract.0x6412bdbDf5863..f6805cb83613B2B1
networkintyesThe chain id of the network where the contract resides.80001
idintyesThe id of the NFT.1

Example

{
"contractAddress": "0x6412bdbDf5863..f6805cb83613B2B1",
"network": 80001,
"id": 1
}

Response

The ownerOf endpoint will return a JSON with the following information:

NameTypeDescriptionExample
ownerstringThe address of the account that currently owns the NFT.0x8c437496d4b31..4cd47863732165a3

Example

{
"owner": "0x8c437496d4b31..4cd47863732165a3"
}