fix(types): change BuilderTradeResponse.builder from Address to ApiKey#322
Open
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
Open
fix(types): change BuilderTradeResponse.builder from Address to ApiKey#322skyc1e wants to merge 1 commit intoPolymarket:mainfrom
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
Conversation
The API returns a UUID for the builder field (e.g. "019b618b-..."), not an Ethereum address. This caused deserialization failures. Closes Polymarket#294
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #322 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 32 32
Lines 5167 5167
=======================================
Hits 4420 4420
Misses 747 747
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Zorak556
added a commit
to Zorak556/polymarket-client-sdk
that referenced
this pull request
Apr 10, 2026
Upstream merges: - Polymarket#321: accept custom reqwest::Client via Config - Polymarket#322: BuilderTradeResponse.builder Address → ApiKey - Polymarket#306: add match_time_nano to TradeResponse - Polymarket#305: preserve unknown activity side values - Polymarket#303: version bump to 0.4.5 - Dep bumps: rust_decimal 1.41, uuid 1.23 Local patches: - Reduce auth header allocations (HeaderValue::from for integers) - Reorder order_builder size validation before async fee_rate call - Skip double deserialization when tracing is disabled - subscribe_book_and_prices: single-stream book + price_change - subscribe_user/orders/trades: async for tokio::sync::RwLock - Subscription lag: escalate to error and force resubscribe - Broadcast capacity: 1024 → 16384 - excludeDepositsWithdrawals param on ActivityRequest - cancel_order: orderId → orderID Co-Authored-By: Claude Opus 4.6 <[email protected]>
Zorak556
added a commit
to Zorak556/polymarket-client-sdk
that referenced
this pull request
Apr 10, 2026
Upstream merges: - Polymarket#321: accept custom reqwest::Client via Config - Polymarket#322: BuilderTradeResponse.builder Address → ApiKey - Polymarket#306: add match_time_nano to TradeResponse - Polymarket#305: preserve unknown activity side values - Polymarket#303: version bump to 0.4.5 - Dep bumps: rust_decimal 1.41, uuid 1.23 Local patches: - Reduce auth header allocations (HeaderValue::from for integers) - Reorder order_builder size validation before async fee_rate call - Skip double deserialization when tracing is disabled - subscribe_book_and_prices: single-stream book + price_change - subscribe_user/orders/trades: async for tokio::sync::RwLock - Subscription lag: escalate to error and force resubscribe - Broadcast capacity: 1024 → 16384 - excludeDepositsWithdrawals param on ActivityRequest - cancel_order: orderId → orderID Co-Authored-By: Claude Opus 4.6 <[email protected]>
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
BuilderTradeResponse.buildertype fromAddresstoApiKey(UUID)/builder/tradesAPI returns a UUID for thebuilderfield (e.g.019b618b-4a91-7dd9-a4c9-aadfbcbd5b95), not an Ethereum addressApiKeyis already used in the same struct for theownerfield, so this aligns with existing patternsNote
This is a focused fix for #294 only. PR #297 addresses the same issue but bundles additional scope (#293) and has stalled with unresolved review feedback.
Breaking change:
builderfield type changes fromAddresstoApiKey(Uuid). The previous type caused deserialization failures against the real API, so no working code should be affected.Closes #294
Test plan
cargo test --test clob builder_tradespasses with UUID in mock payload/builder/tradesendpointNote
Medium Risk
Breaking type change:
BuilderTradeResponse.builderis now anApiKey(Uuid) instead of an EthereumAddress, which could impact downstream consumers compiling against this SDK. Scope is small and aligns deserialization with the actual/builder/tradespayload, reducing runtime failures.Overview
Fixes
/builder/tradesdeserialization by changingBuilderTradeResponse.builderfromAddresstoApiKey(Uuid), matching the API’s UUID value for thebuilderfield.Updates the
builder_tradestest fixture and expectedBuilderTradeResponseconstruction to use a realistic UUID string instead of an address.Reviewed by Cursor Bugbot for commit c78ae04. Bugbot is set up for automated code reviews on this repo. Configure here.