Skip to content

Commit

Permalink
add blockchair
Browse files Browse the repository at this point in the history
  • Loading branch information
andkom committed Dec 20, 2018
1 parent 083fab0 commit 0866b17
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function pushtx(hex) {
return Promise.all([
services.btccom(hex),
services.bitpay(hex),
services.blockchair(hex),
services.blockchain(hex),
services.blockexplorer(hex),
services.localbitcoins(hex),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pushtx",
"version": "1.0.0",
"version": "1.0.1",
"description": "A JavaScript library for broadcasting Bitcoin raw transcations.",
"main": "index.js",
"dependencies": {
Expand Down
13 changes: 13 additions & 0 deletions services/blockchair.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const fetch = require('node-fetch')

module.exports = data => {
return fetch('https://api.blockchair.com/bitcoin/push/transaction', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({data})
}).then(r => {
return r.json()
})
}
1 change: 1 addition & 0 deletions services/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
btccom: require('./btccom'),
bitpay: require('./bitpay'),
blockchair: require('./blockchair'),
blockchain: require('./blockchain'),
blockexplorer: require('./blockexplorer'),
localbitcoins: require('./localbitcoins'),
Expand Down

0 comments on commit 0866b17

Please sign in to comment.