@riocrypto/common-server 1.0.1303 → 1.0.1305

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.
@@ -3,7 +3,7 @@ import { Crypto } from "@riocrypto/common";
3
3
  declare class FireblocksClient {
4
4
  fireblocks: FireblocksSDK;
5
5
  constructor(privateKey: string, apiKey: string);
6
- estimateWithdrawFee(crypto: Crypto, address: string, amountCrypto: number): Promise<number | undefined>;
6
+ estimateWithdrawFee(crypto: Crypto, address: string, amountCrypto: number): Promise<string | number | undefined>;
7
7
  withdrawFromExchange(crypto: Crypto, address: string, amountCrypto: number): Promise<void>;
8
8
  withdrawFromVault(crypto: Crypto, address: string, amountCrypto: number): Promise<string>;
9
9
  getVaultCryptoBalance(vaultId: string, crypto: Crypto): Promise<number>;
@@ -26,7 +26,8 @@ class FireblocksClient {
26
26
  estimateWithdrawFee(crypto, address, amountCrypto) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  let fee;
29
- const cachedResponse = cache.get(`estimateWithdrawFee(${crypto}, ${address}, ${amountCrypto})`);
29
+ const cachedResponse = cache2.get(`estimateWithdrawFee(${crypto}, ${address}, ${amountCrypto})`);
30
+ console.log(`estimateWithdrawFee(${crypto}, ${address}, ${amountCrypto})`, cachedResponse);
30
31
  if (cachedResponse) {
31
32
  fee = cachedResponse;
32
33
  }
@@ -46,7 +47,8 @@ class FireblocksClient {
46
47
  amount: amountCrypto,
47
48
  operation: fireblocks_sdk_1.TransactionOperation.TRANSFER,
48
49
  });
49
- let fee = estimate.medium.networkFee;
50
+ fee = estimate.medium.networkFee;
51
+ console.log("fee", fee);
50
52
  cache.set(`estimateWithdrawFee(${crypto}, ${address}, ${amountCrypto})`, fee);
51
53
  }
52
54
  return fee;
@@ -107,6 +109,7 @@ class FireblocksClient {
107
109
  return __awaiter(this, void 0, void 0, function* () {
108
110
  let balance = 0;
109
111
  const cachedResponse = cache.get(`getTotalVaultUSDBalance(${vaultId})`);
112
+ console.log(`getTotalVaultUSDBalance(${vaultId})`, cachedResponse);
110
113
  if (cachedResponse) {
111
114
  balance = cachedResponse;
112
115
  }
@@ -127,6 +130,7 @@ class FireblocksClient {
127
130
  }
128
131
  }
129
132
  }
133
+ console.log("balance", balance);
130
134
  cache.set(`getTotalVaultUSDBalance(${vaultId})`, balance);
131
135
  }
132
136
  return balance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1303",
3
+ "version": "1.0.1305",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",