@riocrypto/common-server 1.0.1921 → 1.0.1925
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.
|
@@ -69,6 +69,7 @@ class FireblocksClient {
|
|
|
69
69
|
address,
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
72
73
|
amount: amountCrypto,
|
|
73
74
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
74
75
|
externalTxId: rioId,
|
|
@@ -109,6 +110,7 @@ class FireblocksClient {
|
|
|
109
110
|
},
|
|
110
111
|
amount: amountCrypto,
|
|
111
112
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
113
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
112
114
|
note: notes,
|
|
113
115
|
});
|
|
114
116
|
return response.id;
|
|
@@ -301,6 +303,7 @@ class FireblocksClient {
|
|
|
301
303
|
},
|
|
302
304
|
amount: amountCrypto,
|
|
303
305
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
306
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
304
307
|
externalTxId: rioId,
|
|
305
308
|
note: notes,
|
|
306
309
|
});
|
|
@@ -326,6 +329,7 @@ class FireblocksClient {
|
|
|
326
329
|
},
|
|
327
330
|
amount: amountCrypto,
|
|
328
331
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
332
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
329
333
|
externalTxId: rioId,
|
|
330
334
|
note: notes,
|
|
331
335
|
});
|
|
@@ -349,6 +353,7 @@ class FireblocksClient {
|
|
|
349
353
|
},
|
|
350
354
|
amount: amountCrypto,
|
|
351
355
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
356
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
352
357
|
note: notes,
|
|
353
358
|
externalTxId: rioId,
|
|
354
359
|
});
|
|
@@ -373,6 +378,7 @@ class FireblocksClient {
|
|
|
373
378
|
amount: amountCrypto,
|
|
374
379
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
375
380
|
externalTxId: rioId,
|
|
381
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
376
382
|
note: notes,
|
|
377
383
|
});
|
|
378
384
|
return response.id;
|
|
@@ -396,6 +402,7 @@ class FireblocksClient {
|
|
|
396
402
|
},
|
|
397
403
|
amount: amountCrypto,
|
|
398
404
|
operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
|
|
405
|
+
feeLevel: crypto === common_1.Crypto.USDCSolana ? fireblocks_sdk_1.FeeLevel.HIGH : undefined,
|
|
399
406
|
note: notes,
|
|
400
407
|
});
|
|
401
408
|
return response.id;
|
|
@@ -39,30 +39,40 @@ const getExchangeRates = (mongoose, fiat, side) => __awaiter(void 0, void 0, voi
|
|
|
39
39
|
if (rioSettings.isAfterHours[common_1.Country.Peru].value) {
|
|
40
40
|
conversionRateToUSDWithMarkups =
|
|
41
41
|
conversionRateToUSDWithMarkups *
|
|
42
|
-
(1 -
|
|
42
|
+
(1 -
|
|
43
|
+
afterHoursExchangeRateMarkup[common_1.Fiat.PEN] -
|
|
44
|
+
generalExchangeRateMarkup[common_1.Fiat.PEN]);
|
|
43
45
|
conversionRateFromUSDWithMarkups =
|
|
44
46
|
conversionRateFromUSDWithMarkups *
|
|
45
|
-
(1 -
|
|
47
|
+
(1 -
|
|
48
|
+
afterHoursExchangeRateMarkup[common_1.Fiat.PEN] -
|
|
49
|
+
generalExchangeRateMarkup[common_1.Fiat.PEN]);
|
|
46
50
|
}
|
|
47
51
|
if (generalExchangeRateMarkup) {
|
|
48
52
|
conversionRateToUSDWithMarkups =
|
|
49
|
-
conversionRateToUSDWithMarkups *
|
|
53
|
+
conversionRateToUSDWithMarkups *
|
|
54
|
+
(1 - generalExchangeRateMarkup[common_1.Fiat.PEN]);
|
|
50
55
|
conversionRateFromUSDWithMarkups =
|
|
51
|
-
conversionRateFromUSDWithMarkups *
|
|
56
|
+
conversionRateFromUSDWithMarkups *
|
|
57
|
+
(1 - generalExchangeRateMarkup[common_1.Fiat.PEN]);
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
if (fiat === common_1.Fiat.MXN) {
|
|
55
61
|
if (rioSettings.isAfterHours[common_1.Country.Mexico].value) {
|
|
56
62
|
conversionRateToUSDWithMarkups =
|
|
57
|
-
conversionRateToUSDWithMarkups *
|
|
63
|
+
conversionRateToUSDWithMarkups *
|
|
64
|
+
(1 - afterHoursExchangeRateMarkup[common_1.Fiat.MXN]);
|
|
58
65
|
conversionRateFromUSDWithMarkups =
|
|
59
|
-
conversionRateFromUSDWithMarkups *
|
|
66
|
+
conversionRateFromUSDWithMarkups *
|
|
67
|
+
(1 - afterHoursExchangeRateMarkup[common_1.Fiat.MXN]);
|
|
60
68
|
}
|
|
61
69
|
if (generalExchangeRateMarkup) {
|
|
62
70
|
conversionRateToUSDWithMarkups =
|
|
63
|
-
conversionRateToUSDWithMarkups *
|
|
71
|
+
conversionRateToUSDWithMarkups *
|
|
72
|
+
(1 - generalExchangeRateMarkup[common_1.Fiat.MXN]);
|
|
64
73
|
conversionRateFromUSDWithMarkups =
|
|
65
|
-
conversionRateFromUSDWithMarkups *
|
|
74
|
+
conversionRateFromUSDWithMarkups *
|
|
75
|
+
(1 - generalExchangeRateMarkup[common_1.Fiat.MXN]);
|
|
66
76
|
}
|
|
67
77
|
}
|
|
68
78
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fiat } from "@riocrypto/common";
|
|
1
2
|
import mongoose from "mongoose";
|
|
2
3
|
interface RioSettingsAttrs {
|
|
3
4
|
platformFee: number;
|
|
@@ -9,10 +10,18 @@ interface RioSettingsAttrs {
|
|
|
9
10
|
};
|
|
10
11
|
buyOrderNextDaySettlementFee: number;
|
|
11
12
|
sellOrderNextDaySettlementFee: number;
|
|
12
|
-
buyOrderAfterHoursExchangeRateMarkup:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
buyOrderAfterHoursExchangeRateMarkup: {
|
|
14
|
+
[key in Fiat]: number;
|
|
15
|
+
};
|
|
16
|
+
sellOrderAfterHoursExchangeRateMarkup: {
|
|
17
|
+
[key in Fiat]: number;
|
|
18
|
+
};
|
|
19
|
+
buyOrderGeneralExchangeRateMarkup: {
|
|
20
|
+
[key in Fiat]: number;
|
|
21
|
+
};
|
|
22
|
+
sellOrderGeneralExchangeRateMarkup: {
|
|
23
|
+
[key in Fiat]: number;
|
|
24
|
+
};
|
|
16
25
|
additionalBuyOrderLiquidityUSD?: number;
|
|
17
26
|
additionalSellOrderLiquidityUSD?: number;
|
|
18
27
|
previousDayUSDMXNConversionRate?: number;
|
|
@@ -27,10 +36,18 @@ interface RioSettingsDoc extends mongoose.Document {
|
|
|
27
36
|
frozen: boolean;
|
|
28
37
|
};
|
|
29
38
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sellOrderGeneralExchangeRateMarkup:
|
|
39
|
+
buyOrderGeneralExchangeRateMarkup: {
|
|
40
|
+
[key in Fiat]: number;
|
|
41
|
+
};
|
|
42
|
+
sellOrderGeneralExchangeRateMarkup: {
|
|
43
|
+
[key in Fiat]: number;
|
|
44
|
+
};
|
|
45
|
+
buyOrderAfterHoursExchangeRateMarkup: {
|
|
46
|
+
[key in Fiat]: number;
|
|
47
|
+
};
|
|
48
|
+
sellOrderAfterHoursExchangeRateMarkup: {
|
|
49
|
+
[key in Fiat]: number;
|
|
50
|
+
};
|
|
34
51
|
additionalBuyOrderLiquidityUSD?: number;
|
|
35
52
|
additionalSellOrderLiquidityUSD?: number;
|
|
36
53
|
previousDayUSDMXNConversionRate?: number;
|
|
@@ -21,16 +21,16 @@ const buildRioSettings = (mongoose) => {
|
|
|
21
21
|
type: Object,
|
|
22
22
|
},
|
|
23
23
|
buyOrderAfterHoursExchangeRateMarkup: {
|
|
24
|
-
type:
|
|
24
|
+
type: Object,
|
|
25
25
|
},
|
|
26
26
|
sellOrderAfterHoursExchangeRateMarkup: {
|
|
27
|
-
type:
|
|
27
|
+
type: Object,
|
|
28
28
|
},
|
|
29
29
|
buyOrderGeneralExchangeRateMarkup: {
|
|
30
|
-
type:
|
|
30
|
+
type: Object,
|
|
31
31
|
},
|
|
32
32
|
sellOrderGeneralExchangeRateMarkup: {
|
|
33
|
-
type:
|
|
33
|
+
type: Object,
|
|
34
34
|
},
|
|
35
35
|
additionalBuyOrderLiquidityUSD: {
|
|
36
36
|
type: 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.1925",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1704",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|