"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultHlTransport = getDefaultHlTransport;
exports.getHlInfoClient = getHlInfoClient;
exports.isHlAccountActive = isHlAccountActive;
var tslib_1 = require("tslib");
var hl = tslib_1.__importStar(require("@nktkas/hyperliquid"));
function getDefaultHlTransport(extraOptions) {
    var _a;
    if (extraOptions === void 0) { extraOptions = []; }
    return new ((_a = hl.HttpTransport).bind.apply(_a, tslib_1.__spreadArray([void 0], extraOptions, false)))();
}
function getHlInfoClient(transport) {
    if (transport === void 0) { transport = getDefaultHlTransport(); }
    return new hl.InfoClient({ transport: transport });
}
function isHlAccountActive(account) {
    return tslib_1.__awaiter(this, void 0, void 0, function () {
        var client, userRole;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    client = getHlInfoClient();
                    return [4, client.userRole({ user: account })];
                case 1:
                    userRole = _a.sent();
                    return [2, userRole.role !== "missing"];
            }
        });
    });
}
//# sourceMappingURL=HyperLiquidUtils.js.map