Commit 91a848a8 authored by kenshin-samourai's avatar kenshin-samourai
Browse files

Merge branch 'develop' into 'master'

merge develop into master for 0.1.0

See merge request !1
parents 0f34237d 4dae08ea
......@@ -7,7 +7,7 @@ A set of utilities for working with BIP47 and bitcoinjs-lib.
### Mainnet
```
const bip47 = require('bip47');
const bip47 = require('bip47-js');
const b58PCode = 'PM8TJTLJbPRGxSbc8EJi42Wrr6QbNSaSSVJ5Y3E4pbCYiTHUskHg13935Ubb7q8tx9GVbh2UuRnBc3WSyJHhUrw8KhprKnn9eDznYGieTzFcwQRya4GA';
......@@ -19,7 +19,7 @@ const notifAddr = pcode.getNotificationAddress();
```
const bitcoinjs = require('bitcoinjs-lib');
const bip47 = require('bip47');
const bip47 = require('bip47-js');
const networks = bitcoinjs.networks;
......@@ -38,7 +38,7 @@ The recommended method of using this library and bitcoinjs-lib in your browser i
<head>
<meta charset="utf-8">
<title>Test BIP47 lib</title>
<script src="libs/bip47-bundle.min.js"></script>
<script src="libs/bip47-js-bundle.min.js"></script>
</head>
<body>
<script type="text/javascript">
......
{
"name": "bip47",
"name": "bip47-js",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
......
{
"name": "bip47",
"name": "bip47-js",
"version": "0.1.0",
"description": "A set of utilities for working with BIP47 and bitcoinjs-lib",
"main": "test/index.js",
"main": "src/index.js",
"scripts": {
"test": "mocha --recursive --reporter spec"
},
"repository": {
"type": "git",
"url": "git+ssh://git@code.samourai.io:dojo/bip47.git"
"url": "git+ssh://git@code.samourai.io:dojo/bip47-js.git"
},
"author": "Katana Cryptographic Ltd.",
"license": "AGPL-3.0-only",
"homepage": "https://code.samourai.io/dojo/bip47",
"homepage": "https://code.samourai.io/dojo/bip47-js",
"dependencies": {
"bitcoinjs-lib": "5.1.4",
"bip32": "2.0.6",
......
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bitcoinjs = require('bitcoinjs-lib');
const bip32 = require('bip32');
const bs58check = require('bs58check');
const p2pkh = bitcoinjs.payments.p2pkh;
const networks = bitcoinjs.networks;
const { networks, payments } = require('bitcoinjs-lib');
const { p2pkh } = payments;
const { fromPublicKey } = require('bip32');
const { encode, decode } = require('bs58check');
const PC_VERSION = 0x47;
......@@ -23,7 +22,7 @@ class PaymentCode {
this.buf = buf;
this.network = network;
this.root = bip32.fromPublicKey(this.pubKey, this.chainCode, this.network);
this.root = fromPublicKey(this.pubKey, this.chainCode, this.network);
}
get features() {
......@@ -45,7 +44,7 @@ class PaymentCode {
toBase58() {
const version = Buffer.from([PC_VERSION]);
const buf = Buffer.concat([version, this.buf]);
return bs58check.encode(buf);
return encode(buf);
}
derive(index) {
......@@ -67,7 +66,7 @@ class PaymentCode {
function fromBase58(inString, network) {
const buf = bs58check.decode(inString);
const buf = decode(inString);
const version = buf.slice(0, 1);
if (version[0] !== PC_VERSION)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment