@riocrypto/common 1.0.886 → 1.0.888

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.
@@ -457,7 +457,7 @@ class RioAdminClient {
457
457
  }
458
458
  getInvoice(orderId) {
459
459
  return __awaiter(this, void 0, void 0, function* () {
460
- const response = yield this.axios.get(`/api/invoices?orderId=${orderId}}`);
460
+ const response = yield this.axios.get(`/api/invoices?orderId=${orderId}`);
461
461
  return response.data;
462
462
  });
463
463
  }
@@ -369,7 +369,7 @@ class RioClient {
369
369
  }
370
370
  getInvoice(orderId) {
371
371
  return __awaiter(this, void 0, void 0, function* () {
372
- const response = yield this.axios.get(`/api/invoices?orderId=${orderId}}`);
372
+ const response = yield this.axios.get(`/api/invoices?orderId=${orderId}`);
373
373
  return response.data;
374
374
  });
375
375
  }
@@ -0,0 +1,2 @@
1
+ import { Crypto } from "../types/crypto";
2
+ export declare const formatTransactionHash: (hash: string, crypto: Crypto) => string;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatTransactionHash = void 0;
4
+ const crypto_1 = require("../types/crypto");
5
+ const formatTransactionHash = (hash, crypto) => {
6
+ if ([crypto_1.Crypto.USDC, crypto_1.Crypto.USDTEthereum].includes(crypto)) {
7
+ return `https://etherscan.io/tx/${hash}`;
8
+ }
9
+ else if ([crypto_1.Crypto.USDCPolygon, crypto_1.Crypto.USDCPolygon].includes(crypto)) {
10
+ return `https://polygonscan.com/tx/${hash}`;
11
+ }
12
+ else if ([crypto_1.Crypto.USDCSolana].includes(crypto)) {
13
+ return `https://explorer.solana.com/tx/${hash}`;
14
+ }
15
+ else if ([crypto_1.Crypto.USDTTron].includes(crypto)) {
16
+ return `https://tronscan.org/#/transaction/${hash}`;
17
+ }
18
+ else {
19
+ return "N/A";
20
+ }
21
+ };
22
+ exports.formatTransactionHash = formatTransactionHash;
package/build/index.d.ts CHANGED
@@ -172,6 +172,7 @@ export * from "./helpers/validate-address";
172
172
  export * from "./helpers/round-down-to-two-decimal-places";
173
173
  export * from "./helpers/humanize-order-status";
174
174
  export * from "./helpers/humanize-kyc-status";
175
+ export * from "./helpers/format-transaction-hash";
175
176
  export * from "./clients/rio-client";
176
177
  export * from "./clients/rio-admin-client";
177
178
  export * from "./constants/mexico-fiscal-regimens";
package/build/index.js CHANGED
@@ -188,6 +188,7 @@ __exportStar(require("./helpers/validate-address"), exports);
188
188
  __exportStar(require("./helpers/round-down-to-two-decimal-places"), exports);
189
189
  __exportStar(require("./helpers/humanize-order-status"), exports);
190
190
  __exportStar(require("./helpers/humanize-kyc-status"), exports);
191
+ __exportStar(require("./helpers/format-transaction-hash"), exports);
191
192
  __exportStar(require("./clients/rio-client"), exports);
192
193
  __exportStar(require("./clients/rio-admin-client"), exports);
193
194
  __exportStar(require("./constants/mexico-fiscal-regimens"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.886",
3
+ "version": "1.0.888",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",