"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDefiEdgeLatestRanges = void 0;
var useError_1 = require("../useError");
var arkiverTypes_1 = require("../../gql/arkiverTypes");
var useSubgraphHelper_1 = require("./useSubgraphHelper");
var useDefiEdgeLatestRanges = function (address, chain) {
    var _a, _b, _c;
    // TODO
    var query = (0, arkiverTypes_1.useArrakisV2LatestRangesQuery)({
        context: { arkiver: 'defiedge' },
        variables: { address: address === null || address === void 0 ? void 0 : address.toLowerCase(), chain: chain || '' },
        pollInterval: 5000,
    });
    var error = query.error;
    (0, useError_1.useError)(error);
    return (0, useSubgraphHelper_1.useSubgraphHelper)(query, (_c = (_b = (_a = query === null || query === void 0 ? void 0 : query.data) === null || _a === void 0 ? void 0 : _a.VaultSnapshots) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__typename);
};
exports.useDefiEdgeLatestRanges = useDefiEdgeLatestRanges;
//# sourceMappingURL=useDefiEdgeLatestRanges.js.map