Broadcast raw transactions to Bitcoin, Litecoin, Vertcoin and testnets.
npm install sendtximportsendtxfrom'sendtx';// Broadcast to Bitcoin testnet4 (default)consttxid=awaitsendtx(rawTxHex);// Broadcast to specific networkconsttxid=awaitsendtx(rawTxHex,'btc');// With custom optionsconsttxid=awaitsendtx(rawTxHex,'vtc',{endpoint: 'https://your-vertcoin-node/api/tx',timeout: 60000});# Broadcast to testnet4 (default)
sendtx 0200000001...
# Broadcast to mainnet
sendtx 0200000001... btc
# Show help
sendtx --help
# List networks
sendtx --networks| Network | Description | Endpoint |
|---|---|---|
btc | Bitcoin Mainnet | mempool.guide/api/tx |
tbtc3 | Bitcoin Testnet3 | mempool.guide/testnet/api/tx |
tbtc4 | Bitcoin Testnet4 | mempool.guide/testnet4/api/tx |
signet | Bitcoin Signet | mempool.guide/signet/api/tx |
ltc | Litecoin Mainnet | litecoinspace.org/api/tx |
vtc | Vertcoin | Requires custom endpoint |
Broadcast a raw transaction.
rawTx(string) - Raw transaction hexnetwork(string) - Network identifier (default:'tbtc4')options(object)endpoint(string) - Custom endpoint URLtimeout(number) - Request timeout in ms (default: 30000)
Returns: Promise<string> - Transaction ID
Returns object with all supported network configurations.
Check if a network is supported.
MIT