@riocrypto/common-server 1.0.1849 → 1.0.1851
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.
|
@@ -4,7 +4,7 @@ declare class ClusterClient {
|
|
|
4
4
|
private clusterApiKey;
|
|
5
5
|
private axios;
|
|
6
6
|
constructor(baseUrl: string, clusterApiKey: string);
|
|
7
|
-
|
|
7
|
+
refreshQuote(orderId: string, newAmountFiat?: number, newAmountCrypto?: number): Promise<Quote>;
|
|
8
8
|
getQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire"): Promise<Quote>;
|
|
9
9
|
getNewChainedQuote(chainedOrderId: string, chainedQuote: ChainedQuote, newOriginAmount?: number): Promise<ChainedQuote>;
|
|
10
10
|
getBidQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire", netPrice?: string): Promise<Quote>;
|
|
@@ -43,40 +43,16 @@ class ClusterClient {
|
|
|
43
43
|
}
|
|
44
44
|
this.axios.defaults.headers.common["Host"] = hostHeader;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
refreshQuote(orderId, newAmountFiat, newAmountCrypto) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (newAmountCrypto) {
|
|
51
|
-
amountCrypto = newAmountCrypto;
|
|
52
|
-
amountFiat = undefined;
|
|
53
|
-
}
|
|
54
|
-
else if (newAmountFiat) {
|
|
55
|
-
amountFiat = newAmountFiat;
|
|
56
|
-
amountCrypto = undefined;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
if (quote.side === common_1.Side.Sell) {
|
|
60
|
-
amountCrypto = quote.amountCrypto;
|
|
61
|
-
amountFiat = undefined;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
amountFiat = quote.amountFiat;
|
|
65
|
-
amountCrypto = undefined;
|
|
66
|
-
}
|
|
48
|
+
if (newAmountCrypto && newAmountFiat) {
|
|
49
|
+
throw new common_1.GenericInternalError("Cannot specify both newAmountCrypto and newAmountFiat");
|
|
67
50
|
}
|
|
68
51
|
const response = yield this.axios.post(`${this.baseUrl}/api/quotes`, {
|
|
69
52
|
orderId,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
fiat: quote.fiat,
|
|
74
|
-
amountFiat,
|
|
75
|
-
amountCrypto,
|
|
76
|
-
country: quote.country,
|
|
77
|
-
discount: quote.discount,
|
|
78
|
-
markup: quote.markup,
|
|
79
|
-
noMarkups: quote.noMarkups,
|
|
53
|
+
newAmountFiat,
|
|
54
|
+
newAmountCrypto,
|
|
55
|
+
ignoreLiquidityError: true,
|
|
80
56
|
}, {
|
|
81
57
|
headers: {
|
|
82
58
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
interface RioSettingsAttrs {
|
|
3
3
|
platformFee: number;
|
|
4
|
-
buyOrderNextDaySettlementFee: number;
|
|
5
|
-
sellOrderNextDaySettlementFee: number;
|
|
6
4
|
isAfterHours: {
|
|
7
5
|
[key: string]: {
|
|
8
6
|
value: boolean;
|
|
9
7
|
frozen: boolean;
|
|
10
8
|
};
|
|
11
9
|
};
|
|
10
|
+
buyOrderNextDaySettlementFee: number;
|
|
11
|
+
sellOrderNextDaySettlementFee: number;
|
|
12
12
|
buyOrderAfterHoursExchangeRateMarkup: number;
|
|
13
13
|
sellOrderAfterHoursExchangeRateMarkup: number;
|
|
14
14
|
buyOrderGeneralExchangeRateMarkup: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1851",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
27
27
|
"@google-cloud/storage": "^6.9.5",
|
|
28
28
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
29
|
-
"@riocrypto/common": "^1.0.
|
|
29
|
+
"@riocrypto/common": "^1.0.1660",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
32
|
"crypto-js": "^4.2.0",
|