New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

accept-bitcoin-payment

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

accept-bitcoin-payment

A self hosted JS libarary which you can use to accept bitcoin payments directly.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Accept Bitcoin Payment

A lightweight module for accepting Bitcoin payments by scanning HD wallet addresses derived from a provided zpub. This module converts a zpub to an xpub, scans derived addresses using the Blockstream API, and returns payment details including the next unused address and a sorted list of transactions.

Features

  • HD Wallet Scanning: Derives addresses from a given zpub.
  • Transaction Fetching: Retrieves transaction details for each address via the Blockstream API.
  • Payment Information: Processes transactions to identify sends and receives along with their amounts and timestamps.
  • Sorted Output: Returns transactions sorted by timestamp (oldest to newest).

Installation

npm install accept-bitcoin-payment

Usage

import { nextAddress } from "accept-bitcoin-payment";

const zpub =
  "zpub6qU3pMzBXcDxURjEZXDna8h8VJvDAmmUChYspM5NEZvHYxW5z48wKM8uMSqwY5pJEML41Aq7FC3hLSwa14EG42mVA1izYJzxo9TSt4W7Xii";

(async () => {
  try {
    const { index, address } = await nextAddress(zpub);

    console.log("Next Address:", address);
  } catch (error) {
    console.error("Error:", error);
  }
})();

Contributing

Contributions, suggestions, and improvements are welcome! Please open an issue or submit a pull request on GitHub.

Keywords

bitcoin

FAQs

Package last updated on 08 Apr 2025

Related posts