ripple-binary-codec
Advanced tools
Comparing version 0.0.2 to 0.0.3
'use strict'; | ||
var assert = require('assert'); | ||
var coreTypes = require('@niq/ripple-core-types'); | ||
var coreTypes = require('@niq/ripple-core'); | ||
var quality = coreTypes.quality; | ||
var _coreTypes$binary = coreTypes.binary; | ||
var bytesToHex = _coreTypes$binary.bytesToHex; | ||
var signingData = _coreTypes$binary.signingData; | ||
var multiSigningData = _coreTypes$binary.multiSigningData; | ||
var binaryToJSON = _coreTypes$binary.binaryToJSON; | ||
@@ -11,3 +14,3 @@ var serializeObject = _coreTypes$binary.serializeObject; | ||
exports.decode = function (binary) { | ||
assert(typeof binary === 'string'); | ||
assert(typeof binary === 'string', 'binary must be a hex string'); | ||
return binaryToJSON(binary); | ||
@@ -19,2 +22,22 @@ }; | ||
return bytesToHex(serializeObject(json)); | ||
}; | ||
exports.encodeForSigning = function (json) { | ||
assert(typeof json === 'object'); | ||
return bytesToHex(signingData(json)); | ||
}; | ||
exports.encodeForMultisigning = function (json, signer) { | ||
assert(typeof json === 'object'); | ||
return bytesToHex(multiSigningData(json, signer)); | ||
}; | ||
exports.encodeQuality = function (value) { | ||
assert(typeof value === 'string'); | ||
return bytesToHex(quality.encode(value)); | ||
}; | ||
exports.decodeQuality = function (value) { | ||
assert(typeof value === 'string'); | ||
return quality.decode(value).toString(); | ||
}; |
{ | ||
"name": "ripple-binary-codec", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "ripple binary codec", | ||
@@ -17,3 +17,3 @@ "files": [ | ||
"dependencies": { | ||
"@niq/ripple-core-types": "0.0.3" | ||
"@niq/ripple-core": "0.0.6" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250531
6
4728
+ Added@niq/ripple-core@0.0.6
+ Added@niq/ripple-core@0.0.6(transitive)
- Removed@niq/ripple-core-types@0.0.3
- Removed@niq/ripple-core-types@0.0.3(transitive)