Package Exports
- cuff
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cuff) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Overview
cuff is a promise-based suite of blockchain tools for tracking and analysis.
Bitcoin and Etherium are currently supported.
cuff uses John-David Dalton's future thinking '@std/esm' module for ES6 imports and exports on the back end; no transpilation step is required.
Installation
$ npm i --save cuff
or
$ yarn add cuff
You might need to add .esm-cache to your .gitignore
Examples
const { Bitcoin, Etherium } = require('cuff');
Bitcoin.blockchainInfo()
.then(data => {
console.info(data);
})
.catch(err => {
console.info('Error:', err)
});
Etherium.blockchainInfo()
.then(data => {
console.info(data);
})
.catch(err => {
console.info('Error:', err);
});Sample Output
{
"name": "BTC.main",
"height": 488733,
"hash": "0000000000000000005d1ec542fda806c5ee9a27781812e161f6ae135d1b825d",
"time": "2017-10-07T17:53:09.761213067Z",
"latest_url": "https://api.blockcypher.com/v1/btc/main/blocks/0000000000000000005d1ec542fda806c5ee9a27781812e161f6ae135d1b825d",
"previous_hash": "000000000000000000e39bd308bca48bb5339fc52ba246323870839f33c7421d",
"previous_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000000e39bd308bca48bb5339fc52ba246323870839f33c7421d",
"peer_count": 994,
"unconfirmed_count": 12845,
"high_fee_per_kb": 124705,
"medium_fee_per_kb": 110000,
"low_fee_per_kb": 90000,
"last_fork_height": 487958,
"last_fork_hash": "0000000000000000005c5028bbbc9f3d472e85144f2698ad9fb4e1dd95fc9d93"
}
{
"name": "ETH.main",
"height": 4345456,
"hash": "ca126aae76d6c7eb81f44503a0230e749ec73df8fb8cd4cac9680a9c2fcaf388",
"time": "2017-10-07T18:10:16.190462938Z",
"latest_url": "https://api.blockcypher.com/v1/eth/main/blocks/ca126aae76d6c7eb81f44503a0230e749ec73df8fb8cd4cac9680a9c2fcaf388",
"previous_hash": "c73f7b54989ae473fd35767f7cfa527cb5d08b8fcda1eeaa8830cddf06c471b4",
"previous_url": "https://api.blockcypher.com/v1/eth/main/blocks/c73f7b54989ae473fd35767f7cfa527cb5d08b8fcda1eeaa8830cddf06c471b4",
"peer_count": 200,
"unconfirmed_count": 7367,
"high_gas_price": 19729608499,
"medium_gas_price": 19729608499,
"low_gas_price": 5000000000,
"last_fork_height": 4345407,
"last_fork_hash": "9b6c0ecb62cf8fdd20e8d7314837d03fa36778516405dd8a85e71dd5730adba3"
}The Future
cuff's philosophy is to maintain currency with the avant-garde progress of the trustworthy economy. And we are committed to provide simple and clear interfaces for the developer.
More extensive functionality will be forthcoming.
Have fun!
Gerry Gold
October 2017