You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "use strict";
  2. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3. if (k2 === undefined) k2 = k;
  4. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5. }) : (function(o, m, k, k2) {
  6. if (k2 === undefined) k2 = k;
  7. o[k2] = m[k];
  8. }));
  9. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  10. Object.defineProperty(o, "default", { enumerable: true, value: v });
  11. }) : function(o, v) {
  12. o["default"] = v;
  13. });
  14. var __importStar = (this && this.__importStar) || function (mod) {
  15. if (mod && mod.__esModule) return mod;
  16. var result = {};
  17. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  18. __setModuleDefault(result, mod);
  19. return result;
  20. };
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. exports.serverInfo = exports.validate = exports.errors = exports.constants = exports.ensureClassicAddress = void 0;
  23. const constants = __importStar(require("./constants"));
  24. exports.constants = constants;
  25. const errors = __importStar(require("./errors"));
  26. exports.errors = errors;
  27. const validate = __importStar(require("./validate"));
  28. exports.validate = validate;
  29. const serverInfo = __importStar(require("./serverinfo"));
  30. exports.serverInfo = serverInfo;
  31. const ripple_address_codec_1 = require("ripple-address-codec");
  32. function ensureClassicAddress(account) {
  33. if (ripple_address_codec_1.isValidXAddress(account)) {
  34. const { classicAddress, tag } = ripple_address_codec_1.xAddressToClassicAddress(account);
  35. if (tag !== false) {
  36. throw new Error('This command does not support the use of a tag. Use an address without a tag.');
  37. }
  38. return classicAddress;
  39. }
  40. else {
  41. return account;
  42. }
  43. }
  44. exports.ensureClassicAddress = ensureClassicAddress;
  45. var utils_1 = require("./utils");
  46. Object.defineProperty(exports, "dropsToXrp", { enumerable: true, get: function () { return utils_1.dropsToXrp; } });
  47. Object.defineProperty(exports, "xrpToDrops", { enumerable: true, get: function () { return utils_1.xrpToDrops; } });
  48. Object.defineProperty(exports, "toRippledAmount", { enumerable: true, get: function () { return utils_1.toRippledAmount; } });
  49. Object.defineProperty(exports, "removeUndefined", { enumerable: true, get: function () { return utils_1.removeUndefined; } });
  50. Object.defineProperty(exports, "convertKeysFromSnakeCaseToCamelCase", { enumerable: true, get: function () { return utils_1.convertKeysFromSnakeCaseToCamelCase; } });
  51. Object.defineProperty(exports, "iso8601ToRippleTime", { enumerable: true, get: function () { return utils_1.iso8601ToRippleTime; } });
  52. Object.defineProperty(exports, "rippleTimeToISO8601", { enumerable: true, get: function () { return utils_1.rippleTimeToISO8601; } });
  53. var connection_1 = require("./connection");
  54. Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_1.Connection; } });
  55. var txflags_1 = require("./txflags");
  56. Object.defineProperty(exports, "txFlags", { enumerable: true, get: function () { return txflags_1.txFlags; } });
  57. //# sourceMappingURL=index.js.map