filecoin-station / on-contract-event

Subscribe to smart contract events, which is currently broken on Lotus w/ Ethers@6
Other
1 stars 0 forks source link

Add TypeScript definition file #2

Open bajtos opened 2 weeks ago

bajtos commented 2 weeks ago

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:

juliangruber commented 2 weeks ago

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 :)