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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wingriders/cab

v2.1.7

Published

CAB is a library, that helps you with development of Cardano apps for browser and Node.js

Downloads

54

Readme

@wingriders/cab

CAB (Cardano Application Backend) is a powerful library designed to streamline the development of Cardano applications for both browser and Node.js environments.

Features

CAB provides essential tools for:

  • Wallet & Account Management – Securely manage Cardano wallets and accounts.
  • Custom Data Sources – Define and integrate blockchain data providers.
  • Cryptographic Utilities – Generate mnemonics and derive keys.
  • CIP-30 dApp Connector – Easily connect with Cardano dApps.
  • Transaction Planning – Build Plutus-compatible transactions with metadata and automatic UTxO selection.
  • Plutus V1 & V2 Support – Compatible with both Plutus versions.

Installation

Using Yarn

yarn add @wingriders/cab

Using npm

npm install @wingriders/cab

Development Roadmap

  • [ ] Add comprehensive documentation
  • [x] Support Plutus V2
  • [ ] Improve transaction planner
  • [x] Open-source data providers
  • [ ] Enhance error reporting and helper functions
  • [ ] Expand test coverage
  • [ ] Add ES Modules support

Basic Usage

CAB offers a wide range of functionalities. Below are some basic examples to help you get started.

Account Management

Manage a wallet using a mnemonic phrase.

import {NETWORKS} from '@wingriders/cab/constants'
import {JsCryptoProvider, mnemonicToWalletSecretDef} from '@wingriders/cab/crypto'
import {CabBackend} from '@wingriders/cab/dataProvider'
import {NetworkName} from '@wingriders/cab/types/network'
import {Wallet} from '@wingriders/cab/wallet'

const dataProvider = new CabBackend('https://cab-server.mainnet.wingriders.com', NetworkName.MAINNET)

const wallet = new Wallet({
  dataProvider,
  cryptoProvider: new JsCryptoProvider({
    // Here we assume the mnemonic is in a variable called `secretMnemonic`
    // for example loaded from the environment variables
    walletSecretDef: await mnemonicToWalletSecretDef(secretMnemonic),
    network: NETWORKS[NetworkName.MAINNET],
    config: {
      shouldExportPubKeyBulk: true,
    },
  }),
  gapLimit: 20,
})

const account = await wallet.getOrLoadAccount(0)
const utxos = account.getUtxos()

Transaction Planner

Send 10 ADA to Alice using a planned transaction.

import {getTxPlan} from '@wingriders/cab/ledger/transaction'
import {Lovelace, TxPlanArgs} from '@wingriders/cab/types'

// Obtain the protocol parameters from your ledger state provider
const protocolParameters = await dataProvider.getProtocolParameters()

// Define the plan of the transaction
const txPlanArgs: TxPlanArgs = {
  planId: 'send-ada-to-Alice',
  outputs: [
    {
      address: 'addr1z8n...u6v8',
      coins: new Lovelace(10_000_000) as Lovelace,
      tokenBundle: [],
    },
  ],
  protocolParameters,
}

// Try to create the transaction plan, using available utxos in your account
// and send the change to your account's change address
const txPlanResult = getTxPlan(txPlanArgs, account.getUtxos(), account.getChangeAddress())

if (!txPlanResult.success) {
  console.error(txPlanResult.error)
  process.exit(1)
}

// Sign the transaction using your account and submit the transaction
// via your wallet's dataProvider
const txAux = prepareTxAux(txPlanResult.txPlan)
const signedTx = await account.signTxAux(txAux)
console.log(`Submitting transaction ${signedTx.txHash}`)
await wallet.submitTx(signedTx.txBody)