@riocrypto/common-server 1.0.1730 → 1.0.1732

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,6 +11,10 @@ declare class ClusterClient {
11
11
  createOrder(quoteId: string, cryptoAddress?: string, notes?: string, externalAccountId?: string): Promise<Order>;
12
12
  confirmPayment(orderId: string): Promise<void>;
13
13
  createBitsoBankAccount(userId: string): Promise<BitsoBankAccount>;
14
+ getLiquidityAvailable(): Promise<{
15
+ buy: number;
16
+ sell: number;
17
+ }>;
14
18
  getBalance(asset: Crypto | Fiat): Promise<number>;
15
19
  createPayout(orderId: string, bankAccountId: string): Promise<void>;
16
20
  getUSBankAccounts(userId: string): Promise<{
@@ -172,6 +172,16 @@ class ClusterClient {
172
172
  return response.data;
173
173
  });
174
174
  }
175
+ getLiquidityAvailable() {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ const { data } = yield this.axios.get(`${this.baseUrl}/api/wallet/rio-balances/usd`, {
178
+ headers: {
179
+ "x-cluster-api-key": this.clusterApiKey,
180
+ },
181
+ });
182
+ return data;
183
+ });
184
+ }
175
185
  getBalance(asset) {
176
186
  return __awaiter(this, void 0, void 0, function* () {
177
187
  const rioResponse = yield this.axios.get(`${this.baseUrl}/api/liquidity/${asset}`, {
@@ -7,7 +7,7 @@ const errorHandler = (err, req, res, next) => {
7
7
  return res.status(err.statusCode).send({ errors: err.serializeErrors() });
8
8
  }
9
9
  console.error(err);
10
- res.status(400).send({
10
+ res.status(500).send({
11
11
  errors: [{ message: "Something went wrong" }],
12
12
  });
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1730",
3
+ "version": "1.0.1732",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@google-cloud/secret-manager": "^5.3.0",
27
27
  "@google-cloud/storage": "^6.9.5",
28
28
  "@hyperdx/node-opentelemetry": "^0.4.2",
29
- "@riocrypto/common": "^1.0.1514",
29
+ "@riocrypto/common": "^1.0.1516",
30
30
  "@types/express": "^4.17.13",
31
31
  "axios": "^1.6.0",
32
32
  "crypto-js": "^4.2.0",