feat: Data client #17
Open
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.
This pull request introduces a new Data API client to the codebase, enabling access to market analytics, user positions, trade history, leaderboards, and other data-centric endpoints. The changes include the addition of a dedicated
Dataclient, integration into the mainClientclass, and resource classes for each Data API feature. An example usage script is also provided to demonstrate the new functionality.New Data API client integration:
Dataclient (src/Data.php) to handle Data API operations such as positions, trades, analytics, leaderboards, and health checks.Dataclient into the mainClientclass, including support for custom HTTP clients and lazy instantiation. [1] [2] [3] [4]Configclass to support a separate Data API base URL via the newdataBaseUrlproperty. [1] [2]Data API resource classes:
Positions,Trades,Activity,Analytics,Leaderboards, andHealth, each providing typed methods for their respective API operations. [1] [2] [3] [4] [5] [6]Documentation and examples:
examples/data-api-positions.php) demonstrating how to use the Data API client to fetch user positions, analytics, trade history, leaderboard data, and API health status.