Mesh Introduces a New Cardano Transaction Builder

Mesh SDK 2.0 adds tools for linking transactions and testing them locally. Developers upgrading from earlier versions will also need to account for changes to existing packages and transaction code.

By SongMarketCap

Updated:

Cardano News - Mesh Introduces a New Cardano Transaction Builder

Mesh has released version 2.0 of its Cardano development toolkit, introducing TxBuilder for assembling, signing and submitting transactions.

Published on GitHub on December 2, the release also adds a local transaction emulator and a system for coordinating processes that require more than one transaction. The update includes changes that affect applications built with earlier Mesh versions.

A New Way to Build Cardano Transactions

Mesh is an open source software development kit, or SDK, that helps developers connect applications to Cardano wallets and work with smart contracts.

TxBuilder lets developers assemble a transaction from defined components. These include outputs, assets being minted, collateral, metadata and voting operations. According to the release notes, the builder can then select inputs, calculate fees and change, and evaluate scripts.

The system also returns specific errors when a transaction cannot be built correctly. These can identify problems such as an output containing less than the required minimum amount of ADA, a fee that is too low or a mismatch between networks.

The previous MeshTxBuilder remains available as a compatibility adapter, although Mesh has marked it as deprecated.

Linking Transactions and Testing Locally

Some applications need several transactions to complete a process. A later transaction, for example, may depend on an output created by an earlier one.

Mesh 2.0 introduces TxPlan to manage those sequences. The tool tracks signing, submission and confirmation, while a plan store allows work to resume after an application restarts. Mesh also describes support for waiting on dependencies and rebuilding a plan when transactions expire or are rolled back.

Developers can test individual transactions or transaction chains with the new @meshsdk/tx-emulator package. It simulates a local Cardano ledger and can model information such as unspent transaction outputs, stake balances, pools and governance actions.

TxBuilder uses a Scalus evaluator by default to assess Plutus scripts locally. Developers can also supply a different evaluator.

[NEWSBREAK]

Changes for Existing Mesh Applications

Mesh has published a migration guide for developers moving from version 1.x. The update removes @meshsdk/core-csl, with @meshsdk/core-cst used for serialization and parsing.

Existing transaction code also needs review. Mesh notes that the underlying serialized transaction data can change and that some older custom serializers and input selectors are no longer accepted.

The release changes how certain stake registration and deregistration methods construct certificates under Cardano’s Conway rules. Separate methods remain available for developers who need the earlier certificate formats.

Mesh 2.0 also adds @meshsdk/x402, a separately versioned package for Cardano payments using the x402 exact scheme. The package supports direct payments, script payments and Masumi escrow, according to the release notes.