opinion-clob-sdk 0.2.3__py3-none-any.whl → 0.2.5__py3-none-any.whl
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.
Potentially problematic release.
This version of opinion-clob-sdk might be problematic. Click here for more details.
- opinion_clob_sdk/__init__.py +1 -1
- opinion_clob_sdk/chain/contract_caller.py +10 -0
- {opinion_clob_sdk-0.2.3.dist-info → opinion_clob_sdk-0.2.5.dist-info}/METADATA +2 -2
- {opinion_clob_sdk-0.2.3.dist-info → opinion_clob_sdk-0.2.5.dist-info}/RECORD +6 -6
- {opinion_clob_sdk-0.2.3.dist-info → opinion_clob_sdk-0.2.5.dist-info}/WHEEL +0 -0
- {opinion_clob_sdk-0.2.3.dist-info → opinion_clob_sdk-0.2.5.dist-info}/top_level.txt +0 -0
opinion_clob_sdk/__init__.py
CHANGED
|
@@ -8,6 +8,13 @@ from web3 import Web3
|
|
|
8
8
|
from web3.contract import Contract
|
|
9
9
|
from web3.providers import HTTPProvider
|
|
10
10
|
|
|
11
|
+
# Handle both old and new web3.py versions
|
|
12
|
+
try:
|
|
13
|
+
from web3.middleware import ExtraDataToPOAMiddleware
|
|
14
|
+
geth_poa_middleware = ExtraDataToPOAMiddleware
|
|
15
|
+
except ImportError:
|
|
16
|
+
from web3.middleware import geth_poa_middleware
|
|
17
|
+
|
|
11
18
|
from .exception import BalanceNotEnough, NoPositionsToRedeem, InsufficientGasBalance
|
|
12
19
|
from .safe.constants import NULL_HASH
|
|
13
20
|
from .safe.multisend import MultiSendTx, MultiSendOperation
|
|
@@ -40,6 +47,9 @@ class ContractCaller:
|
|
|
40
47
|
self.conditional_tokens_addr = conditional_tokens_addr
|
|
41
48
|
self.multisend_addr = multisend_addr
|
|
42
49
|
w3 = Web3(HTTPProvider(rpc_url))
|
|
50
|
+
# Inject POA middleware to handle BNB Chain (BSC) which is a Proof of Authority chain
|
|
51
|
+
# BNB Chain includes extra validator data in block headers (280 bytes instead of 32)
|
|
52
|
+
w3.middleware_onion.inject(geth_poa_middleware, layer=0)
|
|
43
53
|
self.w3 = w3
|
|
44
54
|
self.safe = Safe(w3, private_key, multi_sig_addr, multisend_addr)
|
|
45
55
|
self.__enable_trading_check_interval: int = enable_trading_check_interval
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opinion_clob_sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Opinion CLOB SDK (Tech Preview) - Python SDK for Opinion Prediction Market Central Limit Order Book API
|
|
5
5
|
Home-page: https://opinion.trade
|
|
6
6
|
Author: Opinion Labs
|
|
@@ -26,7 +26,7 @@ Requires-Dist: hexbytes>=1.2.1
|
|
|
26
26
|
Requires-Dist: web3>=7.6.1
|
|
27
27
|
Requires-Dist: eth_account>=0.13.0
|
|
28
28
|
Requires-Dist: poly_eip712_structs>=0.0.1
|
|
29
|
-
Requires-Dist: opinion_api>=0.1.
|
|
29
|
+
Requires-Dist: opinion_api>=0.1.2
|
|
30
30
|
Requires-Dist: pytest>=7.0.0
|
|
31
31
|
Dynamic: author
|
|
32
32
|
Dynamic: author-email
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
opinion_clob_sdk/__init__.py,sha256=
|
|
1
|
+
opinion_clob_sdk/__init__.py,sha256=HZdRO6Hdfl5ifHbNdQtfEzE1wnVxzoCt1Rz7GRXKFks,622
|
|
2
2
|
opinion_clob_sdk/config.py,sha256=xODivHbEcgrPLYXEoGsUZ4eQaXr0LY35gw6Dxg_wIeo,547
|
|
3
3
|
opinion_clob_sdk/model.py,sha256=eqNkEdyJPmcL_wax8ieybeyhR40JwGDB_KPplXLmNxE,309
|
|
4
4
|
opinion_clob_sdk/sdk.py,sha256=l6zTGh5RSwWt8jD2L6luuDVLYeiFlNUZT6B7kSS8M5k,40912
|
|
5
5
|
opinion_clob_sdk/verify_api_calls.py,sha256=MU4NEyfQ5hDmFJ0lT8g7KXVdlZ0cBtFyBTCbhhfI6a4,5031
|
|
6
6
|
opinion_clob_sdk/chain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
opinion_clob_sdk/chain/contract_caller.py,sha256=
|
|
7
|
+
opinion_clob_sdk/chain/contract_caller.py,sha256=Cyljq0IBuDM8kd9yUTg1_Fen0ZkwIFJj_ktltOSiJmk,17629
|
|
8
8
|
opinion_clob_sdk/chain/exception.py,sha256=6SSx4T_WZL8BxzRbfGSDp6eGD4zJ5ACeBB58DlrpmoA,234
|
|
9
9
|
opinion_clob_sdk/chain/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
opinion_clob_sdk/chain/contracts/conditional_tokens.py,sha256=P_MpetUKMNnT_hchZ0A9q7-g_ZKjkOr-BLldPXB4J7o,13998
|
|
@@ -41,7 +41,7 @@ opinion_clob_sdk/chain/safe/safe_contracts/compatibility_fallback_handler_v1_3_0
|
|
|
41
41
|
opinion_clob_sdk/chain/safe/safe_contracts/multisend_v1_3_0.py,sha256=8oGhNkS2k2Cy5pG6YNt_BKytS3AEtPeXv4rkyXv_p0M,380
|
|
42
42
|
opinion_clob_sdk/chain/safe/safe_contracts/safe_v1_3_0.py,sha256=YCUWTpf_pR44iUUkDl42f3n2YXSVGlTBcvMtReN7rlM,21922
|
|
43
43
|
opinion_clob_sdk/chain/safe/safe_contracts/utils.py,sha256=xnW8JSq8tVMfvZ4lhT-L96P3Usjs2zrZ5jzrNZvFHjc,631
|
|
44
|
-
opinion_clob_sdk-0.2.
|
|
45
|
-
opinion_clob_sdk-0.2.
|
|
46
|
-
opinion_clob_sdk-0.2.
|
|
47
|
-
opinion_clob_sdk-0.2.
|
|
44
|
+
opinion_clob_sdk-0.2.5.dist-info/METADATA,sha256=NbMh-m88RmzhOOSQxHmrsrtcSMf82u2S42EvQg49eNQ,2912
|
|
45
|
+
opinion_clob_sdk-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
46
|
+
opinion_clob_sdk-0.2.5.dist-info/top_level.txt,sha256=4gH76GRX1WZSc3b146FfxE6BAxggJD8y3NMEHUOSPA0,17
|
|
47
|
+
opinion_clob_sdk-0.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|