ripple-binary-codec 1.4.2 → 1.4.3
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.
- package/dist/binary.js +25 -29
- package/dist/binary.js.map +1 -1
- package/dist/coretypes.js +31 -8
- package/dist/coretypes.js.map +1 -1
- package/dist/enums/bytes.d.ts +26 -0
- package/dist/enums/bytes.js +64 -0
- package/dist/enums/bytes.js.map +1 -0
- package/dist/enums/constants.d.ts +4 -0
- package/dist/enums/constants.js +8 -0
- package/dist/enums/constants.js.map +1 -0
- package/dist/enums/definitions.json +2330 -1971
- package/dist/enums/field.d.ts +29 -0
- package/dist/enums/field.js +59 -0
- package/dist/enums/field.js.map +1 -0
- package/dist/enums/index.js +69 -60
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/src/enums/definitions.json +2337 -0
- package/dist/enums/utils-renumber.js +14 -14
- package/dist/enums/utils-renumber.js.map +1 -1
- package/dist/enums/xrpl-definitions-base.d.ts +44 -0
- package/dist/enums/xrpl-definitions-base.js +64 -0
- package/dist/enums/xrpl-definitions-base.js.map +1 -0
- package/dist/enums/xrpl-definitions.d.ts +21 -0
- package/dist/enums/xrpl-definitions.js +28 -0
- package/dist/enums/xrpl-definitions.js.map +1 -0
- package/dist/hash-prefixes.js +3 -3
- package/dist/hash-prefixes.js.map +1 -1
- package/dist/hashes.js +21 -43
- package/dist/hashes.js.map +1 -1
- package/dist/index.d.ts +2 -12
- package/dist/index.js +39 -16
- package/dist/index.js.map +1 -1
- package/dist/ledger-hashes.d.ts +1 -1
- package/dist/ledger-hashes.js +51 -28
- package/dist/ledger-hashes.js.map +1 -1
- package/dist/quality.js +18 -21
- package/dist/quality.js.map +1 -1
- package/dist/serdes/binary-parser.js +78 -56
- package/dist/serdes/binary-parser.js.map +1 -1
- package/dist/serdes/binary-serializer.js +59 -40
- package/dist/serdes/binary-serializer.js.map +1 -1
- package/dist/shamap.js +70 -98
- package/dist/shamap.js.map +1 -1
- package/dist/types/account-id.js +18 -35
- package/dist/types/account-id.js.map +1 -1
- package/dist/types/amount.js +71 -88
- package/dist/types/amount.js.map +1 -1
- package/dist/types/blob.js +10 -27
- package/dist/types/blob.js.map +1 -1
- package/dist/types/currency.js +26 -44
- package/dist/types/currency.js.map +1 -1
- package/dist/types/hash-128.d.ts +6 -0
- package/dist/types/hash-128.js +23 -25
- package/dist/types/hash-128.js.map +1 -1
- package/dist/types/hash-160.js +8 -25
- package/dist/types/hash-160.js.map +1 -1
- package/dist/types/hash-256.js +8 -25
- package/dist/types/hash-256.js.map +1 -1
- package/dist/types/hash.js +20 -38
- package/dist/types/hash.js.map +1 -1
- package/dist/types/index.js +18 -18
- package/dist/types/index.js.map +1 -1
- package/dist/types/path-set.js +57 -87
- package/dist/types/path-set.js.map +1 -1
- package/dist/types/serialized-type.d.ts +3 -3
- package/dist/types/serialized-type.js +35 -56
- package/dist/types/serialized-type.js.map +1 -1
- package/dist/types/st-array.js +26 -46
- package/dist/types/st-array.js.map +1 -1
- package/dist/types/st-object.js +49 -73
- package/dist/types/st-object.js.map +1 -1
- package/dist/types/uint-16.js +15 -32
- package/dist/types/uint-16.js.map +1 -1
- package/dist/types/uint-32.js +16 -33
- package/dist/types/uint-32.js.map +1 -1
- package/dist/types/uint-64.d.ts +1 -1
- package/dist/types/uint-64.js +30 -47
- package/dist/types/uint-64.js.map +1 -1
- package/dist/types/uint-8.js +15 -32
- package/dist/types/uint-8.js.map +1 -1
- package/dist/types/uint.d.ts +1 -1
- package/dist/types/uint.js +10 -27
- package/dist/types/uint.js.map +1 -1
- package/dist/types/vector-256.js +23 -40
- package/dist/types/vector-256.js.map +1 -1
- package/package.json +6 -8
- package/test/amount.test.js +1 -1
- package/test/binary-json.test.js +1 -1
- package/test/binary-parser.test.js +4 -4
- package/test/binary-serializer.test.js +3 -3
- package/test/fixtures/data-driven-tests.json +0 -14
- package/test/hash.test.js +28 -2
- package/test/ledger.test.js +1 -1
- package/test/lower-case-hex.test.js +1 -1
- package/test/pseudo-transaction.test.js +1 -1
- package/test/quality.test.js +1 -1
- package/test/shamap.test.js +3 -3
- package/test/signing-data-encoding.test.js +1 -1
- package/test/tx-encode-decode.test.js +1 -1
- package/test/types.test.js +2 -2
- package/test/uint.test.js +2 -2
- package/test/x-address.test.js +1 -1
package/dist/types/uint-32.js
CHANGED
|
@@ -1,46 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.UInt32 = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const uint_1 = require("./uint");
|
|
5
|
+
const buffer_1 = require("buffer/");
|
|
21
6
|
/**
|
|
22
7
|
* Derived UInt class for serializing/deserializing 32 bit UInt
|
|
23
8
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return _super.call(this, bytes !== null && bytes !== void 0 ? bytes : UInt32.defaultUInt32.bytes) || this;
|
|
9
|
+
class UInt32 extends uint_1.UInt {
|
|
10
|
+
constructor(bytes) {
|
|
11
|
+
super(bytes !== null && bytes !== void 0 ? bytes : UInt32.defaultUInt32.bytes);
|
|
28
12
|
}
|
|
29
|
-
|
|
13
|
+
static fromParser(parser) {
|
|
30
14
|
return new UInt32(parser.read(UInt32.width));
|
|
31
|
-
}
|
|
15
|
+
}
|
|
32
16
|
/**
|
|
33
17
|
* Construct a UInt32 object from a number
|
|
34
18
|
*
|
|
35
19
|
* @param val UInt32 object or number
|
|
36
20
|
*/
|
|
37
|
-
|
|
21
|
+
static from(val) {
|
|
38
22
|
if (val instanceof UInt32) {
|
|
39
23
|
return val;
|
|
40
24
|
}
|
|
41
|
-
|
|
25
|
+
const buf = buffer_1.Buffer.alloc(UInt32.width);
|
|
42
26
|
if (typeof val === 'string') {
|
|
43
|
-
|
|
27
|
+
const num = Number.parseInt(val);
|
|
44
28
|
buf.writeUInt32BE(num, 0);
|
|
45
29
|
return new UInt32(buf);
|
|
46
30
|
}
|
|
@@ -49,18 +33,17 @@ var UInt32 = /** @class */ (function (_super) {
|
|
|
49
33
|
return new UInt32(buf);
|
|
50
34
|
}
|
|
51
35
|
throw new Error('Cannot construct UInt32 from given value');
|
|
52
|
-
}
|
|
36
|
+
}
|
|
53
37
|
/**
|
|
54
38
|
* get the value of a UInt32 object
|
|
55
39
|
*
|
|
56
40
|
* @returns the number represented by this.bytes
|
|
57
41
|
*/
|
|
58
|
-
|
|
42
|
+
valueOf() {
|
|
59
43
|
return this.bytes.readUInt32BE(0);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
UInt32.defaultUInt32 = new UInt32(buffer_1.Buffer.alloc(UInt32.width));
|
|
63
|
-
return UInt32;
|
|
64
|
-
}(uint_1.UInt));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
65
46
|
exports.UInt32 = UInt32;
|
|
47
|
+
UInt32.width = 32 / 8; // 4
|
|
48
|
+
UInt32.defaultUInt32 = new UInt32(buffer_1.Buffer.alloc(UInt32.width));
|
|
66
49
|
//# sourceMappingURL=uint-32.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uint-32.js","sourceRoot":"","sources":["../../src/types/uint-32.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uint-32.js","sourceRoot":"","sources":["../../src/types/uint-32.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,oCAAgC;AAEhC;;GAEG;AACH,MAAM,MAAO,SAAQ,WAAI;IAIvB,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAoB;QACpC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC9C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAqC,GAAM;QACpD,IAAI,GAAG,YAAY,MAAM,EAAE;YACzB,OAAO,GAAG,CAAA;SACX;QAED,MAAM,GAAG,GAAG,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAEtC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAChC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;YACzB,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAA;SACvB;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;YACzB,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAA;SACvB;QAED,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC7D,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IACnC,CAAC;;AAGM,wBAAM;AA/Ca,YAAK,GAAW,EAAE,GAAG,CAAC,CAAA,CAAC,IAAI;AACrC,oBAAa,GAAW,IAAI,MAAM,CAAC,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA"}
|
package/dist/types/uint-64.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UInt } from './uint';
|
|
2
2
|
import { BinaryParser } from '../serdes/binary-parser';
|
|
3
|
-
import
|
|
3
|
+
import bigInt = require('big-integer');
|
|
4
4
|
import { Buffer } from 'buffer/';
|
|
5
5
|
/**
|
|
6
6
|
* Derived UInt class for serializing/deserializing 64 bit UInt
|
package/dist/types/uint-64.js
CHANGED
|
@@ -1,104 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.UInt64 = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
const uint_1 = require("./uint");
|
|
5
|
+
const bigInt = require("big-integer");
|
|
6
|
+
const big_integer_1 = require("big-integer");
|
|
7
|
+
const buffer_1 = require("buffer/");
|
|
8
|
+
const HEX_REGEX = /^[a-fA-F0-9]{1,16}$/;
|
|
9
|
+
const mask = bigInt(0x00000000ffffffff);
|
|
25
10
|
/**
|
|
26
11
|
* Derived UInt class for serializing/deserializing 64 bit UInt
|
|
27
12
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _super.call(this, bytes !== null && bytes !== void 0 ? bytes : UInt64.defaultUInt64.bytes) || this;
|
|
13
|
+
class UInt64 extends uint_1.UInt {
|
|
14
|
+
constructor(bytes) {
|
|
15
|
+
super(bytes !== null && bytes !== void 0 ? bytes : UInt64.defaultUInt64.bytes);
|
|
32
16
|
}
|
|
33
|
-
|
|
17
|
+
static fromParser(parser) {
|
|
34
18
|
return new UInt64(parser.read(UInt64.width));
|
|
35
|
-
}
|
|
19
|
+
}
|
|
36
20
|
/**
|
|
37
21
|
* Construct a UInt64 object
|
|
38
22
|
*
|
|
39
23
|
* @param val A UInt64, hex-string, bigInt, or number
|
|
40
24
|
* @returns A UInt64 object
|
|
41
25
|
*/
|
|
42
|
-
|
|
26
|
+
static from(val) {
|
|
43
27
|
if (val instanceof UInt64) {
|
|
44
28
|
return val;
|
|
45
29
|
}
|
|
46
|
-
|
|
30
|
+
let buf = buffer_1.Buffer.alloc(UInt64.width);
|
|
47
31
|
if (typeof val === 'number') {
|
|
48
32
|
if (val < 0) {
|
|
49
33
|
throw new Error('value must be an unsigned integer');
|
|
50
34
|
}
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
const number = bigInt(val);
|
|
36
|
+
const intBuf = [buffer_1.Buffer.alloc(4), buffer_1.Buffer.alloc(4)];
|
|
53
37
|
intBuf[0].writeUInt32BE(Number(number.shiftRight(32)), 0);
|
|
54
38
|
intBuf[1].writeUInt32BE(Number(number.and(mask)), 0);
|
|
55
39
|
return new UInt64(buffer_1.Buffer.concat(intBuf));
|
|
56
40
|
}
|
|
57
41
|
if (typeof val === 'string') {
|
|
58
42
|
if (!HEX_REGEX.test(val)) {
|
|
59
|
-
throw new Error(
|
|
43
|
+
throw new Error(`${val} is not a valid hex-string`);
|
|
60
44
|
}
|
|
61
|
-
|
|
45
|
+
const strBuf = val.padStart(16, '0');
|
|
62
46
|
buf = buffer_1.Buffer.from(strBuf, 'hex');
|
|
63
47
|
return new UInt64(buf);
|
|
64
48
|
}
|
|
65
49
|
if ((0, big_integer_1.isInstance)(val)) {
|
|
66
|
-
|
|
50
|
+
const intBuf = [buffer_1.Buffer.alloc(4), buffer_1.Buffer.alloc(4)];
|
|
67
51
|
intBuf[0].writeUInt32BE(Number(val.shiftRight(bigInt(32))), 0);
|
|
68
52
|
intBuf[1].writeUInt32BE(Number(val.and(mask)), 0);
|
|
69
53
|
return new UInt64(buffer_1.Buffer.concat(intBuf));
|
|
70
54
|
}
|
|
71
55
|
throw new Error('Cannot construct UInt64 from given value');
|
|
72
|
-
}
|
|
56
|
+
}
|
|
73
57
|
/**
|
|
74
58
|
* The JSON representation of a UInt64 object
|
|
75
59
|
*
|
|
76
60
|
* @returns a hex-string
|
|
77
61
|
*/
|
|
78
|
-
|
|
62
|
+
toJSON() {
|
|
79
63
|
return this.bytes.toString('hex').toUpperCase();
|
|
80
|
-
}
|
|
64
|
+
}
|
|
81
65
|
/**
|
|
82
66
|
* Get the value of the UInt64
|
|
83
67
|
*
|
|
84
68
|
* @returns the number represented buy this.bytes
|
|
85
69
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
valueOf() {
|
|
71
|
+
const msb = bigInt(this.bytes.slice(0, 4).readUInt32BE(0));
|
|
72
|
+
const lsb = bigInt(this.bytes.slice(4).readUInt32BE(0));
|
|
89
73
|
return msb.shiftLeft(bigInt(32)).or(lsb);
|
|
90
|
-
}
|
|
74
|
+
}
|
|
91
75
|
/**
|
|
92
76
|
* Get the bytes representation of the UInt64 object
|
|
93
77
|
*
|
|
94
78
|
* @returns 8 bytes representing the UInt64
|
|
95
79
|
*/
|
|
96
|
-
|
|
80
|
+
toBytes() {
|
|
97
81
|
return this.bytes;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
UInt64.defaultUInt64 = new UInt64(buffer_1.Buffer.alloc(UInt64.width));
|
|
101
|
-
return UInt64;
|
|
102
|
-
}(uint_1.UInt));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
103
84
|
exports.UInt64 = UInt64;
|
|
85
|
+
UInt64.width = 64 / 8; // 8
|
|
86
|
+
UInt64.defaultUInt64 = new UInt64(buffer_1.Buffer.alloc(UInt64.width));
|
|
104
87
|
//# sourceMappingURL=uint-64.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uint-64.js","sourceRoot":"","sources":["../../src/types/uint-64.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uint-64.js","sourceRoot":"","sources":["../../src/types/uint-64.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,sCAAsC;AACtC,6CAAwC;AACxC,oCAAgC;AAEhC,MAAM,SAAS,GAAG,qBAAqB,CAAA;AACvC,MAAM,IAAI,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAEvC;;GAEG;AACH,MAAM,MAAO,SAAQ,WAAI;IAIvB,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAoB;QACpC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC9C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CACT,GAAM;QAEN,IAAI,GAAG,YAAY,MAAM,EAAE;YACzB,OAAO,GAAG,CAAA;SACX;QAED,IAAI,GAAG,GAAG,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAEpC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,IAAI,GAAG,GAAG,CAAC,EAAE;gBACX,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;aACrD;YAED,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;YAE1B,MAAM,MAAM,GAAG,CAAC,eAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,eAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YACjD,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YACzD,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAEpD,OAAO,IAAI,MAAM,CAAC,eAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;SACzC;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACxB,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,4BAA4B,CAAC,CAAA;aACpD;YAED,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;YACpC,GAAG,GAAG,eAAM,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;YAChC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAA;SACvB;QAED,IAAI,IAAA,wBAAU,EAAC,GAAG,CAAC,EAAE;YACnB,MAAM,MAAM,GAAG,CAAC,eAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,eAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YACjD,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC9D,MAAM,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAEjD,OAAO,IAAI,MAAM,CAAC,eAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;SACzC;QAED,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC7D,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;IACjD,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAA;QACvD,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IAC1C,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;;AAGM,wBAAM;AA3Fa,YAAK,GAAW,EAAE,GAAG,CAAC,CAAA,CAAC,IAAI;AACrC,oBAAa,GAAW,IAAI,MAAM,CAAC,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA"}
|
package/dist/types/uint-8.js
CHANGED
|
@@ -1,61 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.UInt8 = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const uint_1 = require("./uint");
|
|
5
|
+
const buffer_1 = require("buffer/");
|
|
21
6
|
/**
|
|
22
7
|
* Derived UInt class for serializing/deserializing 8 bit UInt
|
|
23
8
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return _super.call(this, bytes !== null && bytes !== void 0 ? bytes : UInt8.defaultUInt8.bytes) || this;
|
|
9
|
+
class UInt8 extends uint_1.UInt {
|
|
10
|
+
constructor(bytes) {
|
|
11
|
+
super(bytes !== null && bytes !== void 0 ? bytes : UInt8.defaultUInt8.bytes);
|
|
28
12
|
}
|
|
29
|
-
|
|
13
|
+
static fromParser(parser) {
|
|
30
14
|
return new UInt8(parser.read(UInt8.width));
|
|
31
|
-
}
|
|
15
|
+
}
|
|
32
16
|
/**
|
|
33
17
|
* Construct a UInt8 object from a number
|
|
34
18
|
*
|
|
35
19
|
* @param val UInt8 object or number
|
|
36
20
|
*/
|
|
37
|
-
|
|
21
|
+
static from(val) {
|
|
38
22
|
if (val instanceof UInt8) {
|
|
39
23
|
return val;
|
|
40
24
|
}
|
|
41
25
|
if (typeof val === 'number') {
|
|
42
|
-
|
|
26
|
+
const buf = buffer_1.Buffer.alloc(UInt8.width);
|
|
43
27
|
buf.writeUInt8(val, 0);
|
|
44
28
|
return new UInt8(buf);
|
|
45
29
|
}
|
|
46
30
|
throw new Error('Cannot construct UInt8 from given value');
|
|
47
|
-
}
|
|
31
|
+
}
|
|
48
32
|
/**
|
|
49
33
|
* get the value of a UInt8 object
|
|
50
34
|
*
|
|
51
35
|
* @returns the number represented by this.bytes
|
|
52
36
|
*/
|
|
53
|
-
|
|
37
|
+
valueOf() {
|
|
54
38
|
return this.bytes.readUInt8(0);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
UInt8.defaultUInt8 = new UInt8(buffer_1.Buffer.alloc(UInt8.width));
|
|
58
|
-
return UInt8;
|
|
59
|
-
}(uint_1.UInt));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
60
41
|
exports.UInt8 = UInt8;
|
|
42
|
+
UInt8.width = 8 / 8; // 1
|
|
43
|
+
UInt8.defaultUInt8 = new UInt8(buffer_1.Buffer.alloc(UInt8.width));
|
|
61
44
|
//# sourceMappingURL=uint-8.js.map
|
package/dist/types/uint-8.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uint-8.js","sourceRoot":"","sources":["../../src/types/uint-8.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uint-8.js","sourceRoot":"","sources":["../../src/types/uint-8.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAE7B,oCAAgC;AAEhC;;GAEG;AACH,MAAM,KAAM,SAAQ,WAAI;IAItB,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC1C,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAoB;QACpC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;IAC5C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAA2B,GAAM;QAC1C,IAAI,GAAG,YAAY,KAAK,EAAE;YACxB,OAAO,GAAG,CAAA;SACX;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,MAAM,GAAG,GAAG,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACrC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;YACtB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;SACtB;QAED,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAC5D,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IAChC,CAAC;;AAGM,sBAAK;AAxCc,WAAK,GAAW,CAAC,GAAG,CAAC,CAAA,CAAC,IAAI;AACpC,kBAAY,GAAU,IAAI,KAAK,CAAC,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA"}
|
package/dist/types/uint.d.ts
CHANGED
package/dist/types/uint.js
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.UInt = void 0;
|
|
19
|
-
|
|
4
|
+
const serialized_type_1 = require("./serialized-type");
|
|
20
5
|
/**
|
|
21
6
|
* Compare numbers and bigInts n1 and n2
|
|
22
7
|
*
|
|
@@ -30,10 +15,9 @@ function compare(n1, n2) {
|
|
|
30
15
|
/**
|
|
31
16
|
* Base class for serializing and deserializing unsigned integers.
|
|
32
17
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return _super.call(this, bytes) || this;
|
|
18
|
+
class UInt extends serialized_type_1.Comparable {
|
|
19
|
+
constructor(bytes) {
|
|
20
|
+
super(bytes);
|
|
37
21
|
}
|
|
38
22
|
/**
|
|
39
23
|
* Overload of compareTo for Comparable
|
|
@@ -41,19 +25,18 @@ var UInt = /** @class */ (function (_super) {
|
|
|
41
25
|
* @param other other UInt to compare this to
|
|
42
26
|
* @returns -1, 0, or 1 depending on how the objects relate to each other
|
|
43
27
|
*/
|
|
44
|
-
|
|
28
|
+
compareTo(other) {
|
|
45
29
|
return compare(this.valueOf(), other.valueOf());
|
|
46
|
-
}
|
|
30
|
+
}
|
|
47
31
|
/**
|
|
48
32
|
* Convert a UInt object to JSON
|
|
49
33
|
*
|
|
50
34
|
* @returns number or string represented by this.bytes
|
|
51
35
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
toJSON() {
|
|
37
|
+
const val = this.valueOf();
|
|
54
38
|
return typeof val === 'number' ? val : val.toString();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
}(serialized_type_1.Comparable));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
58
41
|
exports.UInt = UInt;
|
|
59
42
|
//# sourceMappingURL=uint.js.map
|
package/dist/types/uint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uint.js","sourceRoot":"","sources":["../../src/types/uint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uint.js","sourceRoot":"","sources":["../../src/types/uint.ts"],"names":[],"mappings":";;;AACA,uDAA8C;AAG9C;;;;;;GAMG;AACH,SAAS,OAAO,CACd,EAA8B,EAC9B,EAA8B;IAE9B,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC;AAED;;GAEG;AACH,MAAe,IAAK,SAAQ,4BAAU;IAGpC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,KAAW;QACnB,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;IACjD,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAA;QAC1B,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;IACvD,CAAC;CAQF;AAEQ,oBAAI"}
|
package/dist/types/vector-256.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.Vector256 = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
const serialized_type_1 = require("./serialized-type");
|
|
5
|
+
const hash_256_1 = require("./hash-256");
|
|
6
|
+
const binary_serializer_1 = require("../serdes/binary-serializer");
|
|
22
7
|
/**
|
|
23
8
|
* TypeGuard for Array<string>
|
|
24
9
|
*/
|
|
@@ -28,10 +13,9 @@ function isStrings(arg) {
|
|
|
28
13
|
/**
|
|
29
14
|
* Class for serializing and deserializing vectors of Hash256
|
|
30
15
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _super.call(this, bytes) || this;
|
|
16
|
+
class Vector256 extends serialized_type_1.SerializedType {
|
|
17
|
+
constructor(bytes) {
|
|
18
|
+
super(bytes);
|
|
35
19
|
}
|
|
36
20
|
/**
|
|
37
21
|
* Construct a Vector256 from a BinaryParser
|
|
@@ -40,53 +24,52 @@ var Vector256 = /** @class */ (function (_super) {
|
|
|
40
24
|
* @param hint length of the vector, in bytes, optional
|
|
41
25
|
* @returns a Vector256 object
|
|
42
26
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
for (
|
|
27
|
+
static fromParser(parser, hint) {
|
|
28
|
+
const bytesList = new binary_serializer_1.BytesList();
|
|
29
|
+
const bytes = hint !== null && hint !== void 0 ? hint : parser.size();
|
|
30
|
+
const hashes = bytes / 32;
|
|
31
|
+
for (let i = 0; i < hashes; i++) {
|
|
48
32
|
hash_256_1.Hash256.fromParser(parser).toBytesSink(bytesList);
|
|
49
33
|
}
|
|
50
34
|
return new Vector256(bytesList.toBytes());
|
|
51
|
-
}
|
|
35
|
+
}
|
|
52
36
|
/**
|
|
53
37
|
* Construct a Vector256 object from an array of hashes
|
|
54
38
|
*
|
|
55
39
|
* @param value A Vector256 object or array of hex-strings representing Hash256's
|
|
56
40
|
* @returns a Vector256 object
|
|
57
41
|
*/
|
|
58
|
-
|
|
42
|
+
static from(value) {
|
|
59
43
|
if (value instanceof Vector256) {
|
|
60
44
|
return value;
|
|
61
45
|
}
|
|
62
46
|
if (isStrings(value)) {
|
|
63
|
-
|
|
64
|
-
value.forEach(
|
|
65
|
-
hash_256_1.Hash256.from(hash).toBytesSink(
|
|
47
|
+
const bytesList = new binary_serializer_1.BytesList();
|
|
48
|
+
value.forEach((hash) => {
|
|
49
|
+
hash_256_1.Hash256.from(hash).toBytesSink(bytesList);
|
|
66
50
|
});
|
|
67
|
-
return new Vector256(
|
|
51
|
+
return new Vector256(bytesList.toBytes());
|
|
68
52
|
}
|
|
69
53
|
throw new Error('Cannot construct Vector256 from given value');
|
|
70
|
-
}
|
|
54
|
+
}
|
|
71
55
|
/**
|
|
72
56
|
* Return an Array of hex-strings represented by this.bytes
|
|
73
57
|
*
|
|
74
58
|
* @returns An Array of strings representing the Hash256 objects
|
|
75
59
|
*/
|
|
76
|
-
|
|
60
|
+
toJSON() {
|
|
77
61
|
if (this.bytes.byteLength % 32 !== 0) {
|
|
78
62
|
throw new Error('Invalid bytes for Vector256');
|
|
79
63
|
}
|
|
80
|
-
|
|
81
|
-
for (
|
|
64
|
+
const result = [];
|
|
65
|
+
for (let i = 0; i < this.bytes.byteLength; i += 32) {
|
|
82
66
|
result.push(this.bytes
|
|
83
67
|
.slice(i, i + 32)
|
|
84
68
|
.toString('hex')
|
|
85
69
|
.toUpperCase());
|
|
86
70
|
}
|
|
87
71
|
return result;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}(serialized_type_1.SerializedType));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
91
74
|
exports.Vector256 = Vector256;
|
|
92
75
|
//# sourceMappingURL=vector-256.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-256.js","sourceRoot":"","sources":["../../src/types/vector-256.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vector-256.js","sourceRoot":"","sources":["../../src/types/vector-256.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAElD,yCAAoC;AACpC,mEAAuD;AAGvD;;GAEG;AACH,SAAS,SAAS,CAAC,GAAG;IACpB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAA;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,SAAU,SAAQ,gCAAc;IACpC,YAAY,KAAa;QACvB,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAoB,EAAE,IAAa;QACnD,MAAM,SAAS,GAAG,IAAI,6BAAS,EAAE,CAAA;QACjC,MAAM,KAAK,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,MAAM,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,MAAM,GAAG,KAAK,GAAG,EAAE,CAAA;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,kBAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;SAClD;QACD,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAsC,KAAQ;QACvD,IAAI,KAAK,YAAY,SAAS,EAAE;YAC9B,OAAO,KAAK,CAAA;SACb;QAED,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;YACpB,MAAM,SAAS,GAAG,IAAI,6BAAS,EAAE,CAAA;YACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBACrB,kBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;YAC3C,CAAC,CAAC,CAAA;YACF,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;SAC1C;QAED,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAChE,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,KAAK,CAAC,EAAE;YACpC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;SAC/C;QAED,MAAM,MAAM,GAAkB,EAAE,CAAA;QAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;YAClD,MAAM,CAAC,IAAI,CACT,IAAI,CAAC,KAAK;iBACP,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;iBAChB,QAAQ,CAAC,KAAK,CAAC;iBACf,WAAW,EAAE,CACjB,CAAA;SACF;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAEQ,8BAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripple-binary-codec",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "XRP Ledger binary codec",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/*",
|
|
@@ -17,15 +17,13 @@
|
|
|
17
17
|
"buffer": "5.6.0",
|
|
18
18
|
"create-hash": "^1.2.0",
|
|
19
19
|
"decimal.js": "^10.2.0",
|
|
20
|
-
"ripple-address-codec": "^4.2.
|
|
20
|
+
"ripple-address-codec": "^4.2.5"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "
|
|
24
|
-
"build:default": "tsc -b && copy .\\src\\enums\\definitions.json .\\dist\\enums",
|
|
25
|
-
"build:nix": "tsc -b && cp ./src/enums/definitions.json ./dist/enums",
|
|
23
|
+
"build": "tsc -b && copyfiles ./src/enums/definitions.json ./dist/enums/",
|
|
26
24
|
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
|
|
27
25
|
"prepare": "npm run build && npm test",
|
|
28
|
-
"test": "jest",
|
|
26
|
+
"test": "jest --verbose false --silent=false ./test/*.test.js",
|
|
29
27
|
"lint": "eslint . --ext .ts --ext .test.js"
|
|
30
28
|
},
|
|
31
29
|
"repository": {
|
|
@@ -40,7 +38,7 @@
|
|
|
40
38
|
"readmeFilename": "README.md",
|
|
41
39
|
"prettier": "@xrplf/prettier-config",
|
|
42
40
|
"engines": {
|
|
43
|
-
"node": ">=10
|
|
41
|
+
"node": ">= 10"
|
|
44
42
|
},
|
|
45
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b3d3bc2f99c21336c32d234026ddff79f16e8194"
|
|
46
44
|
}
|
package/test/amount.test.js
CHANGED
package/test/binary-json.test.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const { coreTypes } = require('../
|
|
1
|
+
const { coreTypes } = require('../src/types')
|
|
2
2
|
const Decimal = require('decimal.js')
|
|
3
3
|
|
|
4
4
|
const { encodeAccountID } = require('ripple-address-codec')
|
|
5
|
-
const { binary } = require('../
|
|
5
|
+
const { binary } = require('../src/coretypes')
|
|
6
6
|
const { Amount, Hash160 } = coreTypes
|
|
7
7
|
const { makeParser, readJSON } = binary
|
|
8
|
-
const { Field, TransactionType } = require('./../
|
|
8
|
+
const { Field, TransactionType } = require('./../src/enums')
|
|
9
9
|
const { parseHexOnly, hexOnly, loadFixture } = require('./utils')
|
|
10
10
|
const fixtures = loadFixture('data-driven-tests.json')
|
|
11
|
-
const { BytesList } = require('../
|
|
11
|
+
const { BytesList } = require('../src/serdes/binary-serializer')
|
|
12
12
|
const { Buffer } = require('buffer/')
|
|
13
13
|
|
|
14
14
|
const __ = hexOnly
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const { binary } = require('../
|
|
2
|
-
const { encode, decode } = require('../
|
|
1
|
+
const { binary } = require('../src/coretypes')
|
|
2
|
+
const { encode, decode } = require('../src')
|
|
3
3
|
const { makeParser, BytesList, BinarySerializer } = binary
|
|
4
|
-
const { coreTypes } = require('../
|
|
4
|
+
const { coreTypes } = require('../src/types')
|
|
5
5
|
const { UInt8, UInt16, UInt32, UInt64, STObject } = coreTypes
|
|
6
6
|
const bigInt = require('big-integer')
|
|
7
7
|
const { Buffer } = require('buffer/')
|