"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const rest_1 = __importDefault(require("./rest"));
/**
 * @description REST endpoints for data unrelated to a particular address.
 */
class MarketsClient extends rest_1.default {
    async getAssets() {
        const uri = '/v4/assets';
        return this.get(uri);
    }
    async getPerpetualMarkets(market) {
        const uri = '/v4/perpetualMarkets';
        return this.get(uri, { ticker: market });
    }
    async getPerpetualMarketOrderbook(market) {
        const uri = `/v4/orderbooks/perpetualMarket/${market}`;
        return this.get(uri);
    }
    async getPerpetualMarketTrades(market, startingBeforeOrAtHeight, startingBeforeOrAt, limit, page) {
        const uri = `/v4/trades/perpetualMarket/${market}`;
        return this.get(uri, {
            createdBeforeOrAtHeight: startingBeforeOrAtHeight,
            createdBeforeOrAt: startingBeforeOrAt,
            limit,
            page,
        });
    }
    async getPerpetualMarketCandles(market, resolution, fromISO, toISO, limit) {
        const uri = `/v4/candles/perpetualMarkets/${market}`;
        return this.get(uri, {
            resolution,
            fromISO,
            toISO,
            limit,
        });
    }
    async getPerpetualMarketHistoricalFunding(market, effectiveBeforeOrAt, effectiveBeforeOrAtHeight, limit) {
        const uri = `/v4/historicalFunding/${market}`;
        return this.get(uri, {
            effectiveBeforeOrAt,
            effectiveBeforeOrAtHeight,
            limit,
        });
    }
    async getPerpetualMarketSparklines(period = constants_1.TimePeriod.ONE_DAY) {
        const uri = '/v4/sparklines';
        return this.get(uri, {
            timePeriod: period,
        });
    }
}
exports.default = MarketsClient;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2V0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jbGllbnRzL21vZHVsZXMvbWFya2V0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUEwQ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