Skip to main content
Version: 0.6

Mint a single NFT

Mint a new NFT on the Aventus network.

This page is kept simple to show the function signature and how it can be used. To understand the various variable names and their constraints, HERE is an explainer. For a further deep-dive into how the Aventus Network supports NFTs, check this out.

await API.send.mintSingleNft(
AVN_RELAYER,
externalRef,
royalties,
t1AdminName
);
info

This operation uses a relayer account that the sender authorizes to submit the transfer transaction.
Contact us here to request a relayer address.

Example

const AVN_API = require("avn-api");

//Replace the endpoint_url with the url received from Aventus.
const AVN_GATEWAY_URL = "<endpoint_url>";
const API = new AVN_API(AVN_GATEWAY_URL);

//Please, request the address or public key from Aventus.
const AVN_RELAYER = "5Fb...yTh";
//check the link above to learn about EXTERNAL_REF
const EXTERNAL_REF = "https://5DA/gxV";
// follow the link above to learn about T1_ADMIN_NAME
const T1_ADMIN_NAME = "0x1a2...b3c";
//see next page for more info on Royalties.
const ROYALTIES = [];

async function main() {
await API.init();

let result = await API.send.mintSingleNft(
AVN_RELAYER,
EXTERNAL_REF,
ROYALTIES,
T1_ADMIN_NAME
);
// Returns a request id
console.log(result);
}

(async () => {
await main();
})();

You have now successfully submitted a transaction to the AVN to mint an NFT.

Example Result

f1710fe7-141f-43c1-b1bb-6ec33d9b3e9a
tip

You can query the state your transaction here using the returned request id.

JSON-RPC

Mints a single NFT to the sender over HTTPS POST

REQUEST POST https://AVN-API-URL/send

HEADERS Content-Type: application/json Authorization': bearer <awtToken>

REQUEST PARAMS

  • relayer [required] - a string representing the relayer.
  • user [required] - a string representing the user's SS58 address.
  • payer [required] - a string representing the payer's SS58 address.
  • externalRef [required] - a unique string representing the NFT's external reference.
  • royalties [optional] - an array of royalty rates with percentages set in parts per million - accepts empty array if no royalties.
  • t1Authority [required] - a hex string representing the 20 byte Ethereum address of the relevant authority.
  • proxySignature [required] - a proof signed by the user allowing the transaction to be proxied.
  • feePaymentSignature [required] - a proof signed by the payer allowing the relayer fees to be paid.
  • paymentNonce [required] - string integer value of the current payment nonce of the payer.

JSON-RPC Example

curl https://AVN-API-URL/send \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"proxyMintSingleNft", "params":{"relayer":"5Fb...ryTh", "user":"5DAgx...DdMr", "payer":"5DAg...JDdMr", "externalRef":"my-unique-ref-2022-01-18T10:32:45.199Z", "royalties": [{"recipient_t1_address":"0xf...10Ec03", "rate": {"parts_per_million":"10000"}}], "t1Authority":"0xd6a...453e", "proxySignature":"0xd4d20c5be0943cd1e784b7d83f7bf69d1c2419411c1b6b6d60c1e6d2c636742c30f44100d0fe24717104cad467890272d47a36f8daf497ebd2ec3ed106c58d8f", "feePaymentSignature":"0x4e4ec2190d44765d1b5fa88f6aabbf87744ef964c171f0ec48763fcfbc99e47e9b0ccd633403f75068604cf3b94336c7e93a56b13a0973d181432d381b5b0f8a", "paymentNonce":"201"}, "id":1}'

result 👇🏽 - a request ID that can be queried for the transaction's status

Example Output

{
"jsonrpc": "2.0",
"id": 1,
"result": "a3ef1c40-c1be-4beb-9953-357d0ab504a9"
}

Production Example

Multiple NFTs have been minted on the AVN and HERE is a link to the AVN Explorer that provides more detail on the minted NFT. Click on the Advanced tab on the page to view more details on the transaction.