@riocrypto/common 1.0.1900 → 1.0.1901

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -331,6 +331,13 @@ export * from "./types/CEP-status";
331
331
  export * from "./types/fx-sub-trade";
332
332
  export * from "./types/fx-sub-trade-status";
333
333
  export * from "./types/fx-sub-trade-type";
334
+ export * from "./types/external-trade";
335
+ export * from "./types/external-trade-status";
336
+ export * from "./types/external-trade-type";
337
+ export * from "./types/external-trading-algorithm";
338
+ export * from "./types/external-trading-algorithm-status";
339
+ export * from "./types/external-trading-algorithm-type";
340
+ export * from "./types/external-trading-provider";
334
341
  export * from "./classes/KYCFieldClass";
335
342
  export * from "./classes/KYCFileClass";
336
343
  export * from "./classes/CountryAsset";
package/build/index.js CHANGED
@@ -347,6 +347,13 @@ __exportStar(require("./types/CEP-status"), exports);
347
347
  __exportStar(require("./types/fx-sub-trade"), exports);
348
348
  __exportStar(require("./types/fx-sub-trade-status"), exports);
349
349
  __exportStar(require("./types/fx-sub-trade-type"), exports);
350
+ __exportStar(require("./types/external-trade"), exports);
351
+ __exportStar(require("./types/external-trade-status"), exports);
352
+ __exportStar(require("./types/external-trade-type"), exports);
353
+ __exportStar(require("./types/external-trading-algorithm"), exports);
354
+ __exportStar(require("./types/external-trading-algorithm-status"), exports);
355
+ __exportStar(require("./types/external-trading-algorithm-type"), exports);
356
+ __exportStar(require("./types/external-trading-provider"), exports);
350
357
  __exportStar(require("./classes/KYCFieldClass"), exports);
351
358
  __exportStar(require("./classes/KYCFileClass"), exports);
352
359
  __exportStar(require("./classes/CountryAsset"), exports);
@@ -0,0 +1,9 @@
1
+ export declare enum ExternalTradeStatus {
2
+ PendingApproval = "pendingApproval",
3
+ Trading = "trading",
4
+ Completed = "completed",
5
+ Cancelled = "cancelled",
6
+ Failed = "failed",
7
+ PendingExecutionThreshold = "pendingExecutionThreshold",
8
+ WaitingForFunds = "waitingForFunds"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExternalTradeStatus = void 0;
4
+ var ExternalTradeStatus;
5
+ (function (ExternalTradeStatus) {
6
+ ExternalTradeStatus["PendingApproval"] = "pendingApproval";
7
+ ExternalTradeStatus["Trading"] = "trading";
8
+ ExternalTradeStatus["Completed"] = "completed";
9
+ ExternalTradeStatus["Cancelled"] = "cancelled";
10
+ ExternalTradeStatus["Failed"] = "failed";
11
+ ExternalTradeStatus["PendingExecutionThreshold"] = "pendingExecutionThreshold";
12
+ ExternalTradeStatus["WaitingForFunds"] = "waitingForFunds";
13
+ })(ExternalTradeStatus = exports.ExternalTradeStatus || (exports.ExternalTradeStatus = {}));
@@ -0,0 +1,4 @@
1
+ export declare enum ExternalTradeType {
2
+ Market = "market",
3
+ Limit = "limit"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExternalTradeType = void 0;
4
+ var ExternalTradeType;
5
+ (function (ExternalTradeType) {
6
+ ExternalTradeType["Market"] = "market";
7
+ ExternalTradeType["Limit"] = "limit";
8
+ })(ExternalTradeType = exports.ExternalTradeType || (exports.ExternalTradeType = {}));
@@ -0,0 +1,27 @@
1
+ import { ExternalTradeStatus } from "./external-trade-status";
2
+ import { ExternalTradeType } from "./external-trade-type";
3
+ import { ExternalTradingProvider } from "./external-trading-provider";
4
+ import { Fiat } from "./fiat";
5
+ import { Side } from "./side";
6
+ export interface ExternalTrade {
7
+ id: string;
8
+ createdAt: Date;
9
+ providerOrderId?: string;
10
+ type: ExternalTradeType;
11
+ side: Side;
12
+ provider: ExternalTradingProvider;
13
+ originCurrency: Fiat | Crypto;
14
+ originAmount: number;
15
+ destinationCurrency: Fiat | Crypto;
16
+ destinationAmount: number;
17
+ amountTraded: number;
18
+ limitPrice?: number;
19
+ actualPrice?: number;
20
+ status: ExternalTradeStatus;
21
+ providerOptions?: {
22
+ emarkets?: {
23
+ orderType?: "TOD" | "SPT" | "TOM";
24
+ };
25
+ };
26
+ externalTradingAlgorithmId?: string;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export declare enum ExternalTradingAlgorithmStatus {
2
+ Running = "running",
3
+ Stopped = "stopped",
4
+ Completed = "complete",
5
+ Failed = "failed",
6
+ WaitingForFunds = "waitingForFunds",
7
+ Stopping = "stopping"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExternalTradingAlgorithmStatus = void 0;
4
+ var ExternalTradingAlgorithmStatus;
5
+ (function (ExternalTradingAlgorithmStatus) {
6
+ ExternalTradingAlgorithmStatus["Running"] = "running";
7
+ ExternalTradingAlgorithmStatus["Stopped"] = "stopped";
8
+ ExternalTradingAlgorithmStatus["Completed"] = "complete";
9
+ ExternalTradingAlgorithmStatus["Failed"] = "failed";
10
+ ExternalTradingAlgorithmStatus["WaitingForFunds"] = "waitingForFunds";
11
+ ExternalTradingAlgorithmStatus["Stopping"] = "stopping";
12
+ })(ExternalTradingAlgorithmStatus = exports.ExternalTradingAlgorithmStatus || (exports.ExternalTradingAlgorithmStatus = {}));
@@ -0,0 +1,3 @@
1
+ export declare enum ExternalTradingAlgorithmType {
2
+ TopOfBook = "top-of-book"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExternalTradingAlgorithmType = void 0;
4
+ var ExternalTradingAlgorithmType;
5
+ (function (ExternalTradingAlgorithmType) {
6
+ ExternalTradingAlgorithmType["TopOfBook"] = "top-of-book";
7
+ })(ExternalTradingAlgorithmType = exports.ExternalTradingAlgorithmType || (exports.ExternalTradingAlgorithmType = {}));
@@ -0,0 +1,27 @@
1
+ import { ExternalTradingAlgorithmStatus } from "./external-trading-algorithm-status";
2
+ import { ExternalTradingAlgorithmType } from "./external-trading-algorithm-type";
3
+ import { ExternalTradingProvider } from "./external-trading-provider";
4
+ import { Fiat } from "./fiat";
5
+ export interface ExternalTradingAlgorithm {
6
+ id: string;
7
+ createdAt: Date;
8
+ type: ExternalTradingAlgorithmType;
9
+ provider: ExternalTradingProvider;
10
+ status: ExternalTradingAlgorithmStatus;
11
+ originAmount: number;
12
+ originCurrency: Fiat | Crypto;
13
+ destinationAmount: number;
14
+ destinationCurrency: Fiat | Crypto;
15
+ maxAmountToTrade: number;
16
+ allowAfterHoursTrading: boolean;
17
+ isExecuting: boolean;
18
+ actualPrice?: number;
19
+ algoOptions: {
20
+ topOfBook: {
21
+ tradeTTL: number;
22
+ limitPriceDifference?: number;
23
+ limitPrice?: number;
24
+ };
25
+ };
26
+ externalTradeIds: string[];
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export declare enum ExternalTradingProvider {
2
+ Emarkets = "emarkets",
3
+ Nonco = "nonco",
4
+ Binance = "binance"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExternalTradingProvider = void 0;
4
+ var ExternalTradingProvider;
5
+ (function (ExternalTradingProvider) {
6
+ ExternalTradingProvider["Emarkets"] = "emarkets";
7
+ ExternalTradingProvider["Nonco"] = "nonco";
8
+ ExternalTradingProvider["Binance"] = "binance";
9
+ })(ExternalTradingProvider = exports.ExternalTradingProvider || (exports.ExternalTradingProvider = {}));
@@ -13,6 +13,7 @@ export interface FXTrade {
13
13
  averageOfferedPrice: number;
14
14
  price: number;
15
15
  provider: FXProvider;
16
+ partiallyFilledOrderTTL: number;
16
17
  executedTrades: {
17
18
  amount: number;
18
19
  provider: FXProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1900",
3
+ "version": "1.0.1901",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",