UNPKG

1.25 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.HashPrefix = void 0;
4const 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 */
11function 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 */
19const 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};
40exports.HashPrefix = HashPrefix;
41//# sourceMappingURL=hash-prefixes.js.map
\No newline at end of file