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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitcoin-payment-microservice

v0.2.7

Published

A micro bitcoin payment package Beta Version

Downloads

18

Readme

Micro Bitcoin Payment Service

A micro service for adding bitcoin payment to your node application. using node 8.0

Prerequisites

To install the module you need to have node install in your loacl machine and also npm / yarn.

Testing

To run a unit test run the following command

  npm run test

Usage

To use with the micro service you need to install some module first with.

  npm install --save bitcoin-payment-mircoservice

Or you use yarn to install the package

 yarn add bitcoin-payment-mircoservice

then in, your javascript file.

  const bitcoinPayment = require('bitcoin-payment-mircoservice')

To get the current bitcoin balance of an address

 const balance =  bitcoinPayment.getBalance(address) // return address balance
 console.log('bitcoin Balance', balance)

returns

  bitcoin Balance 0.009797

To Generate a bitcoin address

  const address = bitcoinPayment.createAddress() // return a bitcoin address with   private key
  console.log(address)

returns

 {
   address: '1K3QovFjbXG9HMYSfTE8WMc7EHhhpJSGwT',
   privateKey: 'achgjxsdvhjahkjlxkdcbazagshkjlskncvgshjasluyihkjaknjxs'
 }
 ** NOTE: Please always secure your private key

To send Bitcoin to an address

 sendBTC (paperWallet, toAddress, amount, network) =>  transactionID
 // paperWallet - Generated address with private key to validate the transaction
 // amount -  amount to be sent in satoshi
 // toAddress - Bitcoin address to receive the amount
 // network - which could either 'testnet' or 'livenet/mainnet'

To listen to an address on a network for transaction

  bitcoinPayment.litenToLiveTransaction(address) => tx

Will trigger the event in real time if a payment is done to that address:

 Transaction detected! { address: '138WJKb1mXbkRGNpyMVEZ9EsoXjMEvJfT4',
 amount: 381000 }