Skip to content

Commit 0eb1db0

Browse files
committed
Added messages method
1 parent ecc2c60 commit 0eb1db0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ethereal/assets/ext/filter.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
var Filter = function(eth, options) {
1+
var Filter = function(options) {
22
this.callbacks = {};
33
this.seed = Math.floor(Math.random() * 1000000);
4-
this.eth = eth;
4+
this.options = options;
55

66
eth.registerFilter(options, this.seed);
77
};
88

99
Filter.prototype.changed = function(callback) {
1010
var cbseed = Math.floor(Math.random() * 1000000);
11-
this.eth.registerFilterCallback(this.seed, cbseed);
11+
eth.registerFilterCallback(this.seed, cbseed);
1212

1313
var self = this;
1414
message.connect(function(messages, seed, callbackSeed) {
@@ -21,3 +21,7 @@ Filter.prototype.changed = function(callback) {
2121
Filter.prototype.uninstall = function() {
2222
eth.uninstallFilter(this.seed)
2323
}
24+
25+
Filter.prototype.messages = function() {
26+
return JSON.parse(eth.messages(this.options))
27+
}

0 commit comments

Comments
 (0)