Batch mint and broker sale

This commit is contained in:
Dennis Dawson
2025-05-27 14:25:01 -07:00
parent 471c2e48df
commit 9ce8f3faae
9 changed files with 997 additions and 1391 deletions

View File

@@ -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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

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