sendtx
v0.1.0
Published
Broadcast raw transactions to Bitcoin, Litecoin, Vertcoin and testnets
Maintainers
Readme
sendtx
Broadcast raw transactions to Bitcoin, Litecoin, Vertcoin and testnets.
Installation
npm install sendtxUsage
As a module
import sendtx from 'sendtx';
// Broadcast to Bitcoin testnet4 (default)
const txid = await sendtx(rawTxHex);
// Broadcast to specific network
const txid = await sendtx(rawTxHex, 'btc');
// With custom options
const txid = await sendtx(rawTxHex, 'vtc', {
endpoint: 'https://your-vertcoin-node/api/tx',
timeout: 60000
});As CLI
# Broadcast to testnet4 (default)
sendtx 0200000001...
# Broadcast to mainnet
sendtx 0200000001... btc
# Show help
sendtx --help
# List networks
sendtx --networksSupported 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 |
API
sendtx(rawTx, network?, options?)
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
getNetworks()
Returns object with all supported network configurations.
isSupported(network)
Check if a network is supported.
License
MIT
