"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useArrakisLatestRanges = void 0;
var arkiverTypes_1 = require("../../gql/arkiverTypes");
var useSubgraphHelper_1 = require("./useSubgraphHelper");
var useArrakisLatestRanges = function (address, chain) {
    var _a, _b;
    var query = (0, arkiverTypes_1.useArrakisV2LatestRangesQuery)({
        context: { arkiver: 'arrakis' },
        variables: { address: address === null || address === void 0 ? void 0 : address.toLowerCase(), chain: chain || '' },
        pollInterval: 30000,
    });
    var error = query.error;
    // useError(error); // reduce errors while testing.
    return (0, useSubgraphHelper_1.useSubgraphHelper)(query, (_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.length);
};
exports.useArrakisLatestRanges = useArrakisLatestRanges;
//# sourceMappingURL=useArrakisLatestRanges.js.map