@riocrypto/common-server 1.0.2582 → 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.
@@ -89,6 +89,8 @@ declare class BitsoClient {
89
89
  usdc: number;
90
90
  }>;
91
91
  createCryptoWithdrawal(amount: number, crypto: Crypto, address: string): Promise<Object>;
92
+ getDepositByHash(hash: string): Promise<Object>;
93
+ getDepositByConcepto(concepto: string): Promise<Object>;
92
94
  signRequest(requestConfig: AxiosRequestConfig): AxiosRequestConfig;
93
95
  }
94
96
  export declare const buildBitsoClient: () => Promise<BitsoClient>;
@@ -448,6 +448,40 @@ class BitsoClient {
448
448
  return data.payload;
449
449
  });
450
450
  }
451
+ getDepositByHash(hash) {
452
+ return __awaiter(this, void 0, void 0, function* () {
453
+ const requestConfig = {
454
+ method: "GET",
455
+ url: `${this.baseUrl}/api/v3/fundings`,
456
+ headers: {
457
+ "Content-Type": "application/json",
458
+ },
459
+ };
460
+ const signedRequestConfig = this.signRequest(requestConfig);
461
+ const { data } = yield this.axiosClient(signedRequestConfig);
462
+ if (!data.success) {
463
+ throw new Error("Error getting Bitso deposit");
464
+ }
465
+ return data.payload.find((deposit) => deposit.details.tx_hash === hash);
466
+ });
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
+ }
451
485
  signRequest(requestConfig) {
452
486
  var _a;
453
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.2582",
3
+ "version": "1.0.2585",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",