Skip to content

BuilderTradeResponse: builder field typed as Address but API returns UUID #294

@JohnGalt017

Description

@JohnGalt017

Problem

BuilderTradeResponse.builder is typed as Address (20-byte Ethereum address), but the /builder/trades API returns a UUID string (builder API key ID).

Deserialization fails with:

invalid string length at line 1 column 199

Actual API response

{
  "builder": "019b618b-4a91-7dd9-a4c9-aadfbcbd5b95",
  "maker": "0x4Ede3a1320FFD8087C0302b360721696f0037865",
  ...
}

builder is a UUID, maker is an Ethereum address.

Verified

Reproduced locally by deserializing actual API JSON into BuilderTradeResponse — fails at column 199 which is exactly the builder field.

The TypeScript SDK (@polymarket/clob-client) correctly types this as string.

Affected code

src/clob/types/response.rs:657:

pub builder: Address,   // should be String or ApiKey (Uuid)

Suggested fix

pub builder: ApiKey,  // ApiKey = Uuid — matches `owner` field

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions