mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Use encode/decode
This commit is contained in:
@@ -4,12 +4,12 @@ const assert = require('assert');
|
||||
const coreTypes = require('@niq/ripple-core-types');
|
||||
const {binary: {bytesToHex, binaryToJSON, serializeObject}} = coreTypes;
|
||||
|
||||
exports.binaryToJSON = function(binary) {
|
||||
exports.decode = function(binary) {
|
||||
assert(typeof binary === 'string');
|
||||
return binaryToJSON(binary);
|
||||
};
|
||||
|
||||
exports.jsonToBinary = function (json) {
|
||||
exports.encode = function(json) {
|
||||
assert(typeof json === 'object');
|
||||
return bytesToHex(serializeObject(json));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user