@riocrypto/common 1.0.2197 → 1.0.2198
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DeferredPaymentType } from "../types/deferred-payment-type";
|
|
2
2
|
import { Side } from "../types/side";
|
|
3
3
|
export declare const BuyOrderStatusRanking: {
|
|
4
|
+
awaitingTimeInForceToStart: number;
|
|
4
5
|
awaitingLimitPriceCondition: number;
|
|
5
6
|
created: number;
|
|
6
7
|
addressCheckPassed: number;
|
|
@@ -13,6 +14,7 @@ export declare const BuyOrderStatusRanking: {
|
|
|
13
14
|
complete: number;
|
|
14
15
|
};
|
|
15
16
|
export declare const SellOrderStatusRanking: {
|
|
17
|
+
awaitingTimeInForceToStart: number;
|
|
16
18
|
awaitingLimitPriceCondition: number;
|
|
17
19
|
created: number;
|
|
18
20
|
depositAddressCreated: number;
|
|
@@ -26,6 +28,7 @@ export declare const SellOrderStatusRanking: {
|
|
|
26
28
|
complete: number;
|
|
27
29
|
};
|
|
28
30
|
export declare const AsyncBuyOrderStatusRanking: {
|
|
31
|
+
awaitingTimeInForceToStart: number;
|
|
29
32
|
awaitingLimitPriceCondition: number;
|
|
30
33
|
created: number;
|
|
31
34
|
addressCheckPassed: number;
|
|
@@ -38,6 +41,7 @@ export declare const AsyncBuyOrderStatusRanking: {
|
|
|
38
41
|
complete: number;
|
|
39
42
|
};
|
|
40
43
|
export declare const AsyncSellOrderStatusRanking: {
|
|
44
|
+
awaitingTimeInForceToStart: number;
|
|
41
45
|
awaitingLimitPriceCondition: number;
|
|
42
46
|
created: number;
|
|
43
47
|
depositAddressCreated: number;
|
|
@@ -51,6 +55,7 @@ export declare const AsyncSellOrderStatusRanking: {
|
|
|
51
55
|
complete: number;
|
|
52
56
|
};
|
|
53
57
|
export declare const getOrderStatusRanking: (side: Side, deferredPaymentType: DeferredPaymentType) => {
|
|
58
|
+
awaitingTimeInForceToStart: number;
|
|
54
59
|
awaitingLimitPriceCondition: number;
|
|
55
60
|
created: number;
|
|
56
61
|
addressCheckPassed: number;
|
|
@@ -62,6 +67,7 @@ export declare const getOrderStatusRanking: (side: Side, deferredPaymentType: De
|
|
|
62
67
|
filled: number;
|
|
63
68
|
complete: number;
|
|
64
69
|
} | {
|
|
70
|
+
awaitingTimeInForceToStart: number;
|
|
65
71
|
awaitingLimitPriceCondition: number;
|
|
66
72
|
created: number;
|
|
67
73
|
depositAddressCreated: number;
|
|
@@ -74,6 +80,7 @@ export declare const getOrderStatusRanking: (side: Side, deferredPaymentType: De
|
|
|
74
80
|
awaitingPayout: number;
|
|
75
81
|
complete: number;
|
|
76
82
|
} | {
|
|
83
|
+
awaitingTimeInForceToStart: number;
|
|
77
84
|
awaitingLimitPriceCondition: number;
|
|
78
85
|
created: number;
|
|
79
86
|
addressCheckPassed: number;
|
|
@@ -85,6 +92,7 @@ export declare const getOrderStatusRanking: (side: Side, deferredPaymentType: De
|
|
|
85
92
|
processing: number;
|
|
86
93
|
complete: number;
|
|
87
94
|
} | {
|
|
95
|
+
awaitingTimeInForceToStart: number;
|
|
88
96
|
awaitingLimitPriceCondition: number;
|
|
89
97
|
created: number;
|
|
90
98
|
depositAddressCreated: number;
|
|
@@ -6,55 +6,59 @@ const order_status_1 = require("../types/order-status");
|
|
|
6
6
|
const side_1 = require("../types/side");
|
|
7
7
|
// Does not include all possible order statuses, just for a happy path flow
|
|
8
8
|
exports.BuyOrderStatusRanking = {
|
|
9
|
-
[order_status_1.OrderStatus.
|
|
10
|
-
[order_status_1.OrderStatus.
|
|
11
|
-
[order_status_1.OrderStatus.
|
|
12
|
-
[order_status_1.OrderStatus.
|
|
13
|
-
[order_status_1.OrderStatus.
|
|
14
|
-
[order_status_1.OrderStatus.
|
|
15
|
-
[order_status_1.OrderStatus.
|
|
16
|
-
[order_status_1.OrderStatus.LiquiditySourced]: 7,
|
|
17
|
-
[order_status_1.OrderStatus.Filled]: 8,
|
|
18
|
-
[order_status_1.OrderStatus.Complete]: 10,
|
|
19
|
-
};
|
|
20
|
-
exports.SellOrderStatusRanking = {
|
|
21
|
-
[order_status_1.OrderStatus.AwaitingLimitPriceCondition]: 0,
|
|
22
|
-
[order_status_1.OrderStatus.Created]: 1,
|
|
23
|
-
[order_status_1.OrderStatus.DepositAddressCreated]: 2,
|
|
24
|
-
[order_status_1.OrderStatus.AwaitingBankPayoutDetails]: 3,
|
|
25
|
-
[order_status_1.OrderStatus.BankPayoutDetailsAdded]: 4,
|
|
26
|
-
[order_status_1.OrderStatus.AwaitingPayment]: 5,
|
|
27
|
-
[order_status_1.OrderStatus.DepositConfirmed]: 6,
|
|
9
|
+
[order_status_1.OrderStatus.AwaitingTimeInForceToStart]: 0,
|
|
10
|
+
[order_status_1.OrderStatus.AwaitingLimitPriceCondition]: 1,
|
|
11
|
+
[order_status_1.OrderStatus.Created]: 2,
|
|
12
|
+
[order_status_1.OrderStatus.AddressCheckPassed]: 3,
|
|
13
|
+
[order_status_1.OrderStatus.AwaitingPayment]: 4,
|
|
14
|
+
[order_status_1.OrderStatus.Processing]: 5,
|
|
15
|
+
[order_status_1.OrderStatus.Paid]: 6,
|
|
28
16
|
[order_status_1.OrderStatus.SourcingLiquidity]: 7,
|
|
29
17
|
[order_status_1.OrderStatus.LiquiditySourced]: 8,
|
|
30
|
-
[order_status_1.OrderStatus.
|
|
18
|
+
[order_status_1.OrderStatus.Filled]: 9,
|
|
31
19
|
[order_status_1.OrderStatus.Complete]: 10,
|
|
32
20
|
};
|
|
33
|
-
exports.
|
|
34
|
-
[order_status_1.OrderStatus.
|
|
35
|
-
[order_status_1.OrderStatus.
|
|
36
|
-
[order_status_1.OrderStatus.
|
|
37
|
-
[order_status_1.OrderStatus.
|
|
38
|
-
[order_status_1.OrderStatus.
|
|
39
|
-
[order_status_1.OrderStatus.
|
|
40
|
-
[order_status_1.OrderStatus.
|
|
41
|
-
[order_status_1.OrderStatus.
|
|
42
|
-
[order_status_1.OrderStatus.
|
|
43
|
-
[order_status_1.OrderStatus.
|
|
21
|
+
exports.SellOrderStatusRanking = {
|
|
22
|
+
[order_status_1.OrderStatus.AwaitingTimeInForceToStart]: 0,
|
|
23
|
+
[order_status_1.OrderStatus.AwaitingLimitPriceCondition]: 1,
|
|
24
|
+
[order_status_1.OrderStatus.Created]: 2,
|
|
25
|
+
[order_status_1.OrderStatus.DepositAddressCreated]: 3,
|
|
26
|
+
[order_status_1.OrderStatus.AwaitingBankPayoutDetails]: 4,
|
|
27
|
+
[order_status_1.OrderStatus.BankPayoutDetailsAdded]: 5,
|
|
28
|
+
[order_status_1.OrderStatus.AwaitingPayment]: 6,
|
|
29
|
+
[order_status_1.OrderStatus.DepositConfirmed]: 7,
|
|
30
|
+
[order_status_1.OrderStatus.SourcingLiquidity]: 8,
|
|
31
|
+
[order_status_1.OrderStatus.LiquiditySourced]: 9,
|
|
32
|
+
[order_status_1.OrderStatus.AwaitingPayout]: 10,
|
|
33
|
+
[order_status_1.OrderStatus.Complete]: 11,
|
|
44
34
|
};
|
|
45
|
-
exports.
|
|
46
|
-
[order_status_1.OrderStatus.
|
|
47
|
-
[order_status_1.OrderStatus.
|
|
48
|
-
[order_status_1.OrderStatus.
|
|
49
|
-
[order_status_1.OrderStatus.
|
|
50
|
-
[order_status_1.OrderStatus.
|
|
35
|
+
exports.AsyncBuyOrderStatusRanking = {
|
|
36
|
+
[order_status_1.OrderStatus.AwaitingTimeInForceToStart]: 0,
|
|
37
|
+
[order_status_1.OrderStatus.AwaitingLimitPriceCondition]: 1,
|
|
38
|
+
[order_status_1.OrderStatus.Created]: 2,
|
|
39
|
+
[order_status_1.OrderStatus.AddressCheckPassed]: 3,
|
|
40
|
+
[order_status_1.OrderStatus.AwaitingAsyncPayout]: 4,
|
|
51
41
|
[order_status_1.OrderStatus.SourcingLiquidity]: 5,
|
|
52
42
|
[order_status_1.OrderStatus.LiquiditySourced]: 6,
|
|
53
|
-
[order_status_1.OrderStatus.
|
|
43
|
+
[order_status_1.OrderStatus.Filled]: 7,
|
|
54
44
|
[order_status_1.OrderStatus.AwaitingAsyncPayment]: 8,
|
|
55
45
|
[order_status_1.OrderStatus.Processing]: 9,
|
|
56
46
|
[order_status_1.OrderStatus.Complete]: 10,
|
|
57
47
|
};
|
|
48
|
+
exports.AsyncSellOrderStatusRanking = {
|
|
49
|
+
[order_status_1.OrderStatus.AwaitingTimeInForceToStart]: 0,
|
|
50
|
+
[order_status_1.OrderStatus.AwaitingLimitPriceCondition]: 1,
|
|
51
|
+
[order_status_1.OrderStatus.Created]: 2,
|
|
52
|
+
[order_status_1.OrderStatus.DepositAddressCreated]: 3,
|
|
53
|
+
[order_status_1.OrderStatus.AwaitingBankPayoutDetails]: 4,
|
|
54
|
+
[order_status_1.OrderStatus.BankPayoutDetailsAdded]: 5,
|
|
55
|
+
[order_status_1.OrderStatus.SourcingLiquidity]: 6,
|
|
56
|
+
[order_status_1.OrderStatus.LiquiditySourced]: 7,
|
|
57
|
+
[order_status_1.OrderStatus.AwaitingAsyncPayout]: 8,
|
|
58
|
+
[order_status_1.OrderStatus.AwaitingAsyncPayment]: 9,
|
|
59
|
+
[order_status_1.OrderStatus.Processing]: 10,
|
|
60
|
+
[order_status_1.OrderStatus.Complete]: 11,
|
|
61
|
+
};
|
|
58
62
|
const getOrderStatusRanking = (side, deferredPaymentType) => {
|
|
59
63
|
if (side === side_1.Side.Buy && deferredPaymentType === deferred_payment_type_1.DeferredPaymentType.None) {
|
|
60
64
|
return exports.BuyOrderStatusRanking;
|
|
@@ -90,6 +90,10 @@ const humanizeOrderStatus = (status) => {
|
|
|
90
90
|
return "Refund initiated";
|
|
91
91
|
case order_status_1.OrderStatus.AwaitingOriginOrderCompletion:
|
|
92
92
|
return "Waiting for origin order to complete";
|
|
93
|
+
case order_status_1.OrderStatus.AwaitingTimeInForceToStart:
|
|
94
|
+
return "Waiting for time in force to start";
|
|
95
|
+
case order_status_1.OrderStatus.AwaitingLimitPriceCondition:
|
|
96
|
+
return "Waiting for limit price condition";
|
|
93
97
|
default:
|
|
94
98
|
if (status.toLowerCase().includes("failed")) {
|
|
95
99
|
return "Failed";
|
|
@@ -3,6 +3,7 @@ export declare enum OrderStatus {
|
|
|
3
3
|
Cancelled = "cancelled",
|
|
4
4
|
Processing = "processing",
|
|
5
5
|
AwaitingLimitPriceCondition = "awaitingLimitPriceCondition",
|
|
6
|
+
AwaitingTimeInForceToStart = "awaitingTimeInForceToStart",
|
|
6
7
|
LimitPriceConditionMet = "limitPriceConditionMet",
|
|
7
8
|
SourcingLiquidity = "sourcingLiquidity",
|
|
8
9
|
CryptoAddressAdded = "cryptoAddressAdded",
|
|
@@ -12,6 +12,7 @@ var OrderStatus;
|
|
|
12
12
|
// processor
|
|
13
13
|
OrderStatus["Processing"] = "processing";
|
|
14
14
|
OrderStatus["AwaitingLimitPriceCondition"] = "awaitingLimitPriceCondition";
|
|
15
|
+
OrderStatus["AwaitingTimeInForceToStart"] = "awaitingTimeInForceToStart";
|
|
15
16
|
OrderStatus["LimitPriceConditionMet"] = "limitPriceConditionMet";
|
|
16
17
|
OrderStatus["SourcingLiquidity"] = "sourcingLiquidity";
|
|
17
18
|
OrderStatus["CryptoAddressAdded"] = "cryptoAddressAdded";
|