@owstack/btc-payment-protocol

0.0.5 • Public • Published

Btc Payment Protocol

NPM Package Build Status Coverage Status

A module for btc that implements Payment Protocol and other related BIPs.

Attribution

This repository was created by copy forking bitcore-payment-protocol commit b086fc6.

Getting Started

This library is distributed in both the npm and bower packaging systems.

npm install btc-lib
npm install btc-payment-protocol
bower install btc-lib
bower install btc-payment-protocol

There are many examples of how to use it on the developer guide section for payment protocol. For example, the following code would verify a payment request:

var PaymentProtocol = require('@owstack/btc-payment-protocol');

var body = PaymentProtocol.PaymentRequest.decode(rawbody);
var request = new PaymentProtocol().makePaymentRequest(body);

var version = pr.get('payment_details_version');
var pki_type = pr.get('pki_type');
var pki_data = pr.get('pki_data');
var serializedDetails = pr.get('serialized_payment_details');
var signature = pr.get('signature');

// Verify the signature
var verified = request.verify();

Contributing

See CONTRIBUTING.md on the main btc-lib repo for information about how to contribute.

License

Code released under the MIT license.

Copyright 2017 Open Wallet Stack.

Package Sidebar

Install

npm i @owstack/btc-payment-protocol

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

333 kB

Total Files

20

Last publish

Collaborators

  • ajp8164
  • niahmiah