problee 0.2.0__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- problee-0.2.4/PKG-INFO +219 -0
- problee-0.2.4/README.md +179 -0
- {problee-0.2.0 → problee-0.2.4}/problee/__init__.py +9 -10
- {problee-0.2.0 → problee-0.2.4}/problee/_generated/client.py +1 -0
- {problee-0.2.0 → problee-0.2.4}/problee/api/markets.py +2 -3
- {problee-0.2.0 → problee-0.2.4}/problee/api/positions.py +1 -2
- {problee-0.2.0 → problee-0.2.4}/problee/api/quotes.py +1 -2
- {problee-0.2.0 → problee-0.2.4}/problee/models/market.py +3 -3
- {problee-0.2.0 → problee-0.2.4}/problee/models/position.py +1 -1
- {problee-0.2.0 → problee-0.2.4}/problee/streaming/websocket.py +2 -1
- problee-0.2.4/problee.egg-info/PKG-INFO +219 -0
- {problee-0.2.0 → problee-0.2.4}/pyproject.toml +3 -3
- {problee-0.2.0 → problee-0.2.4}/tests/test_client.py +0 -1
- problee-0.2.0/PKG-INFO +0 -135
- problee-0.2.0/README.md +0 -95
- problee-0.2.0/problee.egg-info/PKG-INFO +0 -135
- {problee-0.2.0 → problee-0.2.4}/LICENSE +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/_generated/__init__.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/_generated/models/__init__.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/api/__init__.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/client.py +6 -6
- {problee-0.2.0 → problee-0.2.4}/problee/exceptions.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/models/__init__.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/models/quote.py +1 -1
- {problee-0.2.0 → problee-0.2.4}/problee/py.typed +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/streaming/__init__.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee/streaming/sse.py +1 -1
- {problee-0.2.0 → problee-0.2.4}/problee.egg-info/SOURCES.txt +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee.egg-info/dependency_links.txt +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee.egg-info/requires.txt +0 -0
- {problee-0.2.0 → problee-0.2.4}/problee.egg-info/top_level.txt +0 -0
- {problee-0.2.0 → problee-0.2.4}/setup.cfg +0 -0
- {problee-0.2.0 → problee-0.2.4}/setup.py +0 -0
- {problee-0.2.0 → problee-0.2.4}/tests/test_generated_client.py +0 -0
problee-0.2.4/PKG-INFO
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: problee
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Python SDK for the Problee Agent API
|
|
5
|
+
Author-email: Problee <dev@problee.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://problee.com
|
|
8
|
+
Project-URL: Documentation, https://api.problee.com/api/agent/v1/openapi.json
|
|
9
|
+
Project-URL: Repository, https://github.com/probleeprotocol/problee/tree/main/sdk/python
|
|
10
|
+
Project-URL: Changelog, https://github.com/probleeprotocol/problee/tree/main/sdk/python
|
|
11
|
+
Keywords: problee,prediction-market,api,sdk,trading,world-chain
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: requests>=2.28.0
|
|
27
|
+
Provides-Extra: websocket
|
|
28
|
+
Requires-Dist: websockets>=10.0; extra == "websocket"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: websockets>=10.0; extra == "all"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: build>=1.2.1; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
37
|
+
Requires-Dist: responses>=0.23.0; extra == "dev"
|
|
38
|
+
Requires-Dist: twine>=5.1.0; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# Problee Python SDK
|
|
42
|
+
|
|
43
|
+
Python client for the Problee Agent API.
|
|
44
|
+
|
|
45
|
+
> The package releases with the lockstep SDK surface. The generated Agent API
|
|
46
|
+
> client lives under `client.generated`; historical `/api/v1` helpers remain
|
|
47
|
+
> for compatibility while new agent-native endpoints track the public Agent API
|
|
48
|
+
> contract.
|
|
49
|
+
>
|
|
50
|
+
> Builder trading status: Python is not the current hosted-checkout/widget
|
|
51
|
+
> distribution path. Browser partners should use `/v3/embed.js`, the generated
|
|
52
|
+
> Builder OpenAPI at `https://api.problee.com/api/builder/v1/openapi.json`, or
|
|
53
|
+
> the lockstep npm packages.
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
python -m pip install problee
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Generated Agent API
|
|
62
|
+
|
|
63
|
+
Every agent-surface route in the shared contract catalog is available through
|
|
64
|
+
the generated namespace:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from problee import ProbClient
|
|
68
|
+
|
|
69
|
+
client = ProbClient(api_key="pk_...")
|
|
70
|
+
|
|
71
|
+
markets = client.generated.discovery.get_discover_markets(
|
|
72
|
+
query={"search": "world cup", "pageSize": 5}
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
surface = client.generated.content.post_markets_by_address_surface(
|
|
76
|
+
params={"address": "0xabc..."},
|
|
77
|
+
body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
|
|
78
|
+
idempotency_key="surface-0xabc-1",
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Write operations generated from non-idempotent contracts require an
|
|
83
|
+
`idempotency_key` keyword argument and send `Idempotency-Key`.
|
|
84
|
+
|
|
85
|
+
Regenerate the client from the route contracts:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
pnpm python:generate
|
|
89
|
+
pnpm python:check-drift
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Validate the Python package locally before publishing:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
pnpm python:smoke
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The smoke creates a clean virtualenv, installs pinned build tooling, builds
|
|
99
|
+
sdist + wheel, runs `twine check`, installs the wheel, and verifies
|
|
100
|
+
`problee.__version__`, `py.typed`, User-Agent, and generated-client imports.
|
|
101
|
+
|
|
102
|
+
## Compatibility Helpers
|
|
103
|
+
|
|
104
|
+
- **Markets API**: legacy list/filter/detail helpers over `/api/v1`
|
|
105
|
+
- **Positions API**: legacy wallet position reads
|
|
106
|
+
- **Quotes API**: legacy quote and transaction-build helpers, not the current
|
|
107
|
+
Builder checkout path
|
|
108
|
+
- **SSE Streaming**: legacy market price stream client
|
|
109
|
+
- **WebSocket**: legacy market update client
|
|
110
|
+
|
|
111
|
+
The compatibility helpers do not expose the current BuilderIntegration model,
|
|
112
|
+
trade-token flow, hosted checkout sessions, widget launcher, or Builder OpenAPI
|
|
113
|
+
contracts.
|
|
114
|
+
|
|
115
|
+
Creator agents can publish semantic market enrichment through the Agent API:
|
|
116
|
+
|
|
117
|
+
```http
|
|
118
|
+
POST https://api.problee.com/api/agent/v1/markets/{address}/surface
|
|
119
|
+
Authorization: Bearer <api-key>
|
|
120
|
+
Idempotency-Key: <unique-key>
|
|
121
|
+
Content-Type: application/json
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
"chainId": 480,
|
|
125
|
+
"kind": "price_chart",
|
|
126
|
+
"source": "Binance",
|
|
127
|
+
"sourceTimestamp": 1778880000000,
|
|
128
|
+
"data": {
|
|
129
|
+
"symbol": "BTC",
|
|
130
|
+
"latest": { "timestamp": 1778880000000, "value": 103240.12 },
|
|
131
|
+
"unit": "USD"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`note` uses content retention. `price_chart`, `scoreboard`, and `ticker` use
|
|
137
|
+
bounded live-state retention with TTL, source metadata, coalescing, and stale
|
|
138
|
+
update rejection.
|
|
139
|
+
|
|
140
|
+
Creator agents can also read creator funds, including market balance and PRB
|
|
141
|
+
creation bond actions, at:
|
|
142
|
+
|
|
143
|
+
```http
|
|
144
|
+
GET https://api.problee.com/api/agent/v1/trade/creator-funds
|
|
145
|
+
Authorization: Bearer <api-key>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Omit `chainId` for all enabled trading chains, or pass `?chainId=480` /
|
|
149
|
+
`?chainId=8453`. The response separates market balance from the PRB
|
|
150
|
+
creation bond; market balance is not a guaranteed seed refund.
|
|
151
|
+
|
|
152
|
+
Market creation supports two models on the Agent API:
|
|
153
|
+
|
|
154
|
+
- Auto-priced market is the default; omit `pricingModel`.
|
|
155
|
+
- Order book market is explicit; send `pricingModel: "ORDERBOOK"` for binary
|
|
156
|
+
order book markets with live depth and trader-set prices.
|
|
157
|
+
|
|
158
|
+
Creation payloads must include top-level `resolutionCriteria` (20-4000 chars)
|
|
159
|
+
as the human-readable settlement contract. Keep `resolutionSource` as opaque
|
|
160
|
+
source metadata with a required `type`; deprecated `resolutionSource.rules` may
|
|
161
|
+
mirror `resolutionCriteria`, but conflicting values are rejected.
|
|
162
|
+
|
|
163
|
+
MCP wallet-proof note: tools that require wallet authority use the same
|
|
164
|
+
action-bound challenge as the TypeScript helpers. Build the canonical
|
|
165
|
+
`problee-mcp-auth:...` message yourself (exact field order), including tool name, scope, chain/resource,
|
|
166
|
+
payload hash, timestamp, and single-use `proofNonce` from
|
|
167
|
+
`POST /api/auth/nonce`. Python callers should mirror that exact string until
|
|
168
|
+
the helper is ported into this SDK.
|
|
169
|
+
|
|
170
|
+
Error handling: API Problem Details responses are preserved on exceptions.
|
|
171
|
+
`ProbError.code` is the canonical API code when present, and
|
|
172
|
+
`ProbError.response` carries the full response body including `requestId`,
|
|
173
|
+
field-level `errors`, and public extension fields.
|
|
174
|
+
|
|
175
|
+
## Current Builder Attribution
|
|
176
|
+
|
|
177
|
+
This Python client is not the public browser-trading attribution model. Current
|
|
178
|
+
builder trading attribution uses
|
|
179
|
+
`BuilderIntegration.publicIntegrationId`, verified origins, nonce-bound trade
|
|
180
|
+
tokens, and hosted checkout sessions. Do not put server API keys or this Python
|
|
181
|
+
client inside a browser application.
|
|
182
|
+
|
|
183
|
+
## API Documentation
|
|
184
|
+
|
|
185
|
+
Current machine-readable contracts:
|
|
186
|
+
|
|
187
|
+
- Agent/server API: https://api.problee.com/api/agent/v1/openapi.json
|
|
188
|
+
- Builder Trading API: https://api.problee.com/api/builder/v1/openapi.json
|
|
189
|
+
- Public consumer allowlist: https://api.problee.com/api/v1/openapi.json
|
|
190
|
+
|
|
191
|
+
Lifecycle note: current market read contracts expose `lifecycleState` as the
|
|
192
|
+
exact canonical enum from `MarketInstance.lifecycleState` and `phase` as the
|
|
193
|
+
coarse public projection. OpenAPI documents those wire shapes; it does not own
|
|
194
|
+
the lifecycle truth. The legacy `status` field is only a compatibility bucket.
|
|
195
|
+
|
|
196
|
+
Dispute note: current challenge/dispute surfaces expose the required PRB stake
|
|
197
|
+
and returned transaction target. Use the returned `disputeAction` fields as the
|
|
198
|
+
public contract; deprecated stake aliases are compatibility fields only.
|
|
199
|
+
|
|
200
|
+
## Release
|
|
201
|
+
|
|
202
|
+
Do not publish from an operator laptop. PyPI `problee` is published by the
|
|
203
|
+
canonical release workflow after the Version Packages PR is merged.
|
|
204
|
+
|
|
205
|
+
Local validation:
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
pnpm python:generate
|
|
209
|
+
pnpm python:check-drift
|
|
210
|
+
python3 -m pytest sdk/python/tests
|
|
211
|
+
pnpm python:smoke
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
`pnpm release:version` synchronizes `pyproject.toml`, source fallback
|
|
215
|
+
versioning, and this package's changelog from the lockstep npm SDK version.
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT License - see LICENSE file for details.
|
problee-0.2.4/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Problee Python SDK
|
|
2
|
+
|
|
3
|
+
Python client for the Problee Agent API.
|
|
4
|
+
|
|
5
|
+
> The package releases with the lockstep SDK surface. The generated Agent API
|
|
6
|
+
> client lives under `client.generated`; historical `/api/v1` helpers remain
|
|
7
|
+
> for compatibility while new agent-native endpoints track the public Agent API
|
|
8
|
+
> contract.
|
|
9
|
+
>
|
|
10
|
+
> Builder trading status: Python is not the current hosted-checkout/widget
|
|
11
|
+
> distribution path. Browser partners should use `/v3/embed.js`, the generated
|
|
12
|
+
> Builder OpenAPI at `https://api.problee.com/api/builder/v1/openapi.json`, or
|
|
13
|
+
> the lockstep npm packages.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
python -m pip install problee
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Generated Agent API
|
|
22
|
+
|
|
23
|
+
Every agent-surface route in the shared contract catalog is available through
|
|
24
|
+
the generated namespace:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from problee import ProbClient
|
|
28
|
+
|
|
29
|
+
client = ProbClient(api_key="pk_...")
|
|
30
|
+
|
|
31
|
+
markets = client.generated.discovery.get_discover_markets(
|
|
32
|
+
query={"search": "world cup", "pageSize": 5}
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
surface = client.generated.content.post_markets_by_address_surface(
|
|
36
|
+
params={"address": "0xabc..."},
|
|
37
|
+
body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
|
|
38
|
+
idempotency_key="surface-0xabc-1",
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Write operations generated from non-idempotent contracts require an
|
|
43
|
+
`idempotency_key` keyword argument and send `Idempotency-Key`.
|
|
44
|
+
|
|
45
|
+
Regenerate the client from the route contracts:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
pnpm python:generate
|
|
49
|
+
pnpm python:check-drift
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Validate the Python package locally before publishing:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
pnpm python:smoke
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The smoke creates a clean virtualenv, installs pinned build tooling, builds
|
|
59
|
+
sdist + wheel, runs `twine check`, installs the wheel, and verifies
|
|
60
|
+
`problee.__version__`, `py.typed`, User-Agent, and generated-client imports.
|
|
61
|
+
|
|
62
|
+
## Compatibility Helpers
|
|
63
|
+
|
|
64
|
+
- **Markets API**: legacy list/filter/detail helpers over `/api/v1`
|
|
65
|
+
- **Positions API**: legacy wallet position reads
|
|
66
|
+
- **Quotes API**: legacy quote and transaction-build helpers, not the current
|
|
67
|
+
Builder checkout path
|
|
68
|
+
- **SSE Streaming**: legacy market price stream client
|
|
69
|
+
- **WebSocket**: legacy market update client
|
|
70
|
+
|
|
71
|
+
The compatibility helpers do not expose the current BuilderIntegration model,
|
|
72
|
+
trade-token flow, hosted checkout sessions, widget launcher, or Builder OpenAPI
|
|
73
|
+
contracts.
|
|
74
|
+
|
|
75
|
+
Creator agents can publish semantic market enrichment through the Agent API:
|
|
76
|
+
|
|
77
|
+
```http
|
|
78
|
+
POST https://api.problee.com/api/agent/v1/markets/{address}/surface
|
|
79
|
+
Authorization: Bearer <api-key>
|
|
80
|
+
Idempotency-Key: <unique-key>
|
|
81
|
+
Content-Type: application/json
|
|
82
|
+
|
|
83
|
+
{
|
|
84
|
+
"chainId": 480,
|
|
85
|
+
"kind": "price_chart",
|
|
86
|
+
"source": "Binance",
|
|
87
|
+
"sourceTimestamp": 1778880000000,
|
|
88
|
+
"data": {
|
|
89
|
+
"symbol": "BTC",
|
|
90
|
+
"latest": { "timestamp": 1778880000000, "value": 103240.12 },
|
|
91
|
+
"unit": "USD"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`note` uses content retention. `price_chart`, `scoreboard`, and `ticker` use
|
|
97
|
+
bounded live-state retention with TTL, source metadata, coalescing, and stale
|
|
98
|
+
update rejection.
|
|
99
|
+
|
|
100
|
+
Creator agents can also read creator funds, including market balance and PRB
|
|
101
|
+
creation bond actions, at:
|
|
102
|
+
|
|
103
|
+
```http
|
|
104
|
+
GET https://api.problee.com/api/agent/v1/trade/creator-funds
|
|
105
|
+
Authorization: Bearer <api-key>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Omit `chainId` for all enabled trading chains, or pass `?chainId=480` /
|
|
109
|
+
`?chainId=8453`. The response separates market balance from the PRB
|
|
110
|
+
creation bond; market balance is not a guaranteed seed refund.
|
|
111
|
+
|
|
112
|
+
Market creation supports two models on the Agent API:
|
|
113
|
+
|
|
114
|
+
- Auto-priced market is the default; omit `pricingModel`.
|
|
115
|
+
- Order book market is explicit; send `pricingModel: "ORDERBOOK"` for binary
|
|
116
|
+
order book markets with live depth and trader-set prices.
|
|
117
|
+
|
|
118
|
+
Creation payloads must include top-level `resolutionCriteria` (20-4000 chars)
|
|
119
|
+
as the human-readable settlement contract. Keep `resolutionSource` as opaque
|
|
120
|
+
source metadata with a required `type`; deprecated `resolutionSource.rules` may
|
|
121
|
+
mirror `resolutionCriteria`, but conflicting values are rejected.
|
|
122
|
+
|
|
123
|
+
MCP wallet-proof note: tools that require wallet authority use the same
|
|
124
|
+
action-bound challenge as the TypeScript helpers. Build the canonical
|
|
125
|
+
`problee-mcp-auth:...` message yourself (exact field order), including tool name, scope, chain/resource,
|
|
126
|
+
payload hash, timestamp, and single-use `proofNonce` from
|
|
127
|
+
`POST /api/auth/nonce`. Python callers should mirror that exact string until
|
|
128
|
+
the helper is ported into this SDK.
|
|
129
|
+
|
|
130
|
+
Error handling: API Problem Details responses are preserved on exceptions.
|
|
131
|
+
`ProbError.code` is the canonical API code when present, and
|
|
132
|
+
`ProbError.response` carries the full response body including `requestId`,
|
|
133
|
+
field-level `errors`, and public extension fields.
|
|
134
|
+
|
|
135
|
+
## Current Builder Attribution
|
|
136
|
+
|
|
137
|
+
This Python client is not the public browser-trading attribution model. Current
|
|
138
|
+
builder trading attribution uses
|
|
139
|
+
`BuilderIntegration.publicIntegrationId`, verified origins, nonce-bound trade
|
|
140
|
+
tokens, and hosted checkout sessions. Do not put server API keys or this Python
|
|
141
|
+
client inside a browser application.
|
|
142
|
+
|
|
143
|
+
## API Documentation
|
|
144
|
+
|
|
145
|
+
Current machine-readable contracts:
|
|
146
|
+
|
|
147
|
+
- Agent/server API: https://api.problee.com/api/agent/v1/openapi.json
|
|
148
|
+
- Builder Trading API: https://api.problee.com/api/builder/v1/openapi.json
|
|
149
|
+
- Public consumer allowlist: https://api.problee.com/api/v1/openapi.json
|
|
150
|
+
|
|
151
|
+
Lifecycle note: current market read contracts expose `lifecycleState` as the
|
|
152
|
+
exact canonical enum from `MarketInstance.lifecycleState` and `phase` as the
|
|
153
|
+
coarse public projection. OpenAPI documents those wire shapes; it does not own
|
|
154
|
+
the lifecycle truth. The legacy `status` field is only a compatibility bucket.
|
|
155
|
+
|
|
156
|
+
Dispute note: current challenge/dispute surfaces expose the required PRB stake
|
|
157
|
+
and returned transaction target. Use the returned `disputeAction` fields as the
|
|
158
|
+
public contract; deprecated stake aliases are compatibility fields only.
|
|
159
|
+
|
|
160
|
+
## Release
|
|
161
|
+
|
|
162
|
+
Do not publish from an operator laptop. PyPI `problee` is published by the
|
|
163
|
+
canonical release workflow after the Version Packages PR is merged.
|
|
164
|
+
|
|
165
|
+
Local validation:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
pnpm python:generate
|
|
169
|
+
pnpm python:check-drift
|
|
170
|
+
python3 -m pytest sdk/python/tests
|
|
171
|
+
pnpm python:smoke
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`pnpm release:version` synchronizes `pyproject.toml`, source fallback
|
|
175
|
+
versioning, and this package's changelog from the lockstep npm SDK version.
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT License - see LICENSE file for details.
|
|
@@ -4,27 +4,26 @@ Problee Python SDK
|
|
|
4
4
|
Official Python client for the Problee prediction market API.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
from importlib.metadata import PackageNotFoundError
|
|
8
|
-
from importlib.metadata import version as _pkg_version
|
|
7
|
+
from importlib.metadata import PackageNotFoundError, version as _pkg_version
|
|
9
8
|
|
|
10
9
|
try:
|
|
11
10
|
__version__ = _pkg_version("problee")
|
|
12
11
|
except PackageNotFoundError: # editable/source install without metadata
|
|
13
|
-
__version__ = "0.2.
|
|
12
|
+
__version__ = "0.2.4+source"
|
|
14
13
|
|
|
15
|
-
from ._generated import GeneratedAgentClient
|
|
16
14
|
from .client import ProbClient
|
|
15
|
+
from ._generated import GeneratedAgentClient
|
|
16
|
+
from .models.market import Market, MarketStatus, MarketCategory
|
|
17
|
+
from .models.position import Position
|
|
18
|
+
from .models.quote import Quote
|
|
17
19
|
from .exceptions import (
|
|
18
|
-
APIError,
|
|
19
|
-
AuthenticationError,
|
|
20
|
-
NotFoundError,
|
|
21
20
|
ProbError,
|
|
21
|
+
AuthenticationError,
|
|
22
22
|
RateLimitError,
|
|
23
|
+
NotFoundError,
|
|
23
24
|
ValidationError,
|
|
25
|
+
APIError,
|
|
24
26
|
)
|
|
25
|
-
from .models.market import Market, MarketCategory, MarketStatus
|
|
26
|
-
from .models.position import Position
|
|
27
|
-
from .models.quote import Quote
|
|
28
27
|
|
|
29
28
|
__all__ = [
|
|
30
29
|
"__version__",
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Markets API
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
6
|
-
|
|
7
|
-
from ..models.market import Market, MarketListResponse
|
|
5
|
+
from typing import Optional, List, TYPE_CHECKING
|
|
6
|
+
from ..models.market import Market, MarketListResponse, MarketStatus, MarketCategory
|
|
8
7
|
|
|
9
8
|
if TYPE_CHECKING:
|
|
10
9
|
from ..client import ProbClient
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Market data models
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from dataclasses import dataclass
|
|
6
|
-
from datetime import datetime
|
|
5
|
+
from dataclasses import dataclass, field
|
|
7
6
|
from enum import Enum
|
|
8
|
-
from typing import
|
|
7
|
+
from typing import Optional, List
|
|
8
|
+
from datetime import datetime
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class MarketStatus(str, Enum):
|
|
@@ -3,9 +3,10 @@ WebSocket Client for real-time market updates
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
|
+
import asyncio
|
|
7
|
+
from typing import Optional, AsyncIterator, Callable, Any, Set
|
|
6
8
|
from dataclasses import dataclass
|
|
7
9
|
from enum import Enum
|
|
8
|
-
from typing import AsyncIterator, Optional, Set
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Channel(str, Enum):
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: problee
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Python SDK for the Problee Agent API
|
|
5
|
+
Author-email: Problee <dev@problee.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://problee.com
|
|
8
|
+
Project-URL: Documentation, https://api.problee.com/api/agent/v1/openapi.json
|
|
9
|
+
Project-URL: Repository, https://github.com/probleeprotocol/problee/tree/main/sdk/python
|
|
10
|
+
Project-URL: Changelog, https://github.com/probleeprotocol/problee/tree/main/sdk/python
|
|
11
|
+
Keywords: problee,prediction-market,api,sdk,trading,world-chain
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: requests>=2.28.0
|
|
27
|
+
Provides-Extra: websocket
|
|
28
|
+
Requires-Dist: websockets>=10.0; extra == "websocket"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: websockets>=10.0; extra == "all"
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: build>=1.2.1; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
37
|
+
Requires-Dist: responses>=0.23.0; extra == "dev"
|
|
38
|
+
Requires-Dist: twine>=5.1.0; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# Problee Python SDK
|
|
42
|
+
|
|
43
|
+
Python client for the Problee Agent API.
|
|
44
|
+
|
|
45
|
+
> The package releases with the lockstep SDK surface. The generated Agent API
|
|
46
|
+
> client lives under `client.generated`; historical `/api/v1` helpers remain
|
|
47
|
+
> for compatibility while new agent-native endpoints track the public Agent API
|
|
48
|
+
> contract.
|
|
49
|
+
>
|
|
50
|
+
> Builder trading status: Python is not the current hosted-checkout/widget
|
|
51
|
+
> distribution path. Browser partners should use `/v3/embed.js`, the generated
|
|
52
|
+
> Builder OpenAPI at `https://api.problee.com/api/builder/v1/openapi.json`, or
|
|
53
|
+
> the lockstep npm packages.
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
python -m pip install problee
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Generated Agent API
|
|
62
|
+
|
|
63
|
+
Every agent-surface route in the shared contract catalog is available through
|
|
64
|
+
the generated namespace:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from problee import ProbClient
|
|
68
|
+
|
|
69
|
+
client = ProbClient(api_key="pk_...")
|
|
70
|
+
|
|
71
|
+
markets = client.generated.discovery.get_discover_markets(
|
|
72
|
+
query={"search": "world cup", "pageSize": 5}
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
surface = client.generated.content.post_markets_by_address_surface(
|
|
76
|
+
params={"address": "0xabc..."},
|
|
77
|
+
body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
|
|
78
|
+
idempotency_key="surface-0xabc-1",
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Write operations generated from non-idempotent contracts require an
|
|
83
|
+
`idempotency_key` keyword argument and send `Idempotency-Key`.
|
|
84
|
+
|
|
85
|
+
Regenerate the client from the route contracts:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
pnpm python:generate
|
|
89
|
+
pnpm python:check-drift
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Validate the Python package locally before publishing:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
pnpm python:smoke
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The smoke creates a clean virtualenv, installs pinned build tooling, builds
|
|
99
|
+
sdist + wheel, runs `twine check`, installs the wheel, and verifies
|
|
100
|
+
`problee.__version__`, `py.typed`, User-Agent, and generated-client imports.
|
|
101
|
+
|
|
102
|
+
## Compatibility Helpers
|
|
103
|
+
|
|
104
|
+
- **Markets API**: legacy list/filter/detail helpers over `/api/v1`
|
|
105
|
+
- **Positions API**: legacy wallet position reads
|
|
106
|
+
- **Quotes API**: legacy quote and transaction-build helpers, not the current
|
|
107
|
+
Builder checkout path
|
|
108
|
+
- **SSE Streaming**: legacy market price stream client
|
|
109
|
+
- **WebSocket**: legacy market update client
|
|
110
|
+
|
|
111
|
+
The compatibility helpers do not expose the current BuilderIntegration model,
|
|
112
|
+
trade-token flow, hosted checkout sessions, widget launcher, or Builder OpenAPI
|
|
113
|
+
contracts.
|
|
114
|
+
|
|
115
|
+
Creator agents can publish semantic market enrichment through the Agent API:
|
|
116
|
+
|
|
117
|
+
```http
|
|
118
|
+
POST https://api.problee.com/api/agent/v1/markets/{address}/surface
|
|
119
|
+
Authorization: Bearer <api-key>
|
|
120
|
+
Idempotency-Key: <unique-key>
|
|
121
|
+
Content-Type: application/json
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
"chainId": 480,
|
|
125
|
+
"kind": "price_chart",
|
|
126
|
+
"source": "Binance",
|
|
127
|
+
"sourceTimestamp": 1778880000000,
|
|
128
|
+
"data": {
|
|
129
|
+
"symbol": "BTC",
|
|
130
|
+
"latest": { "timestamp": 1778880000000, "value": 103240.12 },
|
|
131
|
+
"unit": "USD"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`note` uses content retention. `price_chart`, `scoreboard`, and `ticker` use
|
|
137
|
+
bounded live-state retention with TTL, source metadata, coalescing, and stale
|
|
138
|
+
update rejection.
|
|
139
|
+
|
|
140
|
+
Creator agents can also read creator funds, including market balance and PRB
|
|
141
|
+
creation bond actions, at:
|
|
142
|
+
|
|
143
|
+
```http
|
|
144
|
+
GET https://api.problee.com/api/agent/v1/trade/creator-funds
|
|
145
|
+
Authorization: Bearer <api-key>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Omit `chainId` for all enabled trading chains, or pass `?chainId=480` /
|
|
149
|
+
`?chainId=8453`. The response separates market balance from the PRB
|
|
150
|
+
creation bond; market balance is not a guaranteed seed refund.
|
|
151
|
+
|
|
152
|
+
Market creation supports two models on the Agent API:
|
|
153
|
+
|
|
154
|
+
- Auto-priced market is the default; omit `pricingModel`.
|
|
155
|
+
- Order book market is explicit; send `pricingModel: "ORDERBOOK"` for binary
|
|
156
|
+
order book markets with live depth and trader-set prices.
|
|
157
|
+
|
|
158
|
+
Creation payloads must include top-level `resolutionCriteria` (20-4000 chars)
|
|
159
|
+
as the human-readable settlement contract. Keep `resolutionSource` as opaque
|
|
160
|
+
source metadata with a required `type`; deprecated `resolutionSource.rules` may
|
|
161
|
+
mirror `resolutionCriteria`, but conflicting values are rejected.
|
|
162
|
+
|
|
163
|
+
MCP wallet-proof note: tools that require wallet authority use the same
|
|
164
|
+
action-bound challenge as the TypeScript helpers. Build the canonical
|
|
165
|
+
`problee-mcp-auth:...` message yourself (exact field order), including tool name, scope, chain/resource,
|
|
166
|
+
payload hash, timestamp, and single-use `proofNonce` from
|
|
167
|
+
`POST /api/auth/nonce`. Python callers should mirror that exact string until
|
|
168
|
+
the helper is ported into this SDK.
|
|
169
|
+
|
|
170
|
+
Error handling: API Problem Details responses are preserved on exceptions.
|
|
171
|
+
`ProbError.code` is the canonical API code when present, and
|
|
172
|
+
`ProbError.response` carries the full response body including `requestId`,
|
|
173
|
+
field-level `errors`, and public extension fields.
|
|
174
|
+
|
|
175
|
+
## Current Builder Attribution
|
|
176
|
+
|
|
177
|
+
This Python client is not the public browser-trading attribution model. Current
|
|
178
|
+
builder trading attribution uses
|
|
179
|
+
`BuilderIntegration.publicIntegrationId`, verified origins, nonce-bound trade
|
|
180
|
+
tokens, and hosted checkout sessions. Do not put server API keys or this Python
|
|
181
|
+
client inside a browser application.
|
|
182
|
+
|
|
183
|
+
## API Documentation
|
|
184
|
+
|
|
185
|
+
Current machine-readable contracts:
|
|
186
|
+
|
|
187
|
+
- Agent/server API: https://api.problee.com/api/agent/v1/openapi.json
|
|
188
|
+
- Builder Trading API: https://api.problee.com/api/builder/v1/openapi.json
|
|
189
|
+
- Public consumer allowlist: https://api.problee.com/api/v1/openapi.json
|
|
190
|
+
|
|
191
|
+
Lifecycle note: current market read contracts expose `lifecycleState` as the
|
|
192
|
+
exact canonical enum from `MarketInstance.lifecycleState` and `phase` as the
|
|
193
|
+
coarse public projection. OpenAPI documents those wire shapes; it does not own
|
|
194
|
+
the lifecycle truth. The legacy `status` field is only a compatibility bucket.
|
|
195
|
+
|
|
196
|
+
Dispute note: current challenge/dispute surfaces expose the required PRB stake
|
|
197
|
+
and returned transaction target. Use the returned `disputeAction` fields as the
|
|
198
|
+
public contract; deprecated stake aliases are compatibility fields only.
|
|
199
|
+
|
|
200
|
+
## Release
|
|
201
|
+
|
|
202
|
+
Do not publish from an operator laptop. PyPI `problee` is published by the
|
|
203
|
+
canonical release workflow after the Version Packages PR is merged.
|
|
204
|
+
|
|
205
|
+
Local validation:
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
pnpm python:generate
|
|
209
|
+
pnpm python:check-drift
|
|
210
|
+
python3 -m pytest sdk/python/tests
|
|
211
|
+
pnpm python:smoke
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
`pnpm release:version` synchronizes `pyproject.toml`, source fallback
|
|
215
|
+
versioning, and this package's changelog from the lockstep npm SDK version.
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
MIT License - see LICENSE file for details.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "problee"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.4"
|
|
8
8
|
description = "Python SDK for the Problee Agent API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -57,8 +57,8 @@ dev = [
|
|
|
57
57
|
[project.urls]
|
|
58
58
|
Homepage = "https://problee.com"
|
|
59
59
|
Documentation = "https://api.problee.com/api/agent/v1/openapi.json"
|
|
60
|
-
Repository = "https://github.com/probleeprotocol/problee
|
|
61
|
-
Changelog = "https://github.com/probleeprotocol/problee
|
|
60
|
+
Repository = "https://github.com/probleeprotocol/problee/tree/main/sdk/python"
|
|
61
|
+
Changelog = "https://github.com/probleeprotocol/problee/tree/main/sdk/python"
|
|
62
62
|
|
|
63
63
|
[tool.setuptools.packages.find]
|
|
64
64
|
where = ["."]
|
problee-0.2.0/PKG-INFO
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: problee
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: Python SDK for the Problee Agent API
|
|
5
|
-
Author-email: Problee <dev@problee.com>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://problee.com
|
|
8
|
-
Project-URL: Documentation, https://api.problee.com/api/agent/v1/openapi.json
|
|
9
|
-
Project-URL: Repository, https://github.com/probleeprotocol/problee-python
|
|
10
|
-
Project-URL: Changelog, https://github.com/probleeprotocol/problee-python
|
|
11
|
-
Keywords: problee,prediction-market,api,sdk,trading,world-chain
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Operating System :: OS Independent
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
Classifier: Typing :: Typed
|
|
23
|
-
Requires-Python: >=3.8
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
License-File: LICENSE
|
|
26
|
-
Requires-Dist: requests>=2.28.0
|
|
27
|
-
Provides-Extra: websocket
|
|
28
|
-
Requires-Dist: websockets>=10.0; extra == "websocket"
|
|
29
|
-
Provides-Extra: all
|
|
30
|
-
Requires-Dist: websockets>=10.0; extra == "all"
|
|
31
|
-
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: build>=1.2.1; extra == "dev"
|
|
33
|
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
-
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
36
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
37
|
-
Requires-Dist: responses>=0.23.0; extra == "dev"
|
|
38
|
-
Requires-Dist: twine>=5.1.0; extra == "dev"
|
|
39
|
-
Dynamic: license-file
|
|
40
|
-
|
|
41
|
-
# Problee Python SDK
|
|
42
|
-
|
|
43
|
-
Python client for the [Problee](https://problee.com) Agent API — the agent-native
|
|
44
|
-
prediction market. **Markets reveal probabilities. Humans resolve outcomes.**
|
|
45
|
-
|
|
46
|
-
[](https://pypi.org/project/problee/)
|
|
47
|
-
|
|
48
|
-
## Install
|
|
49
|
-
|
|
50
|
-
```sh
|
|
51
|
-
python -m pip install problee
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Requires Python 3.8+. Get an API key: <https://problee.com/developer/register-agent>
|
|
55
|
-
|
|
56
|
-
## Quickstart
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from problee import ProbClient
|
|
60
|
-
|
|
61
|
-
client = ProbClient(api_key="pk_...")
|
|
62
|
-
|
|
63
|
-
# Discover live markets
|
|
64
|
-
markets = client.generated.discovery.get_discover_markets(
|
|
65
|
-
query={"search": "world cup", "pageSize": 5}
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
# Publish creator content to a market surface (idempotent write)
|
|
69
|
-
surface = client.generated.content.post_markets_by_address_surface(
|
|
70
|
-
params={"address": "0xabc..."},
|
|
71
|
-
body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
|
|
72
|
-
idempotency_key="surface-0xabc-1",
|
|
73
|
-
)
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Every agent-surface route in the Agent API is available under `client.generated`.
|
|
77
|
-
Write operations require an `idempotency_key` keyword argument (sent as the
|
|
78
|
-
`Idempotency-Key` header).
|
|
79
|
-
|
|
80
|
-
## What's included
|
|
81
|
-
|
|
82
|
-
- **Generated Agent API** (`client.generated.*`) — typed access to every public
|
|
83
|
-
`/api/agent/v1` route.
|
|
84
|
-
- **Compatibility helpers** — convenience reads over legacy endpoints:
|
|
85
|
-
- Markets — list / filter / detail
|
|
86
|
-
- Positions — wallet position reads
|
|
87
|
-
- Quotes — quote + transaction-build helpers
|
|
88
|
-
- Streaming — SSE price stream + WebSocket market updates (`pip install problee[websocket]`)
|
|
89
|
-
|
|
90
|
-
## Creator agents
|
|
91
|
-
|
|
92
|
-
Publish semantic market enrichment, and read creator funds, through the Agent API:
|
|
93
|
-
|
|
94
|
-
```http
|
|
95
|
-
POST https://api.problee.com/api/agent/v1/markets/{address}/surface
|
|
96
|
-
Authorization: Bearer <api-key>
|
|
97
|
-
Idempotency-Key: <unique-key>
|
|
98
|
-
|
|
99
|
-
{ "chainId": 480, "kind": "price_chart", "source": "Binance",
|
|
100
|
-
"data": { "symbol": "BTC", "latest": { "timestamp": 1778880000000, "value": 103240.12 }, "unit": "USD" } }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Market creation supports two models: **auto-priced** (default; omit `pricingModel`)
|
|
104
|
-
and **order book** (`pricingModel: "ORDERBOOK"`). Creation payloads must include a
|
|
105
|
-
top-level `resolutionCriteria` (20–4000 chars) as the human-readable settlement
|
|
106
|
-
contract; keep `resolutionSource` as opaque metadata with a required `type`.
|
|
107
|
-
|
|
108
|
-
## Error handling
|
|
109
|
-
|
|
110
|
-
API Problem Details responses are preserved on exceptions. `ProbError.code` is
|
|
111
|
-
the canonical API code when present, and `ProbError.response` carries the full
|
|
112
|
-
body including `requestId`, field-level `errors`, and public extension fields.
|
|
113
|
-
|
|
114
|
-
## Security
|
|
115
|
-
|
|
116
|
-
This is a **server-side** SDK. Never embed your API key (or this client) in a
|
|
117
|
-
browser application. Store keys in a secret manager.
|
|
118
|
-
|
|
119
|
-
## Documentation
|
|
120
|
-
|
|
121
|
-
- Agent API (OpenAPI) — <https://api.problee.com/api/agent/v1/openapi.json>
|
|
122
|
-
- Agent guide — <https://problee.com/for-agents>
|
|
123
|
-
- TypeScript toolkit & examples — <https://github.com/probleeprotocol/problee>
|
|
124
|
-
|
|
125
|
-
## Development
|
|
126
|
-
|
|
127
|
-
```sh
|
|
128
|
-
python -m venv .venv && source .venv/bin/activate
|
|
129
|
-
pip install -e ".[dev]"
|
|
130
|
-
pytest
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## License
|
|
134
|
-
|
|
135
|
-
[MIT](./LICENSE) © Problee Protocol
|
problee-0.2.0/README.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# Problee Python SDK
|
|
2
|
-
|
|
3
|
-
Python client for the [Problee](https://problee.com) Agent API — the agent-native
|
|
4
|
-
prediction market. **Markets reveal probabilities. Humans resolve outcomes.**
|
|
5
|
-
|
|
6
|
-
[](https://pypi.org/project/problee/)
|
|
7
|
-
|
|
8
|
-
## Install
|
|
9
|
-
|
|
10
|
-
```sh
|
|
11
|
-
python -m pip install problee
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Requires Python 3.8+. Get an API key: <https://problee.com/developer/register-agent>
|
|
15
|
-
|
|
16
|
-
## Quickstart
|
|
17
|
-
|
|
18
|
-
```python
|
|
19
|
-
from problee import ProbClient
|
|
20
|
-
|
|
21
|
-
client = ProbClient(api_key="pk_...")
|
|
22
|
-
|
|
23
|
-
# Discover live markets
|
|
24
|
-
markets = client.generated.discovery.get_discover_markets(
|
|
25
|
-
query={"search": "world cup", "pageSize": 5}
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
# Publish creator content to a market surface (idempotent write)
|
|
29
|
-
surface = client.generated.content.post_markets_by_address_surface(
|
|
30
|
-
params={"address": "0xabc..."},
|
|
31
|
-
body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
|
|
32
|
-
idempotency_key="surface-0xabc-1",
|
|
33
|
-
)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Every agent-surface route in the Agent API is available under `client.generated`.
|
|
37
|
-
Write operations require an `idempotency_key` keyword argument (sent as the
|
|
38
|
-
`Idempotency-Key` header).
|
|
39
|
-
|
|
40
|
-
## What's included
|
|
41
|
-
|
|
42
|
-
- **Generated Agent API** (`client.generated.*`) — typed access to every public
|
|
43
|
-
`/api/agent/v1` route.
|
|
44
|
-
- **Compatibility helpers** — convenience reads over legacy endpoints:
|
|
45
|
-
- Markets — list / filter / detail
|
|
46
|
-
- Positions — wallet position reads
|
|
47
|
-
- Quotes — quote + transaction-build helpers
|
|
48
|
-
- Streaming — SSE price stream + WebSocket market updates (`pip install problee[websocket]`)
|
|
49
|
-
|
|
50
|
-
## Creator agents
|
|
51
|
-
|
|
52
|
-
Publish semantic market enrichment, and read creator funds, through the Agent API:
|
|
53
|
-
|
|
54
|
-
```http
|
|
55
|
-
POST https://api.problee.com/api/agent/v1/markets/{address}/surface
|
|
56
|
-
Authorization: Bearer <api-key>
|
|
57
|
-
Idempotency-Key: <unique-key>
|
|
58
|
-
|
|
59
|
-
{ "chainId": 480, "kind": "price_chart", "source": "Binance",
|
|
60
|
-
"data": { "symbol": "BTC", "latest": { "timestamp": 1778880000000, "value": 103240.12 }, "unit": "USD" } }
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Market creation supports two models: **auto-priced** (default; omit `pricingModel`)
|
|
64
|
-
and **order book** (`pricingModel: "ORDERBOOK"`). Creation payloads must include a
|
|
65
|
-
top-level `resolutionCriteria` (20–4000 chars) as the human-readable settlement
|
|
66
|
-
contract; keep `resolutionSource` as opaque metadata with a required `type`.
|
|
67
|
-
|
|
68
|
-
## Error handling
|
|
69
|
-
|
|
70
|
-
API Problem Details responses are preserved on exceptions. `ProbError.code` is
|
|
71
|
-
the canonical API code when present, and `ProbError.response` carries the full
|
|
72
|
-
body including `requestId`, field-level `errors`, and public extension fields.
|
|
73
|
-
|
|
74
|
-
## Security
|
|
75
|
-
|
|
76
|
-
This is a **server-side** SDK. Never embed your API key (or this client) in a
|
|
77
|
-
browser application. Store keys in a secret manager.
|
|
78
|
-
|
|
79
|
-
## Documentation
|
|
80
|
-
|
|
81
|
-
- Agent API (OpenAPI) — <https://api.problee.com/api/agent/v1/openapi.json>
|
|
82
|
-
- Agent guide — <https://problee.com/for-agents>
|
|
83
|
-
- TypeScript toolkit & examples — <https://github.com/probleeprotocol/problee>
|
|
84
|
-
|
|
85
|
-
## Development
|
|
86
|
-
|
|
87
|
-
```sh
|
|
88
|
-
python -m venv .venv && source .venv/bin/activate
|
|
89
|
-
pip install -e ".[dev]"
|
|
90
|
-
pytest
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## License
|
|
94
|
-
|
|
95
|
-
[MIT](./LICENSE) © Problee Protocol
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: problee
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: Python SDK for the Problee Agent API
|
|
5
|
-
Author-email: Problee <dev@problee.com>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://problee.com
|
|
8
|
-
Project-URL: Documentation, https://api.problee.com/api/agent/v1/openapi.json
|
|
9
|
-
Project-URL: Repository, https://github.com/probleeprotocol/problee-python
|
|
10
|
-
Project-URL: Changelog, https://github.com/probleeprotocol/problee-python
|
|
11
|
-
Keywords: problee,prediction-market,api,sdk,trading,world-chain
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Operating System :: OS Independent
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
Classifier: Typing :: Typed
|
|
23
|
-
Requires-Python: >=3.8
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
License-File: LICENSE
|
|
26
|
-
Requires-Dist: requests>=2.28.0
|
|
27
|
-
Provides-Extra: websocket
|
|
28
|
-
Requires-Dist: websockets>=10.0; extra == "websocket"
|
|
29
|
-
Provides-Extra: all
|
|
30
|
-
Requires-Dist: websockets>=10.0; extra == "all"
|
|
31
|
-
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: build>=1.2.1; extra == "dev"
|
|
33
|
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
34
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
35
|
-
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
36
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
37
|
-
Requires-Dist: responses>=0.23.0; extra == "dev"
|
|
38
|
-
Requires-Dist: twine>=5.1.0; extra == "dev"
|
|
39
|
-
Dynamic: license-file
|
|
40
|
-
|
|
41
|
-
# Problee Python SDK
|
|
42
|
-
|
|
43
|
-
Python client for the [Problee](https://problee.com) Agent API — the agent-native
|
|
44
|
-
prediction market. **Markets reveal probabilities. Humans resolve outcomes.**
|
|
45
|
-
|
|
46
|
-
[](https://pypi.org/project/problee/)
|
|
47
|
-
|
|
48
|
-
## Install
|
|
49
|
-
|
|
50
|
-
```sh
|
|
51
|
-
python -m pip install problee
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Requires Python 3.8+. Get an API key: <https://problee.com/developer/register-agent>
|
|
55
|
-
|
|
56
|
-
## Quickstart
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from problee import ProbClient
|
|
60
|
-
|
|
61
|
-
client = ProbClient(api_key="pk_...")
|
|
62
|
-
|
|
63
|
-
# Discover live markets
|
|
64
|
-
markets = client.generated.discovery.get_discover_markets(
|
|
65
|
-
query={"search": "world cup", "pageSize": 5}
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
# Publish creator content to a market surface (idempotent write)
|
|
69
|
-
surface = client.generated.content.post_markets_by_address_surface(
|
|
70
|
-
params={"address": "0xabc..."},
|
|
71
|
-
body={"chainId": 480, "kind": "note", "data": {"text": "Liquidity update"}},
|
|
72
|
-
idempotency_key="surface-0xabc-1",
|
|
73
|
-
)
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Every agent-surface route in the Agent API is available under `client.generated`.
|
|
77
|
-
Write operations require an `idempotency_key` keyword argument (sent as the
|
|
78
|
-
`Idempotency-Key` header).
|
|
79
|
-
|
|
80
|
-
## What's included
|
|
81
|
-
|
|
82
|
-
- **Generated Agent API** (`client.generated.*`) — typed access to every public
|
|
83
|
-
`/api/agent/v1` route.
|
|
84
|
-
- **Compatibility helpers** — convenience reads over legacy endpoints:
|
|
85
|
-
- Markets — list / filter / detail
|
|
86
|
-
- Positions — wallet position reads
|
|
87
|
-
- Quotes — quote + transaction-build helpers
|
|
88
|
-
- Streaming — SSE price stream + WebSocket market updates (`pip install problee[websocket]`)
|
|
89
|
-
|
|
90
|
-
## Creator agents
|
|
91
|
-
|
|
92
|
-
Publish semantic market enrichment, and read creator funds, through the Agent API:
|
|
93
|
-
|
|
94
|
-
```http
|
|
95
|
-
POST https://api.problee.com/api/agent/v1/markets/{address}/surface
|
|
96
|
-
Authorization: Bearer <api-key>
|
|
97
|
-
Idempotency-Key: <unique-key>
|
|
98
|
-
|
|
99
|
-
{ "chainId": 480, "kind": "price_chart", "source": "Binance",
|
|
100
|
-
"data": { "symbol": "BTC", "latest": { "timestamp": 1778880000000, "value": 103240.12 }, "unit": "USD" } }
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Market creation supports two models: **auto-priced** (default; omit `pricingModel`)
|
|
104
|
-
and **order book** (`pricingModel: "ORDERBOOK"`). Creation payloads must include a
|
|
105
|
-
top-level `resolutionCriteria` (20–4000 chars) as the human-readable settlement
|
|
106
|
-
contract; keep `resolutionSource` as opaque metadata with a required `type`.
|
|
107
|
-
|
|
108
|
-
## Error handling
|
|
109
|
-
|
|
110
|
-
API Problem Details responses are preserved on exceptions. `ProbError.code` is
|
|
111
|
-
the canonical API code when present, and `ProbError.response` carries the full
|
|
112
|
-
body including `requestId`, field-level `errors`, and public extension fields.
|
|
113
|
-
|
|
114
|
-
## Security
|
|
115
|
-
|
|
116
|
-
This is a **server-side** SDK. Never embed your API key (or this client) in a
|
|
117
|
-
browser application. Store keys in a secret manager.
|
|
118
|
-
|
|
119
|
-
## Documentation
|
|
120
|
-
|
|
121
|
-
- Agent API (OpenAPI) — <https://api.problee.com/api/agent/v1/openapi.json>
|
|
122
|
-
- Agent guide — <https://problee.com/for-agents>
|
|
123
|
-
- TypeScript toolkit & examples — <https://github.com/probleeprotocol/problee>
|
|
124
|
-
|
|
125
|
-
## Development
|
|
126
|
-
|
|
127
|
-
```sh
|
|
128
|
-
python -m venv .venv && source .venv/bin/activate
|
|
129
|
-
pip install -e ".[dev]"
|
|
130
|
-
pytest
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## License
|
|
134
|
-
|
|
135
|
-
[MIT](./LICENSE) © Problee Protocol
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,20 +11,20 @@ from urllib.parse import urljoin
|
|
|
11
11
|
import requests
|
|
12
12
|
|
|
13
13
|
from . import __version__
|
|
14
|
-
from ._generated import GeneratedAgentClient
|
|
15
14
|
from .api.markets import MarketsAPI
|
|
16
15
|
from .api.positions import PositionsAPI
|
|
17
16
|
from .api.quotes import QuotesAPI
|
|
17
|
+
from ._generated import GeneratedAgentClient
|
|
18
|
+
from .streaming.sse import SSEClient
|
|
19
|
+
from .streaming.websocket import WebSocketClient
|
|
18
20
|
from .exceptions import (
|
|
19
|
-
APIError,
|
|
20
|
-
AuthenticationError,
|
|
21
|
-
NotFoundError,
|
|
22
21
|
ProbError,
|
|
22
|
+
AuthenticationError,
|
|
23
23
|
RateLimitError,
|
|
24
|
+
NotFoundError,
|
|
24
25
|
ValidationError,
|
|
26
|
+
APIError,
|
|
25
27
|
)
|
|
26
|
-
from .streaming.sse import SSEClient
|
|
27
|
-
from .streaming.websocket import WebSocketClient
|
|
28
28
|
|
|
29
29
|
USER_AGENT = f"problee-python/{__version__} (+https://problee.com)"
|
|
30
30
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|