Skip to content

Commit fd16c1e

Browse files
committed
docs(sdk): sync generated API references
1 parent e537341 commit fd16c1e

2 files changed

Lines changed: 94 additions & 32 deletions

File tree

sdks/python/API_REFERENCE.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,25 @@ for pos in positions:
14431443

14441444
## Data Models
14451445

1446+
### `ExchangeOptions`
1447+
1448+
Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.).
1449+
Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against
1450+
a local sidecar with venue credentials.
1451+
1452+
```python
1453+
@dataclass
1454+
class ExchangeOptions:
1455+
pmxt_api_key: str # PMXT customer API key. When set, the SDK routes to api.pmxt.dev (catalog) and trade.pmxt.dev (trading). Get one at pmxt.dev/dashboard.
1456+
wallet_address: str # EVM wallet address for hosted reads/writes. Required for endpoints that operate on a wallet (balances, positions, trades, open orders).
1457+
signer: object # Optional pre-built signer for hosted writes. If absent and privateKey is set, the SDK auto-wraps privateKey into a signer.
1458+
private_key: str # Private key. In hosted mode, used to derive an EIP-712 signer for writes (wraps into EthAccountSigner/EthersSigner). In self-hosted mode, used as the venue credential directly.
1459+
base_url: str # Explicit base URL override. When unset, the SDK uses api.pmxt.dev when pmxtApiKey is set, or the local sidecar otherwise.
1460+
api_key: str # Venue-side API key (e.g. Polymarket CLOB key). Only relevant for self-hosted mode.
1461+
auto_start_server: bool # Auto-start the local sidecar when running self-hosted. Defaults to true when no pmxtApiKey is set, false when hosted.
1462+
```
1463+
1464+
---
14461465
### `UnifiedMarket`
14471466

14481467

@@ -1527,11 +1546,11 @@ id: str # Stable venue-native series identifier (e.g. "KXATPMATCH" on Kalshi, "a
15271546
ticker: str # Venue-native ticker, when distinct from `id`.
15281547
slug: str # Venue-native slug.
15291548
title: str # Human-readable series title (e.g. "ATP Match Winner", "WTA").
1530-
description: Any # Long-form series description.
1531-
recurrence: Any # Recurrence cadence the venue reports ('daily', 'weekly', 'annual', ...).
1549+
description: str # Long-form series description.
1550+
recurrence: str # Recurrence cadence the venue reports ('daily', 'weekly', 'annual', ...).
15321551
events: List[UnifiedEvent] # Child events. Populated when fetched by id; the list form usually omits this to keep payloads small.
1533-
url: Any # Canonical venue URL for the series.
1534-
image: Any # Venue-hosted image.
1552+
url: str # Canonical venue URL for the series.
1553+
image: str # Venue-hosted image.
15351554
source_exchange: str # The exchange this series originates from. Populated by the Router.
15361555
source_metadata: object # Raw venue-specific fields not promoted to first-class columns.
15371556
```
@@ -1613,6 +1632,9 @@ amount: float # Size of the trade in contracts/shares.
16131632
side: str # Trade side from the taker's perspective.
16141633
outcome_id: str # The outcome this trade is for (if known).
16151634
order_id: str # The order that produced this trade, if known.
1635+
tx_hash: str # Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1636+
chain: str # Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1637+
block_number: float # Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
16161638
```
16171639

16181640
---
@@ -1637,24 +1659,31 @@ remaining: float # Amount remaining
16371659
timestamp: float # Unix timestamp in milliseconds when the order was created.
16381660
fee: float # Fee paid for this order, if known.
16391661
fee_rate_bps: float # Fee rate in basis points applied to this order (e.g. 100 = 1%).
1662+
tx_hash: str # Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1663+
chain: str # Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1664+
block_number: float # Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
16401665
```
16411666

16421667
---
16431668
### `Position`
16441669

1645-
1670+
A current position in a market. In hosted mode, `outcomeLabel`, `entryPrice`, `currentPrice` and `unrealizedPnL` may be null when the server cannot derive them (e.g. `with_mtm=false` or no fill history). Venue-direct callers continue to populate every field.
16461671

16471672
```python
16481673
@dataclass
16491674
class Position:
16501675
market_id: str # The market this position is held in.
16511676
outcome_id: str # The outcome this position is held in.
1652-
outcome_label: str # Human-readable label for the outcome held.
1677+
outcome_label: str # Human-readable label for the outcome held. Optional in hosted mode.
16531678
size: float # Positive for long, negative for short
1654-
entry_price: float # Average entry price for the position (probability between 0.0 and 1.0).
1655-
current_price: float # Current mark price for the position (probability between 0.0 and 1.0).
1656-
unrealized_pnl: float # Unrealized profit or loss at the current price (USD).
1679+
entry_price: float # Average entry price for the position (probability between 0.0 and 1.0). Optional in hosted mode when no fill history is available.
1680+
current_price: float # Current mark price for the position (probability between 0.0 and 1.0). Optional in hosted mode when mark-to-market data is unavailable.
1681+
current_value: float # Current market value of the position (size * currentPrice). Null when currentPrice is unavailable.
1682+
unrealized_pnl: float # Unrealized profit or loss at the current price (USD). Optional in hosted mode when mark-to-market data is unavailable.
16571683
realized_pnl: float # Realized profit or loss booked so far (USD).
1684+
tx_hash: str # Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1685+
chain: str # Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1686+
block_number: float # Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
16581687
```
16591688

16601689
---
@@ -1669,6 +1698,7 @@ currency: str # e.g., 'USDC'
16691698
total: float # Total balance including funds locked in open orders.
16701699
available: float # Balance available to trade (excludes locked funds).
16711700
locked: float # In open orders
1701+
venue: str # Hosted-mode: which venue this balance belongs to in a multi-venue response. Null when the balance is venue-agnostic.
16721702
```
16731703

16741704
---
@@ -1723,6 +1753,7 @@ params: Any # The original params used to build this order.
17231753
signed_order: object # For CLOB exchanges (Polymarket): the EIP-712 signed order ready to POST to the exchange's order endpoint.
17241754
tx: object # For on-chain AMM exchanges: the EVM transaction payload. Reserved for future exchanges; no current exchange populates this.
17251755
raw: Any # The raw, exchange-native payload. Always present.
1756+
expiry: float # Unix epoch (ms) when this built order expires server-side. Submitting after expiry returns BUILT_ORDER_EXPIRED.
17261757
```
17271758

17281759
---
@@ -1774,9 +1805,9 @@ market: UnifiedMarket #
17741805
source_market: Any # The source market this was matched against. Present in browse mode (no marketId), absent in lookup mode.
17751806
relation: str #
17761807
confidence: float #
1777-
reasoning: Any #
1778-
best_bid: Any #
1779-
best_ask: Any #
1808+
reasoning: str #
1809+
best_bid: float #
1810+
best_ask: float #
17801811
```
17811812

17821813
---
@@ -1802,9 +1833,9 @@ class PriceComparison:
18021833
market: UnifiedMarket #
18031834
relation: str #
18041835
confidence: float #
1805-
reasoning: Any #
1806-
best_bid: Any #
1807-
best_ask: Any #
1836+
reasoning: str #
1837+
best_bid: float #
1838+
best_ask: float #
18081839
venue: str #
18091840
```
18101841

@@ -1844,7 +1875,7 @@ price_a: float #
18441875
price_b: float #
18451876
relation: str # The set-theoretic relation between the two markets (e.g. identity, subset).
18461877
confidence: float # Match confidence score (0.0 to 1.0).
1847-
reasoning: Any # Why the two markets were matched.
1878+
reasoning: str # Why the two markets were matched.
18481879
```
18491880

18501881
---

sdks/typescript/API_REFERENCE.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,25 @@ positions.forEach(pos => {
14441444
14451445
## Data Models
14461446
1447+
### `ExchangeOptions`
1448+
1449+
Constructor-level options for venue clients (Polymarket, Kalshi, Opinion, etc.).
1450+
Hosted mode is the default when pmxtApiKey is set; otherwise the SDK runs against
1451+
a local sidecar with venue credentials.
1452+
1453+
```typescript
1454+
interface ExchangeOptions {
1455+
pmxtApiKey: string; // PMXT customer API key. When set, the SDK routes to api.pmxt.dev (catalog) and trade.pmxt.dev (trading). Get one at pmxt.dev/dashboard.
1456+
walletAddress: string; // EVM wallet address for hosted reads/writes. Required for endpoints that operate on a wallet (balances, positions, trades, open orders).
1457+
signer: object; // Optional pre-built signer for hosted writes. If absent and privateKey is set, the SDK auto-wraps privateKey into a signer.
1458+
privateKey: string; // Private key. In hosted mode, used to derive an EIP-712 signer for writes (wraps into EthAccountSigner/EthersSigner). In self-hosted mode, used as the venue credential directly.
1459+
baseUrl: string; // Explicit base URL override. When unset, the SDK uses api.pmxt.dev when pmxtApiKey is set, or the local sidecar otherwise.
1460+
apiKey: string; // Venue-side API key (e.g. Polymarket CLOB key). Only relevant for self-hosted mode.
1461+
autoStartServer: boolean; // Auto-start the local sidecar when running self-hosted. Defaults to true when no pmxtApiKey is set, false when hosted.
1462+
}
1463+
```
1464+
1465+
---
14471466
### `UnifiedMarket`
14481467
14491468
@@ -1527,11 +1546,11 @@ id: string; // Stable venue-native series identifier (e.g. "KXATPMATCH" on Kalsh
15271546
ticker: string; // Venue-native ticker, when distinct from `id`.
15281547
slug: string; // Venue-native slug.
15291548
title: string; // Human-readable series title (e.g. "ATP Match Winner", "WTA").
1530-
description: any; // Long-form series description.
1531-
recurrence: any; // Recurrence cadence the venue reports ('daily', 'weekly', 'annual', ...).
1549+
description: string; // Long-form series description.
1550+
recurrence: string; // Recurrence cadence the venue reports ('daily', 'weekly', 'annual', ...).
15321551
events: UnifiedEvent[]; // Child events. Populated when fetched by id; the list form usually omits this to keep payloads small.
1533-
url: any; // Canonical venue URL for the series.
1534-
image: any; // Venue-hosted image.
1552+
url: string; // Canonical venue URL for the series.
1553+
image: string; // Venue-hosted image.
15351554
sourceExchange: string; // The exchange this series originates from. Populated by the Router.
15361555
sourceMetadata: object; // Raw venue-specific fields not promoted to first-class columns.
15371556
}
@@ -1613,6 +1632,9 @@ amount: number; // Size of the trade in contracts/shares.
16131632
side: string; // Trade side from the taker's perspective.
16141633
outcomeId: string; // The outcome this trade is for (if known).
16151634
orderId: string; // The order that produced this trade, if known.
1635+
txHash: string; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1636+
chain: string; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1637+
blockNumber: number; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
16161638
}
16171639
```
16181640
@@ -1637,24 +1659,31 @@ remaining: number; // Amount remaining
16371659
timestamp: number; // Unix timestamp in milliseconds when the order was created.
16381660
fee: number; // Fee paid for this order, if known.
16391661
feeRateBps: number; // Fee rate in basis points applied to this order (e.g. 100 = 1%).
1662+
txHash: string; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1663+
chain: string; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
1664+
blockNumber: number; // Populated in hosted mode after on-chain settlement; null for local-mode and for non-on-chain venues.
16401665
}
16411666
```
16421667
16431668
---
16441669
### `Position`
16451670
1646-
1671+
A current position in a market. In hosted mode, `outcomeLabel`, `entryPrice`, `currentPrice` and `unrealizedPnL` may be null when the server cannot derive them (e.g. `with_mtm=false` or no fill history). Venue-direct callers continue to populate every field.
16471672
16481673
```typescript
16491674
interface Position {
16501675
marketId: string; // The market this position is held in.
16511676
outcomeId: string; // The outcome this position is held in.
1652-
outcomeLabel: string; // Human-readable label for the outcome held.
1677+
outcomeLabel: string; // Human-readable label for the outcome held. Optional in hosted mode.
16531678
size: number; // Positive for long, negative for short
1654-
entryPrice: number; // Average entry price for the position (probability between 0.0 and 1.0).
1655-
currentPrice: number; // Current mark price for the position (probability between 0.0 and 1.0).
1656-
unrealizedPnL: number; // Unrealized profit or loss at the current price (USD).
1679+
entryPrice: number; // Average entry price for the position (probability between 0.0 and 1.0). Optional in hosted mode when no fill history is available.
1680+
currentPrice: number; // Current mark price for the position (probability between 0.0 and 1.0). Optional in hosted mode when mark-to-market data is unavailable.
1681+
currentValue: number; // Current market value of the position (size * currentPrice). Null when currentPrice is unavailable.
1682+
unrealizedPnL: number; // Unrealized profit or loss at the current price (USD). Optional in hosted mode when mark-to-market data is unavailable.
16571683
realizedPnL: number; // Realized profit or loss booked so far (USD).
1684+
txHash: string; // Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1685+
chain: string; // Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
1686+
blockNumber: number; // Populated in hosted mode after on-chain settlement (from the last fill); null for local-mode and for non-on-chain venues.
16581687
}
16591688
```
16601689
@@ -1669,6 +1698,7 @@ currency: string; // e.g., 'USDC'
16691698
total: number; // Total balance including funds locked in open orders.
16701699
available: number; // Balance available to trade (excludes locked funds).
16711700
locked: number; // In open orders
1701+
venue: string; // Hosted-mode: which venue this balance belongs to in a multi-venue response. Null when the balance is venue-agnostic.
16721702
}
16731703
```
16741704
@@ -1723,6 +1753,7 @@ params: any; // The original params used to build this order.
17231753
signedOrder: object; // For CLOB exchanges (Polymarket): the EIP-712 signed order ready to POST to the exchange's order endpoint.
17241754
tx: object; // For on-chain AMM exchanges: the EVM transaction payload. Reserved for future exchanges; no current exchange populates this.
17251755
raw: any; // The raw, exchange-native payload. Always present.
1756+
expiry: number; // Unix epoch (ms) when this built order expires server-side. Submitting after expiry returns BUILT_ORDER_EXPIRED.
17261757
}
17271758
```
17281759
@@ -1774,9 +1805,9 @@ market: UnifiedMarket; //
17741805
sourceMarket: any; // The source market this was matched against. Present in browse mode (no marketId), absent in lookup mode.
17751806
relation: string; //
17761807
confidence: number; //
1777-
reasoning: any; //
1778-
bestBid: any; //
1779-
bestAsk: any; //
1808+
reasoning: string; //
1809+
bestBid: number; //
1810+
bestAsk: number; //
17801811
}
17811812
```
17821813
@@ -1802,9 +1833,9 @@ interface PriceComparison {
18021833
market: UnifiedMarket; //
18031834
relation: string; //
18041835
confidence: number; //
1805-
reasoning: any; //
1806-
bestBid: any; //
1807-
bestAsk: any; //
1836+
reasoning: string; //
1837+
bestBid: number; //
1838+
bestAsk: number; //
18081839
venue: string; //
18091840
}
18101841
```
@@ -1844,7 +1875,7 @@ priceA: number; //
18441875
priceB: number; //
18451876
relation: string; // The set-theoretic relation between the two markets (e.g. identity, subset).
18461877
confidence: number; // Match confidence score (0.0 to 1.0).
1847-
reasoning: any; // Why the two markets were matched.
1878+
reasoning: string; // Why the two markets were matched.
18481879
}
18491880
```
18501881

0 commit comments

Comments
 (0)