Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/sync_denoms_ini_files #264

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ poetry run pytest -v
```

### Changelogs
**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

Expand Down
17 changes: 13 additions & 4 deletions pyinjective/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,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 @@ -917,8 +923,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
Loading