@hydra-sdk/core
v1.5.0
Published
Hydra SDK - Core library for building decentralized applications on Cardano
Maintainers
Readme
@hydra-sdk/core
HD wallets, key management and Cardano utilities — the foundation every other Hydra SDK package builds on.
🎮 Try it first
The Hydra SDK Playground runs this package in your browser — generate a wallet, derive accounts, pick UTxOs and build a transaction, with the matching TypeScript written out as you go. It is the quickest way to see what the API feels like before installing anything.
🚀 Quick Start
pnpm add @hydra-sdk/core @hydra-sdk/cardano-wasm@hydra-sdk/cardano-wasm carries the WASM every package imports through, so keep it a direct dependency — your bundler needs to see it. See the Configuration Guide for Vite / Next.js / Webpack setup.
import { AppWallet, NETWORK_ID } from '@hydra-sdk/core'
const wallet = new AppWallet({
networkId: NETWORK_ID.PREPROD,
key: { type: 'mnemonic', words: AppWallet.brew() }
})
const account = wallet.getAccount(0, 0)
console.log(account.baseAddressBech32)NETWORK_ID is a Record, not an enum — { MAINNET: 1, PREPROD: 0, PREVIEW: 0 }. There is no TESTNET key.
📦 What's inside
Wallets
AppWallet— HD wallet (BIP39/BIP44) from amnemonic, a bech32rootkey orclisigning keys, with signing, UTxO queries and submission through a fetcher/submitter pairEmbeddedWallet— lower-level key derivation without the account bookkeepingCardanoCliWallet— signing keys in thecardano-cliJSON envelope format
Utility namespaces
| Namespace | Covers |
| --- | --- |
| Serializer / Deserializer / Converter / Resolver | CBOR ↔ objects, hashes, address and UTxO conversion |
| DatumUtils / RedeemerUtils / PlutusUtils | Plutus data, redeemers, script handling |
| AddressUtils / KeysUtils / BuildKeys | Address derivation, key material |
| MetadataUtils / TimeUtils / ParserUtils | Tx metadata, slot ↔ time, hex and bytes |
| ProviderUtils | Blockfrost, Ogmios and other chain providers |
| ValidationUtils / CostModels | Address and output validation, Plutus cost models |
Constants: NETWORK_ID, NETWORK_MAGIC, DEFAULT_PROTOCOL_PARAMETERS (PV11), SLOT_CONFIG_NETWORK.
