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';
const boltzmann = new Boltzmann({
maxDuration: 30,
maxTxos: 16,
logLevel: "INFO"
});
const transaction = {
inputs: [
["address1", 1000],
["address2", 2000]
],
outputs: [
["address3", 500],
["address4", 2200]
]
}
const result: BoltzmannResult = boltzmann.process(transaction);
console.log(result.toJSON());