@riocrypto/common-server 1.0.2809 → 1.0.2810
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/clients/fireblocks-client.d.ts +2 -1
- package/build/clients/fireblocks-client.js +14 -0
- package/build/models/fireblocks-transfer.d.ts +4 -0
- package/build/models/fireblocks-transfer.js +6 -0
- package/build/models/rio-settings.d.ts +13 -1
- package/build/models/rio-settings.js +6 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExchangeResponse, FireblocksSDK, VaultAccountResponse } from "fireblocks-sdk";
|
|
1
|
+
import { ExchangeResponse, FireblocksSDK, TransactionResponse, VaultAccountResponse } from "fireblocks-sdk";
|
|
2
2
|
import { Crypto } from "@riocrypto/common";
|
|
3
3
|
export declare class FireblocksApiError extends Error {
|
|
4
4
|
readonly endpoint: string;
|
|
@@ -37,6 +37,7 @@ declare class FireblocksClient {
|
|
|
37
37
|
notes?: string;
|
|
38
38
|
memo?: string;
|
|
39
39
|
}): Promise<string>;
|
|
40
|
+
getTransactionByExternalTxId(externalTxId: string): Promise<TransactionResponse | null>;
|
|
40
41
|
getVaultCryptoBalance(vaultId: string, crypto: Crypto): Promise<number>;
|
|
41
42
|
getVaultAccount(vaultId: string): Promise<VaultAccountResponse>;
|
|
42
43
|
getExchangeAccount(exchangeId: string): Promise<ExchangeResponse>;
|
|
@@ -173,6 +173,20 @@ class FireblocksClient {
|
|
|
173
173
|
return response.id;
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
+
getTransactionByExternalTxId(externalTxId) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
try {
|
|
179
|
+
return yield this.fireblocks.getTransactionByExternalTxId(externalTxId);
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
const statusCode = error === null || error === void 0 ? void 0 : error.statusCode;
|
|
183
|
+
if (statusCode === 404) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
176
190
|
getVaultCryptoBalance(vaultId, crypto) {
|
|
177
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
192
|
try {
|
|
@@ -13,11 +13,13 @@ interface FireblocksTransferAttrs {
|
|
|
13
13
|
partsCompleted?: number;
|
|
14
14
|
fireblocksTransfers: {
|
|
15
15
|
uuid: string;
|
|
16
|
+
rioId?: string;
|
|
16
17
|
fireblocksTransferId?: string;
|
|
17
18
|
amount: number;
|
|
18
19
|
partNumber?: number;
|
|
19
20
|
status: FireblocksTransferStatus;
|
|
20
21
|
retryCount: number;
|
|
22
|
+
dispatchAttemptedAt?: Date;
|
|
21
23
|
}[];
|
|
22
24
|
netAmountTransfered?: number;
|
|
23
25
|
}
|
|
@@ -34,11 +36,13 @@ interface FireblocksTransferDoc extends mongoose.Document {
|
|
|
34
36
|
partsCompleted?: number;
|
|
35
37
|
fireblocksTransfers: {
|
|
36
38
|
uuid: string;
|
|
39
|
+
rioId?: string;
|
|
37
40
|
fireblocksTransferId?: string;
|
|
38
41
|
amount: number;
|
|
39
42
|
partNumber?: number;
|
|
40
43
|
status: FireblocksTransferStatus;
|
|
41
44
|
retryCount: number;
|
|
45
|
+
dispatchAttemptedAt?: Date;
|
|
42
46
|
}[];
|
|
43
47
|
netAmountTransfered?: number;
|
|
44
48
|
}
|
|
@@ -40,6 +40,9 @@ const buildFireblocksTransfer = (mongoose) => {
|
|
|
40
40
|
uuid: {
|
|
41
41
|
type: String,
|
|
42
42
|
},
|
|
43
|
+
rioId: {
|
|
44
|
+
type: String,
|
|
45
|
+
},
|
|
43
46
|
fireblocksTransferId: {
|
|
44
47
|
type: String,
|
|
45
48
|
},
|
|
@@ -55,6 +58,9 @@ const buildFireblocksTransfer = (mongoose) => {
|
|
|
55
58
|
retryCount: {
|
|
56
59
|
type: Number,
|
|
57
60
|
},
|
|
61
|
+
dispatchAttemptedAt: {
|
|
62
|
+
type: Date,
|
|
63
|
+
},
|
|
58
64
|
},
|
|
59
65
|
],
|
|
60
66
|
multipartLiquidityOrderId: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Country, DeferredPaymentType, Fiat, FXProvider, FXTradingPolicies, Processor, Side } from "@riocrypto/common";
|
|
1
|
+
import { Country, Crypto, DeferredPaymentType, Fiat, FXProvider, FXTradingPolicies, Processor, Side } from "@riocrypto/common";
|
|
2
2
|
import { TVFXDataProvider } from "@riocrypto/common";
|
|
3
3
|
import mongoose, { HydratedDocument } from "mongoose";
|
|
4
4
|
interface RioSettingsAttrs {
|
|
@@ -34,6 +34,12 @@ interface RioSettingsAttrs {
|
|
|
34
34
|
sellOrderGeneralExchangeRateMarkup: {
|
|
35
35
|
[key in Fiat]: number;
|
|
36
36
|
};
|
|
37
|
+
buyOrderAssetPriceMarkup?: {
|
|
38
|
+
[key in Crypto]?: number;
|
|
39
|
+
};
|
|
40
|
+
sellOrderAssetPriceMarkup?: {
|
|
41
|
+
[key in Crypto]?: number;
|
|
42
|
+
};
|
|
37
43
|
defaultServiceFee: {
|
|
38
44
|
[key in Country]?: {
|
|
39
45
|
[key in Side]?: number;
|
|
@@ -126,6 +132,12 @@ interface RioSettingsDoc extends mongoose.Document {
|
|
|
126
132
|
sellOrderAfterHoursExchangeRateMarkup: {
|
|
127
133
|
[key in Fiat]: number;
|
|
128
134
|
};
|
|
135
|
+
buyOrderAssetPriceMarkup?: {
|
|
136
|
+
[key in Crypto]?: number;
|
|
137
|
+
};
|
|
138
|
+
sellOrderAssetPriceMarkup?: {
|
|
139
|
+
[key in Crypto]?: number;
|
|
140
|
+
};
|
|
129
141
|
additionalBuyOrderLiquidityUSD?: number;
|
|
130
142
|
additionalSellOrderLiquidityUSD?: number;
|
|
131
143
|
previousDayUSDMXNConversionRate?: number;
|
|
@@ -33,6 +33,12 @@ const buildRioSettings = (mongoose) => {
|
|
|
33
33
|
sellOrderGeneralExchangeRateMarkup: {
|
|
34
34
|
type: Object,
|
|
35
35
|
},
|
|
36
|
+
buyOrderAssetPriceMarkup: {
|
|
37
|
+
type: Object,
|
|
38
|
+
},
|
|
39
|
+
sellOrderAssetPriceMarkup: {
|
|
40
|
+
type: Object,
|
|
41
|
+
},
|
|
36
42
|
additionalBuyOrderLiquidityUSD: {
|
|
37
43
|
type: Number,
|
|
38
44
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2810",
|
|
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.6.0",
|
|
29
29
|
"@google-cloud/storage": "^7.19.0",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.10.3",
|
|
31
|
-
"@riocrypto/common": "1.0.
|
|
31
|
+
"@riocrypto/common": "1.0.2616",
|
|
32
32
|
"@slack/web-api": "^7.15.0",
|
|
33
33
|
"@types/express": "^4.17.25",
|
|
34
34
|
"axios": "1.16.0",
|