-
Notifications
You must be signed in to change notification settings - Fork 34
[CHORE] regenerate protos for injective-core/indexer and align v1.19.0-beta #410
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
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 |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ clean-all: | |
| $(call clean_repos) | ||
|
|
||
| clone-injective-indexer: | ||
| git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.18.3 --depth 1 --single-branch | ||
| git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.18.59 --depth 1 --single-branch | ||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Current Makefile pin =="
rg -n -C2 'clone-injective-indexer|injective-indexer\.git|-b v' Makefile
echo "== Remote tags check (exists + nearby versions) =="
git ls-remote --tags https://github.com/InjectiveLabs/injective-indexer.git \
| rg -n 'refs/tags/v1\.18\.59$|refs/tags/v1\.19|refs/tags/v1\.18' \
| tail -n 50Repository: InjectiveLabs/sdk-python Length of output: 502 🏁 Script executed: # Search for references to proto versions, v1.19.0-beta, or indexer compatibility
rg -i "v1\.19|proto.*version|indexer.*version|compatibility" --type-list | head -5Repository: InjectiveLabs/sdk-python Length of output: 457 🏁 Script executed: # Search for README or documentation files that might explain version requirements
find . -maxdepth 2 -type f \( -name "README*" -o -name "*.md" -o -name "requirements*" -o -name "setup.py" \) | head -20Repository: InjectiveLabs/sdk-python Length of output: 151 🏁 Script executed: # Check if there are any version or compatibility files in the root
ls -la | grep -E "(version|proto|indexer|requirement)" || trueRepository: InjectiveLabs/sdk-python Length of output: 50 🏁 Script executed: # Search the codebase for any mentions of v1.18.59 or comments about this pin
rg "v1\.18\.59|v1\.19\.0" -A3 -B3Repository: InjectiveLabs/sdk-python Length of output: 674 🏁 Script executed: # Check README for version or compatibility information
cat README.md | head -100Repository: InjectiveLabs/sdk-python Length of output: 2985 🏁 Script executed: # Check CHANGELOG for version compatibility notes
cat CHANGELOG.md | head -200Repository: InjectiveLabs/sdk-python Length of output: 7787 🏁 Script executed: # Search for any TODOs or FIXMEs related to versions or indexer
rg "TODO|FIXME|XXX" Makefile buf.gen.yaml -B2 -A2Repository: InjectiveLabs/sdk-python Length of output: 50 🏁 Script executed: # Check if there's any documentation or comments explaining the version pin
rg "v1\.18|v1\.19|indexer" --type md -B2 -A2Repository: InjectiveLabs/sdk-python Length of output: 1759 Address version mismatch between proto and indexer pins. The proto generation (buf.gen.yaml) uses 🤖 Prompt for AI Agents |
||
|
|
||
| clone-all: clone-injective-indexer | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -72,45 +72,21 @@ poetry run pytest -v | |||||||||||
|
|
||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| ## Choose Exchange V1 or Exchange V2 queries | ||||||||||||
|
|
||||||||||||
| The Injective Python SDK provides two different clients for interacting with the exchange: | ||||||||||||
|
|
||||||||||||
| 1. **Exchange V1 Client** (`async_client` module): | ||||||||||||
| - Use this client if you need to interact with the original Injective Exchange API | ||||||||||||
| - Import using: `from pyinjective.async_client import AsyncClient` | ||||||||||||
| - Suitable for applications that need to maintain compatibility with the original exchange interface | ||||||||||||
| - Example: | ||||||||||||
| ```python | ||||||||||||
| from pyinjective.async_client import AsyncClient | ||||||||||||
| from pyinjective.network import Network | ||||||||||||
|
|
||||||||||||
| async def main(): | ||||||||||||
| # Initialize client with mainnet | ||||||||||||
| client = AsyncClient(network=Network.mainnet()) | ||||||||||||
| # Or use testnet | ||||||||||||
| # client = AsyncClient(network=Network.testnet()) | ||||||||||||
| # Use V1 exchange queries here | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| 2. **Exchange V2 Client** (`async_client_v2` module): | ||||||||||||
| - Use this client for the latest exchange features and improvements | ||||||||||||
| - Import using: `from pyinjective.async_client_v2 import AsyncClient` | ||||||||||||
| - Recommended for new applications and when you need access to the latest exchange features | ||||||||||||
| - Example: | ||||||||||||
| ```python | ||||||||||||
| from pyinjective.async_client_v2 import AsyncClient | ||||||||||||
| from pyinjective.network import Network | ||||||||||||
|
|
||||||||||||
| async def main(): | ||||||||||||
| # Initialize client with mainnet | ||||||||||||
| client = AsyncClient(network=Network.mainnet()) | ||||||||||||
| # Or use testnet | ||||||||||||
| # client = AsyncClient(network=Network.testnet()) | ||||||||||||
| # Use V2 exchange queries here | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| Both clients provide similar interfaces but with different underlying implementations. Choose V2 for new projects unless you have specific requirements for V1 compatibility. | ||||||||||||
| ## Async client (exchange V2) | ||||||||||||
|
|
||||||||||||
| The Injective Python SDK exposes `AsyncClient` from the `async_client_v2` module: | ||||||||||||
|
|
||||||||||||
| - Import using: `from pyinjective.async_client_v2 import AsyncClient` | ||||||||||||
| - Example: | ||||||||||||
| ```python | ||||||||||||
| from pyinjective.async_client_v2 import AsyncClient | ||||||||||||
| from pyinjective.network import Network | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+82
to
+84
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Network module files:"
fd -i 'network.py'
echo "Network class definitions:"
rg -n --type=py '\bclass\s+Network\b'
echo "Current import paths used in repository:"
rg -n --type=py 'from pyinjective\.network import Network|from pyinjective\.core\.network import Network'Repository: InjectiveLabs/sdk-python Length of output: 35125 🏁 Script executed: cat -n README.md | sed -n '75,95p'Repository: InjectiveLabs/sdk-python Length of output: 960 🏁 Script executed: find pyinjective -name '__init__.py' -type f -exec grep -l "from.*network.*import\|Network" {} \;Repository: InjectiveLabs/sdk-python Length of output: 50 🏁 Script executed: ls -la pyinjective/network.py 2>&1Repository: InjectiveLabs/sdk-python Length of output: 137 Fix the Line 83 uses 📝 Proposed doc fix from pyinjective.async_client_v2 import AsyncClient
-from pyinjective.network import Network
+from pyinjective.core.network import Network📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| async def main(): | ||||||||||||
| client = AsyncClient(network=Network.mainnet()) | ||||||||||||
| # Or use testnet | ||||||||||||
| # client = AsyncClient(network=Network.testnet()) | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| > **Market Format Differences**: | ||||||||||||
| > - V1 AsyncClient: Markets are initialized with values in chain format (raw blockchain values) | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import asyncio | ||
| import json | ||
| import os | ||
|
|
||
| import dotenv | ||
|
|
||
| from pyinjective.async_client_v2 import AsyncClient | ||
| from pyinjective.core.broadcaster import MsgBroadcasterWithPk | ||
| from pyinjective.core.network import Network | ||
| from pyinjective.wallet import PrivateKey | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| dotenv.load_dotenv() | ||
| private_key_in_hexa = os.getenv("INJECTIVE_PRIVATE_KEY") | ||
|
|
||
| network = Network.devnet() | ||
|
|
||
| client = AsyncClient(network) | ||
| composer = await client.composer() | ||
|
|
||
| gas_price = await client.current_chain_gas_price() | ||
| gas_price = int(gas_price * 1.1) | ||
|
|
||
| message_broadcaster = MsgBroadcasterWithPk.new_using_simulation( | ||
| network=network, | ||
| private_key=private_key_in_hexa, | ||
| gas_price=gas_price, | ||
| client=client, | ||
| composer=composer, | ||
| ) | ||
|
|
||
| priv_key = PrivateKey.from_hex(private_key_in_hexa) | ||
| pub_key = priv_key.to_public_key() | ||
| address = pub_key.to_address() | ||
|
|
||
| denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
|
|
||
| message = composer.msg_auction_claim_voucher( | ||
| sender=address.to_acc_bech32(), | ||
| denom=denom, | ||
| ) | ||
|
|
||
| result = await message_broadcaster.broadcast([message]) | ||
| print("---Transaction Response---") | ||
| print(json.dumps(result, indent=2)) | ||
|
|
||
| gas_price = await client.current_chain_gas_price() | ||
| gas_price = int(gas_price * 1.1) | ||
| message_broadcaster.update_gas_price(gas_price=gas_price) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client_v2 import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| network = Network.testnet() | ||
| client = AsyncClient(network) | ||
|
|
||
| denom = "inj" | ||
| vouchers = await client.fetch_auction_vouchers(denom=denom) | ||
| print(vouchers) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client_v2 import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| network = Network.testnet() | ||
| client = AsyncClient(network) | ||
|
|
||
| denom = "inj" | ||
| address = "inj1knhahceyp57j5x7xh69p7utegnnnfgxavmahjr" | ||
| voucher = await client.fetch_auction_voucher(denom=denom, address=address) | ||
| print(voucher) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import asyncio | ||
| import json | ||
| import os | ||
|
|
||
| import dotenv | ||
|
|
||
| from pyinjective.async_client_v2 import AsyncClient | ||
| from pyinjective.core.broadcaster import MsgBroadcasterWithPk | ||
| from pyinjective.core.network import Network | ||
| from pyinjective.wallet import PrivateKey | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| dotenv.load_dotenv() | ||
| private_key_in_hexa = os.getenv("INJECTIVE_PRIVATE_KEY") | ||
|
|
||
| network = Network.devnet() | ||
|
|
||
| client = AsyncClient(network) | ||
| composer = await client.composer() | ||
|
|
||
| gas_price = await client.current_chain_gas_price() | ||
| gas_price = int(gas_price * 1.1) | ||
|
|
||
| message_broadcaster = MsgBroadcasterWithPk.new_using_simulation( | ||
| network=network, | ||
| private_key=private_key_in_hexa, | ||
| gas_price=gas_price, | ||
| client=client, | ||
| composer=composer, | ||
| ) | ||
|
|
||
| priv_key = PrivateKey.from_hex(private_key_in_hexa) | ||
| pub_key = priv_key.to_public_key() | ||
| address = pub_key.to_address() | ||
|
|
||
| denom = "factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test" | ||
|
|
||
| message = composer.msg_insurance_claim_voucher( | ||
| sender=address.to_acc_bech32(), | ||
| denom=denom, | ||
| ) | ||
|
|
||
| result = await message_broadcaster.broadcast([message]) | ||
| print("---Transaction Response---") | ||
| print(json.dumps(result, indent=2)) | ||
|
|
||
| gas_price = await client.current_chain_gas_price() | ||
| gas_price = int(gas_price * 1.1) | ||
| message_broadcaster.update_gas_price(gas_price=gas_price) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client_v2 import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| network = Network.testnet() | ||
| client = AsyncClient(network) | ||
|
|
||
| denom = "inj" | ||
| vouchers = await client.fetch_insurance_vouchers(denom=denom) | ||
| print(vouchers) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import asyncio | ||
|
|
||
| from pyinjective.async_client_v2 import AsyncClient | ||
| from pyinjective.core.network import Network | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| network = Network.testnet() | ||
| client = AsyncClient(network) | ||
|
|
||
| denom = "inj" | ||
| address = "inj1knhahceyp57j5x7xh69p7utegnnnfgxavmahjr" | ||
| voucher = await client.fetch_insurance_voucher(denom=denom, address=address) | ||
| print(voucher) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.get_event_loop().run_until_complete(main()) |
Uh oh!
There was an error while loading. Please reload this page.