const WebSocket = require('ws');
const ws = new WebSocket(
"wss://api.blxrbdn.com/ws",
"Authorization" : <YOUR-AUTHORIZATION-HEADER>
rejectUnauthorized: false,
ws.send(`{"jsonrpc": "2.0", "id": 1, "method": "blxr_tx", "params": {"transaction": "f86b0184...e0b58219"}}`);
// ws.send(`{"jsonrpc": "2.0", "id": 1, "method": "blxr_tx", "params": {"transaction": "f86b0184...e0b58219", "blockchain_network": "BSC-Mainnet"}}`);
// or use a variable for the transaction string:
// rawTx = "f86b0184...e0b58219";
// ws.send(`{"jsonrpc": "2.0", "id": 1, "method": "blxr_tx", "params": {"transaction": "${rawTx}"}}`);
function handle(response) {
console.log(response.toString()); // or process it generally
ws.on('message', handle);