Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Add TypeScript definition file #2

Open
2 tasks
bajtos opened this issue May 3, 2024 · 1 comment
Open
2 tasks

Add TypeScript definition file #2

bajtos opened this issue May 3, 2024 · 1 comment

Comments

@bajtos
Copy link
Member

bajtos commented May 3, 2024

When using this package from a TypeScript-enabled project, the function onContractEvent has any type, which prevents TypeScript for performing any type checking.

Could not find a declaration file for module 'on-contract-event'. '(...)/node_modules/on-contract-event/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/on-contract-event` if it exists or add a new declaration (.d.ts) file containing `declare module 'on-contract-event';`ts(7016)

Things to change:

  • Add index.d.ts file and describe the exported types there

  • Add the following entry to package.json:

    "typings": "index.d.ts"
    
@juliangruber
Copy link
Member

As mentioned in the review of the spark-evaluate PR, we should rather switch to ethers@6. This module was only a temporary crutch, as JSON-RPC providers didn't yet support eth_getFilterChanges. I believe that's also less work :)

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

2 participants