Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to viem #123

Merged
merged 22 commits into from
Mar 8, 2023
Merged

Migrate to viem #123

merged 22 commits into from
Mar 8, 2023

Conversation

typedarray
Copy link
Collaborator

@typedarray typedarray commented Mar 8, 2023

Migrates to viem!

  • Ponder projects must now use Node 18 or a fetch polyfill (see viem docs).
  • Many of the values in event.block, event.transaction, and event.log are now bigint instead of ethers.BigNumber.
  • context.contracts objects will also have slightly different types.
  • Projects should remove ethers as a dependency, and will need to add dev dependencies on viem, abitype, and typescript.

Fixes #5, #74, #43

@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2023

🦋 Changeset detected

Latest commit: 7df4975

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Mar 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
ponder-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 8, 2023 at 9:58PM (UTC)

@typedarray typedarray marked this pull request as ready for review March 8, 2023 21:48

**BREAKING** Migrated to [viem](https://viem.sh). Notes:

Ponder projects must now use **Node 18** or a fetch polyfill (see [viem docs](https://viem.sh/docs/compatibility.html)).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively node --experimental-fetch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. I suppose users could change their package.json like this (just tested, works on Node 16). Pretty ugly though!

// before
{
  "scripts": {
    "dev": "ponder dev",
  },
}

// after
{
  "scripts": {
    "dev": "node --experimental-fetch node_modules/@ponder/core/dist/bin/ponder.js dev",
  },
}

@typedarray typedarray deleted the olias/viem-2 branch March 28, 2023 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update Entity methods & instance types to use ethers.BigNumber for BigInt scalar fields
2 participants