Transfer a single NFT
Transfer ownership of an NFT purchased in FIAT to another account 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.transferFiatNft(AVN_RELAYER, recipientAvnAddress, nftId);
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 from Aventus the address or public key.
const AVN_RELAYER = "5Fb...yTh";
// replace with the nftID of the NFT you're trying to list.
const NFT_ID = "0xcd...f6";
//This can be the address or public key.
const RECIPIENT_ADDRESS = "5Fb...yTh";
async function main() {
await API.init();
let result = await API.send.transferFiatNft(
AVN_RELAYER,
RECIPIENT_ADDRESS,
NFT_ID
);
// Returns a request id
console.log(result);
}
(async () => {
await main();
})();
You have now successfully submitted a transaction to the AVN to transfer NFT.
Example Result
f1710fe7-141f-43c1-b1bb-6ec33d9b3e9a
You can check the status of your transaction here using the returned request id.
JSON-RPC
Transfers an NFT that is currently listed for sale in fiat 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 SS58 address.
- user [required] - a string representing the user's SS58 address.
- payer [required] - a string representing the payer's SS58 address.
- nftId [required] - a string representing the NFT ID (32 bytes) to check for nonce.
- recipient [required] - a hex string representing the recipient's public key.
- 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":"proxyTransferFiatNft", "params":{"relayer":"5FbUQ...yTh", "user":"5DAgx...Mr", "payer":"5DAgx...Mr", "nftId":"0x30445...7587c", "recipient":"5FgyNN...gqosF", "proxySignature":"0xaa3b454549de3a941e19293c0da9e47e83b920df232d5db56d5912f83b1e0c43083b1103f9655c52290221bf590facd9e99a839cafc383c30567055a56c97c8a", "feePaymentSignature":"0x500da1ab75346f2b4459cc2b958a3eb690a4b8c50cc1e6f3d49fe786cb6acd0be0ca93da71bbe55d11f8df8f64f3b99c2c47a053495bf6eb842ecc4fbfad6b87", "paymentNonce":"212"}, "id":1}'
result 👇🏽 - a request ID that can be queried for the transaction's status
Example Output
{
"jsonrpc": "2.0",
"id": 1,
"result": "5415c92b-57a5-46f7-ba79-57176afb2510"
}
Production Example
Multiple NFTs have changed ownership on the AVN, and HERE is a link to the AVN Explorer that provides more detail on a transferred NFT. Click on the Advanced tab on the page to view more details on the transaction.