import { __awaiter, __generator, __spreadArray } from "tslib";
import * as hl from "@nktkas/hyperliquid";
export function getDefaultHlTransport(extraOptions) {
    var _a;
    if (extraOptions === void 0) { extraOptions = []; }
    return new ((_a = hl.HttpTransport).bind.apply(_a, __spreadArray([void 0], extraOptions, false)))();
}
export function getHlInfoClient(transport) {
    if (transport === void 0) { transport = getDefaultHlTransport(); }
    return new hl.InfoClient({ transport: transport });
}
export function isHlAccountActive(account) {
    return __awaiter(this, void 0, void 0, function () {
        var client, userRole;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    client = getHlInfoClient();
                    return [4 /*yield*/, client.userRole({ user: account })];
                case 1:
                    userRole = _a.sent();
                    return [2 /*return*/, userRole.role !== "missing"];
            }
        });
    });
}
//# sourceMappingURL=HyperLiquidUtils.js.map