feat: add ERC-5564 compliant metadata builders#97
Merged
marcomariscal merged 15 commits intomainfrom Apr 13, 2026
Merged
Conversation
- Add buildMetadataForETH() for native ETH transfers - Add buildMetadataForERC20() for token transfers - Add buildMetadataForERC721() for NFT transfers - Add buildMetadataCustom() for arbitrary contract calls - Add parseMetadata() for debugging/validation - Include comprehensive test suite (18 tests) - Update prepareAnnounce example with multiple metadata types - Maintain backward compatibility with buildMetadataWithViewTagOnly() Resolves #95 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove buildMetadataWithViewTagOnly() function - Remove BaseMetadataParams type - Update examples to show only proper ERC-5564 metadata - Remove backward compatibility tests - Simplify API surface for cleaner developer experience All metadata must now follow proper ERC-5564 structure: - viewTag + functionSelector + contractAddress + amount/data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace hardcoded hex values with viem's toFunctionSelector() - Improves maintainability and accuracy - Self-documenting function signatures - Ensures compatibility with viem's ABI handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Log hostname, FQDN, and IP of GitHub Actions runner - Will help identify correct domain allowlist for subgraph access 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…steps - Environment variables were only available in test step, not debug step - Moving to job level makes them available throughout the job - Should fix 403 errors in subgraph tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Test actual HTTP response from subgraph endpoint - Use simple metadata query to verify auth and connectivity - Will help identify if issue is auth, network, or API-related 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…tent 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…bles - Remove all debug logging steps - Keep environment variables at job level for proper access - Clean up both test and coverage jobs - Ready for actual testing with fixed subgraph domain restrictions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add detailed JSDoc comments to all exported functions with examples - Improve parseMetadata error handling with specific error messages - Add validation for hex format in parseMetadata - Update tests to match new error messages - Better IDE support and developer experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix formatting in buildMetadata.ts JSDoc comments - Fix formatting in buildMetadata.test.ts test assertions - Ensure consistent code style for CI/CD pipeline 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
… into tmp/pr97-merge-main-no-workflows # Conflicts: # .github/workflows/ci.yml # src/lib/actions/getAnnouncementsUsingSubgraph/getAnnouncementsUsingSubgraph.test.ts
garyghayrat
approved these changes
Apr 13, 2026
Member
garyghayrat
left a comment
There was a problem hiding this comment.
Prob want to update the version since there are some breaking changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
parseMetadata()bigintor decimal integer stringsuint256Test Plan
bun run checkbun run buildbun testCloses #95