Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

TypeError: filter.watch is not a function #19

Open
miguelmota opened this issue Jan 3, 2018 · 2 comments
Open

TypeError: filter.watch is not a function #19

miguelmota opened this issue Jan 3, 2018 · 2 comments

Comments

@miguelmota
Copy link

miguelmota commented Jan 3, 2018

Code example is from user guide

const Eth = require('ethjs');
const eth = new Eth(new Eth.HttpProvider('http://localhost:8545'));

const filter = new eth.filter.PendingTransactionFilter()
.new()
.then((result) => {
  // result <BigNumber ...> filterId
})
.catch((error) => {
  // result null
});

const watcher = filter.watch((error, result) => {
  // result null ['0xfd234829...', '0xsf2030d1...']
});
watcher.stopWatching(cb);

filter.uninstall()
.then((result) => {
  // result true
})
.catch((error) => {
  // result null
});

Error

$ node index.js
index.js:13
const watcher = filter.watch((error, result) => {
                       ^

TypeError: filter.watch is not a function
    at Object.<anonymous> (/index.js:13:24)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:423:7)
    at startup (bootstrap_node.js:147:9)
    at bootstrap_node.js:538:3
@karvex
Copy link

karvex commented Jan 4, 2018

Fetching pending transactions doesn't work at all. Had the same problem and also did the same as you did and spent 1 whole day with it. I think this issue should be in ethjs-filter repository.

Made an issue here:
ethjs/ethjs-filter#5

@SilentCicero
Copy link
Member

SilentCicero commented Jan 4, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants