Skip to content

BoltzExchange/boltz-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

364 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

boltz-core

CI Version

Boltz Reference Client & Library in TypeScript, used by e.g. https://github.com/BoltzExchange/boltz-web-app.

The library exposes building blocks for Boltz-style submarine and reverse swaps: swap scripts and Taproot swap trees, claim/refund transaction construction, MuSig2 helpers, preimage/swap detection, and the Solidity EtherSwap/ERC20Swap ABIs.

Installation

npm install boltz-core

The package is ESM only and requires Node.js >=20.10.

Optional peer dependencies

Liquid support is opt-in. The two peer dependencies are declared as optional, so installing boltz-core on its own pulls no Liquid code:

Install them only if you import from boltz-core/liquid:

npm install liquidjs-lib @vulpemventures/secp256k1-zkp

The main boltz-core entry point never imports either package, so Bitcoin-only consumers will not see them in their bundle or dependency tree.

Usage

Bitcoin

import {
  Networks,
  OutputType,
  constructClaimTransaction,
  swapTree,
} from 'boltz-core';

Liquid

boltz-core/liquid requires a one-time init call with a loaded secp256k1-zkp instance before any swap helpers are used:

import zkpInit from '@vulpemventures/secp256k1-zkp';
import {
  Networks,
  constructClaimTransaction,
  init,
  reverseSwapTree,
} from 'boltz-core/liquid';

const zkp = await zkpInit();
init(zkp);

Development

npm install
npm run compile
npm test

Integration tests need local Bitcoin and Elements regtest nodes:

npm run docker:start
npm run test:int
npm run docker:stop

About

Boltz Reference Library in TypeScript

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors