"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const web3Utils = __importStar(require("web3-utils"));
const ensure_1 = require("../guards/ensure");
exports.isAddress = (address) => `${address}`.length === 42 &&
    web3Utils.isAddress(`${address}`) &&
    web3Utils.isHexStrict(`${address}`);
exports.ensureAddress = (address) => ensure_1.ensure(exports.isAddress(address), `${address} is not a vaild address`, address);
