dethcrypto / TypeChain

🔌 TypeScript bindings for Ethereum smart contracts
MIT License
2.76k stars 365 forks source link

fix(ethers-v6): correctly type event listener #884

Open pocin opened 1 year ago

pocin commented 1 year ago

fixes #867

Not sure about the broader implications of this, but when i made this change to the generated file it correctly types the last event listener arg so one can do

  contract.on(
    contract.filters.Swap,
    async (
      address,
      fundsOwner,
      userSellTokenAmount,
      userBuyTokenAmount,
      event
    ) => {
      console.log(event.log.transactionHash) // this
  })

seems to be working fine in my script so far

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: b1512f0650bda507e0ed2c55b762a2ff6f845d26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR