"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDefiEdgeVaultArkiver = void 0;
var useError_1 = require("../useError");
var defiedgeTypes_1 = require("../../gql/defiedgeTypes");
var useSubgraphHelper_1 = require("./useSubgraphHelper");
var useDefiEdgeVaultArkiver = function (address, chain) {
    var _a, _b, _c;
    var query = (0, defiedgeTypes_1.useDefiedgeVaultQuery)({
        context: { arkiver: 'defiedge' },
        variables: { address: address === null || address === void 0 ? void 0 : address.toLowerCase(), chain: chain || '' },
        pollInterval: 20000,
    });
    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.Vaults) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.address);
};
exports.useDefiEdgeVaultArkiver = useDefiEdgeVaultArkiver;
//# sourceMappingURL=useDefiEdgeVaultArkiver.js.map