@riocrypto/common-server 1.0.1284 → 1.0.1285
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.
|
@@ -9,6 +9,7 @@ declare class FireblocksClient {
|
|
|
9
9
|
getVaultCryptoBalance(vaultId: string, crypto: Crypto): Promise<number>;
|
|
10
10
|
getVaultCryptoAddress(vaultId: string, crypto: Crypto): Promise<string>;
|
|
11
11
|
getTotalVaultUSDBalance(vaultId: string): Promise<number>;
|
|
12
|
+
getTotalExchangesUSDBalance(): Promise<number>;
|
|
12
13
|
getExchangeCryptoBalance(crypto: Crypto): Promise<number>;
|
|
13
14
|
getExchangeFiatBalance(): Promise<number>;
|
|
14
15
|
getTransactions(vaultId: string, crypto: Crypto, nextPage?: string): Promise<any>;
|
|
@@ -110,6 +110,28 @@ class FireblocksClient {
|
|
|
110
110
|
return balance;
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
getTotalExchangesUSDBalance() {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
let exchanges = yield this.fireblocks.getExchangeAccounts();
|
|
116
|
+
let balance = 0;
|
|
117
|
+
exchanges.forEach((exchange) => {
|
|
118
|
+
exchange.assets.forEach((asset) => {
|
|
119
|
+
if ([
|
|
120
|
+
common_1.Crypto.USDC,
|
|
121
|
+
common_1.Crypto.USDCPolygon,
|
|
122
|
+
common_1.Crypto.USDCPolygonBridged,
|
|
123
|
+
common_1.Crypto.USDCSolana,
|
|
124
|
+
common_1.Crypto.USDTEthereum,
|
|
125
|
+
common_1.Crypto.USDTPolygon,
|
|
126
|
+
common_1.Crypto.USDTTron,
|
|
127
|
+
].includes(asset.id)) {
|
|
128
|
+
balance += Number(asset.available);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
return balance;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
113
135
|
getExchangeCryptoBalance(crypto) {
|
|
114
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
137
|
let exchanges = yield this.fireblocks.getExchangeAccounts();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1285",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
|
-
"@riocrypto/common": "^1.0.
|
|
30
|
+
"@riocrypto/common": "^1.0.1164",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|