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.

NFTokenMint.js 1.3KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.validateNFTokenMint = exports.NFTokenMintFlags = void 0;
  4. const errors_1 = require("../../errors");
  5. const utils_1 = require("../utils");
  6. const common_1 = require("./common");
  7. var NFTokenMintFlags;
  8. (function (NFTokenMintFlags) {
  9. NFTokenMintFlags[NFTokenMintFlags["tfBurnable"] = 1] = "tfBurnable";
  10. NFTokenMintFlags[NFTokenMintFlags["tfOnlyXRP"] = 2] = "tfOnlyXRP";
  11. NFTokenMintFlags[NFTokenMintFlags["tfTrustLine"] = 4] = "tfTrustLine";
  12. NFTokenMintFlags[NFTokenMintFlags["tfTransferable"] = 8] = "tfTransferable";
  13. })(NFTokenMintFlags = exports.NFTokenMintFlags || (exports.NFTokenMintFlags = {}));
  14. function validateNFTokenMint(tx) {
  15. (0, common_1.validateBaseTransaction)(tx);
  16. if (tx.Account === tx.Issuer) {
  17. throw new errors_1.ValidationError('NFTokenMint: Issuer must not be equal to Account');
  18. }
  19. if (typeof tx.URI === 'string' && !(0, utils_1.isHex)(tx.URI)) {
  20. throw new errors_1.ValidationError('NFTokenMint: URI must be in hex format');
  21. }
  22. if (tx.NFTokenTaxon == null) {
  23. throw new errors_1.ValidationError('NFTokenMint: missing field NFTokenTaxon');
  24. }
  25. }
  26. exports.validateNFTokenMint = validateNFTokenMint;
  27. //# sourceMappingURL=NFTokenMint.js.map