MerlinB / bsv-pay

Broadcast bitcoin transactions to miners

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bsv-pay

NPM Package

Broadcast bitcoin transactions to miners

Current supported services:

  • mattercloud
  • matterpool
  • mempool
  • taal
  • whatsonchain

Use

npm install bsv-pay

const BsvPay = require('bsv-pay')

const pay = new BsvPay({
    fetchFunc: require('node-fetch'),  // Node.js
    // fetchFunc: fetch, // Browser
    mattercloud: {
        api_key: ''
    },
    mempool: {
        token: ''
    },
    // whatsonchain: false // To disable specific service
})
const { txid } = await pay.broadcast({ tx, verbose: false })
const { valid } = await pay.status({ txid, verbose: true })
pay.feePerKb()

Tests

npm run test

About

Broadcast bitcoin transactions to miners

License:MIT License


Languages

Language:JavaScript 100.0%