Skip to content

feat(abi): add formatEventSignature utility#4015

Closed
PaulRBerg wants to merge 2 commits intowevm:mainfrom
PaulRBerg:feature/format-event-signature
Closed

feat(abi): add formatEventSignature utility#4015
PaulRBerg wants to merge 2 commits intowevm:mainfrom
PaulRBerg:feature/format-event-signature

Conversation

@PaulRBerg
Copy link
Copy Markdown
Contributor

Adds formatEventSignature utility to format ABI events with indexed keywords.

Implements the proposal from #3765

Adds formatEventSignature function that formats ABI events into signature strings with 'indexed' keywords prepended to indexed parameters.

This format is required by blockchain indexers like The Graph that need to distinguish indexed parameters in event signatures.

Handles complex types including tuples, nested tuples, and array types. Includes 17 comprehensive tests covering edge cases.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 12, 2025

🦋 Changeset detected

Latest commit: 181b369

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

This PR includes changesets to release 1 package
Name Type
viem Minor

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Oct 12, 2025

Open in StackBlitz

npm i https://pkg.pr.new/viem@4015

commit: 181b369

@PaulRBerg
Copy link
Copy Markdown
Contributor Author

Tests are failing but the issue seems unrelated to this PR

CleanShot 2025-10-18 at 11 54 04@2x

@PaulRBerg
Copy link
Copy Markdown
Contributor Author

@jxom why has this been closed?

@jxom
Copy link
Copy Markdown
Member

jxom commented Apr 21, 2026

we have this in ox: https://oxlib.sh/api/AbiEvent/format

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.

2 participants