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

@totemsdk/tx-builder

v0.1.6

Published

Transaction builder for Minima blockchain — coin selection, multisig, and WOTS signing

Readme

@totemsdk/tx-builder

Construct Minima transactions in pure TypeScript.

Provides coin selection, multi-signature transaction management, and the EnhancedBuildParams type used across the SDK. Depends only on @noble/hashes.

Install

npm install @totemsdk/tx-builder @noble/hashes

What's inside

Coin selection

| Export | What it does | |--------|-------------| | CoinSelectionService | Service class for selecting UTXOs to cover a payment | | CoinSelectionResult | Result type: selectedCoins, totalSelected, change, insufficientFunds, fromAddresses | | CoinSelectionOptions | Options: mode ('global' | 'focused'), targetAmount, tokenId, focusedAddress | | CoinSelectionError | Typed error with code: 'INSUFFICIENT_FUNDS', 'FETCH_FAILED', etc. | | SpendableCoin | A coin that is eligible for selection |

Multi-signature

| Export | What it does | |--------|-------------| | MultisigConfig | Configuration for '2of2' or 'mofn' multi-sig (threshold, publicKeys, ownPublicKey) | | PendingMultisigTransaction | A multi-sig transaction awaiting co-signatures |

Transaction types

| Export | What it does | |--------|-------------| | EnhancedBuildParams | Full transaction build parameters (inputs, outputs, transactionState, linkHash) | | EnhancedCoinInput | Input coin with coinId, address, amount, scriptDescriptor, coinProofHex | | EnhancedCoinOutput | Output with address, amount, tokenId, storeState, state |

Usage

Select coins for a payment

import { CoinSelectionService, CoinSelectionError } from '@totemsdk/tx-builder';

const service = new CoinSelectionService(storage, coinFetcher);

try {
  const result = await service.selectCoinsForSend('MxABC...', {
    mode: 'global',
    targetAmount: '10',
    tokenId: '0x00',
  });

  console.log('Selected coins:', result.selectedCoins.length);
  console.log('Change:', result.change);
} catch (err) {
  if (err instanceof CoinSelectionError && err.code === 'INSUFFICIENT_FUNDS') {
    console.error('Not enough funds');
  }
}

Build transaction parameters

import type { EnhancedBuildParams } from '@totemsdk/tx-builder';

// Assemble params to pass to sendComplex() in @totemsdk/connect
const buildParams: EnhancedBuildParams = {
  inputs: [
    {
      coinId: '0xABC...',
      address: 'MxABC...',
      amount: '15',
      tokenId: '0x00',
      scriptDescriptor: { type: 'signedby', publicKey: '0x...' },
      coinProofHex: '...',
    },
  ],
  outputs: [
    { address: 'MxDEF...', amount: '10', tokenId: '0x00' },
    { address: 'MxABC...', amount: '5',  tokenId: '0x00' }, // change
  ],
};

Multi-signature configuration

import type { MultisigConfig } from '@totemsdk/tx-builder';

const config: MultisigConfig = {
  type: 'mofn',
  threshold: 2,
  publicKeys: ['0xAAA...', '0xBBB...', '0xCCC...'],
  ownPublicKey: '0xAAA...',
};

See also