insight-cli
Advanced tools
Comparing version 0.0.9 to 0.4.0
@@ -6,4 +6,4 @@ var StreamClient = require('..').StreamClient; | ||
setTimeout(function(){ | ||
console.log("end"); | ||
console.log("end"); | ||
scl.close() | ||
}, 1000 * 10) | ||
}, 1000 * 30) |
@@ -16,8 +16,8 @@ 'use strict' | ||
InsightRestClient.prototype.addr = function(btcaddress){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['addr', btcaddress])) | ||
InsightRestClient.prototype.addr = function(btcaddress, options){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['addr', btcaddress]), options) | ||
} | ||
InsightRestClient.prototype.addrWithoutTx = function(btcaddress){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['addr', btcaddress]), { noTxList:1 }) | ||
return this.addr(btcaddress, { noTxList:1 }) | ||
} | ||
@@ -33,2 +33,13 @@ | ||
InsightRestClient.prototype.blocks = function(options){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['blocks']), options) | ||
} | ||
InsightRestClient.prototype.lastBlock = function(){ | ||
return this.blocks({ limit : 1 }).then(function(info){ | ||
if(info.blocks.length === 0) throw new Error("no block") | ||
else return info.blocks[0] | ||
}) | ||
} | ||
InsightRestClient.prototype.transaction = function(txid){ | ||
@@ -42,10 +53,18 @@ return getQuery(this.timeout_sec, makeApi(this.host, ['tx', txid])) | ||
InsightRestClient.prototype.transactions = function(options){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['txs', '']), options) | ||
} | ||
InsightRestClient.prototype.transactionsbyBlock = function(blockhash){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['txs', '']), { block : blockhash }) | ||
return this.transactions({ block : blockhash }) | ||
} | ||
InsightRestClient.prototype.transactionsbyAddress = function(btcaddress){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['txs', '']), { address : btcaddress }) | ||
return this.transactions({ address : btcaddress }) | ||
} | ||
InsightRestClient.prototype.rawBlock = function(blockhash){ | ||
return getQuery(this.timeout_sec, makeApi(this.host, ['rawblock', blockhash])) | ||
} | ||
InsightRestClient.prototype.sendTransaction = function(rawtx){ | ||
@@ -52,0 +71,0 @@ return postQuery(this.timeout_sec, makeApi(this.host, ['tx', 'send']), {rawtx : rawtx}) |
@@ -7,9 +7,10 @@ 'use strict' | ||
// live-net | ||
{host:'https://search.bitaccess.ca', max:1, sec:2}, | ||
{host:'https://insight.bitpay.com', max:1, sec:2}, | ||
{host:'https://bitcore2.mytrezor.com', max:1, sec:2}, | ||
{host:'https://blockexplorer.com', max:1, sec:2}, | ||
{host:'https://chain.localbitcoins.com', max:1, sec:2}, | ||
{host:'https://insight.bitpay.com', max:1, sec:2}, | ||
{host:'https://insight.satoshipay.io', max:1, sec:2}, | ||
{host:'https://www.localbitcoinschain.com', max:1, sec:2}, | ||
// test-net | ||
{host:'https://testnet.blockexplorer.com', max:1, sec:5}, | ||
{host:'https://test-insight.bitpay.com', max:1, sec:5} | ||
{host:'https://testnet.blockexplorer.com', max:1, sec:3}, | ||
{host:'https://test-insight.bitpay.com', max:1, sec:3} | ||
]); |
{ | ||
"author": "Yuki Akiyama", | ||
"name": "insight-cli", | ||
"version": "0.0.9", | ||
"version": "0.4.0", | ||
"private": false, | ||
"dependencies": { | ||
"@you21979/array-util": "https://github.com/you21979/node-array-util.git", | ||
"@you21979/array-util": "0.0.1", | ||
"promise-util-task": "0.0.*", | ||
"socket.io-client": "1.0.*", | ||
"limit-request-promise" : "0.0.*" | ||
"socket.io-client": "1.5.*", | ||
"limit-request-promise" : "0.1.*" | ||
}, | ||
@@ -12,0 +12,0 @@ "readmeFilename": "README.md", |
122
README.md
@@ -40,6 +40,6 @@ # node-insight-cli | ||
{ addrStr: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
balance: 50.02572069, | ||
balanceSat: 5002572069, | ||
totalReceived: 50.02572069, | ||
totalReceivedSat: 5002572069, | ||
balance: 0.04011425, | ||
balanceSat: 4011425, | ||
totalReceived: 0.04011425, | ||
totalReceivedSat: 4011425, | ||
totalSent: 0, | ||
@@ -50,30 +50,18 @@ totalSentSat: 0, | ||
unconfirmedTxApperances: 0, | ||
txApperances: 27, | ||
txApperances: 44, | ||
transactions: | ||
[ 'ddd78924a1e15ad98b28342987d266e95bade122d4d066be6c5aaec91f172209', | ||
'0cabee6178c031c259609ce33864e5db60f1be86213121bd910983b9618ab531', | ||
'ca0eac93cb73d28872aa2ce644a2f1cfbbe29adfee307e6b9284b215603f835f', | ||
'f7a906a1924cb51f38a301ba6f423d8ff2ee8cea889ef96dc6a87e95451b0300', | ||
'268a648e76074ff6adff922100a72c908d33259295f10f4a5352020916ad4b83', | ||
'571060bfdf239d7272415b502107f14a41e83834a762a38b6325e6217f48b97a', | ||
'82e9cc08d424451e6ff1347a9ef62c88585fa658da3e36c7ce9a18de94726e8e', | ||
'b4c5b2884fd3490144824977b27b1a8495784d4c473b5b24ceab6703fd311d34', | ||
'a6be9f9f6c2194c9d593859e94a09a307ad4fd16179ea903de055c17b46a299c', | ||
'ead9f9c56783aedca6a40fea8af37e4227a53a830d2c50e5003c03993bc4154c', | ||
'aba797b6afe2ca2123f086613d04aca0d2609d2ef209d81e27da907f2b535f69', | ||
'7f66c5e6a8bb4b9e640dfcb097232c740a43481dc02817959f48c48d3436b583', | ||
'1b0235867691784492804fce22a18c2337c97d58a1c63fc275fe26137596d671', | ||
'91b21c74b6b9cc168fc9a079d0aadf4acc90706196a7278cd674611a9104122e', | ||
'24087a08309ea5796ef139e65f13ce10db1e4465057b665b9d5102a640aac6be', | ||
'a3a6f902a51a2cbebede144e48a88c05e608c2cce28024041a5b9874013a1e2a', | ||
'cea36d008badf5c7866894b191d3239de9582d89b6b452b596f1f1b76347f8cb', | ||
'065ef6b1463f552f675622a5d1fd2c08d6324b4402049f68e767a719e2049e8d', | ||
'a66dddd42f9f2491d3c336ce5527d45cc5c2163aaed3158f81dc054447f447a2', | ||
'ffd901679de65d4398de90cefe68d2c3ef073c41f7e8dbec2fb5cd75fe71dfe7', | ||
'd658ab87cc053b8dbcfd4aa2717fd23cc3edfe90ec75351fadd6a0f7993b461d', | ||
'36ebe0ca3237002acb12e1474a3859bde0ac84b419ec4ae373e63363ebef731c', | ||
'fd87f9adebb17f4ebb1673da76ff48ad29e64b7afa02fda0f2c14e43d220fe24', | ||
'dfdf0b375a987f17056e5e919ee6eadd87dad36c09c4016d4a03cea15e5c05e3', | ||
'cb2679bfd0a557b2dc0d8a6116822f3fcbe281ca3f3e18d3855aa7ea378fa373', | ||
'd6be34ccf6edddc3cf69842dce99fe503bf632ba2c2adb0f95c63f6706ae0c52', | ||
[ '48e76c0ba8b766a2e1ba0ad3ddb9a510fe1410fbcf5c76d9e5cb231c25c05a78', | ||
'f684914938dedf40b64eaaeccddfed6e9a830b3f2505aa576b826593d43391cc', | ||
'fda45dc723ff174cd2c8cfd3dd42d3c8fd20f18f3fc5dc16913e3283b6195471', | ||
'a162df9f7653ad982e8f630c95c7f7c2bd42d38a1fd4ec4588f611fab4d19b53', | ||
'99d1be2407a19c0bfd5909d7a70cf7267877eaaf1987dc8789efeedb5a6993ad', | ||
'038b25a681b9df1757ee80b83641c8cf99b0943915d91ce053ece9a35a07a101', | ||
'250d3f281583c27f11b09d448273df1d4201cc8812b5478a468ba9548fa3a8fa', | ||
'3b8fea6db161183cbda2bfe5d9638070517209d9ff4c98d19212c7cef22a5bc7', | ||
'563291347309d03f40fa056a02390c44b95dfad668021acc1b18dded8d355c33', | ||
'0c95ae7a1be95740a5892465376efa322bc798f8790a560408f772e24651ec32', | ||
... | ||
... | ||
... | ||
... | ||
'0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098' ] } | ||
@@ -86,2 +74,4 @@ ``` | ||
max input address:1000 | ||
``` | ||
@@ -95,57 +85,45 @@ cli.utxo(['12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX']).then(console.log) | ||
[ { address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: 'ddd78924a1e15ad98b28342987d266e95bade122d4d066be6c5aaec91f172209', | ||
vout: 0, | ||
ts: 1439726931, | ||
txid: '48e76c0ba8b766a2e1ba0ad3ddb9a510fe1410fbcf5c76d9e5cb231c25c05a78', | ||
vout: 2225, | ||
scriptPubKey: '76a914119b098e2e980a229e139a9ed01a469e518e6f2688ac', | ||
amount: 0.0001, | ||
confirmations: 6, | ||
confirmationsFromCache: true }, | ||
amount: 0.00062175, | ||
satoshis: 62175, | ||
height: 436683, | ||
confirmations: 53 }, | ||
{ address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: 'a6be9f9f6c2194c9d593859e94a09a307ad4fd16179ea903de055c17b46a299c', | ||
txid: 'f684914938dedf40b64eaaeccddfed6e9a830b3f2505aa576b826593d43391cc', | ||
vout: 0, | ||
ts: 1417737772, | ||
scriptPubKey: '76a914119b098e2e980a229e139a9ed01a469e518e6f2688ac', | ||
amount: 0.0001, | ||
confirmations: 6, | ||
confirmationsFromCache: true }, | ||
amount: 0.0000175, | ||
satoshis: 1750, | ||
height: 425802, | ||
confirmations: 10934 }, | ||
{ address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: 'a3a6f902a51a2cbebede144e48a88c05e608c2cce28024041a5b9874013a1e2a', | ||
txid: 'fda45dc723ff174cd2c8cfd3dd42d3c8fd20f18f3fc5dc16913e3283b6195471', | ||
vout: 0, | ||
ts: 1395328322, | ||
scriptPubKey: '76a914119b098e2e980a229e139a9ed01a469e518e6f2688ac', | ||
amount: 0.00333, | ||
confirmations: 6, | ||
confirmationsFromCache: true }, | ||
amount: 0.00156973, | ||
satoshis: 156973, | ||
height: 420000, | ||
confirmations: 16736 }, | ||
{ address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: 'cea36d008badf5c7866894b191d3239de9582d89b6b452b596f1f1b76347f8cb', | ||
vout: 31, | ||
ts: 1395315555, | ||
txid: 'a162df9f7653ad982e8f630c95c7f7c2bd42d38a1fd4ec4588f611fab4d19b53', | ||
vout: 5, | ||
scriptPubKey: '76a914119b098e2e980a229e139a9ed01a469e518e6f2688ac', | ||
amount: 0.0001, | ||
confirmations: 6, | ||
confirmationsFromCache: true }, | ||
amount: 0.0002023, | ||
satoshis: 20230, | ||
height: 417969, | ||
confirmations: 18767 }, | ||
.... | ||
.... | ||
.... | ||
.... | ||
{ address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: 'dfdf0b375a987f17056e5e919ee6eadd87dad36c09c4016d4a03cea15e5c05e3', | ||
vout: 1, | ||
ts: 1357423766, | ||
scriptPubKey: '76a914119b098e2e980a229e139a9ed01a469e518e6f2688ac', | ||
amount: 0.00001337, | ||
confirmations: 6, | ||
confirmationsFromCache: true }, | ||
{ address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: 'd6be34ccf6edddc3cf69842dce99fe503bf632ba2c2adb0f95c63f6706ae0c52', | ||
vout: 1, | ||
ts: 1306768384, | ||
scriptPubKey: '76a914119b098e2e980a229e139a9ed01a469e518e6f2688ac', | ||
amount: 0.02, | ||
confirmations: 6, | ||
confirmationsFromCache: true }, | ||
{ address: '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX', | ||
txid: '0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098', | ||
vout: 0, | ||
ts: 1231469665, | ||
scriptPubKey: '410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac', | ||
amount: 50, | ||
confirmations: 6, | ||
confirmationsFromCache: true } ] | ||
satoshis: 2000000, | ||
height: 127659, | ||
confirmations: 309077 } ] | ||
``` | ||
@@ -152,0 +130,0 @@ |
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
27
288
0
0
17598
181
+ Added@you21979/array-util@0.0.1(transitive)
+ Added@you21979/promise-sleep@1.0.1(transitive)
+ Addedbacko2@1.0.2(transitive)
+ Addedbase64-arraybuffer@0.1.5(transitive)
+ Addedblob@0.0.4(transitive)
+ Addedbluebird@3.4.7(transitive)
+ Addedcomponent-emitter@1.2.0(transitive)
+ Addeddebug@2.2.0(transitive)
+ Addedengine.io-client@1.7.2(transitive)
+ Addedengine.io-parser@1.3.1(transitive)
+ Addedhas-binary@0.1.60.1.7(transitive)
+ Addedhas-cors@1.1.0(transitive)
+ Addedjson3@3.3.2(transitive)
+ Addedlimit-request-promise@0.1.2(transitive)
+ Addedms@0.7.1(transitive)
+ Addedparseuri@0.0.4(transitive)
+ Addedrequest-limitter@0.0.2(transitive)
+ Addedrequest-promise@4.1.1(transitive)
+ Addedrequest-promise-core@1.1.1(transitive)
+ Addedsocket.io-client@1.5.1(transitive)
+ Addedsocket.io-parser@2.3.1(transitive)
+ Addedstealthy-require@1.1.1(transitive)
+ Addedto-array@0.1.4(transitive)
+ Addedultron@1.0.2(transitive)
+ Addedws@1.1.1(transitive)
+ Addedwtf-8@1.0.0(transitive)
+ Addedxmlhttprequest-ssl@1.5.1(transitive)
+ Addedyeast@0.1.2(transitive)
- Removedbase64-arraybuffer@0.1.2(transitive)
- Removedblob@0.0.2(transitive)
- Removedbluebird@2.11.0(transitive)
- Removedcommander@0.6.1(transitive)
- Removeddebug@0.7.4(transitive)
- Removedengine.io-client@1.3.1(transitive)
- Removedengine.io-parser@1.0.6(transitive)
- Removedhas-binary-data@0.1.1(transitive)
- Removedhas-cors@1.0.3(transitive)
- Removedjson3@3.2.6(transitive)
- Removedlimit-request-promise@0.0.10(transitive)
- Removednan@0.3.2(transitive)
- Removedparseuri@0.0.2(transitive)
- Removedrequest-limitter@0.0.1(transitive)
- Removedrequest-promise@2.0.1(transitive)
- Removedsocket.io-client@1.0.6(transitive)
- Removedsocket.io-parser@2.2.0(transitive)
- Removedtinycolor@0.0.1(transitive)
- Removedto-array@0.1.3(transitive)
- Removedutf8@2.0.0(transitive)
- Removedws@0.4.31(transitive)
Updated@you21979/array-util@0.0.1
Updatedlimit-request-promise@0.1.*
Updatedsocket.io-client@1.5.*