Conversation
The pull request title promises typed order grouping only. The raw asset-index order, cancel, and leverage methods and the response Serialize derives are a separate feature. They move to their own pull request. This keeps the change focused on one thing. This reverts commit fea9dcc. This reverts commit 9dc8b25.
Add two tests that answer the compatibility question directly. The first builds one bulk order twice, once from OrderGrouping and once from the grouping string that the SDK used before. It asserts an equal action hash, an equal JSON body, and that the derived Serialize agrees with as_str. The second asserts that OrderGrouping::Na still produces the two signatures that test_limit_order_action_hashing already pinned. Both tests fail if any wire value changes.
|
Rebased on current I also cut this pull request back to its title. It previously carried raw asset-index order, cancel, and leverage methods plus On backward compatibility:
I checked that these tests can fail. Changing Commands and results on No public item is removed or renamed, and no existing test changed. One note: the workflow run for this branch is at |
|
Closing this July fork PR: upstream CI still needs maintainer approval to run, so this head has no green-check or merge path; the branch remains available for a fresh request. |
Summary
Add a typed
OrderGroupingenum for the three Hyperliquid grouping values, and expose grouping on bulk orders.OrderGrouping::{Na, NormalTpsl, PositionTpsl}withas_str()for the wire valuebulk_order_with_groupingandbulk_order_with_builder_and_groupingbulk_orderandbulk_order_with_builderkeep their signatures and delegate withOrderGrouping::NaThis lets callers send atomic
normalTpslbrackets without passing an arbitrary grouping string.Compatibility
BulkOrder.groupingstays aString. The enum only chooses the value, so nothing on the wire changes. Two tests prove it:test_typed_grouping_serializes_like_the_string_it_replacesbuilds the same bulk order twice, once fromOrderGroupingand once from the grouping string used before, then asserts an equal action hash, an equal JSON body, and that the derivedSerializeagrees withas_str().test_default_grouping_keeps_the_known_signaturesasserts thatOrderGrouping::Nastill produces the two signatures thattest_limit_order_action_hashingalready pinned.Both tests fail if any wire value changes. I checked this: changing
Nato"NA"makes both fail.No public item is removed or renamed. No existing test changed.
Scope
This branch first also added raw asset-index order, cancel, and leverage methods, plus
Serializeon the exchange responses. That is a separate feature, so I reverted it here to keep this pull request to one subject. I can open it as its own pull request if you want it.Proof
Ran
./ci.shon08eea95, rebased on currentmaster(aac7558):cargo build: cleancargo fmt -- --check: cleancargo clippy -- -D warnings: cleancargo clippy --all-targets -- -D warnings: cleancargo test: 14 passed, 0 failedCI checks passed successfully.