npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hydra-sdk/transaction

v1.2.3

Published

Hydra SDK - Transaction library for building decentralized applications on Cardano

Readme

@hydra-sdk/transaction

TxBuilder — a fluent Cardano transaction builder covering multi-asset transfers, minting and burning, Plutus scripts, staking and Hydra L2.

npm

🎮 Try it first

The Transaction Builder playground is this package with a UI on top: pick inputs, add outputs, mint, attach scripts and datums, then read the generated TypeScript next to the built CBOR. Every builder method below has a control there, so it doubles as a live reference.

🚀 Quick Start

pnpm add @hydra-sdk/transaction @hydra-sdk/cardano-wasm
import { TxBuilder } from '@hydra-sdk/transaction'

const cbor = await new TxBuilder()
  .setInputs(utxos)
  .txOut('addr_test1...', [{ unit: 'lovelace', quantity: '2000000' }])
  .changeAddress(changeAddress)
  .completeCbor()

const signedTx = await wallet.signTx(cbor)
const txHash = await wallet.submitTx(signedTx)

For a Hydra head, pass isHydra: true (and the head's protocol parameters) to the constructor:

const builder = new TxBuilder({ isHydra: true, params: await bridge.getProtocolParameters() })

🧠 WASM memory — the one thing to get right

Every object the builder touches lives in WASM linear memory and is only reclaimed by .free(). The JS garbage collector will not do it promptly, so a build loop leaks unless you help it.

| You need | Use | Who frees | | --- | --- | --- | | Just the CBOR | completeCbor() | The builder — nothing to free | | A live Transaction | complete() | You — call tx.free() when done | | Done with the builder | dispose(), or using builder = new TxBuilder() | The builder frees everything it holds |

For high-volume workloads, reuse one builder with reset() between transactions and dispose() it at the end. See Performance for measurements.

✨ What it builds

  • InputssetInputs() with four coin-selection strategies, or explicit txIn()
  • OutputstxOut() / addOutput(), multi-asset, inline datums
  • Mint & burnmint(), mintingScript(), mintRedeemerValue()
  • Plutus V1/V2/V3 — script inputs, datum hashes, inline datums, redeemers, collateral, reference inputs
  • StakingregisterStake(), deregisterStake(), delegateStake(), withdrawal()
  • Metadata & validitymetadataValue(), invalidBefore(), invalidAfter()
  • Fees — computed from protocol parameters, or pinned with setFee() / setMinFee()
  • Script budgets — pass an evaluator and complete() rebuilds with real exUnits so the fee is accurate (omit it for Hydra, which has no on-chain evaluation)

📚 Documentation

License

Apache 2.0. Repo | Issues