@chorus-one/ethereum
Version:
All-in-one toolkit for building staking dApps on Ethereum network
19 lines (18 loc) • 720 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCompoundingAddress = exports.isStandardAddress = void 0;
const ethereumConfigNetwork_1 = require("../types/ethereumConfigNetwork");
/**
* Validates if an address is a standard Ethereum address (0x01 withdrawal credentials)
*/
function isStandardAddress(address) {
return ethereumConfigNetwork_1.ADDRESS_REGEX.test(address);
}
exports.isStandardAddress = isStandardAddress;
/**
* Validates if an address uses compounding withdrawal credentials (0x02)
*/
function isCompoundingAddress(address) {
return ethereumConfigNetwork_1.COMPOUNDING_ADDRESS_REGEX.test(address);
}
exports.isCompoundingAddress = isCompoundingAddress;