"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useAggregatorVaultPageSubgraph = exports.useAggregatorVaultSubgraph = void 0;
var utils_1 = require("../../../utils");
var types_1 = require("../../../gql/types");
var router_1 = require("../../router");
var react_router_dom_1 = require("react-router-dom");
var useError_1 = require("../../useError");
var useAggregatorVaultSubgraph = function (chain, address) {
    var query = (0, types_1.useAggregatorVaultQuery)({
        context: { chain: chain },
        variables: { id: (0, utils_1.getSgId)(address, chain) },
        pollInterval: 20000,
    });
    var error = query.error;
    (0, useError_1.useError)(error);
    return query;
};
exports.useAggregatorVaultSubgraph = useAggregatorVaultSubgraph;
var useAggregatorVaultPageSubgraph = function () {
    var vaultAddress = (0, react_router_dom_1.useParams)().vaultAddress;
    var chain = (0, router_1.useChain)();
    return (0, exports.useAggregatorVaultSubgraph)(chain, vaultAddress);
};
exports.useAggregatorVaultPageSubgraph = useAggregatorVaultPageSubgraph;
//# sourceMappingURL=useAggregatorVaultSubgraph.js.map