@riocrypto/common 1.0.664 → 1.0.666
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/helpers/get-country-name-from-code.d.ts +1 -0
- package/build/helpers/get-country-name-from-code.js +9 -0
- package/build/helpers/humanize-order-status.d.ts +2 -0
- package/build/helpers/humanize-order-status.js +59 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCountryNameFromCode: (code: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCountryNameFromCode = void 0;
|
|
4
|
+
const country_1 = require("../types/country");
|
|
5
|
+
const getCountryNameFromCode = (code) => {
|
|
6
|
+
const country = Object.keys(country_1.Country).find((key) => country_1.Country[key] === code);
|
|
7
|
+
return country || "Unknown";
|
|
8
|
+
};
|
|
9
|
+
exports.getCountryNameFromCode = getCountryNameFromCode;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.humanizeOrderStatus = void 0;
|
|
4
|
+
const order_status_1 = require("../types/order-status");
|
|
5
|
+
const humanizeOrderStatus = (status) => {
|
|
6
|
+
switch (status) {
|
|
7
|
+
case order_status_1.OrderStatus.Created:
|
|
8
|
+
return "Created";
|
|
9
|
+
case order_status_1.OrderStatus.Cancelled:
|
|
10
|
+
return "Canceled";
|
|
11
|
+
case order_status_1.OrderStatus.Processing:
|
|
12
|
+
return "Processing";
|
|
13
|
+
case order_status_1.OrderStatus.AwaitingBankPayoutDetails:
|
|
14
|
+
return "Awaiting Bank Payout Details";
|
|
15
|
+
case order_status_1.OrderStatus.DepositRegistered:
|
|
16
|
+
return "Deposit Registered";
|
|
17
|
+
case order_status_1.OrderStatus.DepositConfirmed:
|
|
18
|
+
return "Deposit confirmed";
|
|
19
|
+
case order_status_1.OrderStatus.Paid:
|
|
20
|
+
return "Paid";
|
|
21
|
+
case order_status_1.OrderStatus.Filled:
|
|
22
|
+
return "Filled";
|
|
23
|
+
case order_status_1.OrderStatus.Complete:
|
|
24
|
+
return "Completed";
|
|
25
|
+
case order_status_1.OrderStatus.PaymentFailed:
|
|
26
|
+
return "Payment failed";
|
|
27
|
+
case order_status_1.OrderStatus.AwaitingPayment:
|
|
28
|
+
return "Awaiting payment";
|
|
29
|
+
case order_status_1.OrderStatus.AwaitingPayout:
|
|
30
|
+
return "Awaiting payout";
|
|
31
|
+
case order_status_1.OrderStatus.FillFailed:
|
|
32
|
+
return "Fill failed";
|
|
33
|
+
case order_status_1.OrderStatus.TransferFailed:
|
|
34
|
+
return "Transfer failed";
|
|
35
|
+
case order_status_1.OrderStatus.QuoteFailed:
|
|
36
|
+
return "Quote failed";
|
|
37
|
+
case order_status_1.OrderStatus.ProcessorRoutingFailed:
|
|
38
|
+
return "Processor routing failed";
|
|
39
|
+
case order_status_1.OrderStatus.LiquidityRoutingFailed:
|
|
40
|
+
return "Liquidity routing failed";
|
|
41
|
+
case order_status_1.OrderStatus.FeesFailed:
|
|
42
|
+
return "Fees failed";
|
|
43
|
+
case order_status_1.OrderStatus.AddressCheckFailed:
|
|
44
|
+
return "Address check failed";
|
|
45
|
+
case order_status_1.OrderStatus.Failed:
|
|
46
|
+
return "Failed (unknown reason)";
|
|
47
|
+
case order_status_1.OrderStatus.Expired:
|
|
48
|
+
return "Expired";
|
|
49
|
+
case order_status_1.OrderStatus.DepositAddressFailed:
|
|
50
|
+
return "Deposit address failed";
|
|
51
|
+
case order_status_1.OrderStatus.DepositRegistered:
|
|
52
|
+
return "Deposit registered";
|
|
53
|
+
case order_status_1.OrderStatus.DepositConfirmed:
|
|
54
|
+
return "Deposit confirmed";
|
|
55
|
+
default:
|
|
56
|
+
return "Unknown";
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.humanizeOrderStatus = humanizeOrderStatus;
|
package/build/index.d.ts
CHANGED
|
@@ -136,5 +136,7 @@ export * from "./classes/WyrePaymentMethodAsset";
|
|
|
136
136
|
export * from "./helpers/get-user-from-client-helper";
|
|
137
137
|
export * from "./helpers/validate-address";
|
|
138
138
|
export * from "./helpers/round-down-to-two-decimal-places";
|
|
139
|
+
export * from "./helpers/humanize-order-status";
|
|
140
|
+
export * from "./helpers/get-country-name-from-code";
|
|
139
141
|
export * from "./clients/rio-client";
|
|
140
142
|
export * from "./clients/rio-admin-client";
|
package/build/index.js
CHANGED
|
@@ -152,5 +152,7 @@ __exportStar(require("./classes/WyrePaymentMethodAsset"), exports);
|
|
|
152
152
|
__exportStar(require("./helpers/get-user-from-client-helper"), exports);
|
|
153
153
|
__exportStar(require("./helpers/validate-address"), exports);
|
|
154
154
|
__exportStar(require("./helpers/round-down-to-two-decimal-places"), exports);
|
|
155
|
+
__exportStar(require("./helpers/humanize-order-status"), exports);
|
|
156
|
+
__exportStar(require("./helpers/get-country-name-from-code"), exports);
|
|
155
157
|
__exportStar(require("./clients/rio-client"), exports);
|
|
156
158
|
__exportStar(require("./clients/rio-admin-client"), exports);
|