@parcl-finance/product-sdk
Version:
TypeScript SDK for interacting with Parcl's product APIs
43 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Market = void 0;
const defaults_1 = require("./constants/defaults");
const httpClient_1 = require("./httpClient");
class Market {
headers;
expressClient;
constructor(env) {
const headers = {};
this.headers = headers;
this.expressClient = new httpClient_1.HttpClient((0, defaults_1.getDefaultExpressApiUrl)(env), this.headers);
}
async getMarketBySymbol({ symbol }) {
const { market } = await this.expressClient.get({
path: `/market/${symbol}`,
});
return market;
}
async getMarketVolumesBySymbol({ symbol }) {
const { volumes } = await this.expressClient.get({
path: `/market/${symbol}/volumes`,
});
return volumes;
}
async getMarketFilterDistributions() {
const { distributions } = await this.expressClient.get({
path: `/market/market-filter-distribution`,
});
return distributions;
}
async getMarketsBySymbols({ symbols }) {
const { markets } = await this.expressClient.get({
path: `/market/symbols`,
params: {
symbols: symbols.join(","),
},
});
return markets;
}
}
exports.Market = Market;
//# sourceMappingURL=market.js.map