ripple-binary-codec 1.6.0-beta.0 → 1.7.0
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.d.ts +21 -6
- package/dist/binary.js +47 -32
- package/dist/binary.js.map +1 -1
- package/dist/coretypes.d.ts +2 -2
- package/dist/coretypes.js +33 -9
- 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 +14 -572
- 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.d.ts +12 -48
- package/dist/enums/index.js +42 -124
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/src/enums/definitions.json +14 -572
- 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 +59 -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 +29 -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 +14 -16
- package/dist/index.js +62 -24
- package/dist/index.js.map +1 -1
- package/dist/ledger-hashes.d.ts +5 -2
- package/dist/ledger-hashes.js +54 -29
- 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.d.ts +6 -3
- package/dist/serdes/binary-parser.js +82 -57
- package/dist/serdes/binary-parser.js.map +1 -1
- package/dist/serdes/binary-serializer.d.ts +1 -1
- package/dist/serdes/binary-serializer.js +59 -40
- package/dist/serdes/binary-serializer.js.map +1 -1
- package/dist/shamap.js +72 -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.d.ts +3 -24
- package/dist/types/index.js +37 -30
- 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.d.ts +6 -3
- package/dist/types/st-object.js +52 -74
- 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 +7 -7
- 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/definitions.test.js +100 -0
- package/test/fixtures/codec-fixtures.json +14 -468
- 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 +104 -2
- 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/issue.d.ts +0 -39
- package/dist/types/issue.js +0 -98
- package/dist/types/issue.js.map +0 -1
- package/dist/types/xchain-attestation-batch.d.ts +0 -44
- package/dist/types/xchain-attestation-batch.js +0 -107
- package/dist/types/xchain-attestation-batch.js.map +0 -1
- package/dist/types/xchain-bridge.d.ts +0 -45
- package/dist/types/xchain-bridge.js +0 -119
- package/dist/types/xchain-bridge.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Bytes } from './bytes';
|
|
2
|
+
import { SerializedType } from '../types/serialized-type';
|
|
3
|
+
import { Buffer } from 'buffer/';
|
|
4
|
+
/**
|
|
5
|
+
* Encoding information for a rippled field, often used in transactions.
|
|
6
|
+
* See the enums [README.md](https://github.com/XRPLF/xrpl.js/tree/main/packages/ripple-binary-codec/src/enums) for more details on what each means.
|
|
7
|
+
*/
|
|
8
|
+
export interface FieldInfo {
|
|
9
|
+
nth: number;
|
|
10
|
+
isVLEncoded: boolean;
|
|
11
|
+
isSerialized: boolean;
|
|
12
|
+
isSigningField: boolean;
|
|
13
|
+
type: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FieldInstance {
|
|
16
|
+
readonly nth: number;
|
|
17
|
+
readonly isVariableLengthEncoded: boolean;
|
|
18
|
+
readonly isSerialized: boolean;
|
|
19
|
+
readonly isSigningField: boolean;
|
|
20
|
+
readonly type: Bytes;
|
|
21
|
+
readonly ordinal: number;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly header: Buffer;
|
|
24
|
+
readonly associatedType: typeof SerializedType;
|
|
25
|
+
}
|
|
26
|
+
export declare class FieldLookup {
|
|
27
|
+
constructor(fields: Array<[string, FieldInfo]>, types: Record<string, number>);
|
|
28
|
+
fromString(value: string): FieldInstance;
|
|
29
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldLookup = void 0;
|
|
4
|
+
const bytes_1 = require("./bytes");
|
|
5
|
+
const serialized_type_1 = require("../types/serialized-type");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const buffer_1 = require("buffer/");
|
|
8
|
+
/*
|
|
9
|
+
* @brief: Serialize a field based on type_code and Field.nth
|
|
10
|
+
*/
|
|
11
|
+
function fieldHeader(type, nth) {
|
|
12
|
+
const header = [];
|
|
13
|
+
if (type < 16) {
|
|
14
|
+
if (nth < 16) {
|
|
15
|
+
header.push((type << 4) | nth);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
header.push(type << 4, nth);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else if (nth < 16) {
|
|
22
|
+
header.push(nth, type);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
header.push(0, type, nth);
|
|
26
|
+
}
|
|
27
|
+
return buffer_1.Buffer.from(header);
|
|
28
|
+
}
|
|
29
|
+
function buildField([name, info], typeOrdinal) {
|
|
30
|
+
const field = fieldHeader(typeOrdinal, info.nth);
|
|
31
|
+
return {
|
|
32
|
+
name: name,
|
|
33
|
+
nth: info.nth,
|
|
34
|
+
isVariableLengthEncoded: info.isVLEncoded,
|
|
35
|
+
isSerialized: info.isSerialized,
|
|
36
|
+
isSigningField: info.isSigningField,
|
|
37
|
+
ordinal: (typeOrdinal << 16) | info.nth,
|
|
38
|
+
type: new bytes_1.Bytes(info.type, typeOrdinal, constants_1.TYPE_WIDTH),
|
|
39
|
+
header: field,
|
|
40
|
+
associatedType: serialized_type_1.SerializedType, // For later assignment in ./types/index.js or Definitions.updateAll(...)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/*
|
|
44
|
+
* @brief: The collection of all fields as defined in definitions.json
|
|
45
|
+
*/
|
|
46
|
+
class FieldLookup {
|
|
47
|
+
constructor(fields, types) {
|
|
48
|
+
fields.forEach(([name, field_info]) => {
|
|
49
|
+
const typeOrdinal = types[field_info.type];
|
|
50
|
+
this[name] = buildField([name, field_info], typeOrdinal);
|
|
51
|
+
this[this[name].ordinal.toString()] = this[name];
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
fromString(value) {
|
|
55
|
+
return this[value];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.FieldLookup = FieldLookup;
|
|
59
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/enums/field.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,8DAAyD;AACzD,2CAAwC;AACxC,oCAAgC;AA0BhC;;GAEG;AACH,SAAS,WAAW,CAAC,IAAY,EAAE,GAAW;IAC5C,MAAM,MAAM,GAAkB,EAAE,CAAA;IAChC,IAAI,IAAI,GAAG,EAAE,EAAE;QACb,IAAI,GAAG,GAAG,EAAE,EAAE;YACZ,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAA;SAC/B;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;SAC5B;KACF;SAAM,IAAI,GAAG,GAAG,EAAE,EAAE;QACnB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;KACvB;SAAM;QACL,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;KAC1B;IACD,OAAO,eAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,UAAU,CACjB,CAAC,IAAI,EAAE,IAAI,CAAsB,EACjC,WAAmB;IAEnB,MAAM,KAAK,GAAG,WAAW,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;IAChD,OAAO;QACL,IAAI,EAAE,IAAI;QACV,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,uBAAuB,EAAE,IAAI,CAAC,WAAW;QACzC,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,OAAO,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG;QACvC,IAAI,EAAE,IAAI,aAAK,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,sBAAU,CAAC;QACnD,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,gCAAc,EAAE,yEAAyE;KAC1G,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAa,WAAW;IACtB,YACE,MAAkC,EAClC,KAA6B;QAE7B,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE;YACpC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YAC1C,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,WAAW,CAAC,CAAA;YACxD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,KAAK,CAAkB,CAAA;IACrC,CAAC;CACF;AAfD,kCAeC"}
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -1,48 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
toBytes(): Uint8Array;
|
|
14
|
-
}
|
|
15
|
-
declare class BytesLookup {
|
|
16
|
-
readonly ordinalWidth: number;
|
|
17
|
-
constructor(types: Record<string, number>, ordinalWidth: number);
|
|
18
|
-
from(value: Bytes | string): Bytes;
|
|
19
|
-
fromParser(parser: any): Bytes;
|
|
20
|
-
}
|
|
21
|
-
interface FieldInfo {
|
|
22
|
-
nth: number;
|
|
23
|
-
isVLEncoded: boolean;
|
|
24
|
-
isSerialized: boolean;
|
|
25
|
-
isSigningField: boolean;
|
|
26
|
-
type: string;
|
|
27
|
-
}
|
|
28
|
-
interface FieldInstance {
|
|
29
|
-
readonly nth: number;
|
|
30
|
-
readonly isVariableLengthEncoded: boolean;
|
|
31
|
-
readonly isSerialized: boolean;
|
|
32
|
-
readonly isSigningField: boolean;
|
|
33
|
-
readonly type: Bytes;
|
|
34
|
-
readonly ordinal: number;
|
|
35
|
-
readonly name: string;
|
|
36
|
-
readonly header: Buffer;
|
|
37
|
-
readonly associatedType: typeof SerializedType;
|
|
38
|
-
}
|
|
39
|
-
declare class FieldLookup {
|
|
40
|
-
constructor(fields: Array<[string, FieldInfo]>);
|
|
41
|
-
fromString(value: string): FieldInstance;
|
|
42
|
-
}
|
|
43
|
-
declare const Type: BytesLookup;
|
|
44
|
-
declare const LedgerEntryType: BytesLookup;
|
|
45
|
-
declare const TransactionType: BytesLookup;
|
|
46
|
-
declare const TransactionResult: BytesLookup;
|
|
47
|
-
declare const Field: FieldLookup;
|
|
48
|
-
export { Field, FieldInstance, Type, LedgerEntryType, TransactionResult, TransactionType, };
|
|
1
|
+
import { XrplDefinitionsBase, FieldInstance, Bytes } from './xrpl-definitions-base';
|
|
2
|
+
/**
|
|
3
|
+
* By default, coreTypes from the `types` folder is where known type definitions are initialized to avoid import cycles.
|
|
4
|
+
*/
|
|
5
|
+
declare const DEFAULT_DEFINITIONS: XrplDefinitionsBase;
|
|
6
|
+
declare const Type: import("./bytes").BytesLookup;
|
|
7
|
+
declare const LedgerEntryType: import("./bytes").BytesLookup;
|
|
8
|
+
declare const TransactionType: import("./bytes").BytesLookup;
|
|
9
|
+
declare const TransactionResult: import("./bytes").BytesLookup;
|
|
10
|
+
declare const Field: import("./field").FieldLookup;
|
|
11
|
+
declare const TRANSACTION_TYPES: string[];
|
|
12
|
+
export { Bytes, XrplDefinitionsBase, DEFAULT_DEFINITIONS, Field, FieldInstance, Type, LedgerEntryType, TransactionResult, TransactionType, TRANSACTION_TYPES, };
|
package/dist/enums/index.js
CHANGED
|
@@ -1,133 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
* @brief: All valid transaction types
|
|
9
|
-
*/
|
|
10
|
-
exports.TRANSACTION_TYPES = Object.entries(enums.TRANSACTION_TYPES)
|
|
11
|
-
.filter(function (_a) {
|
|
12
|
-
var _key = _a[0], value = _a[1];
|
|
13
|
-
return value >= 0;
|
|
14
|
-
})
|
|
15
|
-
.map(function (_a) {
|
|
16
|
-
var key = _a[0], _value = _a[1];
|
|
17
|
-
return key;
|
|
18
|
-
});
|
|
19
|
-
var TYPE_WIDTH = 2;
|
|
20
|
-
var LEDGER_ENTRY_WIDTH = 2;
|
|
21
|
-
var TRANSACTION_TYPE_WIDTH = 2;
|
|
22
|
-
var TRANSACTION_RESULT_WIDTH = 1;
|
|
23
|
-
/*
|
|
24
|
-
* @brief: Serialize a field based on type_code and Field.nth
|
|
25
|
-
*/
|
|
26
|
-
function fieldHeader(type, nth) {
|
|
27
|
-
var header = [];
|
|
28
|
-
if (type < 16) {
|
|
29
|
-
if (nth < 16) {
|
|
30
|
-
header.push((type << 4) | nth);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
header.push(type << 4, nth);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
else if (nth < 16) {
|
|
37
|
-
header.push(nth, type);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
header.push(0, type, nth);
|
|
41
|
-
}
|
|
42
|
-
return buffer_1.Buffer.from(header);
|
|
43
|
-
}
|
|
44
|
-
/*
|
|
45
|
-
* @brief: Bytes, name, and ordinal representing one type, ledger_type, transaction type, or result
|
|
46
|
-
*/
|
|
47
|
-
var Bytes = /** @class */ (function () {
|
|
48
|
-
function Bytes(name, ordinal, ordinalWidth) {
|
|
49
|
-
this.name = name;
|
|
50
|
-
this.ordinal = ordinal;
|
|
51
|
-
this.ordinalWidth = ordinalWidth;
|
|
52
|
-
this.bytes = buffer_1.Buffer.alloc(ordinalWidth);
|
|
53
|
-
for (var i = 0; i < ordinalWidth; i++) {
|
|
54
|
-
this.bytes[ordinalWidth - i - 1] = (ordinal >>> (i * 8)) & 0xff;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
Bytes.prototype.toJSON = function () {
|
|
58
|
-
return this.name;
|
|
59
|
-
};
|
|
60
|
-
Bytes.prototype.toBytesSink = function (sink) {
|
|
61
|
-
sink.put(this.bytes);
|
|
62
|
-
};
|
|
63
|
-
Bytes.prototype.toBytes = function () {
|
|
64
|
-
return this.bytes;
|
|
65
|
-
};
|
|
66
|
-
return Bytes;
|
|
67
|
-
}());
|
|
68
|
-
exports.Bytes = Bytes;
|
|
69
|
-
/*
|
|
70
|
-
* @brief: Collection of Bytes objects, mapping bidirectionally
|
|
71
|
-
*/
|
|
72
|
-
var BytesLookup = /** @class */ (function () {
|
|
73
|
-
function BytesLookup(types, ordinalWidth) {
|
|
74
|
-
var _this = this;
|
|
75
|
-
this.ordinalWidth = ordinalWidth;
|
|
76
|
-
Object.entries(types).forEach(function (_a) {
|
|
77
|
-
var k = _a[0], v = _a[1];
|
|
78
|
-
_this[k] = new Bytes(k, v, ordinalWidth);
|
|
79
|
-
_this[v.toString()] = _this[k];
|
|
80
|
-
});
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
81
7
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}()
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* @brief: The collection of all fields as defined in definitions.json
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TRANSACTION_TYPES = exports.TransactionType = exports.TransactionResult = exports.LedgerEntryType = exports.Type = exports.Field = exports.DEFAULT_DEFINITIONS = exports.XrplDefinitionsBase = exports.Bytes = void 0;
|
|
27
|
+
const enums = __importStar(require("./definitions.json"));
|
|
28
|
+
const xrpl_definitions_base_1 = require("./xrpl-definitions-base");
|
|
29
|
+
Object.defineProperty(exports, "XrplDefinitionsBase", { enumerable: true, get: function () { return xrpl_definitions_base_1.XrplDefinitionsBase; } });
|
|
30
|
+
Object.defineProperty(exports, "Bytes", { enumerable: true, get: function () { return xrpl_definitions_base_1.Bytes; } });
|
|
31
|
+
/**
|
|
32
|
+
* By default, coreTypes from the `types` folder is where known type definitions are initialized to avoid import cycles.
|
|
108
33
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
fields.forEach(function (_a) {
|
|
113
|
-
var k = _a[0], v = _a[1];
|
|
114
|
-
_this[k] = buildField([k, v]);
|
|
115
|
-
_this[_this[k].ordinal.toString()] = _this[k];
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
FieldLookup.prototype.fromString = function (value) {
|
|
119
|
-
return this[value];
|
|
120
|
-
};
|
|
121
|
-
return FieldLookup;
|
|
122
|
-
}());
|
|
123
|
-
var Type = new BytesLookup(enums.TYPES, TYPE_WIDTH);
|
|
34
|
+
const DEFAULT_DEFINITIONS = new xrpl_definitions_base_1.XrplDefinitionsBase(enums, {});
|
|
35
|
+
exports.DEFAULT_DEFINITIONS = DEFAULT_DEFINITIONS;
|
|
36
|
+
const Type = DEFAULT_DEFINITIONS.type;
|
|
124
37
|
exports.Type = Type;
|
|
125
|
-
|
|
38
|
+
const LedgerEntryType = DEFAULT_DEFINITIONS.ledgerEntryType;
|
|
126
39
|
exports.LedgerEntryType = LedgerEntryType;
|
|
127
|
-
|
|
40
|
+
const TransactionType = DEFAULT_DEFINITIONS.transactionType;
|
|
128
41
|
exports.TransactionType = TransactionType;
|
|
129
|
-
|
|
42
|
+
const TransactionResult = DEFAULT_DEFINITIONS.transactionResult;
|
|
130
43
|
exports.TransactionResult = TransactionResult;
|
|
131
|
-
|
|
44
|
+
const Field = DEFAULT_DEFINITIONS.field;
|
|
132
45
|
exports.Field = Field;
|
|
46
|
+
/*
|
|
47
|
+
* @brief: All valid transaction types
|
|
48
|
+
*/
|
|
49
|
+
const TRANSACTION_TYPES = DEFAULT_DEFINITIONS.transactionNames;
|
|
50
|
+
exports.TRANSACTION_TYPES = TRANSACTION_TYPES;
|
|
133
51
|
//# sourceMappingURL=index.js.map
|
package/dist/enums/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA2C;AAC3C,mEAIgC;AAmB9B,oGAtBA,2CAAmB,OAsBA;AADnB,sFAnBA,6BAAK,OAmBA;AAjBP;;GAEG;AACH,MAAM,mBAAmB,GAAG,IAAI,2CAAmB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;AAgB5D,kDAAmB;AAdrB,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;AAiBnC,oBAAI;AAhBN,MAAM,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAA;AAiBzD,0CAAe;AAhBjB,MAAM,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAA;AAkBzD,0CAAe;AAjBjB,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAA;AAgB7D,8CAAiB;AAfnB,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAA;AAWrC,sBAAK;AATP;;GAEG;AACH,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,gBAAgB,CAAA;AAY5D,8CAAiB"}
|