Skip to content

Commit

Permalink
Address prefix change
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanzhenzhen committed Oct 30, 2018
1 parent ba95e21 commit d5cc752
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 143 deletions.
2 changes: 1 addition & 1 deletion docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var myNode = new bitcore.Node({
Now that you've loaded your services you can access them via `myNode.services.<service-name>.<method-name>`. For example if you wanted to check the balance of an address, you could access the address service like so.

```js
myNode.services.bitcoind.getAddressBalance('1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v', false, function(err, total) {
myNode.services.bitcoind.getAddressBalance('CRWU94qucE6rBWeMhMKMEyLzzsjVpjSAG3NC', false, function(err, total) {
console.log(total.balance); //Satoshi amount of this address
});
```
Expand Down
14 changes: 7 additions & 7 deletions docs/services/bitcoind.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ node.services.bitcoind.sendTransaction(transaction.serialize(), function(err, ha
One of the most common uses will be to retrieve unspent outputs necessary to create a transaction, here is how to get the unspent outputs for an address:
```js
var address = 'mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW';
var address = 'tCRWE1Wu4gnbCnJQSH9CQDqBziu9hAVRC2xk4';
node.services.bitcoind.getAddressUnspentOutputs(address, options, function(err, unspentOutputs) {
// see below
});
Expand All @@ -193,7 +193,7 @@ The `unspentOutputs` will have the format:
```js
[
{
address: 'mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW',
address: 'tCRWE1Wu4gnbCnJQSH9CQDqBziu9hAVRC2xk4',
txid: '9d956c5d324a1c2b12133f3242deff264a9b9f61be701311373998681b8c1769',
outputIndex: 1,
height: 150,
Expand All @@ -207,7 +207,7 @@ The `unspentOutputs` will have the format:
**View Balances**
```js
var address = 'mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW';
var address = 'tCRWE1Wu4gnbCnJQSH9CQDqBziu9hAVRC2xk4';
node.services.bitcoind.getAddressBalance(address, options, function(err, balance) {
// balance will be in satoshis with "received" and "balance"
});
Expand All @@ -222,7 +222,7 @@ If "queryMempool" is set as true (it is true by default), it will show unconfirm
If "queryMempoolOnly" is set as true (it is false by default), it will show *only* unconfirmed transactions from mempool.
```js
var addresses = ['mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW'];
var addresses = ['tCRWE1Wu4gnbCnJQSH9CQDqBziu9hAVRC2xk4'];
var options = {
start: 345000,
end: 344000,
Expand All @@ -241,7 +241,7 @@ The history format will be:
items: [
{
addresses: {
'mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW': {
'tCRWE1Wu4gnbCnJQSH9CQDqBziu9hAVRC2xk4': {
inputIndexes: [],
outputIndexes: [0]
}
Expand All @@ -256,7 +256,7 @@ The history format will be:
**View Address Summary**
```js
var address = 'mgY65WSfEmsyYaYPQaXhmXMeBhwp4EcsQW';
var address = 'tCRWE1Wu4gnbCnJQSH9CQDqBziu9hAVRC2xk4';
var options = {
noTxList: false
};
Expand Down Expand Up @@ -316,7 +316,7 @@ For details on instantiating a bus for a node, see the [Bus Documentation](../bu
```js
bus.subscribe('bitcoind/rawtransaction');
bus.subscribe('bitcoind/hashblock');
bus.subscribe('bitcoind/addresstxid', ['13FMwCYz3hUhwPcaWuD2M1U2KzfTtvLM89']);
bus.subscribe('bitcoind/addresstxid', ['CRWEDMFkpSAJAVTayCjUnopQkEdhH8e6TRrP']);

bus.on('bitcoind/rawtransaction', function(transactionHex) {
//...
Expand Down
4 changes: 2 additions & 2 deletions lib/services/bitcoind.js
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@ Bitcoin.prototype.getTransaction = function(txid, callback) {
* sequence: 123456789,
* script: [hexString],
* scriptAsm: [asmString],
* address: '1LCTmj15p7sSXv3jmrPfA6KGs6iuepBiiG',
* address: 'CRWXAT6HGXviZE47QMzRySdVbVAoLaHiEk82',
* satoshis: 771146
* }
* ],
Expand All @@ -1927,7 +1927,7 @@ Bitcoin.prototype.getTransaction = function(txid, callback) {
* satoshis: 811146,
* script: '76a914d2955017f4e3d6510c57b427cf45ae29c372c99088ac',
* scriptAsm: 'OP_DUP OP_HASH160 d2955017f4e3d6510c57b427cf45ae29c372c990 OP_EQUALVERIFY OP_CHECKSIG',
* address: '1LCTmj15p7sSXv3jmrPfA6KGs6iuepBiiG',
* address: 'CRWXAT6HGXviZE47QMzRySdVbVAoLaHiEk82',
* spentTxId: '4316b98e7504073acd19308b4b8c9f4eeb5e811455c54c0ebfe276c0b1eb6315',
* spentIndex: 1,
* spentHeight: 100
Expand Down
Loading

0 comments on commit d5cc752

Please sign in to comment.