Loading...
Loading...
Use when building Cardano transactions with MeshJS SDK. Covers MeshTxBuilder API for sending ADA, minting NFTs and tokens, spending from Plutus scripts, staking, governance voting, DRep registration, and multi-sig patterns. Includes correct method ordering, coin selection, fee calculation, and troubleshooting common Cardano transaction errors.
npx skill4agent add meshjs/skills mesh-transactionMeshTxBuilder@meshsdk/transactionnpm install @meshsdk/transaction
# or
npm install @meshsdk/core # includes transaction + wallet + provider| Task | Method Chain |
|---|---|
| Send ADA | |
| Mint tokens (Plutus) | |
| Mint tokens (Native) | |
| Script spending | |
| Stake delegation | |
| Withdraw rewards | |
| Governance vote | |
| DRep registration | |
import { MeshTxBuilder } from '@meshsdk/transaction';
const txBuilder = new MeshTxBuilder({
fetcher?: IFetcher, // For querying UTxOs (e.g., BlockfrostProvider)
submitter?: ISubmitter, // For submitting transactions
evaluator?: IEvaluator, // For script execution cost estimation
serializer?: IMeshTxSerializer, // Custom serializer
selector?: IInputSelector, // Custom coin selection
isHydra?: boolean, // Hydra L2 mode (zero fees)
params?: Partial<Protocol>, // Custom protocol parameters
verbose?: boolean, // Enable logging
});| Method | Async | Balanced | Use Case |
|---|---|---|---|
| Yes | Yes | Production - auto coin selection, fee calculation |
| No | No | Testing - requires manual inputs/fee |
| No | No | Partial build for inspection |
| No | N/A | Add signatures after complete() |
thistxBuilder
.txIn(hash, index)
.txOut(address, amount)
.changeAddress(addr)
.complete();spendingPlutusScriptV1/V2/V3()txIn()mintPlutusScriptV1/V2/V3()mint()withdrawalPlutusScriptV1/V2/V3()withdrawal()votePlutusScriptV1/V2/V3()vote()"Mesh""JSON""CBOR"*TxInReference()complete()changeAddress()txInCollateral()spendingPlutusScriptV2()txIn()selectUtxosFrom()