Skip to main content

Your First Transaction

Time to send real value (well, real test value). Every Cardano interaction follows the same three steps: build a transaction, sign it with your key, and submit it to the network. This page sends ADA on Preprod, then reads it back. Pick your tool below.

Before you start​

Send ADA​

import { Address, Assets, preprod, Client } from "@evolution-sdk/evolution"

// Provider (Blockfrost) + wallet (seed phrase) = a signing client
const client = Client.make(preprod)
.withBlockfrost({
baseUrl: "https://cardano-preprod.blockfrost.io/api/v0",
projectId: process.env.BLOCKFROST_API_KEY!
})
.withSeed({ mnemonic: process.env.WALLET_MNEMONIC!, accountIndex: 0 })

// Build -> sign -> submit
const tx = await client
.newTx()
.payToAddress({
address: Address.fromBech32("addr_test1..."), // recipient
assets: Assets.fromLovelace(2_000_000n) // 2 ADA
})
.build()

const signed = await tx.sign()
const txHash = await signed.submit()
console.log("Transaction submitted:", txHash)

The builder selects UTXOs, calculates the fee, and adds a change output for you. 2_000_000n is 2 ADA (amounts are in lovelace, as a bigint).

The transaction hash is your receipt. Paste it into an explorer to watch it confirm.

Query the chain​

Reading state is the other half of building. Check a balance, list UTXOs, or wait for confirmation:

// List your wallet's UTXOs and sum the balance
const utxos = await client.getWalletUtxos()
const totalLovelace = utxos.reduce((sum, u) => sum + u.assets.lovelace, 0n)
console.log("Total balance:", totalLovelace, "lovelace")

// Wait for a transaction to confirm (poll every 3s)
const confirmed = await client.awaitTx(txHash, 3000)
console.log("Confirmed:", confirmed)

Next steps​