Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit 86bc1ec

Browse files
committed
Updated fix for multiple bitcore instances to that suggested in bitpay/bitcore-lib#21, adding bitcore-lib as peerDependency
1 parent 2cb8505 commit 86bc1ec

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ The ``openchain`` module exports the following objects:
5454
- ``MutationSigner``: A class that can be used to sign a mutation.
5555
- ``ByteBuffer``: A buffer of raw bytes.
5656
- ``Long``: A class for representing a 64 bit integer value.
57-
- ``bitcore``: The bitcore class from the bitcore-lib npm package.
5857

5958
## Code samples
6059

@@ -83,11 +82,12 @@ This code submits a transaction that transfers 100 units of an asset from an iss
8382

8483
``` js
8584
var openchain = require("openchain");
85+
var bitcore = require("bitcore-lib");
8686

8787
var seed = "0123456789abcdef0123456789abcdef";
8888

8989
// Load a private key from a seed
90-
var privateKey = openchain.bitcore.HDPrivateKey.fromSeed(seed, "openchain");
90+
var privateKey = bitcore.HDPrivateKey.fromSeed(seed, "openchain");
9191
var address = privateKey.publicKey.toAddress();
9292

9393
// Calculate the accounts corresponding to the private key
@@ -133,11 +133,12 @@ This code submits a transaction recording a piece of arbitrary data (the ``store
133133

134134
``` js
135135
var openchain = require("openchain");
136+
var bitcore = require("bitcore-lib");
136137

137138
var seed = "0123456789abcdef0123456789abcdef";
138139

139140
// Load a private key from a seed
140-
var privateKey = openchain.bitcore.HDPrivateKey.fromSeed(seed, "openchain");
141+
var privateKey = bitcore.HDPrivateKey.fromSeed(seed, "openchain");
141142
var address = privateKey.publicKey.toAddress();
142143

143144
// Calculate the accounts corresponding to the private key

index.js

-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,3 @@ bitcore.Networks.add({
3939
port: livenet.port,
4040
dnsSeeds: livenet.dnsSeeds
4141
});
42-
43-
module.exports.bitcore = bitcore;
44-

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"url": "https://github.com/openchain/openchain-js.git"
1515
},
1616
"dependencies": {
17-
"bitcore-lib": "~0.13.15",
1817
"protobufjs": "4.1.3",
1918
"httpinvoke": "1.4.0"
2019
},
@@ -27,5 +26,8 @@
2726
"grunt-contrib-uglify": "~0.11.0",
2827
"mocha": "~2.3.4",
2928
"q": "~1.4.1"
29+
},
30+
"peerDependencies": {
31+
"bitcore-lib": "~0.13.15",
3032
}
3133
}

0 commit comments

Comments
 (0)