xrpl-binary-codec-prerelease
Advanced tools
Comparing version 6.0.0 to 7.0.0
@@ -10,2 +10,4 @@ import { SerializedType } from '../types/serialized-type'; | ||
TRANSACTION_TYPES: Record<string, number>; | ||
native_currency_code?: string; | ||
hash?: string; | ||
} | ||
@@ -24,2 +26,4 @@ /** | ||
dataTypes: Record<string, typeof SerializedType>; | ||
nativeAsset?: string; | ||
hash?: string; | ||
/** | ||
@@ -45,3 +49,5 @@ * Present rippled types in a typed and updatable format. | ||
getAssociatedTypes(): Record<string, typeof SerializedType>; | ||
getNativeAsset(): string; | ||
getHash(): string | null; | ||
} | ||
export { DefinitionsData, XrplDefinitionsBase, FieldLookup, FieldInfo, FieldInstance, Bytes, BytesLookup, }; |
@@ -28,2 +28,4 @@ "use strict"; | ||
this.type = new bytes_1.BytesLookup(enums.TYPES, constants_1.TYPE_WIDTH); | ||
this.nativeAsset = enums === null || enums === void 0 ? void 0 : enums.native_currency_code; | ||
this.hash = enums === null || enums === void 0 ? void 0 : enums.hash; | ||
this.ledgerEntryType = new bytes_1.BytesLookup(enums.LEDGER_ENTRY_TYPES, constants_1.LEDGER_ENTRY_WIDTH); | ||
@@ -58,4 +60,11 @@ this.transactionType = new bytes_1.BytesLookup(enums.TRANSACTION_TYPES, constants_1.TRANSACTION_TYPE_WIDTH); | ||
} | ||
getNativeAsset() { | ||
return (this === null || this === void 0 ? void 0 : this.nativeAsset) || 'XRP'; | ||
} | ||
getHash() { | ||
return ((this === null || this === void 0 ? void 0 : this.hash) || | ||
'0000000000000000000000000000000000000000000000000000000000000000'); | ||
} | ||
} | ||
exports.XrplDefinitionsBase = XrplDefinitionsBase; | ||
//# sourceMappingURL=xrpl-definitions-base.js.map |
{ | ||
"name": "xrpl-binary-codec-prerelease", | ||
"version": "6.0.0", | ||
"version": "7.0.0", | ||
"description": "XRP Ledger binary codec", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -17,2 +17,4 @@ import { SerializedType } from '../types/serialized-type' | ||
TRANSACTION_TYPES: Record<string, number> | ||
native_currency_code?: string | ||
hash?: string | ||
} | ||
@@ -39,2 +41,6 @@ | ||
dataTypes: Record<string, typeof SerializedType> | ||
// Native asset code (native_currency_code) | ||
nativeAsset?: string | ||
// Hash for the Definitions, can be passed fetching again & suppress output if equal | ||
hash?: string | ||
@@ -57,2 +63,4 @@ /** | ||
this.type = new BytesLookup(enums.TYPES, TYPE_WIDTH) | ||
this.nativeAsset = enums?.native_currency_code | ||
this.hash = enums?.hash | ||
this.ledgerEntryType = new BytesLookup( | ||
@@ -104,2 +112,13 @@ enums.LEDGER_ENTRY_TYPES, | ||
} | ||
public getNativeAsset(): string { | ||
return this?.nativeAsset || 'XRP' | ||
} | ||
public getHash(): string | null { | ||
return ( | ||
this?.hash || | ||
'0000000000000000000000000000000000000000000000000000000000000000' | ||
) | ||
} | ||
} | ||
@@ -106,0 +125,0 @@ |
Sorry, the diff of this file is not supported yet
672018
166
22310