Transaction Builder
Build Cardano transactions with fine-grained control using low-level APIs.
Overview
MeshTxBuilder is a powerful, low-level API for constructing Cardano transactions. It provides complete control over every aspect of transaction building—from simple ADA transfers to complex smart contract interactions, staking operations, and governance actions.
When to use MeshTxBuilder:
- Building custom transaction logic beyond standard transfers
- Creating multi-signature transactions
- Minting and burning native assets
- Interacting with Plutus smart contracts
- Managing stake delegation and rewards
- Participating in on-chain governance
Quick Start
import { MeshTxBuilder, BlockfrostProvider } from "@meshsdk/core";
// Initialize provider and builder
const provider = new BlockfrostProvider("<YOUR_API_KEY>");
const txBuilder = new MeshTxBuilder({
fetcher: provider,
verbose: true,
});
// Get wallet data
const utxos = await wallet.getUtxos();
const changeAddress = await wallet.getChangeAddress();
// Build a simple transfer
const unsignedTx = await txBuilder
.txOut("addr_test1qz...", [{ unit: "lovelace", quantity: "5000000" }])
.changeAddress(changeAddress)
.selectUtxosFrom(utxos)
.complete();
// Sign and submit
const signedTx = await wallet.signTx(unsignedTx);
const txHash = await wallet.submitTx(signedTx);Documentation
Transaction Basics
Working with transactions and its various options
Mint and Burn Assets
Minting and burning assets with Native Script and Plutus Script
Smart Contracts
Transactions to work with smart contracts
Staking Transactions
Transactions for delegating ADA and managing stakepools
Governance Transactions
Transactions for participating in Cardano's on-chain governance
Related
- Transaction Parser — Parse and test transactions
- Providers — Blockchain data providers
- Wallets — Wallet integration options