List a Batch of NFTs Open For Sale on Ethereum
Listing a batch of NFTs for sale on Ethereum requires firstly that the batch of NFTs exist, also that the initiator of the transaction is the creator of the batch, and finally, there are some NFTs within the batch that are not under the ownership of another account.
await api.send.listEthereumNftBatchForSale(BATCH_ID);
You can get the AVN_GATEWAY_URL for all networks here.
- Example
- Example Result
- JSON-RPC
- JSON-RPC Output
const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "https://gateway.testnet.aventus.network";
const singleUserOptions = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};
const avnSdk = new AvnApi(AVN_GATEWAY_URL, singleUserOptions);
// the string representing the batch Id
const BATCH_ID = "0xcd5...2f6";
async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
let result = await api.send.listEthereumNftBatchForSale(BATCH_ID);
// Returns a request id
console.log(result);
}
(async () => {
await main();
})();
f1710fe7-141f-43c1-b1bb-6ec33d9b3e9a
Lists a batch of NFTs as open for sale in a particular NFT marketplace.
REQUEST
POST https://AVN_GATEWAY_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
- batchId [required] - a string representing the batch ID (32 bytes) to check for nonce
- nonce [required] - string integer value of the current proxy nonce of type 'batch'
- 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":"proxyListNftBatchForSale", "params":{"relayer":"5FbUQ2kJWL...yu6UoZaryTh", "user":"5DAgxVxKmn...rSVJDdMr", "payer":"5DAgxVxKmn...rSVJDdMr", "batchId":"0x2c94a703a7b01f0c2d1eed5ccf82b9cbadd0bdd5e4e5283ddf01b249586181c2", "market": 2, "nonce":"10", "proxySignature":"0xc695f01932ce42204d9a01...d29fbb2d0d303d4b5d184fbe294ce5e06c93d9771a56cfe7533e0cdb488", "feePaymentSignature":"0x02529e00606006ef98d70e8c3...60dde125da581b772909b5ed2756b83c71a5ef6568a36a79ab565cd158e", "paymentNonce":"205"}, "id":1}'
result - a request ID that can be queried for the transaction's status
{
"jsonrpc": "2.0",
"id": 1,
"result": "04a3eae5-54e7-4708-9bf9-a172f06453f7"
}
You have now successfully submitted a transaction to the AVN to list your NFT for sale.
You can query the state 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.