Skip to content

Commit

Permalink
split tradegood and tradegood listing in market object
Browse files Browse the repository at this point in the history
  • Loading branch information
Ctri-The-Third committed Mar 4, 2024
1 parent 02d02aa commit 898d0e5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions straders_sdk/models_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,19 +776,22 @@ def is_stale(self, age: int = 60):
return True
return False

def get_tradegood(self, symbol) -> MarketTradeGoodListing:
def get_tradegood(self, symbol) -> MarketTradeGood:
for export in self.exports:
if export.symbol == symbol:
return export
for import_ in self.imports:
if import_.symbol == symbol:
return import_
for exchange in self.exchange:
if exchange.symbol == symbol:
return exchange
return None

def get_tradegood_listing(self, symbol) -> MarketTradeGoodListing:
for listing in self.listings:
if listing.symbol == symbol:
return listing
for listing in self.exports:
if listing.symbol == symbol:
return listing
for listing in self.imports:
if listing.symbol == symbol:
return listing
for listing in self.exchange:
if listing.symbol == symbol:
return listing

return None

Expand Down

0 comments on commit 898d0e5

Please sign in to comment.