From 981c1adf31975f8d0ac62a2a11ca236004e5c10d Mon Sep 17 00:00:00 2001 From: Samuel Tinnerholm Date: Mon, 29 Jun 2026 06:51:33 +0000 Subject: [PATCH] fix(python-sdk): accept wallet address in Hunch client --- sdks/python/pmxt/_exchanges.py | 3 +++ sdks/python/tests/test_hosted_dispatch.py | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sdks/python/pmxt/_exchanges.py b/sdks/python/pmxt/_exchanges.py index 10bf30d6..509bb621 100644 --- a/sdks/python/pmxt/_exchanges.py +++ b/sdks/python/pmxt/_exchanges.py @@ -551,6 +551,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, + wallet_address: Optional[str] = None, ) -> None: """ Initialize Hunch client. @@ -560,6 +561,7 @@ def __init__( base_url: Base URL of the PMXT sidecar server auto_start_server: Automatically start server if not running (default: True) pmxt_api_key: Hosted PMXT API key (optional; enables hosted mode) + wallet_address: EVM wallet address used for hosted reads/writes """ super().__init__( exchange_name="hunch", @@ -567,6 +569,7 @@ def __init__( base_url=base_url, auto_start_server=auto_start_server, pmxt_api_key=pmxt_api_key, + wallet_address=wallet_address, ) diff --git a/sdks/python/tests/test_hosted_dispatch.py b/sdks/python/tests/test_hosted_dispatch.py index a025d152..8e02b221 100644 --- a/sdks/python/tests/test_hosted_dispatch.py +++ b/sdks/python/tests/test_hosted_dispatch.py @@ -22,7 +22,7 @@ from pmxt._hosted_routing import HOSTED_TRADING_BASE_URL from pmxt._hosted_errors import MissingWalletAddress, NotSupported -from pmxt._exchanges import Limitless, Polymarket +from pmxt._exchanges import Hunch, Limitless, Polymarket from pmxt.errors import InvalidSignature import pmxt.client as client_module from pmxt.models import BuiltOrder @@ -146,6 +146,17 @@ def _make_limitless( return Limitless(**kwargs) +def test_hunch_constructor_accepts_wallet_address_for_hosted_mode(): + api = Hunch( + pmxt_api_key=PMXT_API_KEY, + wallet_address=WALLET_ADDRESS, + auto_start_server=False, + ) + + assert api.exchange_name == "hunch" + assert api.wallet_address == WALLET_ADDRESS + + # --------------------------------------------------------------------------- # # Read-method dispatch tests # --------------------------------------------------------------------------- #