Socket
Socket
Sign inDemoInstall

web3

Package Overview
Dependencies
3
Maintainers
2
Versions
467
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.17.0-alpha to 0.17.0-beta

circle.yml

2

coverage/lcov-report/sorter.js

@@ -111,3 +111,3 @@ var addSorting = (function () {

function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-abi' : ' sorted';
}

@@ -114,0 +114,0 @@ // adds event listeners for all sorter widgets

@@ -44,2 +44,3 @@ /*

var IpcProvider = require('./web3/ipcprovider');
var BigNumber = require('bignumber.js');

@@ -86,2 +87,3 @@

Web3.prototype.BigNumber = BigNumber;
Web3.prototype.toHex = utils.toHex;

@@ -88,0 +90,0 @@ Web3.prototype.toAscii = utils.toAscii;

@@ -55,3 +55,3 @@ /*

if (!Jsonrpc.getInstance().isValidResponse(result)) {
if (!Jsonrpc.isValidResponse(result)) {
return requests[index].callback(errors.InvalidResponse(result));

@@ -58,0 +58,0 @@ }

@@ -131,3 +131,3 @@ /*

if(code.length > 2) {
if(code.length > 3) {

@@ -134,0 +134,0 @@ // console.log('Contract code deployed!');

@@ -191,7 +191,11 @@ /*

Filter.prototype.stopWatching = function () {
Filter.prototype.stopWatching = function (callback) {
this.requestManager.stopPolling(this.filterId);
this.callbacks = [];
// remove filter async
this.implementation.uninstallFilter(this.filterId, function(){});
this.callbacks = [];
if (callback) {
this.implementation.uninstallFilter(this.filterId, callback);
} else {
return this.implementation.uninstallFilter(this.filterId);
}
};

@@ -198,0 +202,0 @@

@@ -17,3 +17,3 @@ /*

*/
/**
/**
* @file formatters.js

@@ -85,3 +85,3 @@ * @author Marek Kotewicz <marek@ethdev.com>

return options;
return options;
};

@@ -111,3 +111,3 @@

return options;
return options;
};

@@ -117,3 +117,3 @@

* Formats the output of a transaction to its proper values
*
*
* @method outputTransactionFormatter

@@ -137,3 +137,3 @@ * @param {Object} tx

* Formats the output of a transaction receipt to its proper values
*
*
* @method outputTransactionReceiptFormatter

@@ -164,3 +164,3 @@ * @param {Object} receipt

* @method outputBlockFormatter
* @param {Object} block
* @param {Object} block
* @returns {Object}

@@ -193,3 +193,3 @@ */

* Formats the output of a log
*
*
* @method outputLogFormatter

@@ -235,3 +235,3 @@ * @param {Object} log object

return post;
return post;
};

@@ -288,2 +288,6 @@

result.highestBlock = utils.toDecimal(result.highestBlock);
if (result.knownStates) {
result.knownStates = utils.toDecimal(result.knownStates);
result.pulledStates = utils.toDecimal(result.pulledStates);
}

@@ -290,0 +294,0 @@ return result;

@@ -32,8 +32,4 @@ /*

// meteor server environment
if (typeof Meteor !== 'undefined' && Meteor.isServer) { // jshint ignore: line
XMLHttpRequest = Npm.require('xmlhttprequest').XMLHttpRequest; // jshint ignore: line
// browser
} else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
if (typeof window !== 'undefined' && window.XMLHttpRequest) {
XMLHttpRequest = window.XMLHttpRequest; // jshint ignore: line

@@ -40,0 +36,0 @@

@@ -28,3 +28,3 @@ /*

while (result.length < bytes * 2) {
result = '00' + result;
result = '0' + result;
}

@@ -31,0 +31,0 @@ return result;

@@ -20,24 +20,12 @@ /*

* Marek Kotewicz <marek@ethdev.com>
* Aaron Kumavis <aaron@kumavis.me>
* @date 2015
*/
var Jsonrpc = function () {
// singleton pattern
if (arguments.callee._singletonInstance) {
return arguments.callee._singletonInstance;
}
arguments.callee._singletonInstance = this;
this.messageId = 1;
// Initialize Jsonrpc as a simple object with utility functions.
var Jsonrpc = {
messageId: 0
};
/**
* @return {Jsonrpc} singleton
*/
Jsonrpc.getInstance = function () {
var instance = new Jsonrpc();
return instance;
};
/**
* Should be called to valid json create payload object

@@ -50,11 +38,14 @@ *

*/
Jsonrpc.prototype.toPayload = function (method, params) {
Jsonrpc.toPayload = function (method, params) {
if (!method)
console.error('jsonrpc method should be specified!');
// advance message ID
Jsonrpc.messageId++;
return {
jsonrpc: '2.0',
id: Jsonrpc.messageId,
method: method,
params: params || [],
id: this.messageId++
params: params || []
};

@@ -70,8 +61,12 @@ };

*/
Jsonrpc.prototype.isValidResponse = function (response) {
return !!response &&
!response.error &&
response.jsonrpc === '2.0' &&
typeof response.id === 'number' &&
response.result !== undefined; // only undefined is not valid json object
Jsonrpc.isValidResponse = function (response) {
return Array.isArray(response) ? response.every(validateSingleMessage) : validateSingleMessage(response);
function validateSingleMessage(message){
return !!message &&
!message.error &&
message.jsonrpc === '2.0' &&
typeof message.id === 'number' &&
message.result !== undefined; // only undefined is not valid json object
}
};

@@ -86,6 +81,5 @@

*/
Jsonrpc.prototype.toBatchPayload = function (messages) {
var self = this;
Jsonrpc.toBatchPayload = function (messages) {
return messages.map(function (message) {
return self.toPayload(message.method, message.params);
return Jsonrpc.toPayload(message.method, message.params);
});

@@ -92,0 +86,0 @@ };

@@ -317,2 +317,6 @@ /*

outputFormatter: utils.toDecimal
}),
new Property({
name: 'protocolVersion',
getter: 'eth_protocolVersion'
})

@@ -319,0 +323,0 @@ ];

@@ -62,4 +62,4 @@ /*

var unlockAccountAndSendTransaction = new Method({
name: 'unlockAccountAndSendTransaction',
call: 'personal_signAndSendTransaction',
name: 'unlockAccountAndSendTransaction', // sendTransaction
call: 'personal_signAndSendTransaction', // personal_sendTransaction
params: 2,

@@ -66,0 +66,0 @@ inputFormatter: [formatters.inputTransactionFormatter, null]

@@ -57,6 +57,6 @@ /*

var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);
var payload = Jsonrpc.toPayload(data.method, data.params);
var result = this.provider.send(payload);
if (!Jsonrpc.getInstance().isValidResponse(result)) {
if (!Jsonrpc.isValidResponse(result)) {
throw errors.InvalidResponse(result);

@@ -80,3 +80,3 @@ }

var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);
var payload = Jsonrpc.toPayload(data.method, data.params);
this.provider.sendAsync(payload, function (err, result) {

@@ -87,3 +87,3 @@ if (err) {

if (!Jsonrpc.getInstance().isValidResponse(result)) {
if (!Jsonrpc.isValidResponse(result)) {
return callback(errors.InvalidResponse(result));

@@ -108,3 +108,3 @@ }

var payload = Jsonrpc.getInstance().toBatchPayload(data);
var payload = Jsonrpc.toBatchPayload(data);

@@ -224,3 +224,3 @@ this.provider.sendAsync(payload, function (err, results) {

var payload = Jsonrpc.getInstance().toBatchPayload(pollsData);
var payload = Jsonrpc.toBatchPayload(pollsData);

@@ -258,3 +258,3 @@ // map the request id to they poll id

}).filter(function (result) {
var valid = Jsonrpc.getInstance().isValidResponse(result);
var valid = Jsonrpc.isValidResponse(result);
if (!valid) {

@@ -261,0 +261,0 @@ result.callback(errors.InvalidResponse(result));

/* jshint ignore:start */
Package.describe({
name: 'ethereum:web3',
version: '0.17.0-alpha',
version: '0.17.0-beta',
summary: 'Ethereum JavaScript API, middleware to talk to a ethreum node over RPC',

@@ -6,0 +6,0 @@ git: 'https://github.com/ethereum/ethereum.js',

{
"name": "web3",
"namespace": "ethereum",
"version": "0.17.0-alpha",
"version": "0.17.0-beta",
"description": "Ethereum JavaScript API, middleware to talk to a ethereum node over RPC",

@@ -11,3 +11,3 @@ "main": "./index.js",

"dependencies": {
"bignumber.js": "git+https://github.com/debris/bignumber.js#master",
"bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2",
"crypto-js": "^3.1.4",

@@ -33,3 +33,3 @@ "utf8": "^2.1.1",

"gulp-uglify": ">=1.2.0",
"istanbul": "^0.3.5",
"istanbul": "^0.4.4",
"jshint": ">=2.5.0",

@@ -36,0 +36,0 @@ "mocha": ">=2.3.3",

@@ -20,3 +20,3 @@ # Migration 0.13.0 -> 0.14.0

[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![dependency status][dep-image]][dep-url] [![dev dependency status][dep-dev-image]][dep-dev-url][![Coverage Status][coveralls-image]][coveralls-url][![Stories in Ready][waffle-image]][waffle-url]
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![dependency status][dep-image]][dep-url] [![dev dependency status][dep-dev-image]][dep-dev-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Stories in Ready][waffle-image]][waffle-url]

@@ -56,3 +56,3 @@ <!-- [![browser support](https://ci.testling.com/ethereum/ethereum.js.png)](https://ci.testling.com/ethereum/ethereum.js) -->

* Include `ethereum.min.js` in your html file. (not required for the meteor package)
* Include `web3.min.js` in your html file. (not required for the meteor package)

@@ -59,0 +59,0 @@ ## Usage

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc