@metamask/keyring-utils
Version:
MetaMask Keyring utils
24 lines • 975 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBtcMainnetAddress = isBtcMainnetAddress;
exports.isBtcTestnetAddress = isBtcTestnetAddress;
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);
}
/**
* 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);
}
//# sourceMappingURL=address.cjs.map