Skip to content

Conversation

@river-walras
Copy link

@river-walras river-walras commented May 24, 2025

Description of code - what bug does this fix / what feature does this add?

This commit adds comprehensive type annotations and structure for all trading-related classes in types.pyi. The changes include:

  1. Added type hints for all trading data structures including:

    • Trade
    • Ticker
    • OrderBook
    • Liquidation
    • Funding
    • Candle
    • Index
    • OpenInterest
    • Order
    • OrderInfo
    • Balance
    • L1Book
    • Transaction
    • Fill
    • Position
  2. Each class now has:

    • Properly typed class attributes
    • Type-annotated constructor parameters
    • Return type hints for methods
    • Support for Optional types where appropriate
    • Proper typing for raw data fields
  3. Added support for:

    • Decimal types for financial values
    • Optional fields with proper typing
    • Union types for flexible data structures
    • Generic type parameters where needed

This change improves code maintainability and enables better IDE support through static type checking.

  • - Tested
  • - Changelog updated
  • - Tests run and pass
  • - Flake8 run and all errors/warnings resolved
  • - Contributors file updated (optional)

The changes are purely additive and don't modify any runtime behavior, only adding type information for better development experience and code quality.

… structure documentation and updating timestamp handling in the `_funding` method.
@bmoscon
Copy link
Owner

bmoscon commented May 25, 2025

@River-Shi did you mean to close this? Do you no longer want to merge this?

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