"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isExchangesResponse = exports.isChainIdResponse = void 0;
const hasProps = (obj, ...props) => {
    if (!obj) {
        return false;
    }
    const keys = Reflect.ownKeys(obj);
    // @ts-ignore
    return props.every((prop) => keys.includes(prop));
};
const isChainIdResponse = (raw) => hasProps(raw, "chainId");
exports.isChainIdResponse = isChainIdResponse;
const isExchangesResponse = (raw) => {
    if (!Array.isArray(raw)) {
        return false;
    }
    else if (!raw.length) {
        return true;
    }
    return hasProps(raw[0], "id", "currency", "price", "amount", "blockNumber", "exchangeDate");
};
exports.isExchangesResponse = isExchangesResponse;
