Skip to content

SDK drift/bug: Python Myriad(wallet_address=...) is wired into the base class's private_key slot, so self.wallet_address is never populated #1448

Description

@realfishsam

Drift

This goes beyond the already-filed #464 (which only notes the naming difference between Python's wallet_address and TypeScript's privateKey). Verified directly in the code: the Python Myriad constructor takes the user-supplied wallet_address value and passes it into the base Exchange.__init__'s private_key= parameter — not wallet_address=, even though the base class has a separate wallet_address attribute. The result is a functional misrouting, not just a naming inconsistency.

Python SDK

sdks/python/pmxt/_exchanges.py, lines 263-291:

class Myriad(Exchange):
    def __init__(
        self,
        api_key: Optional[str] = None,
        wallet_address: Optional[str] = None,
        ...
    ) -> None:
        """
        Args:
            wallet_address: Wallet address (required for positions and balance)
        """
        super().__init__(
            exchange_name="myriad",
            api_key=api_key,
            private_key=wallet_address,   # <-- misrouted: feeds base's private_key=, not wallet_address=
            ...
        )

Verified the base class has both attributes as distinct slots, sdks/python/pmxt/client.py:

line 370: self.private_key = private_key
line 374: self.wallet_address = wallet_address

self.wallet_address on a Myriad instance is therefore always None (the base __init__ parameter defaults to None since Myriad never passes it), while self.private_key incorrectly holds a plain wallet address string. Any hosted-mode code path relying on resolve_wallet_address(self) (client.py lines 973, 1007) will fail to find the address for a Myriad instance. Additionally, if no explicit signer is supplied, client.py line 409 constructs EthAccountSigner(self.private_key) — attempting to build a signer from what is actually a public wallet address, not a private key, which would fail or behave unpredictably.

TypeScript SDK

sdks/typescript/pmxt/client.ts, lines 3280-3284:

export class Myriad extends Exchange {
    constructor(options: ExchangeOptions = {}) {
        super("myriad", options);
    }
}

options.walletAddress flows correctly into the base class's own walletAddress slot (per ExchangeOptions, no misrouting).

Expected

Myriad.__init__ in Python should pass wallet_address=wallet_address to the base Exchange.__init__, not private_key=wallet_address.

Impact

This looks like a genuine functional bug independent of cross-language naming: any Python code that constructs Myriad(wallet_address=...) and then relies on self.wallet_address, resolve_wallet_address(), hosted balance/position resolution, or default signer construction from private_key will silently misbehave — the wallet address is stored in the wrong slot and the intended wallet_address attribute is never set.


Found by automated SDK cross-language drift audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: highbugSomething isn't workingeffort: smallgood first issueGood for newcomerspythonPython SDK specificsdk-driftCross-language SDK consistency findings (TypeScript vs Python)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions