To proceed with your development tasks, you will require an address and relevant UTXOs (Unspent Transaction Outputs). For this purpose, it is common practice to utilize our Frontend interface.
You need an address and UTXos, to do so you usually use the frontend SDK.
Here is an example using the chrome inspector (for this simple example):
To acquire an API key, please initiate contact with our team through our official Discord channel: . A member of our team will be happy to assist you.
Once you have obtained your API key, it's essential to modify it according to our format requirements. This involves prepending the string server_ to your assigned API key. The resulting value should then be used with our Server SDK.
Environment and Project Information
Configuring Base URL (Optional)
You may need to set the baseUrl depending on your development environment requirements. Specifically, if you wish to use the pre-production environment, this setup is necessary.
Additionally, please note that accessing the preprod environment will require a specific API key (must be mentionned when requesting the API Key).
Obtaining the Project and Collection id
To proceed, you will need to acquire two essential identifiers:
collectionId: Similar to the project ID, please reach out to us via Discord for assistance with obtaining this required ID.
The changeAddress and utxos
When working in a real-world setup, you should ideally utilize our frontend SDK. However, if needed, you can manually copy the output values from your browser inspector.
In this context:
changeAddress: Manually copying the displayed address value.
utxos: Similarly, acquiring the UTXO values by copying them directly from the browser output.
import { anvil } from "npm:@ada-anvil/sdk-server";
// This key is provided by hand on-demand by contacting Anvil on Discord,
// this one only works on preprod.
const api_key = "server_CgYuz62xAS7EfM0hCP1gz1aOeHlQ4At36pGwnnLf";
anvil.config.authenticate(api_key);
// to use the preprod network,
// to use mainnet omit this field or use api.ada-anvil.app
anvil.config.setBaseUrl("https://preprod.api.ada-anvil.app");
try {
const mint = await anvil.mint.create({
// Contact anvil to get this ID (7 == anvil test)
// Represent the project created in our database to offer the minting service
projectId: 7,
// Contact anvil to get the collection ID (12 == anvil kittens)
// Represent the collection assigned to a project in our database
assets: [{ collectionId: 12, quantity: 1 }],
// See browser step above
changeAddress:
"00c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a04",
// See browser step above
utxos: [
"8282582069fbe40e37dec877f104e253289bae887ec6bd8622bd709d2e0ddd8082f04f5f0182583900c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a041a18184766",
"828258205ad702be3a76ca78504c0b4fb3e8e5fea198b18b227afb48686bfb47866793b20082583900c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a041a0144a178",
"828258202669e4764682d45a1a28ce814711dff6549bbdf028cf5c313d045f003a0ec09c0082583900c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a041a05497460",
"82825820851d711488d9b90f6399f071c88b36e755143faf529bd568d5331711e22e57a80082583900c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a041a01b8faa0",
],
});
console.log("Mint: ", mint);
// Prints
// Mint: {
// success: true,
// transaction: "84a7008182582069fbe40e37dec877f104e253289bae887ec6bd8622bd709d2e0ddd8082f04f5f01018382583900c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a04821a0011d28aa1581c15f078a3bf65139054fd94d9797b0b75073a659140675d50d0a32727a14b436f636f49736c653239360182583900495d6856a5c2e172c4e046bae623db6278180a9ad58b9690d046cc5969390791217ad3ed6790b3f369f90d135b8f1a3e8a1947b4f8ed146d1a004c4b4082583900c4e78614e6baf953d154a7b0b17e76265a5fa88e9988342db0f1b17065d2510958ce434208e16546b95124961824cfc6d3bd518766259a041a17b67c2b021a0003ad71031a039bd583075820a9ca2c70ec3bf116aed443064a6f22d3f5541e041c6c16d99715e5c63effa2dc081a039bb96309a1581c15f078a3bf65139054fd94d9797b0b75073a659140675d50d0a32727a14b436f636f49736c6532393601a20081825820d89e274dc1e8ebff5dcaeb7dfc7711d2ff55582b9ff46aa85fde93a33f3f742a5840b8899102c1553426abd30ce272653a10394b3f6b1cab46fd8b3552028197f08f87bbd3164cf196f680e7931a5aa89f1cf07ca66427231aa3e8b4d383d74ce70b01818201818200581c19c6846ee02335b47c36b4e4182993870903e6700814c5441b2a28cff5f6",
// missingAssets: []
// }
} catch (e) {
console.error(e);
console.log("YOUR ERROR HANDLING");
}
Creating Transactions with Mint.create
The output of the mint.create call must be passed to the customer's browser to sign it.
Usually when you see something starting with 84a... it means that this is a transaction, so you have to sign and submit it.
Step 2
Once the transaction is signed, you can use the Frontend SDK to submit it to Cardano network.
projectId: To obtain this value, contact our team through Discord ().
take a look at our Universal Wallet Connector to quickly and easily integrate Cardano wallets into your frontend,
(Not part of the Anvil SDK)
If you're looking to easily integrate Cardano wallets into your website or application, take a look at our Universal Wallet Connector. It provides a simple way to add wallet functionality from .