event example

This commit is contained in:
Marek Kotewicz
2015-01-29 15:05:43 +01:00
parent c8ee08c24b
commit df17c33898
8 changed files with 162 additions and 15 deletions

View File

@ -31,6 +31,19 @@ var Filter = function(options, impl) {
this.impl = impl;
this.callbacks = [];
if (typeof options !== "string") {
// evaluate lazy properties
options = {
to: options.to,
topics: options.topics,
earliest: options.earliest,
latest: options.latest,
max: options.max,
skip: options.skip,
address: options.address
};
}
this.id = impl.newFilter(options);
web3.provider.startPolling({call: impl.changed, args: [this.id]}, this.id, this.trigger.bind(this));
};