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

@swapdk/wdk-wallet-btc

v0.1.3

Published

WDK wallet module for Bitcoin, extending @tetherto/wdk-wallet-btc with OP_RETURN memo support so sendTransaction can attach swap memos (e.g. THORChain). Fork of @tetherto/wdk-wallet-btc.

Readme

@swapdk/wdk-wallet-btc

WDK wallet module for Bitcoin. Fork of @tetherto/wdk-wallet-btc that adds optional OP_RETURN memo support to sendTransaction / signTransaction, so a spending transaction can carry a swap memo (THORChain, MAYAChain) in a single PSBT output.

Everything else — BIP-84 Native SegWit by default, Electrum and Blockbook transports, BIP-32 derivation, coin-selection — is unchanged from upstream. See the upstream README for the full API.

Why this fork exists

THORChain (and MAYAChain) routes incoming BTC deposits on the OP_RETURN memo of the spending transaction. Without that memo, a deposit to the THORChain inbound vault is either refunded or treated as a pool donation. The upstream WalletAccountBtc.sendTransaction API exposes only a single recipient output (to / value / feeRate) and no way to attach an OP_RETURN payload, leaving any THORChain-routed BTC source flow blocked.

This fork adds a single optional field — memo — to the existing send/sign options. Everything else is bit-for-bit upstream. The change is intended to land upstream as a PR; this fork exists so the SwapDK BTC bridge module can ship while that review happens.

What changed

WalletAccountBtc.sendTransaction and WalletAccountBtc.signTransaction now accept an optional memo field:

import WalletManagerBtc from '@swapdk/wdk-wallet-btc'

const wallet = new WalletManagerBtc({ /* ... */ })
const account = await wallet.getAccount(0)

const { hash, fee } = await account.sendTransaction({
  to:    'bc1qayml3n2nyavx0saqjpkz07h0wcpdum59uegwr9',
  value: 1_000_000n,                       // satoshis
  memo:  '=:e:0xe89E6305…:32324827:commission/SDK:444/5'
})

The memo bytes are emitted as an extra OP_RETURN output with value 0. Standardness rules cap OP_RETURN at 80 bytes on mainnet (Bitcoin Core policy); the wallet rejects longer memos with RangeError before constructing the PSBT.

memo may be a string (encoded as UTF-8) or a Buffer / Uint8Array of raw bytes. If omitted, the behaviour is identical to upstream — no OP_RETURN output is added.

getMaxSpendable() accepts the same memo field so callers can compute "send everything" amounts that already account for the OP_RETURN output's vbytes.

Install

npm install @swapdk/wdk-wallet-btc

Upstreaming

The diff is being prepared for submission to tetherto/wdk-wallet-btc. Once it lands upstream and the relevant version is published on npm, this fork will be deprecated. Until then it is the source of truth for SwapDK's BTC source bridge module.

License

Apache-2.0. Original copyright Tether Operations Limited; modifications copyright SwapDK. See NOTICE.