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

ethjs-rpc

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethjs-rpc - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

63

CHANGELOG.md

@@ -1,64 +0,7 @@

# 0.2.0 -- handle 500 errors better
# 0.1.1 -- handle errors better
1. Handles 500/404/303 errors
1. Better error handling
# 0.1.8 -- bn formatting update
# 0.1.0 -- ethjs-rpc
1. Bignumber formatting update
# 0.1.7 -- Better RPC error handling
1. Better RPC error handling
# 0.1.6 -- Strinigy RPC error
1. Added JSON.strinify for RPC error handling
# 0.1.5 -- format update
1. Tigher formatting enforcement
2. Small schema update
# 0.1.4 -- less dependencies
1. Better formatting
2. Less dependencies
3. ID generation done in house
4. 25kb less file size
5. More docs
# 0.1.2 -- config fixes
1. webpack config updates
2. build config updates
# 0.1.1 -- new packages
1. new ethjs-format
2. more docs
# 0.0.5 -- refactor
1. code cleanup
2. more coverage
3. better error handling
4. less dependencies
# 0.0.4 -- promises, louder errors, more tests
1. added promises
2. louder errors
3. more test coverage
# 0.0.3 -- options with debug logging and other features
1. added low level complete logging `new Eth(provider, { debug: false, logger: console, jsonSpace: 0 })`
2. more tests
# 0.0.2 -- handle eth_getFilterChanges during Block and Pending Tx filter
1. handle getFilterChanges during BlockFilter and PendingTxFilter.
# 0.0.1 -- ethjs-query
1. Basic testing

@@ -65,0 +8,0 @@ 2. Basic docs

2

dist/ethjs-rpc.js

@@ -124,3 +124,3 @@ /* eslint-disable */

if (err || responseObject.error) {
var payloadErrorMessage = '[ethjs-rpc] ' + (responseObject.error && 'rpc' || '') + ' error with payload ' + JSON.stringify(payload, null, self.options.jsonSpace) + ' ' + (err || JSON.stringify(response.error, null, self.options.jsonSpace));
var payloadErrorMessage = '[ethjs-rpc] ' + (responseObject.error && 'rpc' || '') + ' error with payload ' + JSON.stringify(payload, null, self.options.jsonSpace) + ' ' + (err || JSON.stringify(responseObject.error, null, self.options.jsonSpace));
return cb(new Error(payloadErrorMessage), null);

@@ -127,0 +127,0 @@ }

@@ -1,1 +0,1 @@

!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("EthRPC",[],r):"object"==typeof exports?exports.EthRPC=r():t.EthRPC=r()}(this,function(){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var e={};return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,r,e){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=0)}([function(t,r){"use strict";function e(t,r){var o=this,n=r||{};if(!(this instanceof e))throw Error('[ethjs-rpc] the EthRPC object requires the "new" flag in order to function normally (i.e. `const eth = new EthRPC(provider);`).');o.options=Object.assign({jsonSpace:n.jsonSpace||0,max:n.max||9999999999999}),o.idCounter=Math.floor(Math.random()*o.options.max),(o.setProvider=function(t){if("object"!=typeof t)throw Error("[ethjs-rpc] the EthRPC object requires that the first input 'provider' must be an object, got '"+typeof t+"' (i.e. 'const eth = new EthRPC(provider);')");o.currentProvider=t})(t)}function o(t,r){return Object.assign({id:r,jsonrpc:"2.0",params:[]},t)}t.exports=e,e.prototype.sendAsync=function(t,r){var e=this;e.idCounter=e.idCounter%e.options.max,e.currentProvider.sendAsync(o(t,e.idCounter++),function(o,n){var i=n||{};if(o||i.error){var s="[ethjs-rpc] "+(i.error&&"rpc"||"")+" error with payload "+JSON.stringify(t,null,e.options.jsonSpace)+" "+(o||JSON.stringify(n.error,null,e.options.jsonSpace));return r(Error(s),null)}return r(null,i.result)})}}])});
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("EthRPC",[],r):"object"==typeof exports?exports.EthRPC=r():t.EthRPC=r()}(this,function(){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var e={};return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,r,e){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=0)}([function(t,r){"use strict";function e(t,r){var o=this,n=r||{};if(!(this instanceof e))throw Error('[ethjs-rpc] the EthRPC object requires the "new" flag in order to function normally (i.e. `const eth = new EthRPC(provider);`).');o.options=Object.assign({jsonSpace:n.jsonSpace||0,max:n.max||9999999999999}),o.idCounter=Math.floor(Math.random()*o.options.max),(o.setProvider=function(t){if("object"!=typeof t)throw Error("[ethjs-rpc] the EthRPC object requires that the first input 'provider' must be an object, got '"+typeof t+"' (i.e. 'const eth = new EthRPC(provider);')");o.currentProvider=t})(t)}function o(t,r){return Object.assign({id:r,jsonrpc:"2.0",params:[]},t)}t.exports=e,e.prototype.sendAsync=function(t,r){var e=this;e.idCounter=e.idCounter%e.options.max,e.currentProvider.sendAsync(o(t,e.idCounter++),function(o,n){var i=n||{};if(o||i.error){var s="[ethjs-rpc] "+(i.error&&"rpc"||"")+" error with payload "+JSON.stringify(t,null,e.options.jsonSpace)+" "+(o||JSON.stringify(i.error,null,e.options.jsonSpace));return r(Error(s),null)}return r(null,i.result)})}}])});

@@ -51,3 +51,3 @@ 'use strict';

if (err || responseObject.error) {
var payloadErrorMessage = '[ethjs-rpc] ' + (responseObject.error && 'rpc' || '') + ' error with payload ' + JSON.stringify(payload, null, self.options.jsonSpace) + ' ' + (err || JSON.stringify(response.error, null, self.options.jsonSpace));
var payloadErrorMessage = '[ethjs-rpc] ' + (responseObject.error && 'rpc' || '') + ' error with payload ' + JSON.stringify(payload, null, self.options.jsonSpace) + ' ' + (err || JSON.stringify(responseObject.error, null, self.options.jsonSpace));
return cb(new Error(payloadErrorMessage), null);

@@ -54,0 +54,0 @@ }

{
"name": "ethjs-rpc",
"version": "0.1.0",
"version": "0.1.1",
"description": "A super simple module for querying the Ethereum RPC layer without formatting.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -45,3 +45,3 @@ module.exports = EthRPC;

if (err || responseObject.error) {
const payloadErrorMessage = `[ethjs-rpc] ${(responseObject.error && 'rpc' || '')} error with payload ${JSON.stringify(payload, null, self.options.jsonSpace)} ${err || (JSON.stringify(response.error, null, self.options.jsonSpace))}`;
const payloadErrorMessage = `[ethjs-rpc] ${(responseObject.error && 'rpc' || '')} error with payload ${JSON.stringify(payload, null, self.options.jsonSpace)} ${err || (JSON.stringify(responseObject.error, null, self.options.jsonSpace))}`;
return cb(new Error(payloadErrorMessage), null);

@@ -48,0 +48,0 @@ }

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