@riocrypto/common-server 1.0.515 → 1.0.517
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.
|
@@ -95,17 +95,8 @@ class FireblocksClient {
|
|
|
95
95
|
}
|
|
96
96
|
getVaultCryptoBalance(crypto) {
|
|
97
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (!(vault === null || vault === void 0 ? void 0 : vault.assets)) {
|
|
101
|
-
throw new Error();
|
|
102
|
-
}
|
|
103
|
-
vault.assets.forEach((asset) => {
|
|
104
|
-
if (asset.id === crypto) {
|
|
105
|
-
balance += Number(asset.available);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
return balance;
|
|
98
|
+
const vaultAsset = yield this.fireblocks.getVaultAccountAsset("2", crypto);
|
|
99
|
+
return Number(vaultAsset.available) || 0;
|
|
109
100
|
});
|
|
110
101
|
}
|
|
111
102
|
getExchangeCryptoBalance(crypto) {
|
|
@@ -140,7 +140,7 @@ const authorize = (req, res, next, mongoose, authorizationTypes) => __awaiter(vo
|
|
|
140
140
|
const BusinessUser = yield (0, business_user_1.buildBusinessUser)(mongoose);
|
|
141
141
|
brokerBusinessUser = yield BusinessUser.findOne({
|
|
142
142
|
authId: req.currentAuth.id,
|
|
143
|
-
attributes: { $
|
|
143
|
+
attributes: { $in: [common_1.UserAttribute.broker] },
|
|
144
144
|
});
|
|
145
145
|
if (!brokerBusinessUser) {
|
|
146
146
|
throw new Error();
|