pmxt_api_key authenticates you to PMXT; the signature authenticates the order to the venue’s on-chain settlement contract.
What the SDK does for you
Passprivate_key to the exchange constructor and you’re done. The SDK auto-wraps it into a local signer (EthAccountSigner in Python, EthersSigner in TypeScript), builds the typed-data payload for the right venue, signs locally, and submits the signature. You never see the typed-data shape.
Single-signature vs dual-signature flows
Most hosted writes are single-signature — one EIP-712 payload, surfaced asbuilt.raw["typed_data"]. This covers:
- Polymarket buys and sells —
OrderParamson the PolygonPreFundedEscrowdomain. - Opinion BUY —
CrossChainOrderParamson the PolygonPreFundedEscrowdomain (the BSC delivery leg needs no user signature; the user is the recipient). - Limitless buys and sells — ERC-7683 order on the Polygon escrow domain.
built.raw["typed_data"]—CrossChainSellPayParamson the PolygonPreFundedEscrowdomain (the operator’s pay leg into the user’s Polygon balance).built.raw["pull_typed_data"]—CrossChainSellPullParamson the BSCVenueEscrowdomain (the operator’s pull leg against the user’s BSC outcome tokens).
PreFundedEscrow on chainId 137, VenueEscrow on chainId 56) and each signature only authorizes its own chain’s leg.
Why reads only need a wallet address
For reads (fetch_balance, fetch_positions, fetch_my_trades), no signature is required — the pmxt_api_key is enough. You can construct a hosted client with only pmxt_api_key and wallet_address and read hosted state for that wallet:
Advanced: bring your own signer
If your key lives in a hardware wallet, HSM, MPC service, or anything that isn’t a raw hex private key, skipprivate_key and inject a custom signer at construction. The SDK uses it transparently for every hosted write — you keep calling create_order as usual.
The signer protocol is one method: sign_typed_data(typed_data: dict) -> hex (Python) or signTypedData(typedData): Promise<string> plus a readonly address (TypeScript).
EthAccountSigner (Python) / EthersSigner (TypeScript) are reference implementations; ethers v6 supports Ledger out of the box, and for MPC see Fireblocks / Privy / Turnkey docs.
