@riocrypto/common-server 1.0.1614 → 1.0.1615
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.
|
@@ -11,7 +11,7 @@ declare class FireblocksClient {
|
|
|
11
11
|
getTotalVaultUSDBalance(vaultId: string): Promise<number>;
|
|
12
12
|
getTotalExchangesUSDBalance(): Promise<number>;
|
|
13
13
|
getExchangeCryptoBalance(crypto: Crypto): Promise<number>;
|
|
14
|
-
getSingularExchangeCryptoBalance(id: string,
|
|
14
|
+
getSingularExchangeCryptoBalance(id: string, usdType: "usdc" | "usdt"): Promise<number>;
|
|
15
15
|
getExchangeFiatBalance(): Promise<number>;
|
|
16
16
|
getTransactions(vaultId: string, crypto: Crypto, nextPage?: string): Promise<any>;
|
|
17
17
|
getDepositAddress(vaultId: string, crypto: Crypto): Promise<string>;
|
|
@@ -184,14 +184,28 @@ class FireblocksClient {
|
|
|
184
184
|
return balance;
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
getSingularExchangeCryptoBalance(id,
|
|
187
|
+
getSingularExchangeCryptoBalance(id, usdType) {
|
|
188
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
189
189
|
let exchanges = yield this.fireblocks.getExchangeAccounts();
|
|
190
190
|
let balance = 0;
|
|
191
191
|
exchanges.forEach((exchange) => {
|
|
192
192
|
if (exchange.id === id) {
|
|
193
193
|
exchange.assets.forEach((asset) => {
|
|
194
|
-
|
|
194
|
+
let filterList = usdType === "usdc"
|
|
195
|
+
? [
|
|
196
|
+
common_1.Crypto.USDC,
|
|
197
|
+
common_1.Crypto.USDCPolygon,
|
|
198
|
+
common_1.Crypto.USDCPolygonBridged,
|
|
199
|
+
common_1.Crypto.USDCSolana,
|
|
200
|
+
"USD",
|
|
201
|
+
]
|
|
202
|
+
: [
|
|
203
|
+
common_1.Crypto.USDTEthereum,
|
|
204
|
+
"USDT",
|
|
205
|
+
common_1.Crypto.USDTPolygon,
|
|
206
|
+
common_1.Crypto.USDTTron,
|
|
207
|
+
];
|
|
208
|
+
if (filterList.includes(asset.id)) {
|
|
195
209
|
balance += Number(asset.available);
|
|
196
210
|
}
|
|
197
211
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1615",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1453",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.6.0",
|
|
34
34
|
"ccxt": "^3.0.30",
|