Skip to content

Commit

Permalink
Merge pull request #71 from Polymarket/fix/contract-configs
Browse files Browse the repository at this point in the history
[PLAT-853] Fix: fix contract config
  • Loading branch information
JonathanAmenechi authored Mar 11, 2024
2 parents 15edfff + f5bece0 commit 3669764
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions py_clob_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .order_builder.builder import OrderBuilder
from .headers.headers import create_level_1_headers, create_level_2_headers
from .signer import Signer
from .config import get_contract_config

from .endpoints import (
CANCEL,
Expand Down Expand Up @@ -100,6 +101,7 @@ def __init__(
Allows access to all endpoints
"""
self.host = host[0:-1] if host.endswith("/") else host
self.chain_id = chain_id
self.signer = Signer(key, chain_id) if key else None
self.creds = creds
self.mode = self._get_client_mode()
Expand All @@ -121,22 +123,25 @@ def get_collateral_address(self):
"""
Returns the collateral token address
"""
if self.contract_config:
return self.contract_config.get_collateral()
contract_config = get_contract_config(self.chain_id)
if contract_config:
return contract_config.collateral

def get_conditional_address(self):
"""
Returns the conditional token address
"""
if self.contract_config:
return self.contract_config.get_conditional()
contract_config = get_contract_config(self.chain_id)
if contract_config:
return contract_config.conditional_tokens

def get_exchange_address(self):
def get_exchange_address(self, neg_risk = False):
"""
Returns the exchange address
"""
if self.contract_config:
return self.contract_config.get_exchange()
contract_config = get_contract_config(self.chain_id, neg_risk)
if contract_config:
return contract_config.exchange

def get_ok(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="py_clob_client",
version="0.13.2",
version="0.13.3",
author="Polymarket Engineering",
author_email="[email protected]",
maintainer="Polymarket Engineering",
Expand Down

0 comments on commit 3669764

Please sign in to comment.