@riocrypto/common-server 1.0.1284 → 1.0.1286

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,29 @@ 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
+ console.log(asset);
120
+ if ([
121
+ common_1.Crypto.USDC,
122
+ common_1.Crypto.USDCPolygon,
123
+ common_1.Crypto.USDCPolygonBridged,
124
+ common_1.Crypto.USDCSolana,
125
+ common_1.Crypto.USDTEthereum,
126
+ common_1.Crypto.USDTPolygon,
127
+ common_1.Crypto.USDTTron,
128
+ ].includes(asset.id)) {
129
+ balance += Number(asset.available);
130
+ }
131
+ });
132
+ });
133
+ return balance;
134
+ });
135
+ }
113
136
  getExchangeCryptoBalance(crypto) {
114
137
  return __awaiter(this, void 0, void 0, function* () {
115
138
  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.1284",
3
+ "version": "1.0.1286",
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.1163",
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",