eth-block-tracker
Advanced tools
Comparing version 4.1.0 to 4.1.1
@@ -1,2 +0,2 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.BaseBlockTracker = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.BaseBlockTracker = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
const extend = require('xtend') | ||
@@ -112,3 +112,3 @@ const createRandomId = require('json-rpc-random-id')() | ||
},{"json-rpc-random-id":3,"xtend":10}],2:[function(require,module,exports){ | ||
},{"json-rpc-random-id":4,"xtend":10}],2:[function(require,module,exports){ | ||
// Copyright Joyent, Inc. and other Node contributors. | ||
@@ -564,2 +564,27 @@ // | ||
},{}],3:[function(require,module,exports){ | ||
if (typeof Object.create === 'function') { | ||
// implementation from standard node.js 'util' module | ||
module.exports = function inherits(ctor, superCtor) { | ||
ctor.super_ = superCtor | ||
ctor.prototype = Object.create(superCtor.prototype, { | ||
constructor: { | ||
value: ctor, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
}; | ||
} else { | ||
// old school shim for old browsers | ||
module.exports = function inherits(ctor, superCtor) { | ||
ctor.super_ = superCtor | ||
var TempCtor = function () {} | ||
TempCtor.prototype = superCtor.prototype | ||
ctor.prototype = new TempCtor() | ||
ctor.prototype.constructor = ctor | ||
} | ||
} | ||
},{}],4:[function(require,module,exports){ | ||
module.exports = IdIterator | ||
@@ -578,3 +603,3 @@ | ||
} | ||
},{}],4:[function(require,module,exports){ | ||
},{}],5:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -665,3 +690,3 @@ | ||
},{}],5:[function(require,module,exports){ | ||
},{}],6:[function(require,module,exports){ | ||
// shim for using process in browser | ||
@@ -852,3 +877,3 @@ var process = module.exports = {}; | ||
},{}],6:[function(require,module,exports){ | ||
},{}],7:[function(require,module,exports){ | ||
const util = require('util') | ||
@@ -939,28 +964,3 @@ const EventEmitter = require('events/') | ||
},{"events/":2,"util":9}],7:[function(require,module,exports){ | ||
if (typeof Object.create === 'function') { | ||
// implementation from standard node.js 'util' module | ||
module.exports = function inherits(ctor, superCtor) { | ||
ctor.super_ = superCtor | ||
ctor.prototype = Object.create(superCtor.prototype, { | ||
constructor: { | ||
value: ctor, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
}; | ||
} else { | ||
// old school shim for old browsers | ||
module.exports = function inherits(ctor, superCtor) { | ||
ctor.super_ = superCtor | ||
var TempCtor = function () {} | ||
TempCtor.prototype = superCtor.prototype | ||
ctor.prototype = new TempCtor() | ||
ctor.prototype.constructor = ctor | ||
} | ||
} | ||
},{}],8:[function(require,module,exports){ | ||
},{"events/":2,"util":9}],8:[function(require,module,exports){ | ||
module.exports = function isBuffer(arg) { | ||
@@ -1562,3 +1562,3 @@ return arg && typeof arg === 'object' | ||
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
},{"./support/isBuffer":8,"_process":5,"inherits":7}],10:[function(require,module,exports){ | ||
},{"./support/isBuffer":8,"_process":6,"inherits":3}],10:[function(require,module,exports){ | ||
module.exports = extend | ||
@@ -1797,3 +1797,3 @@ | ||
},{"eth-query":1,"pify":4,"safe-event-emitter":6}]},{},[11])(11) | ||
}); | ||
},{"eth-query":1,"pify":5,"safe-event-emitter":7}]},{},[11])(11) | ||
}); |
const EthQuery = require('eth-query'); | ||
const EventEmitter = require('events'); | ||
const pify = require('pify'); | ||
@@ -7,3 +6,2 @@ const BaseBlockTracker = require('./base'); | ||
const sec = 1000; | ||
const min = 60 * sec; | ||
@@ -10,0 +8,0 @@ class PollingBlockTracker extends BaseBlockTracker { |
{ | ||
"name": "eth-block-tracker", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "A block tracker for the Ethereum blockchain. Keeps track of the latest block.", | ||
@@ -17,2 +17,3 @@ "main": "src/polling.js", | ||
"dependencies": { | ||
"babel-runtime": "^6.26.0", | ||
"eth-json-rpc-infura": "^3.1.2", | ||
@@ -29,3 +30,4 @@ "eth-query": "^2.1.0", | ||
"babel-preset-stage-3": "^6.24.1", | ||
"browserify": "^14.3.0", | ||
"babelify": "^8.0.0", | ||
"browserify": "^16.2.3", | ||
"ganache-core": "^2.2.1", | ||
@@ -32,0 +34,0 @@ "tape": "^4.9.0" |
@@ -16,3 +16,3 @@ const EthQuery = require('eth-query') | ||
constructor(opts = {}) { | ||
constructor (opts = {}) { | ||
super() | ||
@@ -33,3 +33,3 @@ // config | ||
isRunning() { | ||
isRunning () { | ||
return this._isRunning | ||
@@ -52,3 +52,3 @@ } | ||
// dont allow module consumer to remove our internal event listeners | ||
removeAllListeners(eventName) { | ||
removeAllListeners (eventName) { | ||
// perform default behavior, preserve fn arity | ||
@@ -138,3 +138,3 @@ if (eventName) { | ||
_setupBlockResetTimeout() { | ||
_setupBlockResetTimeout () { | ||
// clear any existing timeout | ||
@@ -150,7 +150,7 @@ this._cancelBlockResetTimeout() | ||
_cancelBlockResetTimeout() { | ||
_cancelBlockResetTimeout () { | ||
clearTimeout(this._blockResetTimeout) | ||
} | ||
_resetCurrentBlock () { | ||
_resetCurrentBlock () { | ||
this._currentBlock = null | ||
@@ -157,0 +157,0 @@ } |
const EthQuery = require('eth-query') | ||
const EventEmitter = require('events') | ||
const pify = require('pify') | ||
@@ -7,7 +6,6 @@ const BaseBlockTracker = require('./base') | ||
const sec = 1000 | ||
const min = 60 * sec | ||
class PollingBlockTracker extends BaseBlockTracker { | ||
constructor(opts = {}) { | ||
constructor (opts = {}) { | ||
// parse + validate args | ||
@@ -36,3 +34,3 @@ if (!opts.provider) throw new Error('PollingBlockTracker - no provider specified.') | ||
// trigger block polling | ||
async checkForLatestBlock() { | ||
async checkForLatestBlock () { | ||
await this._updateLatestBlock() | ||
@@ -46,3 +44,3 @@ return await this.getLatestBlock() | ||
_start() { | ||
_start () { | ||
this._performSync().catch(err => this.emit('error', err)) | ||
@@ -49,0 +47,0 @@ } |
Sorry, the diff of this file is too big to display
148105
6
8
3930
+ Addedbabel-runtime@^6.26.0