polynode 0.10.7__tar.gz → 0.10.8__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.
- {polynode-0.10.7 → polynode-0.10.8}/.gitignore +2 -0
- {polynode-0.10.7 → polynode-0.10.8}/PKG-INFO +4 -2
- {polynode-0.10.7 → polynode-0.10.8}/README.md +3 -1
- polynode-0.10.8/polynode/_version.py +1 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/eip712.py +15 -5
- {polynode-0.10.7 → polynode-0.10.8}/pyproject.toml +1 -1
- {polynode-0.10.7 → polynode-0.10.8}/tests/test_trading.py +23 -1
- polynode-0.10.7/polynode/_version.py +0 -1
- {polynode-0.10.7 → polynode-0.10.8}/polynode/__init__.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/cache/__init__.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/client.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/engine.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/errors.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/orderbook.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/orderbook_state.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/redemption_watcher.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/short_form.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/subscription.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/testing.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/V2_ORDER_FLOW.md +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/__init__.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/clob_api.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/constants.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/cosigner.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/escrow.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/onboarding.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/position_management.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/privy.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/relayer.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/signer.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/sqlite_backend.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/trader.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/trading/types.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/__init__.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/enums.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/events.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/orderbook.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/rest.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/short_form.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/types/ws.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/polynode/ws.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/__init__.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/conftest.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/test_client.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/test_orderbook.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/test_orderbook_protocol.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/test_types.py +0 -0
- {polynode-0.10.7 → polynode-0.10.8}/tests/test_ws_protocol.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polynode
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.8
|
|
4
4
|
Summary: Python SDK for the PolyNode real-time prediction market data platform
|
|
5
5
|
Project-URL: Homepage, https://polynode.dev
|
|
6
6
|
Project-URL: Documentation, https://docs.polynode.dev
|
|
@@ -35,7 +35,9 @@ Description-Content-Type: text/markdown
|
|
|
35
35
|
|
|
36
36
|
Python SDK for the [PolyNode](https://polynode.dev) real-time prediction market data platform.
|
|
37
37
|
|
|
38
|
-
**New in v0.10.
|
|
38
|
+
**New in v0.10.8:** POLY_1271 V2 order signatures now normalize the ERC-7739 `TypedDataSign` recovery byte to Ethereum `v=27/28` for on-chain ERC-1271 validation.
|
|
39
|
+
|
|
40
|
+
**In v0.10.7:** Polymarket V2 deposit-wallet trading fixes. `ensure_ready()` detects deployed `POLY_1271` wallets correctly, V2 type-3 orders use the deposit wallet as both maker and signer, and existing local credentials can be repaired by rerunning `ensure_ready()`.
|
|
39
41
|
|
|
40
42
|
## Install
|
|
41
43
|
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Python SDK for the [PolyNode](https://polynode.dev) real-time prediction market data platform.
|
|
4
4
|
|
|
5
|
-
**New in v0.10.
|
|
5
|
+
**New in v0.10.8:** POLY_1271 V2 order signatures now normalize the ERC-7739 `TypedDataSign` recovery byte to Ethereum `v=27/28` for on-chain ERC-1271 validation.
|
|
6
|
+
|
|
7
|
+
**In v0.10.7:** Polymarket V2 deposit-wallet trading fixes. `ensure_ready()` detects deployed `POLY_1271` wallets correctly, V2 type-3 orders use the deposit wallet as both maker and signer, and existing local credentials can be repaired by rerunning `ensure_ready()`.
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.10.8"
|
|
@@ -96,6 +96,20 @@ TYPED_DATA_SIGN_TYPES = {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
def _poly1271_inner_signature(signature: str) -> bytes:
|
|
100
|
+
"""Return a 65-byte POLY_1271 inner signature with Ethereum v=27/28."""
|
|
101
|
+
if not signature.startswith("0x"):
|
|
102
|
+
signature = f"0x{signature}"
|
|
103
|
+
sig_bytes = bytearray(bytes.fromhex(signature[2:]))
|
|
104
|
+
if len(sig_bytes) != 65:
|
|
105
|
+
raise ValueError(f"POLY_1271 inner signature must be 65 bytes, got {len(sig_bytes)}")
|
|
106
|
+
if sig_bytes[-1] in (0, 1):
|
|
107
|
+
sig_bytes[-1] += 27
|
|
108
|
+
elif sig_bytes[-1] not in (27, 28):
|
|
109
|
+
raise ValueError(f"invalid POLY_1271 inner signature v: {sig_bytes[-1]}")
|
|
110
|
+
return bytes(sig_bytes)
|
|
111
|
+
|
|
112
|
+
|
|
99
113
|
def compute_amounts(
|
|
100
114
|
price: float,
|
|
101
115
|
size: float,
|
|
@@ -338,11 +352,7 @@ async def create_signed_order_v2(
|
|
|
338
352
|
},
|
|
339
353
|
)
|
|
340
354
|
inner_sig = await sign_typed_data(tds_payload)
|
|
341
|
-
|
|
342
|
-
inner_sig = f"0x{inner_sig}"
|
|
343
|
-
inner_bytes = bytearray(bytes.fromhex(inner_sig[2:]))
|
|
344
|
-
if len(inner_bytes) == 65 and inner_bytes[-1] >= 27:
|
|
345
|
-
inner_bytes[-1] -= 27
|
|
355
|
+
inner_bytes = _poly1271_inner_signature(inner_sig)
|
|
346
356
|
|
|
347
357
|
# Compute app domain separator and contents hash for wrapping
|
|
348
358
|
from eth_utils import keccak
|
|
@@ -108,7 +108,7 @@ def test_v2_poly1271_order_uses_deposit_wallet_as_signer():
|
|
|
108
108
|
|
|
109
109
|
async def fake_sign(payload):
|
|
110
110
|
signed_payload.update(payload.message["contents"])
|
|
111
|
-
return "0x" + "11" *
|
|
111
|
+
return "0x" + "11" * 64 + "01"
|
|
112
112
|
|
|
113
113
|
order = asyncio.run(create_signed_order_v2(
|
|
114
114
|
fake_sign,
|
|
@@ -129,6 +129,28 @@ def test_v2_poly1271_order_uses_deposit_wallet_as_signer():
|
|
|
129
129
|
assert order["signatureType"] == 3
|
|
130
130
|
|
|
131
131
|
|
|
132
|
+
def test_v2_poly1271_inner_signature_normalizes_recovery_id():
|
|
133
|
+
"""POLY_1271 TypedDataSign inner signatures need Ethereum v=27/28."""
|
|
134
|
+
async def fake_sign(_payload):
|
|
135
|
+
return "0x" + "11" * 64 + "01"
|
|
136
|
+
|
|
137
|
+
order = asyncio.run(create_signed_order_v2(
|
|
138
|
+
fake_sign,
|
|
139
|
+
signer_address="0x7b3099fe73372D900a9F0F62CdcA261755f7EA60",
|
|
140
|
+
funder_address="0x58b8048C8f09C2FCc4914258587a8E7E0cc21D76",
|
|
141
|
+
token_id="12345",
|
|
142
|
+
price=0.5,
|
|
143
|
+
size=1,
|
|
144
|
+
side="BUY",
|
|
145
|
+
signature_type=SignatureType.POLY_1271,
|
|
146
|
+
timestamp_ms=1712345678000,
|
|
147
|
+
))
|
|
148
|
+
|
|
149
|
+
wrapped = bytes.fromhex(order["signature"][2:])
|
|
150
|
+
assert len(wrapped) > 65
|
|
151
|
+
assert wrapped[64] == 28
|
|
152
|
+
|
|
153
|
+
|
|
132
154
|
def test_ensure_ready_allows_explicit_poly1271_funder(monkeypatch, tmp_path):
|
|
133
155
|
"""Existing deposit-wallet users can force type 3 plus a known funder."""
|
|
134
156
|
from polynode.trading import trader as trader_mod
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.10.7"
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|