Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ripple-binary-codec

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ripple-binary-codec - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test/quality-test.js

27

distrib/npm/index.js
'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();
};

4

package.json
{
"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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc