Skip to content

Conversation

0xBoringWozniak
Copy link
Member

@0xBoringWozniak 0xBoringWozniak commented Feb 11, 2025

This pull request includes several changes to the hyperliquid package, focusing on refactoring constants, improving logging, and enhancing order handling and conversion functions. The most important changes include the introduction of API URL constants, improvements to the logging level, and the replacement of rounding functions with more precise conversion functions for order prices and sizes.

Refactoring and Constants:

  • hyperliquid/consts.go: Introduced MAINNET_API_URL and TESTNET_API_URL constants to replace hardcoded URLs in getURL function.
  • hyperliquid/client.go: Updated getURL function to use the new constants MAINNET_API_URL and TESTNET_API_URL.

Logging Improvements:

Order Handling Enhancements:

  • hyperliquid/exchange_service.go: Removed several order-related methods (MarketOrder, MarketOrderSpot, LimitOrder, ClosePosition, CancelOrderByOID, CancelAllOrdersByCoin, CancelAllOrders) to streamline the order handling process. [1] [2] [3]
  • hyperliquid/exchange_service.go: Added helper functions for building EIP712 messages for bulk orders and single orders.

Conversion Functions:

  • hyperliquid/convert.go: Replaced RoundOrderPrice and RoundOrderSize with PriceToWire and SizeToWire functions for more precise order price and size conversions.

Testing Enhancements:

- fix rounding functions
- move all tests to testnet
- improve client structure
- fix the bug with a cancel orders response
@0xBoringWozniak 0xBoringWozniak added enhancement New feature or request dependencies Pull requests that update a dependency file labels Feb 11, 2025
@0xBoringWozniak 0xBoringWozniak self-assigned this Feb 11, 2025
@0xBoringWozniak 0xBoringWozniak merged commit 952e4f6 into main Feb 11, 2025
@0xBoringWozniak 0xBoringWozniak deleted the fix-prerelease-fixes branch February 11, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant