Skip to content

SDK drift: MissingWalletAddress constructor accepts only message in TypeScript but inherits ValidationError's full (message, field, exchange) signature in Python #2160

Description

@realfishsam

Drift

TypeScript's MissingWalletAddress explicitly narrows its constructor to a single message parameter, dropping the field/exchange parameters its parent ValidationError exposes. Python's MissingWalletAddress has no __init__ override at all, so it inherits ValidationError.__init__(self, message, field=None, **kwargs) verbatim — callers can pass field=/exchange= that have no TypeScript equivalent.

TypeScript SDK

sdks/typescript/pmxt/hosted-errors.ts:152-157:

export class MissingWalletAddress extends ValidationError {
    constructor(message: string) {
        super(message);
        this.name = this.constructor.name;
    }
}

Only message is accepted; field and exchange (both present on the parent ValidationError constructor, errors.ts:99) are unreachable when constructing MissingWalletAddress directly.

Python SDK

sdks/python/pmxt/_hosted_errors.py:100-101:

class MissingWalletAddress(ValidationError):
    """Hosted trading request requires a wallet address before any network call."""

No __init__ is defined, so it inherits ValidationError.__init__(self, message: str, field: str | None = None, **kwargs) -> None (errors.py:107-109) unchanged — MissingWalletAddress("msg", field="walletAddress", exchange="polymarket") is valid Python but has no TypeScript equivalent constructor call.

Expected

MissingWalletAddress's constructor surface should match across languages — either TypeScript widens its constructor to accept field/exchange like its parent, or Python narrows its override to message only, consistent with how the class is actually constructed in practice.

Impact

Code that constructs MissingWalletAddress with a field or exchange argument (as its parent class and other error subclasses generally support) works in Python but is a compile-time type error in TypeScript, giving the two SDKs different construction ergonomics for hosted-trading wallet-address validation failures.


Found by automated SDK cross-language drift audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions