Skip to main content

ManageMint Creation

Create a managed mint transaction for one or multiple assets.

With the managed minting option, you leverage our distribution logic. The policy, royalty, and metadata are overseen by our backend. The whitelist can be managed either by your backend or our service.

Parameters​

AttributeDescription
projectIdYour project ID provided by Anvil
assetsAn array of assets to mint
utxosAn array of UTXOs
changeAddressWallet change address

Usage Example​

Step 1​

Create the mint transaction server-side.

Find the UTXOs and change address on the front-end using anvil.wallet.getUtxos() and anvil.wallet.getChangeAddress() with the client SDK.

import { anvil } from "@ada-anvil/sdk-server";

try {
const mint = await anvil.mint.create({
projectId: YOUR_PROJECT_ID,
assets: [{ collectionId: YOUR_COLLECTION_ID, quantity: 1 }],
changeAddress: "THE_ADDRESS",
utxos: ["THE_UTXO"],
});
} catch {
console.log("YOUR ERROR HANDLING");
}

Step 2​

Send the transaction to the front-end so the user can sign and submit the transaction

import { anvil } from "@ada-anvil/sdk-client";

try {
const sign = await anvil.walletExt.signAndSubmit({
transaction: mint.transaction,
partialSign: true,
});

// Get the transaction status
const status = await anvil.walletExt.getTxStatus({
transaction: sign.transactionHash,
network: "preprod",
});

// or

// wait for the transaction to be confirmed (usually 2-20 minutes)
const wait = await anvil.walletExt.waitTx({
transaction: sign.transactionHash,
progressCallback: console.log, // getting tx status from the cb
});

console.log("TX confirmed", wait);
} catch {
console.log("YOUR ERROR HANDLING");
}

Return from anvil.mint.create​

AttributeDescription
successIndicates whether the operation was successful
transactionIdentifier for the transaction
missingAssetsAn array containing missing assets, if applicable

Return from anvil.walletExt.signAndSubmit​

AttributeDescription
transactionHashIdentifier for the transaction
submittedTxThe submited transaction