"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.broadcast = void 0;
const node_fetch_1 = __importDefault(require("node-fetch"));
async function broadcast(rawTx, network = "main") {
    const data = {
        txhex: rawTx
    };
    const res = await (0, node_fetch_1.default)(`https://api.whatsonchain.com/v1/bsv/${network}/tx/raw`, {
        method: "POST",
        headers: {
            "Content-Type": "application/json"
        },
        body: JSON.stringify(data)
    });
    return res.json();
}
exports.broadcast = broadcast;
//# sourceMappingURL=whatsonchain.js.map