@metamask/keyring-utils
Version:
MetaMask Keyring utils
20 lines • 672 B
JavaScript
import { validate, Network } from "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.
*/
export function isBtcMainnetAddress(address) {
return validate(address, 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.
*/
export function isBtcTestnetAddress(address) {
return validate(address, Network.testnet);
}
//# sourceMappingURL=address.mjs.map