您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

hash-prefixes.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.HashPrefix = void 0;
  4. const buffer_1 = require("buffer/");
  5. /**
  6. * Write a 32 bit integer to a Buffer
  7. *
  8. * @param uint32 32 bit integer to write to buffer
  9. * @returns a buffer with the bytes representation of uint32
  10. */
  11. function bytes(uint32) {
  12. const result = buffer_1.Buffer.alloc(4);
  13. result.writeUInt32BE(uint32, 0);
  14. return result;
  15. }
  16. /**
  17. * Maps HashPrefix names to their byte representation
  18. */
  19. const HashPrefix = {
  20. transactionID: bytes(0x54584e00),
  21. // transaction plus metadata
  22. transaction: bytes(0x534e4400),
  23. // account state
  24. accountStateEntry: bytes(0x4d4c4e00),
  25. // inner node in tree
  26. innerNode: bytes(0x4d494e00),
  27. // ledger master data for signing
  28. ledgerHeader: bytes(0x4c575200),
  29. // inner transaction to sign
  30. transactionSig: bytes(0x53545800),
  31. // inner transaction to sign
  32. transactionMultiSig: bytes(0x534d5400),
  33. // validation for signing
  34. validation: bytes(0x56414c00),
  35. // proposal for signing
  36. proposal: bytes(0x50525000),
  37. // payment channel claim
  38. paymentChannelClaim: bytes(0x434c4d00),
  39. };
  40. exports.HashPrefix = HashPrefix;
  41. //# sourceMappingURL=hash-prefixes.js.map