Skip to content

Commit

Permalink
Merge branch 'feat/sync_denoms_ini_files' of https://github.com/Injec…
Browse files Browse the repository at this point in the history
…tiveLabs/sdk-python into fix/sync_dev_with_master_095
  • Loading branch information
abel committed Nov 6, 2023
2 parents fbbedf0 + 04abec3 commit 4c371e8
Show file tree
Hide file tree
Showing 6 changed files with 741 additions and 344 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ All notable changes to this project will be documented in this file.
- Remove `aiocron` dependency. Use plain asyncio tasks to solve the timeout height synchronization
- Updated the gas fee buffer used to calculate fee consumption in all examples

## [0.9.5]
* Updated fetch_metadata script (to synchronize denom ini files) to reuse logic in AsyncClient
* Synchronized denom ini files with Indexer information for mainnet, testnet and devnet

## [0.9.4]
* Added TIA/USDT spot market in mainnet and testnet ini file

## [0.9.3]
* Updated TIA/USDT-30NOV2023 market id in denoms_mainnet.ini file

Expand Down
17 changes: 13 additions & 4 deletions pyinjective/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,9 +906,15 @@ async def _initialize_tokens_and_markets(self):
binary_option_markets = dict()
tokens = dict()
tokens_by_denom = dict()
markets_info = (await self.get_spot_markets()).markets
markets_info = (await self.get_spot_markets(market_status="active")).markets
valid_markets = (
market_info
for market_info in markets_info
if len(market_info.base_token_meta.SerializeToString()) > 0
and len(market_info.quote_token_meta.SerializeToString()) > 0
)

for market_info in markets_info:
for market_info in valid_markets:
if "/" in market_info.ticker:
base_token_symbol, quote_token_symbol = market_info.ticker.split(constant.TICKER_TOKENS_SEPARATOR)
else:
Expand Down Expand Up @@ -948,8 +954,11 @@ async def _initialize_tokens_and_markets(self):

spot_markets[market.id] = market

markets_info = (await self.get_derivative_markets()).markets
for market_info in markets_info:
markets_info = (await self.get_derivative_markets(market_status="active")).markets
valid_markets = (
market_info for market_info in markets_info if len(market_info.quote_token_meta.SerializeToString()) > 0
)
for market_info in valid_markets:
quote_token_symbol = market_info.quote_token_meta.symbol

quote_token = self._token_representation(
Expand Down
Loading

0 comments on commit 4c371e8

Please sign in to comment.