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

TypeError: filter.watch is not a function #19

Description

@miguelmota

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

Activity

  1. segirim commented on Jan 4, 2018

    @segirim

    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

  2. SilentCicero commented on Jan 4, 2018

    @SilentCicero
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions