-
Notifications
You must be signed in to change notification settings - Fork 34
[CHORE] final_v1_19_alignment_for_release #411
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
Changes from all commits
625589a
016bbaf
f2f6390
69af88e
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,41 @@ | ||
| import asyncio | ||
| from typing import Any, Dict | ||
|
|
||
| from grpc import RpcError | ||
|
|
||
| from pyinjective.core.network import Network | ||
| from pyinjective.indexer_client import IndexerClient | ||
|
|
||
|
|
||
| async def oracle_list_event_processor(event: Dict[str, Any]): | ||
| print(event) | ||
|
|
||
|
|
||
| def stream_error_processor(exception: RpcError): | ||
| print(f"There was an error listening to oracle list updates ({exception})") | ||
|
|
||
|
|
||
| def stream_closed_processor(): | ||
| print("The oracle list updates stream has been closed") | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| network = Network.testnet() | ||
| client = IndexerClient(network) | ||
|
|
||
| task = asyncio.get_event_loop().create_task( | ||
| client.listen_oracle_list_updates( | ||
| callback=oracle_list_event_processor, | ||
| on_end_callback=stream_closed_processor, | ||
| on_status_callback=stream_error_processor, | ||
| oracle_type="provider", | ||
| symbols=["TIA"], | ||
| ) | ||
| ) | ||
|
|
||
| await asyncio.sleep(delay=60) | ||
| task.cancel() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import asyncio | ||
| from typing import Any, Dict | ||
|
|
||
| from grpc import RpcError | ||
|
|
||
| from pyinjective.core.network import Network | ||
| from pyinjective.indexer_client import IndexerClient | ||
|
|
||
|
|
||
| async def price_event_processor(event: Dict[str, Any]): | ||
| print(event) | ||
|
|
||
|
|
||
| def stream_error_processor(exception: RpcError): | ||
| print(f"There was an error listening to oracle prices by markets updates ({exception})") | ||
|
|
||
|
|
||
| def stream_closed_processor(): | ||
| print("The oracle prices by markets updates stream has been closed") | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| network = Network.testnet() | ||
| client = IndexerClient(network) | ||
| market_id = "0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6" | ||
|
|
||
| task = asyncio.get_event_loop().create_task( | ||
| client.listen_oracle_prices_by_markets_updates( | ||
| market_ids=[market_id], | ||
| callback=price_event_processor, | ||
| on_end_callback=stream_closed_processor, | ||
| on_status_callback=stream_error_processor, | ||
| ) | ||
| ) | ||
|
|
||
| await asyncio.sleep(delay=60) | ||
| task.cancel() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) | ||
|
Comment on lines
+22
to
+41
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. Fix the example to call a real client method. Line 25 calls 🤖 Prompt for AI Agents |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: InjectiveLabs/sdk-python
Length of output: 186
Repository at the specified URL is not accessible—the build will fail immediately.
The clone target fails because
https://github.com/InjectiveLabs/injective-indexer.gitreturns "Repository not found" (exit code 128). Verify the correct repository URL and ensure it is accessible before merging.🤖 Prompt for AI Agents