xrpl 2.3.0 → 2.3.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.
@@ -59305,7 +59305,7 @@ exports.Currency = void 0;
59305
59305
  var hash_160_1 = __webpack_require__(/*! ./hash-160 */ "../../node_modules/ripple-binary-codec/dist/types/hash-160.js");
59306
59306
  var buffer_1 = __webpack_require__(/*! buffer/ */ "../../node_modules/ripple-binary-codec/node_modules/buffer/index.js");
59307
59307
  var XRP_HEX_REGEX = /^0{40}$/;
59308
- var ISO_REGEX = /^[A-Z0-9]{3}$/;
59308
+ var ISO_REGEX = /^[A-Z0-9a-z?!@#$%^&*(){}[\]|]{3}$/;
59309
59309
  var HEX_REGEX = /^[A-F0-9]{40}$/;
59310
59310
  // eslint-disable-next-line no-control-regex
59311
59311
  var STANDARD_FORMAT_HEX_REGEX = /^0{24}[\x00-\x7F]{6}0{10}$/;
@@ -68810,6 +68810,7 @@ var FaucetNetwork;
68810
68810
  (function (FaucetNetwork) {
68811
68811
  FaucetNetwork["Testnet"] = "faucet.altnet.rippletest.net";
68812
68812
  FaucetNetwork["Devnet"] = "faucet.devnet.rippletest.net";
68813
+ FaucetNetwork["NFTDevnet"] = "faucet-nft.ripple.com";
68813
68814
  })(FaucetNetwork || (FaucetNetwork = {}));
68814
68815
  const INTERVAL_SECONDS = 1;
68815
68816
  const MAX_ATTEMPTS = 20;
@@ -68951,6 +68952,9 @@ function getFaucetHost(client) {
68951
68952
  if (connectionUrl.includes('devnet')) {
68952
68953
  return FaucetNetwork.Devnet;
68953
68954
  }
68955
+ if (connectionUrl.includes('xls20-sandbox')) {
68956
+ return FaucetNetwork.NFTDevnet;
68957
+ }
68954
68958
  throw new errors_1.XRPLFaucetError('Faucet URL is not defined or inferrable.');
68955
68959
  }
68956
68960
  exports["default"] = fundWallet;
@@ -68970,6 +68974,7 @@ exports._private = _private;
68970
68974
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
68971
68975
 
68972
68976
  "use strict";
68977
+ /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ "../../node_modules/buffer/index.js")["Buffer"];
68973
68978
 
68974
68979
  var __importDefault = (this && this.__importDefault) || function (mod) {
68975
68980
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -68984,6 +68989,7 @@ const ripple_binary_codec_1 = __webpack_require__(/*! ripple-binary-codec */ "..
68984
68989
  const ripple_keypairs_1 = __webpack_require__(/*! ripple-keypairs */ "../../node_modules/ripple-keypairs/dist/index.js");
68985
68990
  const ECDSA_1 = __importDefault(__webpack_require__(/*! ../ECDSA */ "./dist/npm/ECDSA.js"));
68986
68991
  const errors_1 = __webpack_require__(/*! ../errors */ "./dist/npm/errors.js");
68992
+ const common_1 = __webpack_require__(/*! ../models/transactions/common */ "./dist/npm/models/transactions/common.js");
68987
68993
  const utils_1 = __webpack_require__(/*! ../models/utils */ "./dist/npm/models/utils/index.js");
68988
68994
  const utils_2 = __webpack_require__(/*! ../sugar/utils */ "./dist/npm/sugar/utils.js");
68989
68995
  const hashLedger_1 = __webpack_require__(/*! ../utils/hashes/hashLedger */ "./dist/npm/utils/hashes/hashLedger.js");
@@ -69146,6 +69152,27 @@ class Wallet {
69146
69152
  }
69147
69153
  txCopy.URI = txCopy.URI.toUpperCase();
69148
69154
  }
69155
+ Object.keys(txCopy).forEach((key) => {
69156
+ const standard_currency_code_len = 3;
69157
+ if (txCopy[key] && (0, common_1.isIssuedCurrency)(txCopy[key])) {
69158
+ const decodedAmount = decoded[key];
69159
+ const decodedCurrency = decodedAmount.currency;
69160
+ const txCurrency = txCopy[key].currency;
69161
+ if (txCurrency.length === standard_currency_code_len &&
69162
+ txCurrency.toUpperCase() === 'XRP') {
69163
+ throw new errors_1.XrplError(`Trying to sign an issued currency with a similar standard code to XRP (received '${txCurrency}'). XRP is not an issued currency.`);
69164
+ }
69165
+ const amount = txCopy[key];
69166
+ if (amount.currency.length !== decodedCurrency.length) {
69167
+ if (decodedCurrency.length === standard_currency_code_len) {
69168
+ decodedAmount.currency = isoToHex(decodedCurrency);
69169
+ }
69170
+ else {
69171
+ txCopy[key].currency = isoToHex(txCopy[key].currency);
69172
+ }
69173
+ }
69174
+ }
69175
+ });
69149
69176
  if (!lodash_1.default.isEqual(decoded, txCopy)) {
69150
69177
  const data = {
69151
69178
  decoded,
@@ -69175,6 +69202,14 @@ function removeTrailingZeros(tx) {
69175
69202
  tx.Amount.value = new bignumber_js_1.default(tx.Amount.value).toString();
69176
69203
  }
69177
69204
  }
69205
+ function isoToHex(iso) {
69206
+ const bytes = Buffer.alloc(20);
69207
+ if (iso !== 'XRP') {
69208
+ const isoBytes = iso.split('').map((chr) => chr.charCodeAt(0));
69209
+ bytes.set(isoBytes, 12);
69210
+ }
69211
+ return bytes.toString('hex').toUpperCase();
69212
+ }
69178
69213
  exports["default"] = Wallet;
69179
69214
 
69180
69215