@riocrypto/common-server 1.0.2583 → 1.0.2585

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.
@@ -90,6 +90,7 @@ declare class BitsoClient {
90
90
  }>;
91
91
  createCryptoWithdrawal(amount: number, crypto: Crypto, address: string): Promise<Object>;
92
92
  getDepositByHash(hash: string): Promise<Object>;
93
+ getDepositByConcepto(concepto: string): Promise<Object>;
93
94
  signRequest(requestConfig: AxiosRequestConfig): AxiosRequestConfig;
94
95
  }
95
96
  export declare const buildBitsoClient: () => Promise<BitsoClient>;
@@ -465,6 +465,23 @@ class BitsoClient {
465
465
  return data.payload.find((deposit) => deposit.details.tx_hash === hash);
466
466
  });
467
467
  }
468
+ getDepositByConcepto(concepto) {
469
+ return __awaiter(this, void 0, void 0, function* () {
470
+ const requestConfig = {
471
+ method: "GET",
472
+ url: `${this.baseUrl}/api/v3/fundings`,
473
+ headers: {
474
+ "Content-Type": "application/json",
475
+ },
476
+ };
477
+ const signedRequestConfig = this.signRequest(requestConfig);
478
+ const { data } = yield this.axiosClient(signedRequestConfig);
479
+ if (!data.success) {
480
+ throw new Error("Error getting Bitso deposit");
481
+ }
482
+ return data.payload.find((deposit) => deposit.details.concepto === concepto);
483
+ });
484
+ }
468
485
  signRequest(requestConfig) {
469
486
  var _a;
470
487
  const url = new URL(requestConfig.url || "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2583",
3
+ "version": "1.0.2585",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",