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