@bithomp/xrpl-api 3.1.18 → 3.2.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.
Files changed (128) hide show
  1. package/lib/client.js +1 -0
  2. package/lib/common/index.js +17 -7
  3. package/lib/index.js +17 -7
  4. package/lib/ledger/account_info.js +17 -7
  5. package/lib/ledger/account_lines.js +17 -7
  6. package/lib/ledger/account_namespace.js +17 -7
  7. package/lib/ledger/account_nfts.js +17 -7
  8. package/lib/ledger/account_objects.js +17 -7
  9. package/lib/ledger/account_offers.js +17 -7
  10. package/lib/ledger/account_tx.js +44 -21
  11. package/lib/ledger/amm_info.js +17 -7
  12. package/lib/ledger/book_offers.js +17 -7
  13. package/lib/ledger/currency.js +17 -7
  14. package/lib/ledger/fee.js +17 -7
  15. package/lib/ledger/gateway_balances.js +17 -7
  16. package/lib/ledger/ledger.js +17 -7
  17. package/lib/ledger/ledger_entry.js +17 -7
  18. package/lib/ledger/manifest.js +17 -7
  19. package/lib/ledger/nft_info.js +17 -7
  20. package/lib/ledger/server_definitions.js +17 -7
  21. package/lib/ledger/server_info.js +17 -7
  22. package/lib/ledger/transaction.js +17 -7
  23. package/lib/ledger/vl-v2.js +17 -7
  24. package/lib/ledger/vl.js +17 -7
  25. package/lib/models/index.d.ts +3 -0
  26. package/lib/models/index.js +6 -1
  27. package/lib/models/manifest.js +17 -7
  28. package/lib/models/mptoken.d.ts +7 -0
  29. package/lib/models/mptoken.js +26 -0
  30. package/lib/models/vl.js +17 -7
  31. package/lib/parse/index.js +17 -7
  32. package/lib/parse/ledger/account-order.js +3 -3
  33. package/lib/parse/ledger/amount.d.ts +2 -2
  34. package/lib/parse/ledger/amount.js +8 -5
  35. package/lib/parse/ledger/mptoken-authorize-flags.d.ts +5 -0
  36. package/lib/parse/ledger/mptoken-authorize-flags.js +8 -0
  37. package/lib/parse/ledger/mptoken-issuance-create-flags.d.ts +5 -0
  38. package/lib/parse/ledger/mptoken-issuance-create-flags.js +8 -0
  39. package/lib/parse/ledger/mptoken-issuance-set-flags.d.ts +5 -0
  40. package/lib/parse/ledger/mptoken-issuance-set-flags.js +8 -0
  41. package/lib/parse/ledger/orderbook-order.js +3 -3
  42. package/lib/parse/outcome/amm_changes.d.ts +2 -1
  43. package/lib/parse/outcome/balance_changes.d.ts +15 -2
  44. package/lib/parse/outcome/balance_changes.js +33 -2
  45. package/lib/parse/outcome/delivered_amount.d.ts +2 -2
  46. package/lib/parse/outcome/did_changes.d.ts +2 -1
  47. package/lib/parse/outcome/escrow_changes.d.ts +1 -1
  48. package/lib/parse/outcome/index.d.ts +2 -0
  49. package/lib/parse/outcome/index.js +5 -1
  50. package/lib/parse/outcome/locked_balance_changes.d.ts +14 -2
  51. package/lib/parse/outcome/locked_balance_changes.js +2 -21
  52. package/lib/parse/outcome/mptoken_changes.d.ts +1 -0
  53. package/lib/parse/outcome/mptoken_changes.js +84 -0
  54. package/lib/parse/outcome/mptoken_issuance_changes.d.ts +1 -0
  55. package/lib/parse/outcome/mptoken_issuance_changes.js +94 -0
  56. package/lib/parse/outcome/oracle_changes.d.ts +2 -1
  57. package/lib/parse/outcome/orderbook_changes.d.ts +14 -2
  58. package/lib/parse/outcome/orderbook_changes.js +2 -2
  59. package/lib/parse/outcome/orderbook_quality.js +17 -7
  60. package/lib/parse/outcome.js +4 -20
  61. package/lib/parse/specification/account-delete.js +17 -7
  62. package/lib/parse/specification/amendment.js +17 -7
  63. package/lib/parse/specification/amm-bid.js +17 -7
  64. package/lib/parse/specification/amm-create.js +17 -7
  65. package/lib/parse/specification/amm-delete.js +17 -7
  66. package/lib/parse/specification/amm-deposit.js +17 -7
  67. package/lib/parse/specification/amm-vote.js +17 -7
  68. package/lib/parse/specification/amm-withdraw.js +17 -7
  69. package/lib/parse/specification/check-cancel.js +17 -7
  70. package/lib/parse/specification/check-cash.js +17 -7
  71. package/lib/parse/specification/check-create.js +17 -7
  72. package/lib/parse/specification/clawback.js +17 -7
  73. package/lib/parse/specification/deposit-preauth.js +17 -7
  74. package/lib/parse/specification/did-delete.js +17 -7
  75. package/lib/parse/specification/did-set.js +17 -7
  76. package/lib/parse/specification/escrow-cancel.js +17 -7
  77. package/lib/parse/specification/escrow-create.js +17 -7
  78. package/lib/parse/specification/escrow-finish.js +17 -7
  79. package/lib/parse/specification/genesis-mint.js +17 -7
  80. package/lib/parse/specification/import.js +17 -7
  81. package/lib/parse/specification/invoke.js +17 -7
  82. package/lib/parse/specification/mptoken-authorize.d.ts +3 -0
  83. package/lib/parse/specification/mptoken-authorize.js +58 -0
  84. package/lib/parse/specification/mptoken-issuance-create.d.ts +3 -0
  85. package/lib/parse/specification/mptoken-issuance-create.js +60 -0
  86. package/lib/parse/specification/mptoken-issuance-destroy.d.ts +3 -0
  87. package/lib/parse/specification/mptoken-issuance-destroy.js +52 -0
  88. package/lib/parse/specification/mptoken-issuance-set.d.ts +3 -0
  89. package/lib/parse/specification/mptoken-issuance-set.js +58 -0
  90. package/lib/parse/specification/nftoken-accept-offer.js +22 -7
  91. package/lib/parse/specification/nftoken-burn.js +22 -7
  92. package/lib/parse/specification/nftoken-cancel-offer.js +22 -7
  93. package/lib/parse/specification/nftoken-create-offer.js +17 -7
  94. package/lib/parse/specification/nftoken-mint.js +34 -7
  95. package/lib/parse/specification/offer-cancel.js +22 -9
  96. package/lib/parse/specification/offer-create.js +22 -9
  97. package/lib/parse/specification/oracle-delete.js +17 -9
  98. package/lib/parse/specification/oracle-set.js +17 -7
  99. package/lib/parse/specification/payment-channel-claim.js +17 -7
  100. package/lib/parse/specification/payment-channel-create.js +17 -7
  101. package/lib/parse/specification/payment-channel-fund.js +17 -7
  102. package/lib/parse/specification/payment.js +17 -7
  103. package/lib/parse/specification/remit.js +17 -7
  104. package/lib/parse/specification/settings.js +17 -7
  105. package/lib/parse/specification/ticket-create.js +17 -7
  106. package/lib/parse/specification/trustline.js +17 -7
  107. package/lib/parse/specification/unl-report.js +17 -7
  108. package/lib/parse/specification/uritoken-burn.js +17 -7
  109. package/lib/parse/specification/uritoken-buy.js +17 -7
  110. package/lib/parse/specification/uritoken-cancel-sell-offer.js +17 -7
  111. package/lib/parse/specification/uritoken-create-sell-offer.js +17 -7
  112. package/lib/parse/specification/uritoken-mint.js +17 -7
  113. package/lib/parse/transaction.d.ts +4 -1
  114. package/lib/parse/transaction.js +24 -8
  115. package/lib/parse/utils.d.ts +2 -2
  116. package/lib/parse/utils.js +4 -1
  117. package/lib/types/account.d.ts +2 -2
  118. package/lib/types/amounts.d.ts +6 -2
  119. package/lib/types/checks.d.ts +2 -2
  120. package/lib/types/mptokens.d.ts +54 -0
  121. package/lib/types/mptokens.js +19 -0
  122. package/lib/types/nftokens.d.ts +3 -0
  123. package/lib/types/outcome.d.ts +6 -19
  124. package/lib/v1/utils.d.ts +1 -1
  125. package/lib/v1/utils.js +18 -10
  126. package/lib/validator.js +18 -16
  127. package/lib/wallet.js +17 -7
  128. package/package.json +17 -14
package/lib/validator.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -34,7 +44,6 @@ exports.verify2 = verify2;
34
44
  const assert = __importStar(require("assert"));
35
45
  const ripple_address_codec_1 = require("ripple-address-codec");
36
46
  const Crypto = __importStar(require("crypto"));
37
- const Base58 = __importStar(require("./base58"));
38
47
  const elliptic_1 = __importDefault(require("elliptic"));
39
48
  const secp256k1 = new elliptic_1.default.ec("secp256k1");
40
49
  const ed25519 = new elliptic_1.default.eddsa("ed25519");
@@ -56,14 +65,7 @@ function classicAddressFromValidatorPK(pk) {
56
65
  const pubkeyOuterHash = Crypto.createHash("ripemd160");
57
66
  pubkeyOuterHash.update(pubkeyInnerHash.digest());
58
67
  const accountID = pubkeyOuterHash.digest();
59
- const addressTypePrefix = Buffer.from([0x00]);
60
- const payload = Buffer.concat([addressTypePrefix, accountID]);
61
- const chksumHash1 = Crypto.createHash("sha256").update(payload).digest();
62
- const chksumHash2 = Crypto.createHash("sha256").update(chksumHash1).digest();
63
- const checksum = chksumHash2.slice(0, 4);
64
- const dataToEncode = Buffer.concat([payload, checksum]);
65
- const address = Base58.encode(dataToEncode);
66
- return address;
68
+ return (0, ripple_address_codec_1.encodeAccountID)(accountID);
67
69
  }
68
70
  function generateSecrets() {
69
71
  const keypair = Crypto.generateKeyPairSync("ed25519", {
package/lib/wallet.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.1.18",
3
+ "version": "3.2.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",
@@ -41,7 +41,7 @@
41
41
  "test": "node ./node_modules/mocha/bin/mocha",
42
42
  "build": "tsc",
43
43
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
44
- "lint": "eslint -c .eslintrc.json --ext .ts src/",
44
+ "lint": "eslint",
45
45
  "prepare": "npm run build",
46
46
  "prepublishOnly": "npm test && npm run lint",
47
47
  "preversion": "npm run lint",
@@ -52,36 +52,39 @@
52
52
  "lib/**/*"
53
53
  ],
54
54
  "dependencies": {
55
- "axios": "^1.7.7",
55
+ "axios": "^1.7.9",
56
56
  "base-x": "^5.0.0",
57
57
  "bignumber.js": "^9.1.2",
58
58
  "elliptic": "^6.6.1",
59
59
  "lodash": "^4.17.21",
60
60
  "ripple-address-codec": "^5.0.0",
61
- "ripple-binary-codec": "^2.1.0",
62
- "xrpl": "^4.0.0"
61
+ "ripple-binary-codec": "^2.2.0",
62
+ "xrpl": "^4.1.0"
63
63
  },
64
64
  "devDependencies": {
65
+ "@eslint/eslintrc": "^3.2.0",
66
+ "@eslint/js": "^9.17.0",
65
67
  "@types/chai": "^5.0.1",
66
68
  "@types/chai-as-promised": "^8.0.1",
67
69
  "@types/lodash": "^4.17.13",
68
- "@types/mocha": "^10.0.9",
70
+ "@types/mocha": "^10.0.10",
69
71
  "@types/nconf": "^0.10.7",
70
- "@types/node": "^20.14.15",
71
- "@typescript-eslint/eslint-plugin": "^8.14.0",
72
- "@typescript-eslint/parser": "^8.14.0",
72
+ "@types/node": "^22.10.5",
73
+ "@typescript-eslint/eslint-plugin": "^8.19.0",
74
+ "@typescript-eslint/parser": "^8.19.0",
73
75
  "chai": "^4.5.0",
74
76
  "chai-as-promised": "^7.1.2",
75
- "eslint": "^8.57.0",
77
+ "eslint": "^9.17.0",
76
78
  "eslint-config-prettier": "^9.1.0",
77
79
  "eslint-plugin-chai-friendly": "^1.0.1",
78
80
  "eslint-plugin-import": "^2.31.0",
79
- "eslint-plugin-n": "^17.13.2",
80
- "eslint-plugin-promise": "^7.1.0",
81
- "mocha": "^10.8.2",
81
+ "eslint-plugin-n": "^17.15.1",
82
+ "eslint-plugin-promise": "^7.2.1",
83
+ "globals": "^15.14.0",
84
+ "mocha": "^11.0.1",
82
85
  "nconf": "^0.12.1",
83
86
  "ts-jest": "^29.2.5",
84
87
  "ts-node": "^10.9.2",
85
- "typescript": "^5.4.5"
88
+ "typescript": "^5.7.2"
86
89
  }
87
90
  }