Skip to content

Conversation

@2wheeh
Copy link

@2wheeh 2wheeh commented Jan 16, 2026

Description

The current experimental_namedTuples feature is useful for displaying tuple names in args. However, it currently includes names above a certain frequency threshold. While this covers most cases, there are situations where less common parameter names are used.

For example, toChainId and toAddress exist in the lookup, but fromChainId and fromAddress don't. This PR allows users to add custom names to handle these cases, as well as any project-specific parameter names.

Changes

  • Extended experimental_namedTuples type from boolean to boolean | readonly string[]
  • When a string array is provided, those names are added alongside the common ABI parameter names
  • Trade-offs: this introduces ~10-15% type checking overhead when enabling named tuples (both true and custom array) due to generic parameter added

We can use it like this:

declare module 'abitype' {
  export interface Register {
    experimental_namedTuples: ['myCustomParam', 'someOtherOne']
  }
}

@changeset-bot
Copy link

changeset-bot bot commented Jan 16, 2026

🦋 Changeset detected

Latest commit: 3fe180d

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

This PR includes changesets to release 1 package
Name Type
abitype Patch

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 Jan 16, 2026

@2wheeh is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant