UNPKG

@metamask/keyring-utils

Version:
25 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isBtcTestnetAddress = exports.isBtcMainnetAddress = void 0; const bitcoin_address_validation_1 = require("bitcoin-address-validation"); /** * Returns whether an address is on the Bitcoin mainnet. * * @param address - The address to check. * @returns `true` if the address is on the Bitcoin mainnet, `false` otherwise. */ function isBtcMainnetAddress(address) { return (0, bitcoin_address_validation_1.validate)(address, bitcoin_address_validation_1.Network.mainnet); } exports.isBtcMainnetAddress = isBtcMainnetAddress; /** * Returns whether an address is on the Bitcoin testnet. * * @param address - The address to check. * @returns `true` if the address is on the Bitcoin testnet, `false` otherwise. */ function isBtcTestnetAddress(address) { return (0, bitcoin_address_validation_1.validate)(address, bitcoin_address_validation_1.Network.testnet); } exports.isBtcTestnetAddress = isBtcTestnetAddress; //# sourceMappingURL=address.cjs.map