-
Notifications
You must be signed in to change notification settings - Fork 33
Feat/release v1.9.0 #371
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/release v1.9.0 #371
Changes from all commits
dc8d00f
cd67089
97a172f
5c0fb1f
240d229
e1c526e
0ac7456
a99d7f7
2c4239d
b37a42a
3da362a
10bf137
83c4332
302f09b
fa5e91b
1719ef5
9d1489f
42c994e
9dece94
2803a59
2cd9389
436f8f6
4abdf75
e2e76d9
5c5867a
f7ba353
68759f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| # select network: local, testnet, mainnet | ||
| network = Network.testnet() | ||
|
|
||
| # initialize grpc client | ||
| client = AsyncClient(network) | ||
|
|
||
| orderbook = await client.fetch_l3_derivative_orderbook( | ||
| market_id="0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6", | ||
| ) | ||
| print(orderbook) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| # select network: local, testnet, mainnet | ||
| network = Network.testnet() | ||
|
|
||
| # initialize grpc client | ||
| client = AsyncClient(network) | ||
|
|
||
| orderbook = await client.fetch_l3_spot_orderbook( | ||
| market_id="0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe", | ||
| ) | ||
| print(orderbook) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| """ | ||
| Demonstrate fetching market balance using AsyncClient. | ||
| """ | ||
| # Select network: choose between Network.mainnet(), Network.testnet(), or Network.devnet() | ||
| network = Network.testnet() | ||
|
|
||
| # Initialize the Async Client | ||
| client = AsyncClient(network) | ||
|
|
||
| try: | ||
| # Example market ID (replace with an actual market ID from the network) | ||
| market_id = "0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6" | ||
|
|
||
| # Fetch market balance | ||
| market_balance = await client.fetch_market_balance(market_id=market_id) | ||
| print("Market Balance:") | ||
| print(market_balance) | ||
|
|
||
| except Exception as ex: | ||
| print(f"Error occurred: {ex}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||||
| import asyncio | ||||||||||
|
|
||||||||||
| from pyinjective.async_client import AsyncClient | ||||||||||
| from pyinjective.core.network import Network | ||||||||||
|
|
||||||||||
|
|
||||||||||
| async def main() -> None: | ||||||||||
| """ | ||||||||||
| Demonstrate fetching market balances using AsyncClient. | ||||||||||
| """ | ||||||||||
| # Select network: choose between Network.mainnet(), Network.testnet(), or Network.devnet() | ||||||||||
| network = Network.testnet() | ||||||||||
|
|
||||||||||
| # Initialize the Async Client | ||||||||||
| client = AsyncClient(network) | ||||||||||
|
|
||||||||||
| try: | ||||||||||
| # Fetch market balances | ||||||||||
| market_balances = await client.fetch_market_balances() | ||||||||||
| print("Market Balances:") | ||||||||||
| print(market_balances) | ||||||||||
|
|
||||||||||
| except Exception as ex: | ||||||||||
| print(f"Error occurred: {ex}") | ||||||||||
|
|
||||||||||
|
|
||||||||||
| if __name__ == "__main__": | ||||||||||
| asyncio.get_event_loop().run_until_complete(main()) | ||||||||||
|
Comment on lines
+27
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update event loop usage to follow current best practices.
-if __name__ == "__main__":
- asyncio.get_event_loop().run_until_complete(main())
+if __name__ == "__main__":
+ asyncio.run(main())📝 Committable suggestion
Suggested change
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| """ | ||
| Demonstrate fetching denom min notional using AsyncClient. | ||
| """ | ||
| # Select network: choose between Network.mainnet(), Network.testnet(), or Network.devnet() | ||
| network = Network.testnet() | ||
|
|
||
| # Initialize the Async Client | ||
| client = AsyncClient(network) | ||
|
|
||
| try: | ||
| # Example denom | ||
| denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
|
|
||
| # Fetch market balance | ||
| min_notional = await client.fetch_denom_min_notional(denom=denom) | ||
| print("Min Notional:") | ||
| print(min_notional) | ||
|
|
||
| except Exception as ex: | ||
| print(f"Error occurred: {ex}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||||
| import asyncio | ||||||||||
|
|
||||||||||
| from pyinjective.async_client import AsyncClient | ||||||||||
| from pyinjective.core.network import Network | ||||||||||
|
|
||||||||||
|
|
||||||||||
| async def main() -> None: | ||||||||||
| """ | ||||||||||
| Demonstrate fetching denom min notionals using AsyncClient. | ||||||||||
| """ | ||||||||||
| # Select network: choose between Network.mainnet(), Network.testnet(), or Network.devnet() | ||||||||||
| network = Network.testnet() | ||||||||||
|
|
||||||||||
| # Initialize the Async Client | ||||||||||
| client = AsyncClient(network) | ||||||||||
|
|
||||||||||
| try: | ||||||||||
| # Fetch market balance | ||||||||||
| min_notionals = await client.fetch_denom_min_notionals() | ||||||||||
| print("Min Notionals:") | ||||||||||
| print(min_notionals) | ||||||||||
|
|
||||||||||
| except Exception as ex: | ||||||||||
| print(f"Error occurred: {ex}") | ||||||||||
|
|
||||||||||
|
|
||||||||||
| if __name__ == "__main__": | ||||||||||
| asyncio.get_event_loop().run_until_complete(main()) | ||||||||||
|
Comment on lines
+27
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update event loop usage to follow current best practices.
-if __name__ == "__main__":
- asyncio.get_event_loop().run_until_complete(main())
+if __name__ == "__main__":
+ asyncio.run(main())📝 Committable suggestion
Suggested change
|
||||||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify stability of RC version.
Using release candidate v1.14.1-RC.6 of injective-indexer in production code may introduce instability. Consider waiting for the final release or document any known issues.
🌐 Web query:
💡 Result:
The latest stable release version of
injective-indexerreferenced in the provided sources is v1.11.54, as indicated by its npm package@injectivelabs/indexer-apilast published 4 months ago (September 2024)[4]. This version corresponds to tools for interacting with Injective’s Indexer API[8], though no newer releases are mentioned in the search results despite subsequent updates to other Injective components likeinjective-core(e.g., v1.14.0)[1].Citations:
Action Required: Reevaluate Usage of RC Version in Production
The Makefile currently clones
injective-indexerusing release candidate version v1.14.1-RC.6. However, based on the latest web data, the latest stable release is v1.11.54. Using an RC version in production can lead to unforeseen instability. Please verify whether the features or fixes in the RC version are essential. If not, consider switching to the stable version. Otherwise, ensure that any known issues are well documented and that thorough testing has been performed.