Skip to content

Conversation

@iuwqyir
Copy link
Contributor

@iuwqyir iuwqyir commented Mar 18, 2025

TL;DR

Updated numeric field types to strings for better precision and updated openapi schema

What changed?

  • Generated openapi for a new API endpoint /{chainId}/transfers for retrieving token transfers with various filtering options
  • Added a new TransferModel definition to support the token transfers endpoint
  • Changed several numeric field types from integer to string in API models to better handle large numbers:
    • In BlockModel: gas_limit and gas_used
    • In TransactionModel: value, gas_price, max_fee_per_gas, max_priority_fee_per_gas, effective_gas_price, and blob_gas_price

How to test?

  1. Make a GET request to the new endpoint /{chainId}/transfers with appropriate filters
  2. Verify the response contains token transfer data in the expected format
  3. Check that numeric values are properly returned as strings without precision loss
  4. Test various filter combinations (token type, address, block range, etc.)

Why make this change?

  • The new transfers endpoint provides a dedicated way to query token transfer events, making it easier for clients to track token movements
  • Converting numeric fields to strings prevents precision loss when dealing with large numbers (like gas prices and token values) that can exceed JavaScript's safe integer limits

GitHub Copilot: I'll help you create a pull request description for this change.

Copy link
Contributor Author

iuwqyir commented Mar 18, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir requested a review from a team March 18, 2025 20:26
@iuwqyir iuwqyir marked this pull request as ready for review March 18, 2025 20:27
@iuwqyir iuwqyir merged commit 31936db into main Mar 18, 2025
5 checks passed
@iuwqyir iuwqyir deleted the 03-18-fix_serialized_types_causing_overflow branch March 18, 2025 20:33
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.

3 participants