bitcoin-payment-mircoservice

0.0.8 • Public • Published

Micro Bitcoin Payment Service

A micro service for adding bitcoin payment to your node application

Prerequisites

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

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, txID)
 // paperWallet - Generated address with private key to validate the transaction
 // amount -  amount to be sent
 // toAddress - Bitcoin address to receive the amount
 // txID - Transaction ID on the bitcoin ledger from the address on the paper wallet


To monitor a blockchain transaction on an address and transfer payment to a master address
``` finalizeTransaction (paperWallet, toMasterAddress, amount) ```
### Build With
  • Node Js - javascript runtime engine
  • Bitcoin-live-transactions NPM package
  • Bitcoinjs-lib from bitcoinjs
  • Axios

Readme

Keywords

none

Package Sidebar

Install

npm i bitcoin-payment-mircoservice

Weekly Downloads

0

Version

0.0.8

License

MIT

Last publish

Collaborators

  • devlinblake
  • bensigo.x