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

tendermint

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tendermint - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

30

lib/client.js

@@ -12,6 +12,3 @@ 'use strict';

var EventEmitter = require('events');
var _require = require('request'),
get = _require.get;
var axios = require('axios');
var url = require('url');

@@ -79,3 +76,3 @@ var old = require('old');

if (!data.id) return;
_this2.emit(data.id, data.error ? Error(data.error) : null, data.result);
_this2.emit(data.id, data.error, data.result);
});

@@ -86,14 +83,12 @@ }

value: function callHttp(method, args, cb) {
get({
uri: this.uri + method,
qs: convertArgs(args),
json: true
}, function (err, res, data) {
if (err) return cb(err);
if (res.statusCode !== 200) {
var _err = 'Server responded with status code ' + res.statusCode;
return cb(Error(_err));
}
if (data.error) return cb(Error(data.error));
cb(null, data.result);
axios({
url: this.uri + method,
params: args
}).then(function (_ref) {
var data = _ref.data;
if (data.error) return cb(data.error);
cb(null, data);
}, function (err) {
return cb(Error(err));
});

@@ -108,2 +103,3 @@ }

this.on(id + '#event', cb);
this.once(id, cb); // errors won't have "#event"
} else {

@@ -110,0 +106,0 @@ this.once(id, cb);

{
"name": "tendermint",
"version": "2.0.3",
"version": "2.0.4",
"description": "A light client which talks to your Tendermint node over RPC",

@@ -14,2 +14,3 @@ "main": "index.js",

"dependencies": {
"axios": "^0.17.1",
"browser-request": "^0.3.3",

@@ -16,0 +17,0 @@ "camelcase": "^4.0.0",

'use strict'
const EventEmitter = require('events')
const { get } = require('request')
const axios = require('axios')
const url = require('url')

@@ -54,3 +54,3 @@ const old = require('old')

if (!data.id) return
this.emit(data.id, data.error ? Error(data.error) : null, data.result)
this.emit(data.id, data.error, data.result)
})

@@ -60,14 +60,10 @@ }

callHttp (method, args, cb) {
get({
uri: this.uri + method,
qs: convertArgs(args),
json: true
}, (err, res, data) => {
if (err) return cb(err)
if (res.statusCode !== 200) {
let err = `Server responded with status code ${res.statusCode}`
return cb(Error(err))
}
if (data.error) return cb(Error(data.error))
cb(null, data.result)
axios({
url: this.uri + method,
params: args
}).then(({data}) => {
if (data.error) return cb(data.error)
cb(null, data)
}, (err) => {
return cb(Error(err))
})

@@ -81,2 +77,3 @@ }

this.on(id + '#event', cb)
this.once(id, cb) // errors won't have "#event"
} else {

@@ -83,0 +80,0 @@ this.once(id, cb)

Sorry, the diff of this file is not supported yet

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