@nktkas/hyperliquid
Version:
Hyperliquid API SDK for all major JS runtimes, written in TypeScript.
100 lines • 4.59 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PerpDeployAuctionStatusResponse = exports.PerpDeployAuctionStatusRequest = void 0;
exports.perpDeployAuctionStatus = perpDeployAuctionStatus;
const v = __importStar(require("valibot"));
// ============================================================
// API Schemas
// ============================================================
const _schemas_js_1 = require("../../_schemas.js");
/**
* Request for the status of the perpetual deploy auction.
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-information-about-the-perp-deploy-auction
*/
exports.PerpDeployAuctionStatusRequest = (() => {
return v.pipe(v.object({
/** Type of request. */
type: v.pipe(v.literal("perpDeployAuctionStatus"), v.description("Type of request.")),
}), v.description("Request for the status of the perpetual deploy auction."));
})();
/**
* Status of the perpetual deploy auction.
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-information-about-the-perp-deploy-auction
*/
exports.PerpDeployAuctionStatusResponse = (() => {
return v.pipe(v.object({
/** Current gas. */
currentGas: v.pipe(v.nullable(_schemas_js_1.UnsignedDecimal), v.description("Current gas.")),
/** Duration in seconds. */
durationSeconds: v.pipe(_schemas_js_1.UnsignedInteger, v.description("Duration in seconds.")),
/** Ending gas. */
endGas: v.pipe(v.nullable(_schemas_js_1.UnsignedDecimal), v.description("Ending gas.")),
/** Starting gas. */
startGas: v.pipe(_schemas_js_1.UnsignedDecimal, v.description("Starting gas.")),
/** Auction start time (seconds since epoch). */
startTimeSeconds: v.pipe(_schemas_js_1.UnsignedInteger, v.description("Auction start time (seconds since epoch).")),
}), v.description("Status of the perpetual deploy auction."));
})();
/**
* Request for the status of the perpetual deploy auction.
*
* @param config - General configuration for Info API requests.
* @param signal - [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to cancel the request.
*
* @returns Status of the perpetual deploy auction.
*
* @throws {ValiError} When the request parameters fail validation (before sending).
* @throws {TransportError} When the transport layer throws an error.
*
* @example
* ```ts
* import { HttpTransport } from "@nktkas/hyperliquid";
* import { perpDeployAuctionStatus } from "@nktkas/hyperliquid/api/info";
*
* const transport = new HttpTransport(); // or `WebSocketTransport`
*
* const data = await perpDeployAuctionStatus({ transport });
* ```
*
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-information-about-the-perp-deploy-auction
*/
function perpDeployAuctionStatus(config, signal) {
const request = v.parse(exports.PerpDeployAuctionStatusRequest, {
type: "perpDeployAuctionStatus",
});
return config.transport.request("info", request, signal);
}
//# sourceMappingURL=perpDeployAuctionStatus.js.map