@trezor/connect
Version:
High-level javascript interface for Trezor hardware wallet.
22 lines • 790 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBinaryOptional = exports.getBinary = void 0;
const utils_1 = require("@trezor/utils");
const assets_1 = require("../../utils/assets");
const getBinary = ({ baseUrl, btcOnly, release }) => {
const fwUrl = release[btcOnly ? 'url_bitcoinonly' : 'url'];
const sanitizedBaseUrl = (0, utils_1.removeTrailingSlashes)(baseUrl);
const url = `${sanitizedBaseUrl}/${fwUrl}`;
return (0, assets_1.httpRequest)(url, 'binary');
};
exports.getBinary = getBinary;
const getBinaryOptional = async (props) => {
try {
return await (0, exports.getBinary)(props);
}
catch {
return null;
}
};
exports.getBinaryOptional = getBinaryOptional;
//# sourceMappingURL=getBinary.js.map