List a single NFT Open For Sale
Listing an NFT for sale requires firstly that the NFT exist and that the initiator of the transaction is the owner of the NFT.
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.listNftOpenForSale(
avnRelayerAddress,
nftOwnerAddress,
nftId,
market
);
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 endpoint_url with the url received from Aventus.
const api = new AvnApi(GATEWAY);
const avnRelayerAddress = "5Fb...yTh"; //Please, request from Aventus.
const nftOwnerAddress = "bDB...9MH"; //Your address on the Aventus network
const nftId =
"0xcd59127245d3ae2706e4f3bace05de3fd16c50bb6b844d3f422b283a3b5f72f6";
const market = "Fiat"; //This is an ENUM indicating the sale can be in FIAT or other supported sale options.
async function main() {
await api.init();
const result = await api.send.listNftOpenForSale(
avnRelayerAddress,
nftOwnerAddress,
nftId,
market
);
// Returns a request id
console.log(result);
}
(async () => {
await main();
})();
You have now successfully submitted a transaction to the AVN to list your NFT for sale.
Example Output
f1710fe7-141f-43c1-b1bb-6ec33d9b3e9a
You can check the status of your transaction here using the returned request id.
Production Example
Multiple NFTs have been listed for sale on the AVN in either Ether or FIAT currency, and HERE is a link to the AVN Explorer that provides more detail on a listed NFT in FIAT. Click on the Advanced tab on the page to view more details on the transaction.