mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-28 08:37:22 +00:00
Added messages method
This commit is contained in:
parent
ecc2c609d4
commit
0eb1db0d17
1 changed files with 7 additions and 3 deletions
|
|
@ -1,14 +1,14 @@
|
|||
var Filter = function(eth, options) {
|
||||
var Filter = function(options) {
|
||||
this.callbacks = {};
|
||||
this.seed = Math.floor(Math.random() * 1000000);
|
||||
this.eth = eth;
|
||||
this.options = options;
|
||||
|
||||
eth.registerFilter(options, this.seed);
|
||||
};
|
||||
|
||||
Filter.prototype.changed = function(callback) {
|
||||
var cbseed = Math.floor(Math.random() * 1000000);
|
||||
this.eth.registerFilterCallback(this.seed, cbseed);
|
||||
eth.registerFilterCallback(this.seed, cbseed);
|
||||
|
||||
var self = this;
|
||||
message.connect(function(messages, seed, callbackSeed) {
|
||||
|
|
@ -21,3 +21,7 @@ Filter.prototype.changed = function(callback) {
|
|||
Filter.prototype.uninstall = function() {
|
||||
eth.uninstallFilter(this.seed)
|
||||
}
|
||||
|
||||
Filter.prototype.messages = function() {
|
||||
return JSON.parse(eth.messages(this.options))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue