Make pre-release updates. #22
Merged
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 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
: IntroducedMAINNET_API_URL
andTESTNET_API_URL
constants to replace hardcoded URLs ingetURL
function.hyperliquid/client.go
: UpdatedgetURL
function to use the new constantsMAINNET_API_URL
andTESTNET_API_URL
.Logging Improvements:
hyperliquid/client.go
: Set the logging level toDebug
in theNewClient
function.hyperliquid/client.go
: Changed thedebug
method to useDebugf
instead ofPrintf
for better logging consistency.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
: ReplacedRoundOrderPrice
andRoundOrderSize
withPriceToWire
andSizeToWire
functions for more precise order price and size conversions.Testing Enhancements:
hyperliquid/convert_test.go
: Added unit tests forSizeToWire
andPriceToWire
functions to ensure their correctness.