mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-23 21:25:49 +00:00
Batch mint and broker sale
This commit is contained in:
@@ -146,37 +146,18 @@ async function batchMintNFTs() {
|
|||||||
"NFTokenTaxon": nftTaxonField.value,
|
"NFTokenTaxon": nftTaxonField.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Add optional fields
|
||||||
if (amountField.value) {
|
if (amountField.value) {
|
||||||
const amount = currencyField.value === "XRP" ?
|
transactionParams.Amount = configureAmount(amountField.value);
|
||||||
xrpl.xrpToDrops(amountField.value) : // Use xrpToDrops for XRP
|
|
||||||
{
|
|
||||||
currency: currencyField.value,
|
|
||||||
issuer: issuerField.value,
|
|
||||||
value: amountField.value,
|
|
||||||
};
|
|
||||||
transactionParams.Amount = amount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expirationField.value) {
|
if (expirationField.value) {
|
||||||
const days = parseInt(expirationField.value, 10);
|
transactionParams.Expiration = configureExpiration(expirationField.value);
|
||||||
if (isNaN(days) || days <= 0) {
|
|
||||||
results += `\nWarning: Invalid expiration days for NFT ${i+1}. Skipping expiration for this NFT.`;
|
|
||||||
resultField.value = results;
|
|
||||||
} else {
|
|
||||||
const expirationDate = new Date(Date.now() + days * 24 * 60 * 60 * 1000);
|
|
||||||
transactionParams.Expiration = xrpl.isoTimeToRippleTime(expirationDate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destinationField.value) {
|
if (destinationField.value) {
|
||||||
// Basic XRP address validation
|
|
||||||
if (!xrpl.isValidAddress(destinationField.value)) {
|
|
||||||
results += `\nWarning: Invalid destination address for NFT ${i+1}. Skipping destination for this NFT.`;
|
|
||||||
resultField.value = results;
|
|
||||||
} else {
|
|
||||||
transactionParams.Destination = destinationField.value;
|
transactionParams.Destination = destinationField.value;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const mintTx = await client.submit(transactionParams, {
|
const mintTx = await client.submit(transactionParams, {
|
||||||
@@ -184,7 +165,6 @@ async function batchMintNFTs() {
|
|||||||
});
|
});
|
||||||
results += `\nNFT ${i+1} minted successfully.`;
|
results += `\nNFT ${i+1} minted successfully.`;
|
||||||
mintedNFTsCount++;
|
mintedNFTsCount++;
|
||||||
console.log(mintTx.result.nfts)
|
|
||||||
resultField.value = results;
|
resultField.value = results;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
BIN
docs/img/mt-batch-mint-1-empty-form.png
Normal file
BIN
docs/img/mt-batch-mint-1-empty-form.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 239 KiB |
BIN
docs/img/mt-batch-mint-2-batch-mint.png
Normal file
BIN
docs/img/mt-batch-mint-2-batch-mint.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 352 KiB |
BIN
docs/img/mt-batch-mint-3-get-batch-mint.png
Normal file
BIN
docs/img/mt-batch-mint-3-get-batch-mint.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 388 KiB |
BIN
docs/img/mt-broker-nfts-1-empty-form.png
Normal file
BIN
docs/img/mt-broker-nfts-1-empty-form.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 KiB |
BIN
docs/img/mt-broker-nfts-2-broker-form-with-accounts.png
Normal file
BIN
docs/img/mt-broker-nfts-2-broker-form-with-accounts.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 317 KiB |
BIN
docs/img/mt-broker-nfts-3-broker-sale.png
Normal file
BIN
docs/img/mt-broker-nfts-3-broker-sale.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 391 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user