@barfinex/types
Version:
Core TypeScript type definitions and shared interfaces for the Barfinex ecosystem. Provides strongly-typed contracts for modules, services, and plugins.
229 lines • 6.57 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OrderType = exports.OrderSide = exports.OrderEnv = exports.WorkingEnv = exports.ALL_CANDLE_INTERVALS = exports.TimeFrame = exports.IndicatorType = exports.CandleActionStatus = exports.LogLevel = void 0;
/**
* Enum for log levels to control the verbosity of logging output.
*/
var LogLevel;
(function (LogLevel) {
/**
* `trace`: The most detailed level of logging, used to trace program execution step by step.
* Typically includes entering/exiting functions and detailed variable states.
*/
LogLevel["trace"] = "trace";
/**
* `debug`: Provides detailed information for debugging purposes.
* Useful for tracking the flow and state of the application.
*/
LogLevel["debug"] = "debug";
/**
* `info`: General information about the application's runtime behavior.
* Suitable for production logs to track key events like service startup or task completion.
*/
LogLevel["info"] = "info";
/**
* `warn`: Indicates a potential problem or unexpected situation.
* The application can continue running, but attention may be required.
*/
LogLevel["warn"] = "warn";
/**
* `error`: Logs errors that require attention but allow the application to continue running.
* Typically includes stack traces and error details.
*/
LogLevel["error"] = "error";
/**
* `fatal`: The highest severity level, used for critical issues.
* These errors often indicate that the application cannot continue running.
*/
LogLevel["fatal"] = "fatal";
/**
* `silent`: Disables all logging.
* Often used in testing or scenarios where logging is not needed.
*/
LogLevel["silent"] = "silent";
})(LogLevel || (exports.LogLevel = LogLevel = {}));
/**
* Enum representing actions that can be performed on a candle.
*/
var CandleActionStatus;
(function (CandleActionStatus) {
/**
* `create`: Create a new candle.
*/
CandleActionStatus["create"] = "create";
/**
* `update`: Update an existing candle.
*/
CandleActionStatus["update"] = "update";
/**
* `skipp`: Skip the candle action.
*/
CandleActionStatus["skipp"] = "skipp";
})(CandleActionStatus || (exports.CandleActionStatus = CandleActionStatus = {}));
/**
* Enum for different types of indicators used in trading strategies.
*/
var IndicatorType;
(function (IndicatorType) {
/**
* `line`: A line indicator.
*/
IndicatorType["line"] = "line";
/**
* `circle`: A circle indicator.
*/
IndicatorType["circle"] = "circle";
/**
* `lineSet`: A set of lines as an indicator.
*/
IndicatorType["lineSet"] = "lineSet";
/**
* `volumeprofile`: A volume profile indicator.
*/
IndicatorType["volumeprofile"] = "volumeprofile";
})(IndicatorType || (exports.IndicatorType = IndicatorType = {}));
/**
* Enum for defining time frames in trading.
*/
var TimeFrame;
(function (TimeFrame) {
/**
* `min1`: 1-minute time frame.
*/
TimeFrame["min1"] = "min1";
/**
* `min5`: 5-minute time frame.
*/
TimeFrame["min5"] = "min5";
/**
* `min15`: 15-minute time frame.
*/
TimeFrame["min15"] = "min15";
/**
* `min30`: 30-minute time frame.
*/
TimeFrame["min30"] = "min30";
/**
* `h1`: 1-hour time frame.
*/
TimeFrame["h1"] = "h1";
/**
* `h2`: 2-hour time frame.
*/
TimeFrame["h2"] = "h2";
/**
* `h4`: 4-hour time frame.
*/
TimeFrame["h4"] = "h4";
/**
* `day`: 1-day time frame.
*/
TimeFrame["day"] = "day";
})(TimeFrame || (exports.TimeFrame = TimeFrame = {}));
/**
* Все поддерживаемые интервалы для свечей (подкачка, backfill, подписки).
* Единый источник правды для списка интервалов.
*/
exports.ALL_CANDLE_INTERVALS = [
TimeFrame.min1,
TimeFrame.min5,
TimeFrame.min15,
TimeFrame.min30,
TimeFrame.h1,
TimeFrame.h2,
TimeFrame.h4,
TimeFrame.day,
];
/**
* Enum for working environments in the system.
*/
var WorkingEnv;
(function (WorkingEnv) {
/**
* `genetic`: Genetic environment for simulations or optimizations.
*/
WorkingEnv["genetic"] = "genetic";
/**
* `tester`: Testing environment.
*/
WorkingEnv["tester"] = "tester";
/**
* `production`: Production environment.
*/
WorkingEnv["production"] = "production";
})(WorkingEnv || (exports.WorkingEnv = WorkingEnv = {}));
/**
* Enum for order environments.
*/
var OrderEnv;
(function (OrderEnv) {
/**
* `Prod`: Production environment for orders.
*/
OrderEnv["Prod"] = "Prod";
/**
* `Test`: Testing environment for orders.
*/
OrderEnv["Test"] = "Test";
})(OrderEnv || (exports.OrderEnv = OrderEnv = {}));
/**
* Enum for order sides in trading.
*/
var OrderSide;
(function (OrderSide) {
/**
* `BUY`: Represents a buy order.
*/
OrderSide["BUY"] = "BUY";
/**
* `SELL`: Represents a sell order.
*/
OrderSide["SELL"] = "SELL";
})(OrderSide || (exports.OrderSide = OrderSide = {}));
/**
* Enum for order types in trading.
*/
var OrderType;
(function (OrderType) {
/**
* `LIMIT`: Limit order type.
*/
OrderType["LIMIT"] = "LIMIT";
/**
* `LIMIT_MAKER`: Limit maker order type.
*/
OrderType["LIMIT_MAKER"] = "LIMIT_MAKER";
/**
* `MARKET`: Market order type.
*/
OrderType["MARKET"] = "MARKET";
/**
* `STOP`: Stop order type.
*/
OrderType["STOP"] = "STOP";
/**
* `STOP_MARKET`: Stop market order type.
*/
OrderType["STOP_MARKET"] = "STOP_MARKET";
/**
* `STOP_LOSS_LIMIT`: Stop loss limit order type.
*/
OrderType["STOP_LOSS_LIMIT"] = "STOP_LOSS_LIMIT";
/**
* `TAKE_PROFIT_LIMIT`: Take profit limit order type.
*/
OrderType["TAKE_PROFIT_LIMIT"] = "TAKE_PROFIT_LIMIT";
/**
* `TAKE_PROFIT_MARKET`: Take profit market order type.
*/
OrderType["TAKE_PROFIT_MARKET"] = "TAKE_PROFIT_MARKET";
/**
* `TRAILING_STOP_MARKET`: Trailing stop market order type.
*/
OrderType["TRAILING_STOP_MARKET"] = "TRAILING_STOP_MARKET";
/**
* `TAKE_PROFIT`: Take profit order type.
*/
OrderType["TAKE_PROFIT"] = "TAKE_PROFIT";
})(OrderType || (exports.OrderType = OrderType = {}));
//# sourceMappingURL=common.interface.js.map