Open
Conversation
- Add Builder type with address/fee fields and HLZ_BUILDER constants in types.zig - Add optional builder field to BatchOrder (defaults to null for backward compat) - Update packActionOrder/packBatchOrder msgpack packing to include builder map when present - Update writeActionJson JSON serialization to include builder field - Wire HLZ_BUILDER into all order placement paths: - placeOrder (buy/sell) in commands.zig - twap slices in commands.zig - batchCmd in commands.zig - terminal order placement and close position in trade.zig - Add builder info to dry-run output (both JSON and TTY) - Add checkBuilderApproval hint: queries maxBuilderFee and prints approval hint if needed - Add unit tests for packActionOrder with/without builder, writeActionJson with/without builder - Add addressToHex utility tests
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds builder fee support to all outgoing orders placed through hlz CLI and hlz-terminal.
Resolves: SYM-8
Changes
SDK (types.zig, client.zig)
Builderstruct withaddress: [20]u8andfee: u16(tenths of basis points)builder: ?Builder = nullfield (backward compatible)HLZ_BUILDER_ADDRESS(placeholder 0x0...0),HLZ_BUILDER_FEE(5 = 0.5bp),HLZ_BUILDERpackActionOrderandpackBatchOrderemit builder map when present (map size 4 vs 3)writeActionJsonincludes"builder":{"b":"0x...","f":5}when builder is setaddressToHexutility for formatting builder address in hexCLI (commands.zig)
.builder = types.HLZ_BUILDER:placeOrder(buy/sell)twapslicesbatchCmdcheckBuilderApproval()queriesmaxBuilderFeeand prints one-time hint if user hasn't approved the hlz builder feeTerminal (trade.zig)
.builder = types.HLZ_BUILDERTests
packActionOrderwith builder: verifies map size 4, builder/address in outputpackActionOrderwithout builder: verifies byte-exact match with original test vectorwriteActionJsonwith builder: verifies JSON contains builder fieldwriteActionJsonwithout builder: verifies no builder field presentaddressToHex: zero and non-zero address formattingValidation
zig build test— all tests pass (existing + new)zig build hlz— CLI buildszig build hlz-terminal— terminal builds