Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xoh-xapi

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xoh-xapi - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

19

dist/constants/cmd.js

@@ -1,11 +0,8 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CREDIT = exports.BALANCE = exports.SELL_STOP = exports.BUY_STOP = exports.SELL_LIMIT = exports.BUY_LIMIT = exports.SELL = exports.BUY = void 0;
exports.BUY = 0;
exports.SELL = 1;
exports.BUY_LIMIT = 2;
exports.SELL_LIMIT = 3;
exports.BUY_STOP = 4;
exports.SELL_STOP = 5;
exports.BALANCE = 6;
exports.CREDIT = 7;
export var BUY = 0;
export var SELL = 1;
export var BUY_LIMIT = 2;
export var SELL_LIMIT = 3;
export var BUY_STOP = 4;
export var SELL_STOP = 5;
export var BALANCE = 6;
export var CREDIT = 7;

@@ -1,10 +0,7 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SUNDAY = exports.SATURDAY = exports.FRIDAY = exports.THURSDAY = exports.WEDNESDAY = exports.TUESDAY = exports.MONDAY = void 0;
exports.MONDAY = 1;
exports.TUESDAY = 2;
exports.WEDNESDAY = 3;
exports.THURSDAY = 4;
exports.FRIDAY = 5;
exports.SATURDAY = 6;
exports.SUNDAY = 7;
export var MONDAY = 1;
export var TUESDAY = 2;
export var WEDNESDAY = 3;
export var THURSDAY = 4;
export var FRIDAY = 5;
export var SATURDAY = 6;
export var SUNDAY = 7;

@@ -1,6 +0,3 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MARGIN_CFD = exports.MARGIN_CFD_LEVERAGED = exports.MARGIN_FOREX = void 0;
exports.MARGIN_FOREX = 101;
exports.MARGIN_CFD_LEVERAGED = 102;
exports.MARGIN_CFD = 103;
export var MARGIN_FOREX = 101;
export var MARGIN_CFD_LEVERAGED = 102;
export var MARGIN_CFD = 103;

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DELETE = exports.MODIFY = exports.CLOSE = exports.PENDING = exports.OPEN = void 0;
exports.OPEN = 0; //order open, used for opening orders
exports.PENDING = 1; //order pending, only used in the streaming getTrades command
exports.CLOSE = 2; //order close
exports.MODIFY = 3; //order modify, only used in the tradeTransaction command
exports.DELETE = 4; //order deleted
export var OPEN = 0; //order open, used for opening orders
export var PENDING = 1; //order pending, only used in the streaming getTrades command
export var CLOSE = 2; //order close
export var MODIFY = 3; //order modify, only used in the tradeTransaction command
export var DELETE = 4; //order deleted

@@ -1,12 +0,9 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PERIOD_MN1 = exports.PERIOD_W1 = exports.PERIOD_D1 = exports.PERIOD_H4 = exports.PERIOD_H1 = exports.PERIOD_M30 = exports.PERIOD_M15 = exports.PERIOD_M5 = exports.PERIOD_M1 = void 0;
exports.PERIOD_M1 = 1;
exports.PERIOD_M5 = 5;
exports.PERIOD_M15 = 15;
exports.PERIOD_M30 = 30;
exports.PERIOD_H1 = 60;
exports.PERIOD_H4 = 240;
exports.PERIOD_D1 = 1440;
exports.PERIOD_W1 = 10080;
exports.PERIOD_MN1 = 43200;
export var PERIOD_M1 = 1;
export var PERIOD_M5 = 5;
export var PERIOD_M15 = 15;
export var PERIOD_M30 = 30;
export var PERIOD_H1 = 60;
export var PERIOD_H4 = 240;
export var PERIOD_D1 = 1440;
export var PERIOD_W1 = 10080;
export var PERIOD_MN1 = 43200;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.POSITION_REJECTED = exports.POSITION_ACCEPTED = exports.POSITION_PENDING = exports.POSITION_ERROR = void 0;
exports.POSITION_ERROR = 1;
exports.POSITION_PENDING = 2;
exports.POSITION_ACCEPTED = 3;
exports.POSITION_REJECTED = 4;
export var POSITION_ERROR = 1;
export var POSITION_PENDING = 2;
export var POSITION_ACCEPTED = 3;
export var POSITION_REJECTED = 4;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PRICE_LEVEL_BASE = exports.PRICE_LEVEL_ALL = void 0;
exports.PRICE_LEVEL_ALL = -1;
exports.PRICE_LEVEL_BASE = 0;
export var PRICE_LEVEL_ALL = -1;
export var PRICE_LEVEL_BASE = 0;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PROFIT_CFD = exports.PROFIT_FOREX = void 0;
exports.PROFIT_FOREX = 5;
exports.PROFIT_CFD = 6;
export var PROFIT_FOREX = 5;
export var PROFIT_CFD = 6;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QUOTE_CROSS = exports.QUOTE_DEPTH = exports.QUOTE_FLOAT = exports.QUOTE_FIXED = void 0;
exports.QUOTE_FIXED = 1;
exports.QUOTE_FLOAT = 2;
exports.QUOTE_DEPTH = 3;
exports.QUOTE_CROSS = 4;
export var QUOTE_FIXED = 1;
export var QUOTE_FLOAT = 2;
export var QUOTE_DEPTH = 3;
export var QUOTE_CROSS = 4;

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.POSITION_REJECTED = exports.POSITION_ACCEPTED = exports.POSITION_PENDING = exports.POSITION_ERROR = void 0;
exports.POSITION_ERROR = 1;
exports.POSITION_PENDING = 2;
exports.POSITION_ACCEPTED = 3;
exports.POSITION_REJECTED = 4;
export var POSITION_ERROR = 1;
export var POSITION_PENDING = 2;
export var POSITION_ACCEPTED = 3;
export var POSITION_REJECTED = 4;

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SELL = exports.BUY = void 0;
exports.BUY = 0;
exports.SELL = 1;
export var BUY = 0;
export var SELL = 1;

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EURPLN = void 0;
exports.EURPLN = "EURPLN";
export var EURPLN = "EURPLN";

@@ -1,7 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.REQUEST_STATUS_REJECTED = exports.REQUEST_STATUS_ACCEPTED = exports.REQUEST_STATUS_PENDING = exports.REQUEST_STATUS_ERROR = void 0;
exports.REQUEST_STATUS_ERROR = 0; //error
exports.REQUEST_STATUS_PENDING = 1; //pending
exports.REQUEST_STATUS_ACCEPTED = 3; //The transaction has been executed successfully
exports.REQUEST_STATUS_REJECTED = 4; //The transaction has been rejected
export var REQUEST_STATUS_ERROR = 0; //error
export var REQUEST_STATUS_PENDING = 1; //pending
export var REQUEST_STATUS_ACCEPTED = 3; //The transaction has been executed successfully
export var REQUEST_STATUS_REJECTED = 4; //The transaction has been rejected

@@ -1,5 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.STATE_DELETED = exports.STATE_MODIFIED = void 0;
exports.STATE_MODIFIED = "Modified";
exports.STATE_DELETED = "Deleted";
export var STATE_MODIFIED = "Modified";
export var STATE_DELETED = "Deleted";

@@ -1,8 +0,5 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TRANS_DELETE = exports.TRANS_MODIFY = exports.TRANS_CLOSE = exports.TRANS_PENDING = exports.TRANS_OPEN = void 0;
exports.TRANS_OPEN = 0;
exports.TRANS_PENDING = 1;
exports.TRANS_CLOSE = 2;
exports.TRANS_MODIFY = 3;
exports.TRANS_DELETE = 4;
export var TRANS_OPEN = 0;
export var TRANS_PENDING = 1;
export var TRANS_CLOSE = 2;
export var TRANS_MODIFY = 3;
export var TRANS_DELETE = 4;

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -38,9 +37,6 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Request = exports.SocketManager = exports.createCustomTag = void 0;
function createCustomTag() {
export function createCustomTag() {
var tag = new Date().getMilliseconds();
return String(tag);
}
exports.createCustomTag = createCustomTag;
var SocketManager = /** @class */ (function () {

@@ -62,3 +58,3 @@ function SocketManager() {

}());
exports.SocketManager = SocketManager;
export { SocketManager };
var Request = /** @class */ (function () {

@@ -110,2 +106,2 @@ function Request(webSocket, body) {

}());
exports.Request = Request;
export { Request };

@@ -1,7 +0,2 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var Xapi_1 = __importDefault(require("./Xapi"));
exports.default = Xapi_1.default;
import Xapi from './Xapi';
export default Xapi;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -38,5 +37,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
Object.defineProperty(exports, "__esModule", { value: true });
var ws_1 = require("ws");
var periods_1 = require("./constants/periods");
import { WebSocket } from 'ws';
import { PERIOD_M1 } from './constants/periods';
var Streamer = /** @class */ (function () {

@@ -225,3 +223,3 @@ function Streamer(args) {

start: ((new Date().getTime()) - (1000 * (60 * 60))),
period: ((args.period === undefined) ? periods_1.PERIOD_M1 : args.period),
period: ((args.period === undefined) ? PERIOD_M1 : args.period),
})];

@@ -234,3 +232,3 @@ case 1:

end: (new Date().getTime()),
period: ((args.period === undefined) ? periods_1.PERIOD_M1 : args.period),
period: ((args.period === undefined) ? PERIOD_M1 : args.period),
})];

@@ -315,3 +313,3 @@ case 2:

this.socketOpen = false;
this.socket = new ws_1.WebSocket(this.host);
this.socket = new WebSocket(this.host);
this.requests = [];

@@ -331,2 +329,2 @@ (function () { return __awaiter(_this, void 0, void 0, function () {

}());
exports.default = Streamer;
export default Streamer;

@@ -1,2 +0,1 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -38,9 +37,5 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var ws_1 = require("ws");
var Streamer_1 = __importDefault(require("./Streamer"));
var helpers_1 = require("./helpers");
import { WebSocket } from 'ws';
import Streamer from './Streamer';
import { Request } from './helpers';
var Xapi = /** @class */ (function () {

@@ -128,3 +123,3 @@ /**

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "login",

@@ -142,3 +137,3 @@ arguments: {

_this.loginStatus = true;
_this.streamer = new Streamer_1.default({
_this.streamer = new Streamer({
streamSessionId: _this.streamSessionId,

@@ -176,3 +171,3 @@ host: _this.hostStream,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "logout"

@@ -198,3 +193,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getAllSymbols"

@@ -221,3 +216,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getCalendar"

@@ -244,3 +239,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getChartLastRequest",

@@ -267,3 +262,3 @@ arguments: {

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getChartRangeRequest",

@@ -290,3 +285,3 @@ arguments: {

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getCommissionDef",

@@ -311,3 +306,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getCurrentUserData"

@@ -331,3 +326,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getIbsHistory",

@@ -352,3 +347,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getMarginLevel"

@@ -372,3 +367,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getMarginTrade",

@@ -394,3 +389,3 @@ arguments: args,

args.end = (args.end === undefined) ? 0 : args.end;
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getNews",

@@ -415,3 +410,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getProfitCalculation",

@@ -436,3 +431,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getServerTime"

@@ -456,3 +451,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getStepRules"

@@ -476,3 +471,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getSymbol",

@@ -497,3 +492,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getTickPrices",

@@ -518,3 +513,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getTradeRecords",

@@ -540,3 +535,3 @@ arguments: args,

args.openedOnly = (args.openedOnly === undefined) ? false : args.openedOnly;
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getTrades",

@@ -562,3 +557,3 @@ arguments: args,

args.end = (args.end === undefined) ? 0 : args.end;
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getTradesHistory",

@@ -583,3 +578,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getTradingHours",

@@ -604,3 +599,3 @@ arguments: args,

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "getVersion"

@@ -624,3 +619,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "ping"

@@ -644,3 +639,3 @@ });

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "tradeTransaction",

@@ -667,3 +662,3 @@ arguments: {

return (new Promise(function (resolved, rejected) {
var request = new helpers_1.Request(_this.webSocket, {
var request = new Request(_this.webSocket, {
command: "tradeTransactionStatus",

@@ -714,6 +709,6 @@ arguments: args,

//set websocket
this.webSocket = new ws_1.WebSocket(this.host);
this.webSocket = new WebSocket(this.host);
}
return Xapi;
}());
exports.default = Xapi;
export default Xapi;
{
"name": "xoh-xapi",
"version": "2.0.1",
"version": "2.0.2",
"description": "X Open Hub API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc