@atomic-utils/clients
Version:
42 lines • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StrategyClient = void 0;
const baseClient_1 = require("./baseClient");
/**
* Strategy service client
*/
class StrategyClient extends baseClient_1.BaseClient {
/**
* Retrieves the high-level information for the given strategy
*
* @param strategyName The name of the strategy
* @returns {Promise<StrategyResponse>}
*/
getStrategy(strategyName) {
return this.get(`/${strategyName}`);
}
/**
* Retrieves the current state for the given strategy
*
* @param strategyName The name of the strategy
* @returns {Promise<StrategyStateResponse>}
*/
getStrategyState(strategyName) {
return this.get(`/${strategyName}/state`);
}
/**
* Retrieves the trades for the given strategy, with optional filters for start/end date
*
* @param strategyName The name of the strategy
* @param options Optional filters for start/end date
* @returns {Promise<StrategyTradesResponse>}
*/
getStrategyTrades(strategyName, { startDate, endDate } = {}) {
return this.get(`/${strategyName}/trades`, {
start_date: startDate,
end_date: endDate,
});
}
}
exports.StrategyClient = StrategyClient;
//# sourceMappingURL=strategyClient.js.map