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(
avnRelayerAddress,
externalRef,
royalties,
t1AdminName
);
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 AvnApi = require("avn-api");
const GATEWAY = "<endpoint_url>"; //Replace the endpoint_url with the url received from Aventus.
const api = new AvnApi(GATEWAY);
const avnRelayerAddress = "5Fb...yTh"; //Please, request from Aventus.
const externalRef = "https://5DA/gxV"; //check the link above
const t1AdminName = "0x1a2...b3c"; // check the link above
const royalties = []; //see next page for more info
async function main() {
await api.init();
const result = await api.send.mintSingleNft(
avnRelayerAddress,
externalRef,
royalties,
t1AdminName
);
// 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 Output
f1710fe7-141f-43c1-b1bb-6ec33d9b3e9a
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's
signer [required] - a string representing the sender's
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 sender/signer account allowing the transaction to be proxied
feePaymentSignature [required] - a proof signed by the sender/signer account allowing the relayer fees to be paid
paymentNonce [required] - string integer value of the current account payment nonce
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":"5FbUQ2kJWLoqHuSTSNNqBwKwdQnBVe4HF3TeGyu6UoZaryTh", "signer":"5DAgxVxKmnJ7hfhDEB9UetZm4jR2MPjGZGrmJZjirSVJDdMr", "externalRef":"my-unique-ref-2022-01-18T10:32:45.199Z", "royalties": [{"recipient_t1_address":"0xf8f77379A1C6b5CA66702b5943c5b229E310Ec03", "rate": {"parts_per_million":"10000"}}], "t1Authority":"0xd6ae8250b8348c94847280928c79fb3b63ca453e", "proxySignature":"0xd4d20c5be0943cd1e784b7d83f7bf69d1c2419411c1b6b6d60c1e6d2c636742c30f44100d0fe24717104cad467890272d47a36f8daf497ebd2ec3ed106c58d8f", "feePaymentSignature":"0x4e4ec2190d44765d1b5fa88f6aabbf87744ef964c171f0ec48763fcfbc99e47e9b0ccd633403f75068604cf3b94336c7e93a56b13a0973d181432d381b5b0f8a", "paymentNonce":"201"}, "id":1}'
result 👇🏽 - a request ID that can be queried for the transaction's status
Example Result
{
"jsonrpc": "2.0",
"id": 1,
"result": "a3ef1c40-c1be-4beb-9953-357d0ab504a9"
}
You can query the state your transaction here using the returned request id.
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.