Add EIP712 order building method #4
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 introduces new functionality and refactors existing code in the
hyperliquid
package to support building and signing EIP712 messages for orders. The most important changes include adding new methods for building and signing EIP712 messages, refactoring existing methods to use the new EIP712 message structure, and updating tests to cover the new functionality.New Functionality:
hyperliquid/exchange_service.go
: AddedBuildBulkOrdersEIP712
andBuildOrderEIP712
methods to build EIP712 messages for bulk and single orders respectively.hyperliquid/exchange_signing.go
: AddedBuildEIP712Message
method to construct EIP712 messages for signing.Refactoring:
hyperliquid/exchange_signing.go
: UpdatedSignL1Action
to use the newBuildEIP712Message
method.hyperliquid/signature.go
: RefactoredSign
method inSigner
to useSignRequestToEIP712TypedData
for convertingSignRequest
toTypedData
.hyperliquid/signature.go
: AddedSignRequestToEIP712TypedData
function to convertSignRequest
toTypedData
.Testing:
hyperliquid/exchange_msg_builders_test.go
: AddedTestExchangeAPI_BuildOrder
to test theBuildOrderEIP712
method.