@bithomp/xrpl-api 2.6.0 → 2.6.1

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.
@@ -27,6 +27,7 @@ exports.parseCurrencyInformation = void 0;
27
27
  const Client = __importStar(require("../client"));
28
28
  const utils_1 = require("../parse/utils");
29
29
  const transaction_1 = require("../parse/transaction");
30
+ const client_1 = require("../client");
30
31
  const maxLength = 12;
31
32
  async function parseCurrencyInformation(currency) {
32
33
  if (!currency || typeof currency !== "string") {
@@ -35,7 +36,7 @@ async function parseCurrencyInformation(currency) {
35
36
  if (currency.length < 3) {
36
37
  return null;
37
38
  }
38
- if (currency.length === 3 && currency.trim().toLowerCase() !== "xrp") {
39
+ if (currency.length === 3 && currency.trim().toUpperCase() !== (0, client_1.getNativeCurrency)()) {
39
40
  return decodeSimple(currency);
40
41
  }
41
42
  if (isHex(currency)) {
@@ -118,7 +119,7 @@ async function decodeXlf15d(currencyCode) {
118
119
  }
119
120
  function decodeHex(currencyHex) {
120
121
  const decodedHex = (0, utils_1.hexToString)(currencyHex)?.slice(0, maxLength)?.trim();
121
- if (decodedHex.match(/[a-zA-Z0-9]{3,}/) && decodedHex.toLowerCase() !== "xrp") {
122
+ if (decodedHex.match(/[a-zA-Z0-9]{3,}/) && decodedHex.toUpperCase() !== (0, client_1.getNativeCurrency)()) {
122
123
  return {
123
124
  type: "hex",
124
125
  currencyCode: currencyHex,
@@ -157,7 +158,7 @@ function ctiTransactionCheckGen(txHash) {
157
158
  function isXlf15d(currencyHex) {
158
159
  const hex = currencyHex.toString().replace(/(00)+$/g, "");
159
160
  const xlf15d = Buffer.from(hex, "hex").slice(8).toString("utf-8").slice(0, maxLength).trim();
160
- if (xlf15d.match(/[a-zA-Z0-9]{3,}/) && xlf15d.toLowerCase() !== "xrp") {
161
+ if (xlf15d.match(/[a-zA-Z0-9]{3,}/) && xlf15d.toUpperCase() !== (0, client_1.getNativeCurrency)()) {
161
162
  return true;
162
163
  }
163
164
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -17,8 +17,10 @@
17
17
  "xrpl",
18
18
  "ws",
19
19
  "xrp",
20
+ "xah",
20
21
  "nft",
21
22
  "xls20",
23
+ "xls35",
22
24
  "unl",
23
25
  "bithomp"
24
26
  ],
@@ -36,7 +38,7 @@
36
38
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
37
39
  "lint": "tslint -p tsconfig.json",
38
40
  "prepare": "npm run build",
39
- "prepublishOnly": "npm test && npm run lint",
41
+ "-prepublishOnly": "npm test && npm run lint",
40
42
  "preversion": "npm run lint",
41
43
  "version": "npm run format && git add -A src",
42
44
  "postversion": "git push && git push --tags"