Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@samouraiwallet/boltzmann

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samouraiwallet/boltzmann

## @samouraiwallet/boltzmann

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Boltzmann

@samouraiwallet/boltzmann

This library is a Typescript port of the Java library - boltzmann-java.

Table of Contents

Requirements

  • Node.js v18 or newer
  • NPM (or yarn or pnpm)

Installation

npm i @samouraiwallet/boltzmann

OR

pnpm add @samouraiwallet/boltzmann

OR

yarn add @samouraiwallet/boltzmann

Usage

CLI

See @samouraiwallet/boltzmann-cli

Node.js

Boltzmann computation is CPU bound and blocking, so it is recommended to run it in a separate worker thread or dedicated process to prevent blocking of the main thread.

import {Boltzmann, BoltzmannResult} from '@samouraiwallet/boltzmann';

// instantiate Boltzmann
const boltzmann = new Boltzmann({
  maxDuration: 30,
  maxTxos: 16,
  logLevel: "INFO"
});

// transaction object with entries for inputs and outputs
const transaction = {
  inputs: [
    ["address1", 1000],
    ["address2", 2000]
  ],
  outputs: [
    ["address3", 500],
    ["address4", 2200]
  ]
}

const result: BoltzmannResult = boltzmann.process(transaction);

console.log(result.toJSON());
/*
{
  nbCmbn: number,
  matLnkCombinations: number[][] | null,
  matLnkProbabilities: number[][] | null,
  entropy: number,
  dtrmLnksById: [number, number][],
  dtrmLnks: [string, string][],
  txos: {
    inputs: [string, number][],
    outputs: [string, number][],
  },
  fees: number,
  intraFees: {
    feesMaker: number,
    feesTaker: number,
    hasFees: boolean,
  },
  efficiency: number | null,
  nbCmbnPrfctCj: string | null,
  nbTxosPrfctCj: {
    nbIns: number
    nbOuts: number
  },
}
 */

FAQs

Package last updated on 03 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc