Skip to content

Conversation

@aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented Feb 13, 2025

  • Updated CHANGELO.md for v1.9.0 release.
  • Updated version number to v1.9.0.

Summary by CodeRabbit

  • New Features

    • Introduced new query interfaces to retrieve market balance data, detailed order book information, and minimum notional values.
    • Added governance proposals including a new denomination minimum notional proposal and batch exchange modification operations.
    • Launched enhanced event tracking for token deposits, withdrawals, and fee multiplier updates.
  • Improvements

    • Enhanced permissions and role management for improved governance.
    • Upgraded transaction processes with support for structured message preparation.
    • Optimized data streaming and real‑time query response for a more responsive experience.

PavelInjective and others added 27 commits November 14, 2024 15:08
…used for the v1.14 Testnet upgrade. Included the new fields and endpoints in the SDK API components and updated the example scripts
… Removed the deprecation tests no longer required
…019 to see if that fixes the workflows hanging
…019 to see if that fixes the workflows hanging
…019 to see if that fixes the workflows hanging
…endpoints

Feat/add missing explorer endpoints
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2025

Walkthrough

The pull request updates multiple aspects of the project. CI/CD workflows, build files, and changelog entries have been revised to use updated operating systems, repository tags, and version formats. Numerous new asynchronous Python scripts have been added for blockchain queries including market orders, permissions, and token operations, with method signatures also refined. The internal library has been refactored by deprecating legacy parameters and updating message creation and fetch routines. In addition, extensive modifications have been made to Protocol Buffer definitions and gRPC service stubs across auction, exchange, derivative, and permissions modules.

Changes

File(s) Change Summary
.github/workflows/run-tests.yml
CHANGELOG.md
Makefile
buf.gen.yaml
CI/CD & build configuration updates: OS matrix updated, new environment variables and verbose test options added; changelog entry for version 1.9.0 with new permissions module support; repository tag updates and branch version change in Makefile.
examples/chain_client/*
examples/exchange_client/*
Added and updated multiple asynchronous Python scripts for blockchain interactions: new query endpoints (L3 order books, market balances, denom notionals) and permission message modifications; method signatures enhanced with extra parameters (e.g. base/quote decimals, receiver, burn_from_address).
pyinjective/async_client.py
pyinjective/client/**
pyinjective/composer.py
pyinjective/ofac.json
Core library refactoring: removal of deprecated parameters (e.g. insecure, credentials) and methods; addition of new async fetch methods (order books, market balances, denom notional values) and permissions functions; updates to message creators in the Composer; new entry in the OFAC list.
pyinjective/proto/** Extensive Protocol Buffer and gRPC changes across auction, exchange, derivative and permissions modules: new RPC endpoints and message types added, modifications in serialized descriptors, and restructured fields to streamline API consistency.
pyinjective/proto/google/**
pyinjective/proto/google/longrunning/**
pyinjective/proto/google/rpc/**
Updates in Google API and longrunning descriptors: minor modifications in serialized options and addition of new configuration fields to guide better client library generation.
pyinjective/proto/injective/** Injective-specific module updates: auction and exchange messages revised with new fields (fee multipliers, proposals, segregated wallet addresses) and type changes for amounts; genesis and permissions messages adjusted to support vouchers and updated blockchain data models.

Sequence Diagram(s)

sequenceDiagram
    participant C as Client
    participant S as gRPC Stub
    participant R as gRPC Servicer
    participant A as AsyncClient Method
    C->>S: Call new query (e.g., L3DerivativeOrderBook)
    S->>R: Forward RPC request
    R->>A: Invoke fetch method (e.g., fetch_l3_derivative_orderbook)
    A-->>R: Return orderbook data
    R-->>S: Package response
    S-->>C: Deliver response message
Loading

Poem

In the moonlit code I hop, a rabbit so spry,
New endpoints and methods twinkle in the sky.
With fresh scripts and refactors that light up the night,
I nibble on updates, a most delightful bite!
Hop on through changes, with carrots in sight,
The blockchain garden blooms—oh what a sight!
Hoppity, hoppity, let the new code take flight!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@socket-security
Copy link

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] 🔁 pypi/[email protected] None 0 15.4 MB Andrew.Svetlov, Dreamsorcerer, bdraco, ...2 more
pypi/[email protected] 🔁 pypi/[email protected] None 0 142 kB pawel.nuckowski
pypi/[email protected] filesystem 0 63.2 kB Andrew.Svetlov, mj
pypi/[email protected] None 0 64.1 kB Zac-HD, adriangb
pypi/[email protected] 🔁 pypi/[email protected] None 0 1.51 MB hynek
pypi/[email protected] 🔁 pypi/[email protected] environment, eval, filesystem, network, shell, unsafe 0 6.25 MB JelleZijlstra, ambv, cooperlees, ...2 more
pypi/[email protected] 🔁 pypi/[email protected] None 0 309 kB Lukasa
pypi/[email protected] 🔁 pypi/[email protected] eval, filesystem 0 787 kB Ousret
pypi/[email protected] 🔁 pypi/[email protected] None 0 4.93 MB jtraglia
pypi/[email protected] 🔁 pypi/[email protected] None 0 800 kB

View full report↗︎

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🔭 Outside diff range comments (1)
examples/exchange_client/explorer_rpc/14_GetValidatorUptime.py (1)

1-29: 🛠️ Refactor suggestion

Consider refactoring to reduce code duplication with 13_GetValidator.py.

This script shares significant code duplication with 13_GetValidator.py. Consider extracting common functionality into a shared utility module.

Create a new file examples/exchange_client/explorer_rpc/utils.py:

import asyncio
import logging
import os
from argparse import ArgumentParser
from typing import Any, Callable, Awaitable

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network

async def execute_validator_query(
    query_func: Callable[[AsyncClient, str], Awaitable[Any]],
    query_name: str
) -> None:
    parser = ArgumentParser(description=f'Fetch validator {query_name}')
    parser.add_argument('--address', type=str, 
                       default=os.getenv('VALIDATOR_ADDRESS'),
                       help='Validator address')
    args = parser.parse_args()
    
    if not args.address:
        raise ValueError("Validator address must be provided via --address argument or VALIDATOR_ADDRESS environment variable")
    
    network = Network.testnet()
    client = AsyncClient(network)
    
    try:
        result = await query_func(client, args.address)
        logging.info("Validator %s: %s", query_name, result)
    except ValueError as e:
        logging.error("Invalid input: %s", e)
    except ConnectionError as e:
        logging.error("Connection error while fetching validator %s: %s", query_name, e)
    except Exception as e:
        logging.error("Unexpected error while fetching validator %s: %s", query_name, e)
    finally:
        await client.close()

def main(query_func: Callable[[AsyncClient, str], Awaitable[Any]], query_name: str) -> None:
    logging.basicConfig(level=logging.INFO)
    asyncio.get_event_loop().run_until_complete(
        execute_validator_query(query_func, query_name)
    )

Then simplify this script to:

from pyinjective.async_client import AsyncClient
from utils import main

if __name__ == "__main__":
    main(
        query_func=lambda client, address: client.fetch_validator_uptime(address=address),
        query_name="uptime"
    )
🧹 Nitpick comments (82)
examples/chain_client/permissions/3_MsgUpdateActorRoles.py (1)

31-34: Consider grouping role definitions for maintainability.

Defining each role_actors instance separately works fine, but you might improve readability by grouping role definitions and loop-constructing them (especially if they grow in number).

examples/chain_client/permissions/1_MsgCreateNamespace.py (2)

41-48: Role3 includes potentially powerful actions.

"MINT," "BURN," and "SEND" can be quite powerful. Ensure that granting these to "user" aligns with your security model.


75-79: Policy manager capability.

MODIFY_CONTRACT_HOOK is powerful. Ensure that can_disable and can_seal booleans match your intended governance model.

pyinjective/proto/injective/permissions/v1beta1/permissions_pb2.py (1)

16-16: Remove unused import.

Static analysis indicates pyinjective.proto.gogoproto.gogo_pb2 isn’t used. If this file is not fully auto-generated, remove or comment out the import to avoid linting warnings. If it is auto-generated, remove the import reference from .proto as needed.

- from pyinjective.proto.gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2
🧰 Tools
🪛 Ruff (0.8.2)

16-16: pyinjective.proto.gogoproto.gogo_pb2 imported but unused

Remove unused import: pyinjective.proto.gogoproto.gogo_pb2

(F401)

pyinjective/composer.py (1)

105-111: Refactor to remove .keys() usage in list comprehension.
Static analysis suggests using for permission_name in injective_permissions_pb.Action: rather than for permission_name in injective_permissions_pb.Action.keys(). This is more Pythonic and avoids unnecessary creation of a view object.

Proposed change:

     PERMISSIONS_ACTION = IntFlag(
         "PERMISSIONS_ACTION",
         [
-            (permission_name, injective_permissions_pb.Action.Value(permission_name))
-            for permission_name in injective_permissions_pb.Action.keys()
+            (permission_name, injective_permissions_pb.Action.Value(permission_name))
+            for permission_name in injective_permissions_pb.Action
         ],
     )
🧰 Tools
🪛 Ruff (0.8.2)

109-109: Use key in dict instead of key in dict.keys()

Remove .keys()

(SIM118)

pyinjective/async_client.py (22)

878-880: Consider adding a docstring.
fetch_l3_derivative_orderbook is a new method without inline documentation. Including a brief docstring and potential error-handling steps would help maintain clarity.


881-883: Consider adding a docstring.
fetch_l3_spot_orderbook is a new method without documentation. A concise docstring clarifies its purpose and parameters.


884-886: Add brief documentation.
fetch_market_balance is straightforward, but a docstring stating inputs, outputs, and error handling expectations is beneficial.


887-889: Add brief documentation.
fetch_market_balances could benefit from a docstring detailing the expected return structure.


890-892: Consider docstring for clarity.
fetch_denom_min_notional is self-explanatory, but a short docstring helps maintain consistency with other methods.


893-895: Add a docstring.
Similarly, fetch_denom_min_notionals could specify what “min notionals” represent and how they are retrieved.


918-920: Add docstring & potential error handling.
fetch_inj_burnt might fail if the endpoint is down or unresponsive. Briefly documenting these scenarios can help.


1090-1102: Document the “v2” method.
fetch_contract_txs_v2 is presumably an updated variant; clarify the differences or improvements over any non-v2 version.


1124-1126: Add a brief docstring.
fetch_validator would benefit from clarifying possible exceptions or empty returns if no validator is found.


1127-1128: Add docstring.
fetch_validator_uptime might fail for invalid addresses; a short explanation or reference would help.


1220-1227: Include docstring.
fetch_wasm_codes is new; describing the usage context ensures clarity on the returned content (e.g., code IDs, metadata).


1228-1233: Add docstring.
fetch_wasm_code_by_id could clarify whether it returns source code, metadata, or both, and how large the response might be.


1234-1247: Add docstring.
fetch_wasm_contracts is new; documenting possible query params and the returned structure helps.


1248-1253: Add docstring.
fetch_wasm_contract_by_address could outline possible error states or empty responses if the contract is unknown.


1254-1263: Add docstring & usage details.
fetch_cw20_balance might need an explanation of how to interpret the balance field and typical scenarios (e.g., no balance).


1264-1271: Add docstring.
fetch_relayers is new; specifying the usage scenario and any filters would provide clarity.


1272-1291: Add docstring & mention filters if needed.
fetch_bank_transfers handles multiple optional fields (senders, recipients, etc.). A docstring listing them boosts maintainability.


1512-1524: Document new parameter.
fee_recipient is a new optional argument. Consider adding a docstring or param annotation describing how/why it is used.


1645-1660: Document new parameter.
Similarly, add a note about fee_recipient in listen_spot_trades_updates for consistency.


1789-1801: Include docstring for new parameter.
fee_recipient in fetch_derivative_trades deserves mention in the doc to indicate what it does.


1878-1893: Add docstring for new fee parameter.
In listen_derivative_trades_updates, describing how fee_recipient interacts with the streaming logic helps.


2275-2310: Expand docstrings for new permissions methods.
Multiple new fetch_permissions_* methods are introduced without docstrings. Documenting their purpose and return payloads would clarify usage.

examples/chain_client/permissions/query/12_PermissionsModuleState.py (1)

11-12: Handle potential failure or empty states.
Printing the full module state is useful, but consider adding minimal error handling or logs if None or invalid data is returned.

examples/chain_client/permissions/query/2_Namespaces.py (1)

11-12: Consider improved error handling.
fetch_permissions_namespaces might fail or return an empty set. Logging or verifying the response helps ensure robust usage in production.

examples/chain_client/permissions/query/1_NamespaceDenoms.py (1)

15-16: Modernize asyncio usage.

Replace the deprecated get_event_loop().run_until_complete() pattern with the modern asyncio.run() introduced in Python 3.7.

 if __name__ == "__main__":
-    asyncio.get_event_loop().run_until_complete(main())
+    asyncio.run(main())
examples/chain_client/permissions/query/10_Vouchers.py (2)

11-12: Make denom configurable.

Consider making the denom value configurable through command-line arguments or environment variables for better reusability.

+    import argparse
+    
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--denom', default='inj', help='Denomination to query')
+    args = parser.parse_args()
+
-    denom = "inj"
-    vouchers = await client.fetch_permissions_vouchers(denom=denom)
+    vouchers = await client.fetch_permissions_vouchers(denom=args.denom)

16-17: Modernize asyncio usage.

Replace the deprecated get_event_loop().run_until_complete() pattern with the modern asyncio.run() introduced in Python 3.7.

 if __name__ == "__main__":
-    asyncio.get_event_loop().run_until_complete(main())
+    asyncio.run(main())
examples/chain_client/permissions/query/6_RoleManagers.py (3)

11-12: Make denom configurable.

Consider making the denom value configurable through command-line arguments or environment variables for better reusability.

+    import argparse
+    
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--denom', default='inj', help='Denomination to query')
+    args = parser.parse_args()
+
-    denom = "inj"
-    managers = await client.fetch_permissions_role_managers(denom=denom)
+    managers = await client.fetch_permissions_role_managers(denom=args.denom)

16-17: Modernize asyncio usage.

Replace the deprecated get_event_loop().run_until_complete() pattern with the modern asyncio.run() introduced in Python 3.7.

 if __name__ == "__main__":
-    asyncio.get_event_loop().run_until_complete(main())
+    asyncio.run(main())

1-18: Consider extracting common code into a shared utility module.

There's significant code duplication across the example files. Consider creating a shared utility module for common functionality like network setup, argument parsing, and the main entry point pattern.

Example shared utility module:

# utils.py
import argparse
import asyncio
from typing import Any, Callable, Coroutine

from pyinjective.async_client import AsyncClient
from pyinjective.core.network import Network

def create_parser() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser()
    parser.add_argument('--denom', default='inj', help='Denomination to query')
    return parser

async def setup_client() -> AsyncClient:
    network = Network.testnet()
    return AsyncClient(network)

def run_example(main_func: Callable[[], Coroutine[Any, Any, None]]) -> None:
    asyncio.run(main_func())

Usage in example files:

from utils import create_parser, setup_client, run_example

async def main() -> None:
    args = create_parser().parse_args()
    client = await setup_client()
    
    managers = await client.fetch_permissions_role_managers(denom=args.denom)
    print(managers)

if __name__ == "__main__":
    run_example(main)
examples/chain_client/permissions/query/8_PolicyStatuses.py (2)

11-12: Make denom configurable.

Consider making the denom value configurable through command-line arguments or environment variables for better reusability.

+    import argparse
+    
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--denom', default='inj', help='Denomination to query')
+    args = parser.parse_args()
+
-    denom = "inj"
-    policy_statuses = await client.fetch_permissions_policy_statuses(denom=denom)
+    policy_statuses = await client.fetch_permissions_policy_statuses(denom=args.denom)

16-17: Modernize asyncio usage.

Replace the deprecated get_event_loop().run_until_complete() pattern with the modern asyncio.run() introduced in Python 3.7.

 if __name__ == "__main__":
-    asyncio.get_event_loop().run_until_complete(main())
+    asyncio.run(main())
examples/chain_client/permissions/query/5_ActorsByRole.py (1)

12-13: Consider using a more realistic example value for the role parameter.

The hardcoded value "roleName" might not be representative of actual role names in the system. Consider using a more meaningful example like "validator" or "trader" to help users better understand the expected input.

-    role = "roleName"
+    role = "validator"  # Example: validator, trader, etc.
examples/chain_client/permissions/query/4_RolesByActor.py (1)

12-13: Consider using a more realistic example value for the actor parameter.

The hardcoded value "actor" might not be representative of actual actor addresses in the system. Consider using a more meaningful example like an Injective address to help users better understand the expected input format.

-    actor = "actor"
+    actor = "inj1..."  # Example: Replace with a valid Injective address
examples/chain_client/permissions/query/7_RoleManager.py (1)

12-13: Consider using a more realistic example value for the manager parameter.

The hardcoded value "manager" might not be representative of actual manager addresses in the system. Consider using a more meaningful example like an Injective address to help users better understand the expected input format.

-    manager = "manager"
+    manager = "inj1..."  # Example: Replace with a valid Injective address
examples/chain_client/permissions/query/11_Voucher.py (1)

11-14: Add error handling and documentation.

The code looks good but could benefit from:

  1. Error handling for the async call
  2. Documentation explaining the purpose of the script and expected output format

Apply this diff to add error handling and documentation:

+    """
+    Fetch permissions voucher for a given denom and address.
+    
+    Returns:
+        The permissions voucher details.
+    """
     denom = "inj"
     address = "inj1knhahceyp57j5x7xh69p7utegnnnfgxavmahjr"
-    voucher = await client.fetch_permissions_voucher(denom=denom, address=address)
-    print(voucher)
+    try:
+        voucher = await client.fetch_permissions_voucher(denom=denom, address=address)
+        print(voucher)
+    except Exception as e:
+        print(f"Failed to fetch permissions voucher: {str(e)}")
examples/chain_client/exchange/query/57_L3SpotOrderBook.py (1)

14-17: Add error handling and improve code organization.

The code looks good but could benefit from:

  1. Error handling for the async call
  2. Documentation explaining the purpose of the script and expected output format
  3. Moving the market ID to a constant for better maintainability

Apply this diff to add error handling and improve code organization:

+    # Market ID for the spot order book
+    MARKET_ID = "0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe"
+
+    """
+    Fetch Level 3 spot order book for a given market ID.
+    
+    Returns:
+        The order book details including buy and sell orders.
+    """
-    orderbook = await client.fetch_l3_spot_orderbook(
-        market_id="0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe",
-    )
-    print(orderbook)
+    try:
+        orderbook = await client.fetch_l3_spot_orderbook(
+            market_id=MARKET_ID,
+        )
+        print(orderbook)
+    except Exception as e:
+        print(f"Failed to fetch L3 spot order book: {str(e)}")
examples/chain_client/exchange/query/56_L3DerivativeOrderBook.py (1)

14-17: Add error handling and improve code organization.

The code looks good but could benefit from:

  1. Error handling for the async call
  2. Documentation explaining the purpose of the script and expected output format
  3. Moving the market ID to a constant for better maintainability

Apply this diff to add error handling and improve code organization:

+    # Market ID for the derivative order book
+    MARKET_ID = "0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6"
+
+    """
+    Fetch Level 3 derivative order book for a given market ID.
+    
+    Returns:
+        The order book details including buy and sell orders.
+    """
-    orderbook = await client.fetch_l3_derivative_orderbook(
-        market_id="0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6",
-    )
-    print(orderbook)
+    try:
+        orderbook = await client.fetch_l3_derivative_orderbook(
+            market_id=MARKET_ID,
+        )
+        print(orderbook)
+    except Exception as e:
+        print(f"Failed to fetch L3 derivative order book: {str(e)}")
examples/exchange_client/explorer_rpc/16_GetWasmCodeById.py (2)

9-10: Remove duplicate network initialization comment.

The commented line is identical to the actual initialization and can be removed.

Apply this diff to remove the duplicate comment:

-    # network: Network = Network.testnet()
     network: Network = Network.testnet()

13-19: Add error handling and improve code organization.

The code looks good but could benefit from:

  1. Error handling for the async call
  2. Documentation explaining the purpose of the script and expected output format
  3. Moving the code ID to a constant for better maintainability

Apply this diff to add error handling and improve code organization:

+    # Code ID for the WebAssembly code
+    CODE_ID = 2008
+
+    """
+    Fetch WebAssembly code by its ID.
+    
+    Returns:
+        The WebAssembly code details.
+    """
-    code_id = 2008
-
-    wasm_code = await client.fetch_wasm_code_by_id(
-        code_id=code_id,
-    )
-    print("Wasm code:")
-    print(wasm_code)
+    try:
+        wasm_code = await client.fetch_wasm_code_by_id(
+            code_id=CODE_ID,
+        )
+        print("Wasm code:")
+        print(wasm_code)
+    except Exception as e:
+        print(f"Failed to fetch WebAssembly code: {str(e)}")
examples/exchange_client/explorer_rpc/19_GetCw20Balance.py (4)

9-10: Remove duplicate comment.

Line 9 contains a commented-out line that is identical to line 10.

-    # network: Network = Network.testnet()
     network: Network = Network.testnet()

1-6: Add module docstring.

Add a docstring at the module level to explain the purpose of this example script.

 import asyncio
 import logging

 from pyinjective.async_client import AsyncClient
 from pyinjective.core.network import Network

+"""
+Example script demonstrating how to fetch CW20 token balance for a specific address
+on the Injective blockchain using the AsyncClient.
+"""

8-18: Enhance main function with docstring and type hints.

Add a docstring to explain the function's purpose and add type hints for better code documentation.

 async def main() -> None:
+    """
+    Fetch and display CW20 token balance for a specific address on the testnet.
+    """
     network: Network = Network.testnet()
     client: AsyncClient = AsyncClient(network)

     address = "inj1phd706jqzd9wznkk5hgsfkrc8jqxv0kmlj0kex"

-    balance = await client.fetch_cw20_balance(address=address)
+    balance: dict = await client.fetch_cw20_balance(address=address)
     print("Cw20 balance:")
     print(balance)

13-13: Document the hardcoded address.

Add a comment explaining what this address represents for better understanding.

-    address = "inj1phd706jqzd9wznkk5hgsfkrc8jqxv0kmlj0kex"
+    # Example address - replace with your own address to check its CW20 balance
+    address = "inj1phd706jqzd9wznkk5hgsfkrc8jqxv0kmlj0kex"
examples/exchange_client/explorer_rpc/18_GetWasmContractByAddress.py (3)

1-6: Add module docstring.

Add a docstring at the module level to explain the purpose of this example script.

 import asyncio
 import logging

 from pyinjective.async_client import AsyncClient
 from pyinjective.core.network import Network

+"""
+Example script demonstrating how to fetch WASM contract details by address
+on the Injective blockchain using the AsyncClient.
+"""

8-18: Enhance main function with docstring and type hints.

Add a docstring to explain the function's purpose and add type hints for better code documentation.

 async def main() -> None:
+    """
+    Fetch and display WASM contract details for a specific address on the testnet.
+    """
     network: Network = Network.testnet()
     client: AsyncClient = AsyncClient(network)

     address = "inj1yhz4e7df95908jhs9erl87vdzjkdsc24q7afjf"

-    wasm_contract = await client.fetch_wasm_contract_by_address(address=address)
+    wasm_contract: dict = await client.fetch_wasm_contract_by_address(address=address)
     print("Wasm contract:")
     print(wasm_contract)

13-13: Document the hardcoded address.

Add a comment explaining what this address represents for better understanding.

-    address = "inj1yhz4e7df95908jhs9erl87vdzjkdsc24q7afjf"
+    # Example WASM contract address - replace with your target contract address
+    address = "inj1yhz4e7df95908jhs9erl87vdzjkdsc24q7afjf"
examples/exchange_client/explorer_rpc/20_Relayers.py (1)

1-5: Add module docstring.

Add a docstring at the module level to explain the purpose of this example script.

 import asyncio

 from pyinjective.async_client import AsyncClient
 from pyinjective.core.network import Network

+"""
+Example script demonstrating how to fetch relayers information
+from the Injective blockchain using the AsyncClient.
+"""
examples/exchange_client/explorer_rpc/12_GetValidators.py (2)

1-5: Add module docstring.

Add a docstring at the module level to explain the purpose of this example script.

 import asyncio

 from pyinjective.async_client import AsyncClient
 from pyinjective.core.network import Network

+"""
+Example script demonstrating how to fetch validators information
+from the Injective blockchain using the AsyncClient.
+"""

7-24: Enhance main function with docstring and type hints.

Add docstring and type hints for better code documentation.

-async def main():
+async def main() -> None:
+    """
+    Fetch and display validators information from the selected network.
+    """
     # Select network: choose between testnet, mainnet, or local
     network = Network.testnet()

     # Initialize AsyncClient
     client = AsyncClient(network)

     try:
         # Fetch validators
-        validators = await client.fetch_validators()
+        validators: dict = await client.fetch_validators()

         # Print validators
         print("Validators:")
         print(validators)

     except Exception as e:
         print(f"Error: {e}")
examples/exchange_client/auctions_rpc/4_InjBurntEndpoint.py (1)

7-22: Consider enhancing error handling and cleanup.

While the basic error handling is present, consider:

  1. Adding client cleanup in a finally block
  2. Adding more specific exception types
  3. Including logging instead of print statements
 async def main():
     # Select network: testnet, mainnet, or local
     network = Network.testnet()
 
     # Initialize AsyncClient
     client = AsyncClient(network)
 
     try:
         # Fetch INJ burnt amount
         inj_burnt_response = await client.fetch_inj_burnt()
-        print("INJ Burnt Endpoint Response:")
-        print(inj_burnt_response)
+        logging.info("INJ Burnt Endpoint Response: %s", inj_burnt_response)
 
-    except Exception as e:
-        print(f"Error fetching INJ burnt amount: {e}")
+    except ConnectionError as e:
+        logging.error("Connection error while fetching INJ burnt amount: %s", e)
+    except Exception as e:
+        logging.error("Unexpected error while fetching INJ burnt amount: %s", e)
+    finally:
+        await client.close()
examples/exchange_client/explorer_rpc/13_GetValidator.py (2)

13-13: Consider making the validator address configurable.

The validator address is hardcoded, which limits the script's reusability. Consider making it configurable through environment variables or command-line arguments.

+import os
+from argparse import ArgumentParser
+
 async def main():
     # Select network: choose between testnet, mainnet, or local
     network = Network.testnet()
 
     # Initialize AsyncClient
     client = AsyncClient(network)
-    address = "injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe"
+    
+    parser = ArgumentParser(description='Fetch validator data')
+    parser.add_argument('--address', type=str, 
+                       default=os.getenv('VALIDATOR_ADDRESS'),
+                       help='Validator address')
+    args = parser.parse_args()
+    
+    if not args.address:
+        raise ValueError("Validator address must be provided via --address argument or VALIDATOR_ADDRESS environment variable")
+    
+    address = args.address

15-24: Enhance error handling with specific exceptions and cleanup.

Similar to the previous file, consider improving error handling with specific exceptions, logging, and client cleanup.

+import logging
+
     try:
         # Fetch validator
         validator = await client.fetch_validator(address=address)
 
         # Print validators
-        print("Validator:")
-        print(validator)
+        logging.info("Validator: %s", validator)
 
-    except Exception as e:
-        print(f"Error: {e}")
+    except ValueError as e:
+        logging.error("Invalid input: %s", e)
+    except ConnectionError as e:
+        logging.error("Connection error while fetching validator: %s", e)
+    except Exception as e:
+        logging.error("Unexpected error while fetching validator: %s", e)
+    finally:
+        await client.close()
examples/exchange_client/explorer_rpc/15_GetWasmCodes.py (3)

10-11: Remove duplicate comment.

The commented line is identical to the line below it.

-    # network: Network = Network.testnet()
     network: Network = Network.testnet()

14-18: Consider making pagination parameters configurable.

The pagination parameters are hardcoded, which limits the script's reusability.

+    parser = ArgumentParser(description='Fetch WASM codes')
+    parser.add_argument('--limit', type=int, default=10,
+                       help='Number of results per page')
+    parser.add_argument('--from-number', type=int, default=1000,
+                       help='Start number for pagination')
+    parser.add_argument('--to-number', type=int, default=2000,
+                       help='End number for pagination')
+    args = parser.parse_args()
+
     pagination = PaginationOption(
-        limit=10,
-        from_number=1000,
-        to_number=2000,
+        limit=args.limit,
+        from_number=args.from_number,
+        to_number=args.to_number,
     )

20-24: Enhance error handling and use logging instead of print.

The script configures logging but still uses print statements. Also, error handling could be improved.

-    wasm_codes = await client.fetch_wasm_codes(
-        pagination=pagination,
-    )
-    print("Wasm codes:")
-    print(wasm_codes)
+    try:
+        wasm_codes = await client.fetch_wasm_codes(
+            pagination=pagination,
+        )
+        logging.info("Wasm codes: %s", wasm_codes)
+    except ValueError as e:
+        logging.error("Invalid pagination parameters: %s", e)
+    except ConnectionError as e:
+        logging.error("Connection error while fetching WASM codes: %s", e)
+    except Exception as e:
+        logging.error("Unexpected error while fetching WASM codes: %s", e)
+    finally:
+        await client.close()
examples/chain_client/exchange/query/59_MarketBalances.py (1)

23-24: Consider using more specific exception handling.

Instead of catching a generic Exception, consider catching specific exceptions that might occur during the API call for better error handling and debugging.

-    except Exception as ex:
-        print(f"Error occurred: {ex}")
+    except ConnectionError as ex:
+        print(f"Connection error occurred: {ex}")
+    except TimeoutError as ex:
+        print(f"Timeout error occurred: {ex}")
+    except Exception as ex:
+        print(f"Unexpected error occurred: {ex}")
examples/chain_client/exchange/query/61_DenomMinNotionals.py (2)

18-19: Fix incorrect comment.

The comment mentions "market balance" but the code fetches min notionals.

-        # Fetch market balance
+        # Fetch denom min notionals
         min_notionals = await client.fetch_denom_min_notionals()

23-24: Consider using more specific exception handling.

Instead of catching a generic Exception, consider catching specific exceptions that might occur during the API call for better error handling and debugging.

-    except Exception as ex:
-        print(f"Error occurred: {ex}")
+    except ConnectionError as ex:
+        print(f"Connection error occurred: {ex}")
+    except TimeoutError as ex:
+        print(f"Timeout error occurred: {ex}")
+    except Exception as ex:
+        print(f"Unexpected error occurred: {ex}")
examples/exchange_client/explorer_rpc/21_GetBankTransfers.py (1)

11-12: Remove redundant commented line.

The commented network line is identical to the actual implementation and can be removed.

-    # network: Network = Network.testnet()
     network: Network = Network.testnet()
examples/exchange_client/explorer_rpc/17_GetWasmContracts.py (1)

10-11: Remove redundant commented line.

The commented network line is identical to the actual implementation and can be removed.

-    # network: Network = Network.testnet()
     network: Network = Network.testnet()
examples/chain_client/exchange/query/60_DenomMinNotional.py (2)

19-19: Consider making the denom value configurable.

The example denom is hardcoded. Consider making it configurable through environment variables or command-line arguments for better flexibility in the example.


21-22: Fix comment to match the actual operation.

The comment mentions "Fetch market balance" but the code is fetching denom min notional.

-        # Fetch market balance
+        # Fetch denom min notional
examples/chain_client/exchange/query/58_MarketBalance.py (1)

19-19: Consider making the market ID configurable.

The example market ID is hardcoded. Consider making it configurable through environment variables or command-line arguments for better flexibility in the example.

examples/chain_client/tokenfactory/3_MsgBurn.py (1)

34-34: Consider making the burn_from_address configurable.

The burn_from_address is hardcoded. Consider making it configurable through environment variables or command-line arguments for better flexibility in the example. This is especially important as the same address is used in the denom on line 29.

-        burn_from_address="inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r",
+        burn_from_address=os.getenv("BURN_FROM_ADDRESS"),

Also update line 29 to use the same environment variable:

-    amount = composer.coin(amount=100, denom="factory/inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r/inj_test")
+    burn_from_address = os.getenv("BURN_FROM_ADDRESS")
+    amount = composer.coin(amount=100, denom=f"factory/{burn_from_address}/inj_test")
examples/chain_client/tokenfactory/2_MsgMint.py (1)

34-34: Avoid hardcoding addresses in example code.

The receiver address should be parameterized or documented clearly as a placeholder that users need to replace. This helps prevent accidental usage of the example address in production.

Consider one of these approaches:

  1. Use an environment variable like the private key:
-        receiver="inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r",
+        receiver=os.getenv("RECEIVER_ADDRESS"),
  1. Add a clear comment indicating this is a placeholder:
-        receiver="inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r",
+        receiver="inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r",  # Replace with actual receiver address
examples/exchange_client/derivative_exchange_rpc/9_StreamPositions.py (1)

30-30: Document the migration path from v1 to v2.

The change from listen_derivative_positions_updates to listen_derivative_positions_v2_updates is a breaking change. Please add a comment explaining:

  1. Why users should migrate to v2
  2. Any differences in behavior or returned data structure
  3. Whether v1 is deprecated
examples/exchange_client/explorer_rpc/11_GetContractsTxsV2.py (3)

18-18: Document the example contract address.

Add a comment explaining what this contract address represents and that it should be replaced with an actual address when using the example.

-        address = "inj1ady3s7whq30l4fx8sj3x6muv5mx4dfdlcpv8n7"  # Replace with actual contract address
+        # Example contract address - replace with your target contract address
+        # This example address represents a [describe what this contract does]
+        address = "inj1ady3s7whq30l4fx8sj3x6muv5mx4dfdlcpv8n7"

21-25: Use datetime for clearer time calculations.

The current time calculations using time.time() are not immediately clear. Consider using datetime for more readable time ranges.

+        from datetime import datetime, timedelta
+
         pagination = PaginationOption(
             limit=10,
-            start_time=int((time.time() - 100) * 1000),
-            end_time=int(time.time() * 1000),
+            start_time=int((datetime.now() - timedelta(seconds=100)).timestamp() * 1000),
+            end_time=int(datetime.now().timestamp() * 1000),
         )

28-28: Document the height parameter.

The height parameter is set to a specific value without explanation. Add a comment explaining its significance and how users should choose an appropriate value.

-        response = await client.fetch_contract_txs_v2(address=address, height=60_000_000, pagination=pagination)
+        # Start searching from block height 60,000,000
+        # Adjust this value based on when your target transactions occurred
+        response = await client.fetch_contract_txs_v2(address=address, height=60_000_000, pagination=pagination)
examples/chain_client/exchange/3_MsgInstantSpotMarketLaunch.py (1)

46-47: Consider making decimals configurable or add explanatory comments.

The hardcoded decimal values (18 for base and 6 for quote) might not be suitable for all token pairs. Consider either:

  1. Making these values configurable through environment variables
  2. Adding comments explaining why these specific values were chosen
+# Base token (INJ) uses 18 decimals
 base_decimals=18,
+# Quote token (USDC) uses 6 decimals
 quote_decimals=6,
pyinjective/client/chain/grpc/chain_grpc_permissions_api.py (1)

24-94: Add docstrings to new methods.

The new methods would benefit from docstrings explaining their purpose, parameters, return types, and possible exceptions.

Example docstring format:

async def fetch_namespace_denoms(self) -> Dict[str, Any]:
    """Fetch all namespace denoms.

    Returns:
        Dict[str, Any]: Response containing namespace denoms.

    Raises:
        GrpcException: If the gRPC call fails.
    """
pyinjective/client/indexer/grpc/indexer_grpc_explorer_api.py (1)

71-92: LGTM! The new method follows consistent patterns.

The implementation of fetch_contract_txs_v2 is well-structured and follows the established patterns in the codebase.

Consider using a more explicit approach for setting the "from" attribute:

-            setattr(request, "from", pagination.start_time)
+            request.from_ = pagination.start_time  # Using Python's convention for reserved keywords
pyinjective/proto/injective/exchange/v1beta1/exchange_pb2.py (1)

1-4:

Details

❓ Verification inconclusive

Important: This is a generated protobuf file - do not modify directly.

This file is automatically generated by the protocol buffer compiler. Any manual changes will be overwritten when the file is regenerated. Make changes to the source .proto files instead.

Run this script to locate the source .proto file:


🏁 Script executed:

#!/bin/bash
# Find the source .proto file
fd -e proto -x grep -l "injective/exchange/v1beta1/exchange.proto" {}

Length of output: 71


Action Required: Manual Verification of the Proto Source File Location

  • This file is automatically generated by the Protocol Buffer compiler. Do not modify it directly, as any changes will be overwritten upon regeneration.
  • All modifications must be made in the source .proto file.
  • The initial automated search for the source file (expected to be at injective/exchange/v1beta1/exchange.proto) did not yield results. Please manually verify whether:
    • The expected source file exists, or if it’s located elsewhere.
    • The changes (removal of derivative_atomic_market_order_fee_multiplier and addition of binaryOptionsAtomicMarketOrderFeeMultiplier and isInstantDerivativeMarketLaunchEnabled) are correctly reflected in the proto file.
  • Additionally, ensure that the protobuf version (currently noted as 5.26.1) is compatible across your toolchain.
pyinjective/proto/injective/exchange/v1beta1/tx_pb2.py (1)

467-471: Add documentation for BatchExchangeModification method.

The method is missing documentation that describes its purpose and behavior. Consider adding a docstring to explain what this method does.

pyinjective/proto/injective/exchange/v1beta1/query_pb2_grpc.py (1)

354-364: Add documentation for L3 order book methods.

The implementation is correct, but documentation comments are missing. Consider adding descriptive comments to explain the purpose and behavior of these methods.

-    """Missing associated documentation comment in .proto file."""
+    """Retrieves the Level 3 derivative order book for a market.
+    
+    This provides full order book depth with individual orders.
+    """

Similar documentation should be added for L3SpotOrderBook.

.github/workflows/run-tests.yml (1)

45-45: Consider adding test timing information.

While adding verbosity is good, also consider adding the -v --durations=10 flag to show timing for slowest tests.

-          poetry run pytest --cov --cov-report=xml -v --full-trace
+          poetry run pytest --cov --cov-report=xml -v --full-trace --durations=10
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10c7a90 and 68759f3.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (99)
  • .github/workflows/run-tests.yml (3 hunks)
  • CHANGELOG.md (1 hunks)
  • Makefile (1 hunks)
  • buf.gen.yaml (1 hunks)
  • examples/chain_client/exchange/3_MsgInstantSpotMarketLaunch.py (1 hunks)
  • examples/chain_client/exchange/query/56_L3DerivativeOrderBook.py (1 hunks)
  • examples/chain_client/exchange/query/57_L3SpotOrderBook.py (1 hunks)
  • examples/chain_client/exchange/query/58_MarketBalance.py (1 hunks)
  • examples/chain_client/exchange/query/59_MarketBalances.py (1 hunks)
  • examples/chain_client/exchange/query/60_DenomMinNotional.py (1 hunks)
  • examples/chain_client/exchange/query/61_DenomMinNotionals.py (1 hunks)
  • examples/chain_client/permissions/1_MsgCreateNamespace.py (1 hunks)
  • examples/chain_client/permissions/2_MsgDeleteNamespace.py (0 hunks)
  • examples/chain_client/permissions/2_MsgUpdateNamespace.py (1 hunks)
  • examples/chain_client/permissions/3_MsgUpdateActorRoles.py (1 hunks)
  • examples/chain_client/permissions/3_MsgUpdateNamespace.py (0 hunks)
  • examples/chain_client/permissions/5_MsgRevokeNamespaceRoles.py (0 hunks)
  • examples/chain_client/permissions/query/10_Vouchers.py (1 hunks)
  • examples/chain_client/permissions/query/11_Voucher.py (1 hunks)
  • examples/chain_client/permissions/query/12_PermissionsModuleState.py (1 hunks)
  • examples/chain_client/permissions/query/1_NamespaceDenoms.py (1 hunks)
  • examples/chain_client/permissions/query/2_Namespaces.py (1 hunks)
  • examples/chain_client/permissions/query/3_Namespace.py (1 hunks)
  • examples/chain_client/permissions/query/4_RolesByActor.py (1 hunks)
  • examples/chain_client/permissions/query/5_ActorsByRole.py (1 hunks)
  • examples/chain_client/permissions/query/6_RoleManagers.py (1 hunks)
  • examples/chain_client/permissions/query/7_RoleManager.py (1 hunks)
  • examples/chain_client/permissions/query/8_PolicyStatuses.py (1 hunks)
  • examples/chain_client/permissions/query/9_PolicyManagerCapabilities.py (1 hunks)
  • examples/chain_client/tokenfactory/1_CreateDenom.py (1 hunks)
  • examples/chain_client/tokenfactory/2_MsgMint.py (1 hunks)
  • examples/chain_client/tokenfactory/3_MsgBurn.py (1 hunks)
  • examples/exchange_client/auctions_rpc/4_InjBurntEndpoint.py (1 hunks)
  • examples/exchange_client/derivative_exchange_rpc/9_StreamPositions.py (1 hunks)
  • examples/exchange_client/explorer_rpc/11_GetContractsTxsV2.py (1 hunks)
  • examples/exchange_client/explorer_rpc/12_GetValidators.py (1 hunks)
  • examples/exchange_client/explorer_rpc/13_GetValidator.py (1 hunks)
  • examples/exchange_client/explorer_rpc/14_GetValidatorUptime.py (1 hunks)
  • examples/exchange_client/explorer_rpc/15_GetWasmCodes.py (1 hunks)
  • examples/exchange_client/explorer_rpc/16_GetWasmCodeById.py (1 hunks)
  • examples/exchange_client/explorer_rpc/17_GetWasmContracts.py (1 hunks)
  • examples/exchange_client/explorer_rpc/18_GetWasmContractByAddress.py (1 hunks)
  • examples/exchange_client/explorer_rpc/19_GetCw20Balance.py (1 hunks)
  • examples/exchange_client/explorer_rpc/20_Relayers.py (1 hunks)
  • examples/exchange_client/explorer_rpc/21_GetBankTransfers.py (1 hunks)
  • pyinjective/async_client.py (17 hunks)
  • pyinjective/client/chain/grpc/chain_grpc_exchange_api.py (1 hunks)
  • pyinjective/client/chain/grpc/chain_grpc_permissions_api.py (1 hunks)
  • pyinjective/client/indexer/grpc/indexer_grpc_auction_api.py (1 hunks)
  • pyinjective/client/indexer/grpc/indexer_grpc_derivative_api.py (4 hunks)
  • pyinjective/client/indexer/grpc/indexer_grpc_explorer_api.py (3 hunks)
  • pyinjective/client/indexer/grpc/indexer_grpc_spot_api.py (4 hunks)
  • pyinjective/client/indexer/grpc_stream/indexer_grpc_derivative_stream.py (5 hunks)
  • pyinjective/client/indexer/grpc_stream/indexer_grpc_spot_stream.py (4 hunks)
  • pyinjective/composer.py (7 hunks)
  • pyinjective/ofac.json (1 hunks)
  • pyinjective/proto/cosmwasm/wasm/v1/ibc_pb2.py (2 hunks)
  • pyinjective/proto/cosmwasm/wasm/v1/query_pb2.py (2 hunks)
  • pyinjective/proto/exchange/event_provider_api_pb2.py (2 hunks)
  • pyinjective/proto/exchange/event_provider_api_pb2_grpc.py (4 hunks)
  • pyinjective/proto/exchange/health_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_archiver_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_archiver_rpc_pb2_grpc.py (4 hunks)
  • pyinjective/proto/exchange/injective_auction_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py (4 hunks)
  • pyinjective/proto/exchange/injective_campaign_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_chart_rpc_pb2.py (1 hunks)
  • pyinjective/proto/exchange/injective_chart_rpc_pb2_grpc.py (1 hunks)
  • pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2_grpc.py (4 hunks)
  • pyinjective/proto/exchange/injective_exchange_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_exchange_rpc_pb2_grpc.py (4 hunks)
  • pyinjective/proto/exchange/injective_explorer_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_explorer_rpc_pb2_grpc.py (12 hunks)
  • pyinjective/proto/exchange/injective_spot_exchange_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_trading_rpc_pb2.py (2 hunks)
  • pyinjective/proto/exchange/injective_trading_rpc_pb2_grpc.py (4 hunks)
  • pyinjective/proto/google/api/client_pb2.py (2 hunks)
  • pyinjective/proto/google/api/http_pb2.py (1 hunks)
  • pyinjective/proto/google/api/httpbody_pb2.py (1 hunks)
  • pyinjective/proto/google/api/resource_pb2.py (1 hunks)
  • pyinjective/proto/google/api/visibility_pb2.py (1 hunks)
  • pyinjective/proto/google/longrunning/operations_pb2.py (1 hunks)
  • pyinjective/proto/google/longrunning/operations_pb2_grpc.py (4 hunks)
  • pyinjective/proto/google/rpc/error_details_pb2.py (2 hunks)
  • pyinjective/proto/injective/auction/v1beta1/auction_pb2.py (3 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/events_pb2.py (2 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/exchange_pb2.py (2 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/genesis_pb2.py (2 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/proposal_pb2.py (2 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/query_pb2.py (4 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/query_pb2_grpc.py (6 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/tx_pb2.py (2 hunks)
  • pyinjective/proto/injective/exchange/v1beta1/tx_pb2_grpc.py (4 hunks)
  • pyinjective/proto/injective/peggy/v1/events_pb2.py (3 hunks)
  • pyinjective/proto/injective/peggy/v1/params_pb2.py (2 hunks)
  • pyinjective/proto/injective/permissions/v1beta1/genesis_pb2.py (2 hunks)
  • pyinjective/proto/injective/permissions/v1beta1/permissions_pb2.py (1 hunks)
  • pyinjective/proto/injective/permissions/v1beta1/query_pb2.py (2 hunks)
💤 Files with no reviewable changes (3)
  • examples/chain_client/permissions/5_MsgRevokeNamespaceRoles.py
  • examples/chain_client/permissions/3_MsgUpdateNamespace.py
  • examples/chain_client/permissions/2_MsgDeleteNamespace.py
✅ Files skipped from review due to trivial changes (5)
  • pyinjective/proto/google/api/httpbody_pb2.py
  • pyinjective/proto/google/api/http_pb2.py
  • pyinjective/proto/google/longrunning/operations_pb2_grpc.py
  • pyinjective/proto/google/api/resource_pb2.py
  • pyinjective/ofac.json
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[duplication] ~6-~6: Possible typo: you repeated a word.
Context: ...this file. ## [1.9.0] - 2025-02-13 ### Added - Added support for all new queries and message...

(ENGLISH_WORD_REPEAT_RULE)

🪛 Ruff (0.8.2)
pyinjective/proto/injective/exchange/v1beta1/tx_pb2.py

21-21: pyinjective.proto.injective.exchange.v1beta1.proposal_pb2 imported but unused

Remove unused import: pyinjective.proto.injective.exchange.v1beta1.proposal_pb2

(F401)


22-22: pyinjective.proto.injective.oracle.v1beta1.oracle_pb2 imported but unused

Remove unused import: pyinjective.proto.injective.oracle.v1beta1.oracle_pb2

(F401)


23-23: pyinjective.proto.amino.amino_pb2 imported but unused

Remove unused import: pyinjective.proto.amino.amino_pb2

(F401)

pyinjective/proto/cosmwasm/wasm/v1/query_pb2.py

19-19: pyinjective.proto.cosmos.query.v1.query_pb2 imported but unused

Remove unused import: pyinjective.proto.cosmos.query.v1.query_pb2

(F401)


20-20: pyinjective.proto.amino.amino_pb2 imported but unused

Remove unused import: pyinjective.proto.amino.amino_pb2

(F401)


21-21: pyinjective.proto.cosmos_proto.cosmos_pb2 imported but unused

Remove unused import: pyinjective.proto.cosmos_proto.cosmos_pb2

(F401)

pyinjective/proto/injective/permissions/v1beta1/permissions_pb2.py

16-16: pyinjective.proto.gogoproto.gogo_pb2 imported but unused

Remove unused import: pyinjective.proto.gogoproto.gogo_pb2

(F401)

pyinjective/composer.py

109-109: Use key in dict instead of key in dict.keys()

Remove .keys()

(SIM118)

pyinjective/proto/google/longrunning/operations_pb2.py

18-18: google.protobuf.descriptor_pb2 imported but unused

Remove unused import: google.protobuf.descriptor_pb2

(F401)


19-19: google.protobuf.duration_pb2 imported but unused

Remove unused import: google.protobuf.duration_pb2

(F401)


20-20: google.protobuf.empty_pb2 imported but unused

Remove unused import: google.protobuf.empty_pb2

(F401)


21-21: google.rpc.status_pb2 imported but unused

Remove unused import: google.rpc.status_pb2

(F401)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: run-tests (3.10, windows-latest)
🔇 Additional comments (117)
examples/chain_client/permissions/query/3_Namespace.py (2)

12-12: LGTM! Method call updated correctly.

The method call has been updated from fetch_permissions_namespace_by_denom to fetch_permissions_namespace in line with the API changes, correctly removing the include_roles parameter for a simpler interface.


1-18: LGTM! Well-structured example script.

The example script is well-structured, demonstrating clear initialization, async/await usage, and proper error handling through the event loop. It serves as a good reference for users learning to interact with the permissions API.

pyinjective/client/indexer/grpc_stream/indexer_grpc_spot_stream.py (1)

122-122: LGTM! The fee_recipient parameter is properly integrated.

The addition of the optional fee_recipient parameter to both trade streaming methods is well-implemented and consistent with the API's design pattern.

Also applies to: 139-139, 192-192, 209-209

pyinjective/client/indexer/grpc/indexer_grpc_spot_api.py (1)

92-92: LGTM! The fee_recipient parameter is properly integrated.

The addition of the optional fee_recipient parameter to both trade fetching methods is well-implemented and maintains consistency with the streaming API.

Also applies to: 109-109, 220-220, 237-237

pyinjective/client/indexer/grpc_stream/indexer_grpc_derivative_stream.py (2)

144-144: LGTM! The fee_recipient parameter is properly integrated.

The addition of the optional fee_recipient parameter to both trade streaming methods is well-implemented and maintains consistency with other APIs.

Also applies to: 160-160, 214-214, 231-231


242-267: LGTM! The stream_positions_v2 method is well-implemented.

The new method follows the established streaming pattern and provides comprehensive filtering capabilities through its parameters.

pyinjective/client/indexer/grpc/indexer_grpc_derivative_api.py (1)

217-217: LGTM! The fee_recipient parameter is properly integrated.

The addition of the optional fee_recipient parameter to both trade fetching methods is well-implemented and maintains consistency with other APIs.

Also applies to: 234-234, 327-327, 344-344

pyinjective/proto/injective/permissions/v1beta1/genesis_pb2.py (1)

20-20:

Details

✅ Verification successful

LGTM! The protobuf changes look good.

The addition of the vouchers field to GenesisState and the corresponding update to the serialized end position are correctly reflected in the generated code.

Let's verify that the protobuf definition is being used correctly in the codebase:

Also applies to: 33-33


🏁 Script executed:

#!/bin/bash
# Description: Search for usages of the new vouchers field
# Test: Look for references to the new field. Expect: Initialization or access of vouchers field.

rg -A 5 "vouchers.*GenesisState" 

Length of output: 7485


LGTM – Protobuf changes verified!

The addition of the vouchers field in GenesisState is correctly implemented, and its updated serialized end position is accurately reflected in the generated code. Our search also confirms that references to this new field (for example in pyinjective/proto/injective/permissions/v1beta1/query_pb2.py) are consistent across the codebase.

examples/chain_client/permissions/3_MsgUpdateActorRoles.py (4)

35-38: No functional issues spotted.

Implementation of role_actors2 looks correct. If you anticipate more roles, consider consolidating them to reduce code duplication.


39-42: No concerns.

role_actors3 follows the same pattern and is consistent with the actor-based role assignment approach.


43-45: Roles naming consistency check.

Using "admin" again here is consistent with role_actors1 above. Ensure that repeated roles remain logically consistent in their usage (e.g., for hierarchical or distinct powers).


48-52: Looks good.

The msg_update_actor_roles call is well-formed. Confirm that role_actors_to_revoke is intentionally removing actors who have the same or different roles to avoid unintended override of roles.

examples/chain_client/permissions/1_MsgCreateNamespace.py (8)

31-34: Clear approach for role1.

The bitwise OR to combine permissions is standard, but double-check that each permission constant is a distinct power of two to prevent overlap.


35-40: Role2 logic looks solid.

Assigning MODIFY_ROLE_PERMISSIONS and MODIFY_ADDRESS_ROLES to the "admin" role is sensible.


50-53: Actor-role mapping is straightforward.

actor_role1 maps actor to "admin"; confirm you intend the same privileges that role2 holds.


54-57: Actor-role mapping looks correct.

No issues found. Just ensure addresses are valid bech32 addresses if the chain enforces that format.


59-62: Role manager.

role_manager designates an address with "admin" role. Ensure that no conflicting role managers exist for the same namespace.


64-68: Policy status for MINT.

Not disabling or sealing MINT is fine. Just confirm your downstream logic expects open-ended minting.


69-73: Policy status for BURN.

Similar to the MINT policy, BURN remains enabled. Double-check your internal processes to avoid unintentional token destruction.


85-90: Namespace creation message is consistent with updated roles.

All new roles, actors, statuses, and capabilities appear properly assigned. If a contract hook is needed later, remember to update contract_hook from "".

pyinjective/proto/exchange/injective_trading_rpc_pb2.py (2)

17-17: No functional concerns, but verify usage.

These descriptor updates reflect newly added fields and message types. Please ensure any calling code is updated to leverage these new fields appropriately, and confirm that all relevant unit tests cover the expanded message definitions.


26-42: Confirm downstream integration.

All newly introduced serialization boundaries (e.g., _serialized_start and _serialized_end values) look correct for the updated messages. Verify that both your client-side usage and any downstream consumers properly handle the extended TradingStrategy fields, to avoid potential backward-compatibility or data-handling issues.

pyinjective/proto/exchange/injective_exchange_rpc_pb2.py (2)

17-17: Descriptor creation noted.

The descriptor creation line indicates the newly generated code for the updated messages. Since these are auto-generated, no immediate logic issues—just be sure to confirm that any stale references to old message definitions are removed or updated in your repositories.


37-60: Check EIP-712 flows in higher-level code.

The added fields (PrepareEip712Request, PrepareEip712Response) expand the exchange RPC for structured data signing. Confirm that higher-level usage (client code, tests, docs) aligns with these EIP-712 changes and that signers are tested thoroughly to prevent integration breaks.

pyinjective/proto/exchange/injective_archiver_rpc_pb2.py (2)

17-17: Alignment with updated Archiver RPC.

This indicates updated protocol definitions, including references to new leaderboard and historical trade messages. No immediate concerns, but ensure correct .proto generation steps are consistently followed in your CI/CD pipeline.


43-76: Review new leaderboard/historical trade messages.

New messages (e.g. PnlLeaderboard*; VolLeaderboard*; HistoricalTrades*) appear to provide richer analytics. Verify that you have sufficient test coverage and that your services handle edge cases (e.g., no data for a given range, paging over large result sets). Consider adding integration tests to ensure correctness.

pyinjective/proto/google/api/client_pb2.py (2)

20-20: Validate proper initialization of descriptor data.

This line sets a serialized file into the descriptor pool. As this file is auto-generated, ensure that the protos were compiled with an up-to-date compiler and that no manual edits are needed.


36-79: Looks good—auto-generated code is consistent with new fields.

No functional or logical issues are apparent here. Verify that downstream code properly references these newly introduced fields (e.g., selective_gapic_generation, etc.).

pyinjective/proto/injective/permissions/v1beta1/query_pb2.py (1)

24-115: Confirm that removed and newly introduced queries align with the updated permissions model.

This block reflects auto-generated proto code for the new permission queries. Verify that any references to retired messages or RPC endpoints have been cleaned up in the rest of the codebase, and ensure your tests cover all newly introduced query messages.

pyinjective/proto/injective/exchange/v1beta1/events_pb2.py (1)

21-153: Ensure deprecation of old events and addition of the new event do not cause regressions.

Old event definitions are removed, and EventAtomicMarketOrderFeeMultipliersUpdated is newly defined. Confirm that any subscribers or consumers of the removed events have been updated accordingly, and validate that the new event is properly handled downstream.

pyinjective/proto/exchange/injective_explorer_rpc_pb2.py (2)

17-17: Auto-generated descriptor initialization looks fine.

This line simply initializes the protobuf descriptor pool. No logical or security concerns found.


61-77: New or updated message descriptor references.

These lines point to updated _serialized_start and _serialized_end offsets for newly added or repositioned message types (GetBlocksV2Request, GetBlocksV2Response, Cursor, etc.). This is the standard result of regenerating protobuf code and does not present functional issues.

pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2.py (1)

17-171: Auto-generated descriptor references for extended derivative exchange RPC messages.

All these lines reflect routine protobuf reindexing and new message definitions, including streaming requests/responses for positions, orders, and trades. No direct logic or security concerns to flag. Changes appear consistent with the rest of the file.

pyinjective/proto/injective/exchange/v1beta1/proposal_pb2.py (2)

25-25: Descriptor initialization for proposal protobuf.

Similar to above, this single-line change updates the file descriptor reference after adding or modifying proposal types. No concerns.


178-225: Introduction of DenomMinNotionalProposal and descriptor reindexing.

These lines reflect a new proposal type (DenomMinNotionalProposal) within the descriptor table, plus reindexing for existing proposals. The naming and structure are consistent with the file’s other proposals. No issues found.

pyinjective/composer.py (14)

3-3: Looks good.
The IntFlag import is valid and aligns with its usage below.


403-404: Addition of new parameters for decimals is valid.
Ensuring that callers pass the correct values for base_decimals and quote_decimals will maintain consistency with chain formatting logic.


1180-1181: Parameter allow_admin_burn looks good.
This new boolean parameter is coherently integrated further down (line 1188).


1195-1195: Added receiver parameter in msg_mint.
Extends the functionality correctly by specifying an explicit receiver address.


1203-1203: Added burn_from_address parameter in msg_burn.
Enables burning from a specific address and correctly maps to burnFromAddress in the returned message.


1484-1484: New permissions_role method.
No issues found; the returned Role object is constructed with correct fields.


1487-1488: New permissions_actor_roles method.
Implementation is straightforward and relies correctly on ActorRoles.


1490-1491: New permissions_role_manager method.
Clearly defined; no concerns.


1493-1496: New permissions_policy_status method.
The method signature and return type align with PolicyStatus.


1498-1503: New permissions_policy_manager_capability method.
Implements the correct fields for PolicyManagerCapability.


1505-1506: New permissions_role_actors method.
Returns RoleActors as expected.


1512-1517: Extended parameters in msg_create_namespace.
All new fields (contract_hook, actor_roles, role_managers, policy_statuses, and policy_manager_capabilities) match the updated Namespace structure.


1536-1543: Extended parameters in msg_update_namespace.
Addition of contract_hook, role_permissions, role_managers, policy_statuses, and policy_manager_capabilities is coherent with the updated message.


1555-1567: New msg_update_actor_roles method.
The newly introduced denom, role_actors_to_add, and role_actors_to_revoke parameters correctly map to MsgUpdateActorRoles.

pyinjective/proto/injective/exchange/v1beta1/query_pb2.py (6)

22-22: No issues found in this descriptor initialization.
All additions appear to be standard auto-generated Protobuf code.


153-156: No issues found in these field option assignments.
These lines correctly set serialized options for _TRIMMEDDERIVATIVECONDITIONALORDER and _TRIMMEDLIMITORDER.


164-169: No issues found in these response field definitions.
The balance field options appear properly set for decimal handling.


170-173: No issues found in these method option definitions.
They correctly add or update query method serialization options.


294-305: No issues found in these newly introduced market/denom-related queries.
They align well with the summary stating new endpoints for “MarketBalance,” “MarketBalances,” “DenomMinNotional,” and “DenomMinNotionals.”


553-596: No issues found in the serialization details for the new or modified messages and queries.
All changes here appear consistent with the new endpoints and data structures described.

pyinjective/async_client.py (5)

4-4: Import looks valid.
You are now using Tuple in _tokens_from_official_lists, so this addition is appropriate.


48-51: New gRPC stub imports are consistent.
These imports align with the existing cosmos modules, ensuring consistent naming conventions.


1115-1123: Docstring usage looks good.
This snippet has a short docstring explaining return data. Nicely done.


1913-1936: Deprecation notice is appropriate.
This block clearly warns that listen_derivative_positions_updates is deprecated. Plan a removal timeline to reduce confusion over time.


1937-1970: Docstring is well-defined.
listen_derivative_positions_v2_updates has a clear docstring with parameter references. Good job.

examples/chain_client/permissions/query/8_PolicyStatuses.py (1)

1-18: Consider extracting common code into a shared utility module.

There's significant code duplication across the example files. Consider creating a shared utility module for common functionality like network setup, argument parsing, and the main entry point pattern.

examples/chain_client/permissions/query/9_PolicyManagerCapabilities.py (1)

1-18: LGTM!

The implementation is clean, follows best practices, and provides a good example of how to fetch policy manager capabilities.

examples/exchange_client/explorer_rpc/18_GetWasmContractByAddress.py (1)

9-10: Remove duplicate comment.

Line 9 contains a commented-out line that is identical to line 10.

examples/chain_client/tokenfactory/1_CreateDenom.py (1)

35-35: LGTM! Good security practice.

Setting allow_admin_burn=False by default is a good security practice as it prevents unintended token burning by admin.

pyinjective/client/indexer/grpc/indexer_grpc_auction_api.py (1)

30-34: LGTM! Clean implementation of the new endpoint.

The implementation follows the established patterns in the class and properly utilizes the existing error handling mechanism through _execute_call.

pyinjective/proto/exchange/health_pb2.py (1)

30-32: Auto-generated changes look correct.

The updated serialized positions reflect the protobuf compiler's output and shouldn't be modified manually.

examples/chain_client/permissions/2_MsgUpdateNamespace.py (1)

31-40: Well-structured permission system implementation.

The use of bitwise operations for combining permissions is a clean and efficient approach.

pyinjective/proto/google/api/visibility_pb2.py (1)

25-25: Auto-generated changes look correct.

The updated serialized options reflect the protobuf compiler's output and shouldn't be modified manually.

pyinjective/proto/cosmwasm/wasm/v1/ibc_pb2.py (1)

18-18: LGTM! Auto-generated protobuf code.

The changes correctly add the new MsgIBCWriteAcknowledgementResponse message type and update the serialized positions for all messages.

Also applies to: 38-41

pyinjective/proto/exchange/injective_chart_rpc_pb2.py (1)

1-36: LGTM! Auto-generated protobuf code for chart RPC.

The file correctly defines all necessary message types and services for the chart RPC functionality.

pyinjective/client/chain/grpc/chain_grpc_permissions_api.py (1)

24-94: LGTM! Well-structured API implementation.

The new methods follow a consistent pattern and properly utilize the gRPC request assistant for error handling.

pyinjective/proto/exchange/injective_auction_rpc_pb2.py (1)

17-17: LGTM! Auto-generated protobuf code.

The changes correctly add the new InjBurntEndpoint messages and service, with proper serialized positions.

Also applies to: 43-48

pyinjective/proto/google/rpc/error_details_pb2.py (1)

18-57: LGTM! Generated protobuf code looks correct.

The changes to the serialized positions are consistent with the addition of the new localized_message field in the BadRequest message.

pyinjective/proto/exchange/injective_trading_rpc_pb2_grpc.py (1)

24-28: LGTM! New gRPC method is correctly defined.

The GetTradingStats method is properly integrated into the service with appropriate serialization/deserialization handlers and unimplemented status.

Also applies to: 43-48, 58-62, 103-128

pyinjective/proto/exchange/injective_chart_rpc_pb2_grpc.py (1)

1-126: LGTM! New gRPC service is correctly defined.

The chart data retrieval service is properly implemented with appropriate method handlers for spot and derivative market history. The unimplemented status is suitable for these new methods.

pyinjective/proto/injective/peggy/v1/params_pb2.py (1)

20-20: LGTM! Generated protobuf code looks correct.

The changes to the serialized end position are consistent with the addition of the new segregated_wallet_address field in the Params message.

Also applies to: 43-43

pyinjective/proto/injective/auction/v1beta1/auction_pb2.py (2)

30-31: LGTM! Field options for inj_basket_max_cap are correctly configured.

The new field is properly configured with the correct serialization options for the cosmossdk.io/math.Int type.


47-57: LGTM! Message serialization positions are correctly updated.

The serialized start and end positions for messages have been properly adjusted to accommodate the new field while maintaining the correct sequence.

pyinjective/proto/exchange/event_provider_api_pb2.py (2)

17-17: LGTM! Serialized descriptor is correctly updated.

The serialized descriptor has been properly updated to include the new fields while maintaining the correct structure.


47-70: LGTM! Message serialization positions are correctly updated.

The serialized start and end positions for all messages have been properly adjusted to accommodate the new fields while maintaining the correct sequence.

pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py (4)

33-37: LGTM! New RPC method is correctly registered in the stub.

The InjBurntEndpoint method is properly registered with correct serialization and deserialization handlers.


65-70: LGTM! Error handling is consistent with other methods.

The InjBurntEndpoint implementation follows the same error handling pattern as other methods in the service.


90-94: LGTM! Method handler is correctly registered with the server.

The InjBurntEndpoint method handler is properly registered with correct request/response types.


189-213: LGTM! Static method implementation is consistent.

The static method implementation for InjBurntEndpoint follows the same pattern as other methods in the class.

pyinjective/proto/injective/peggy/v1/events_pb2.py (2)

38-41: LGTM! Field options are correctly configured.

The field options for both EventDepositReceived.amount and Withdrawal.amount are properly configured with the correct serialization options for their respective types.


76-81: LGTM! Message serialization positions are correctly updated.

The serialized start and end positions for the new messages have been properly set while maintaining the correct sequence.

pyinjective/client/indexer/grpc/indexer_grpc_explorer_api.py (2)

244-246: LGTM! Improved pagination handling.

The refactoring to use pagination.from_number and pagination.to_number improves code consistency.


274-275: LGTM! Consistent pagination handling.

Similar to the previous change, using pagination.from_number and pagination.to_number maintains consistency.

pyinjective/proto/exchange/injective_campaign_rpc_pb2.py (1)

41-66: LGTM! Auto-generated protobuf code.

The changes are automatically generated by the protobuf compiler and correctly update the serialization indices.

pyinjective/proto/exchange/event_provider_api_pb2_grpc.py (2)

43-47: LGTM! New gRPC method properly registered.

The new GetABCIBlockEventsAtHeight method is correctly registered with appropriate serializers and deserializers.


89-94: LGTM! Service method stub properly defined.

The service method stub follows the standard gRPC pattern with appropriate error handling.

pyinjective/proto/exchange/injective_exchange_rpc_pb2_grpc.py (3)

28-32: LGTM! New gRPC method properly registered.

The new PrepareEip712 method is correctly registered with appropriate serializers and deserializers.


73-78: LGTM! Service method stub properly defined.

The service method stub follows the standard gRPC pattern with appropriate error handling.


121-125: LGTM! Method handler properly registered.

The RPC method handler is correctly registered with appropriate request/response serializers.

pyinjective/proto/exchange/injective_archiver_rpc_pb2_grpc.py (3)

33-62: LGTM! Well-structured gRPC service additions.

The new methods in InjectiveArchiverRPCStub are properly implemented with correct request serialization and response deserialization. The methods follow consistent patterns and maintain the existing code structure.


90-130: LGTM! Proper error handling in service implementations.

The new methods in InjectiveArchiverRPCServicer correctly implement the unimplemented status and error handling, following the established pattern.


150-179: LGTM! Correct server registration.

The new methods are properly registered with the gRPC server using the correct request deserializers and response serializers.

pyinjective/proto/cosmwasm/wasm/v1/query_pb2.py (2)

19-21: Ignore static analysis warnings about unused imports.

These imports are required by the generated protobuf code even though they appear unused. The static analysis tool cannot detect their indirect usage.

🧰 Tools
🪛 Ruff (0.8.2)

19-19: pyinjective.proto.cosmos.query.v1.query_pb2 imported but unused

Remove unused import: pyinjective.proto.cosmos.query.v1.query_pb2

(F401)


20-20: pyinjective.proto.amino.amino_pb2 imported but unused

Remove unused import: pyinjective.proto.amino.amino_pb2

(F401)


21-21: pyinjective.proto.cosmos_proto.cosmos_pb2 imported but unused

Remove unused import: pyinjective.proto.cosmos_proto.cosmos_pb2

(F401)


89-111: LGTM! Consistent serialization options.

The serialization options for the query methods are consistently updated with the new byte sequence, maintaining compatibility with the protocol.

pyinjective/client/chain/grpc/chain_grpc_exchange_api.py (1)

578-611: LGTM! Well-structured API method additions.

The new methods are properly implemented with:

  • Consistent async/await patterns
  • Clear type hints
  • Proper error handling through _execute_call
  • Descriptive method names
pyinjective/proto/exchange/injective_spot_exchange_rpc_pb2.py (1)

80-124: LGTM! Proper serialization index updates.

The serialization indices for all message types are correctly updated to maintain proper sequential ordering without overlaps or conflicts.

pyinjective/proto/exchange/injective_explorer_rpc_pb2_grpc.py (1)

38-42: LGTM! New RPC methods properly implemented.

The new methods GetBlocksV2, GetTxsV2, and GetStats are correctly implemented following the established pattern, with proper request/response serializers and registration.

Also applies to: 68-72, 138-142

pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2_grpc.py (1)

99-103: LGTM! StreamPositionsV2 implementation is correct.

The new streaming method is properly implemented with all necessary components:

  • Stub registration with correct serializers
  • RPC method handler registration
  • Static method implementation

Also applies to: 424-428, 919-944

pyinjective/proto/injective/exchange/v1beta1/exchange_pb2.py (3)

301-302: LGTM: New field options are properly configured.

The serialized options for the new min_notional field in DenomMinNotional message are correctly set to use cosmossdk.io/math.LegacyDec.


303-416: LGTM: Serialized positions are properly updated.

The serialized start and end positions for all messages and enums have been correctly updated to maintain protobuf compatibility.


4-4:

Details

❓ Verification inconclusive

Verify protobuf version compatibility.

The file is generated using Protobuf Python Version 5.26.1. Ensure this version is compatible with your project's requirements.


🌐 Web query:

What is the latest version of protobuf for Python? Are there any known compatibility issues with version 5.26.1?

💡 Result:

The latest stable release of Protocol Buffers (protobuf) for Python as of February 2025 is version 6.x, released in Q1 2025 according to official documentation[1]. However, this major version update follows a structured release cycle where:

  • Version support timeline:
    Version Release Date Support End
    4.x Feb 2023 Mar 2025
    5.x Mar 2024 Mar 2026
    6.x Q1 2025 TBD

For version compatibility with protobuf==5.26.1, several key issues exist:

Known Compatibility Challenges:

  • Streamlit conflicts: Requires protobuf<5[2][3]
  • Fedora package management: Dependency resolution failures between protobuf v3/v4 and v5[4]
  • pyatv incompatibility: Stack trace errors when using protobuf==5.26.1[8]
  • OpenTelemetry limitations: Version skews may cause undefined behaviors[6]

Workarounds:

# For Streamlit users needing grpcio:
pip install "protobuf<5" "grpcio<2" streamlit
# For Fedora/RedHat systems:
sudo dnf remove conflicting-third-party-repos

The new cross-version runtime guarantee (effective Q1 2025) allows code generated for major version V to work with runtimes V and V+1[4]. However, many ecosystem packages haven't fully adapted to this policy yet.

For most users still on protobuf==4.x or earlier versions (supported until March 2025), upgrading directly to v6.x via pip install protobuf>=6 is recommended rather than using intermediate v5 releases[1][4]. Those requiring v5 functionality should verify all dependencies support this major version before upgrading[2][8].

Citations:


Action: Confirm Protobuf version compatibility with project dependencies

The file indicates it was generated with Protobuf Python Version 5.26.1. As of February 2025, the latest stable release is version 6.x, and there are several known compatibility challenges with version 5.26.1 (e.g., conflicts with Streamlit, Fedora packaging issues, pyatv errors, and OpenTelemetry limitations). Please review your project's dependency requirements to ensure that using 5.26.1 is safe, or consider updating to a newer version if any of these issues affect your workflow.

  • Verify that none of the used ecosystem packages require or conflict with a version upgrade
  • Check for any dependency constraints (e.g., Streamlit requiring protobuf<5) that might affect your project
pyinjective/proto/injective/exchange/v1beta1/tx_pb2.py (2)

21-21: LGTM!

The new import is required for the BatchExchangeModification message type.

🧰 Tools
🪛 Ruff (0.8.2)

21-21: pyinjective.proto.injective.exchange.v1beta1.proposal_pb2 imported but unused

Remove unused import: pyinjective.proto.injective.exchange.v1beta1.proposal_pb2

(F401)


26-26: LGTM!

The DESCRIPTOR is correctly updated to include the new proposal.proto file.

pyinjective/proto/injective/exchange/v1beta1/tx_pb2_grpc.py (3)

193-197: LGTM!

The BatchExchangeModification method is correctly added to the MsgStub class with proper gRPC channel registration.


467-471: LGTM!

The BatchExchangeModification method is correctly added to the MsgServicer class with consistent error handling.


1613-1638: LGTM!

The BatchExchangeModification static method is correctly added to the Msg class with all required parameters and options.

pyinjective/proto/injective/exchange/v1beta1/query_pb2_grpc.py (2)

18-27: LGTM! Well-structured gRPC method implementations.

The new L3 order book methods follow consistent patterns with proper request/response serialization.


790-803: LGTM! Well-documented market balance methods.

The implementation includes clear documentation and proper RPC configuration.

buf.gen.yaml (1)

15-24:

Details

❓ Verification inconclusive

Verify compatibility of updated dependency versions.

Please ensure that the updated versions are compatible:

  • cosmos-sdk: v0.50.9-inj-2
  • wasmd: v0.53.2-inj-1
  • injective-core: v1.14.0

🌐 Web query:

Are there any known compatibility issues between cosmos-sdk v0.50.9-inj-2 and wasmd v0.53.2-inj-1?

💡 Result:

Based on the search results, there are no direct mentions of compatibility issues between cosmos-sdk v0.50.9-inj-2 and wasmd v0.53.2-inj-1, but there are critical considerations from related data:


Compatibility Framework

  1. Official Compatibility Table ([Source 1][4]):

    • The wasmd repository lists compatibility between wasmd and Cosmos SDK versions:
      wasmd Cosmos SDK
      v0.53 v0.50.x
    • This indicates vanilla wasmd v0.53 is explicitly compatible with vanilla cosmos-sdk v0.50.x.
  2. Custom Forks:

    • Projects like Neutron ([Source 7][7]) and Terra ([Source 8][8]) use heavily modified forks of wasmd/x/wasm, which often introduce breaking changes (e.g., floating-point support, gas limits).
    • The -inj suffix in your versions suggests these are Injective-specific forks, which may deviate from upstream compatibility guarantees.

Risks to Evaluate

  • SDK Vulnerabilities: Recent security advisories ([Source 6][6], [Source 2][2]) highlight risks in older SDK versions (e.g., consensus halts), but these do not directly apply to v0.50.x.
  • Contract Compatibility: CosmWasm contracts targeting newer capabilities (e.g., spec3 features) may fail if the fork restricts certain functionalities ([Source 4][4]).

Recommendations

  1. Verify Injective’s documentation for explicit compatibility statements about their forks.
  2. Test critical workflows (e.g., contract instantiation, IBC interactions) in a sandbox environment.
  3. Monitor upstream patches for backported fixes to custom forks.

For production deployments, direct validation with the chain maintainers is strongly advised due to potential deviations in custom builds[1][4][7].

Citations:


Attention: Verify Dependency Compatibility for Injective Custom Forks

Based on the latest web query results, there are no known direct compatibility issues between the vanilla versions of cosmos-sdk v0.50.9-inj-2 and wasmd v0.53.2-inj-1. However, since these versions use Injective-specific forks (indicated by the -inj suffix), please ensure the following:

  • Documentation Check: Confirm with Injective’s documentation that the custom forks maintain the expected compatibility, especially noting any deviations from upstream compatibility guarantees.
  • Testing Critical Workflows: Verify key functionalities (e.g., contract instantiation, IBC interactions) in a controlled sandbox environment.
  • Monitoring Upstream Changes: Keep an eye on related patches and upstream updates that could affect these custom builds.

Please review these recommendations to ensure smooth integration and validate compatibility before proceeding to production.

.github/workflows/run-tests.yml (1)

25-27: LGTM! Good CI environment improvements.

Setting ARCHFLAGS for macOS arm64 architecture improves build compatibility.

CHANGELOG.md (1)

5-8: LGTM! Clear and concise changelog entry.

The changelog entry follows the Keep a Changelog format and clearly documents the addition of the Permissions module support.

🧰 Tools
🪛 LanguageTool

[duplication] ~6-~6: Possible typo: you repeated a word.
Context: ...this file. ## [1.9.0] - 2025-02-13 ### Added - Added support for all new queries and message...

(ENGLISH_WORD_REPEAT_RULE)

pyinjective/proto/google/longrunning/operations_pb2.py (1)

1-4: Warning: This is an auto-generated file.

This file is generated by the protocol buffer compiler and should not be manually edited. Any changes should be made to the corresponding .proto file instead.



DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(injective/exchange/v1beta1/genesis.proto\x12\x1ainjective.exchange.v1beta1\x1a)injective/exchange/v1beta1/exchange.proto\x1a#injective/exchange/v1beta1/tx.proto\x1a\x14gogoproto/gogo.proto\"\xab\x1d\n\x0cGenesisState\x12@\n\x06params\x18\x01 \x01(\x0b\x32\".injective.exchange.v1beta1.ParamsB\x04\xc8\xde\x1f\x00R\x06params\x12I\n\x0cspot_markets\x18\x02 \x03(\x0b\x32&.injective.exchange.v1beta1.SpotMarketR\x0bspotMarkets\x12[\n\x12\x64\x65rivative_markets\x18\x03 \x03(\x0b\x32,.injective.exchange.v1beta1.DerivativeMarketR\x11\x64\x65rivativeMarkets\x12V\n\x0espot_orderbook\x18\x04 \x03(\x0b\x32).injective.exchange.v1beta1.SpotOrderBookB\x04\xc8\xde\x1f\x00R\rspotOrderbook\x12h\n\x14\x64\x65rivative_orderbook\x18\x05 \x03(\x0b\x32/.injective.exchange.v1beta1.DerivativeOrderBookB\x04\xc8\xde\x1f\x00R\x13\x64\x65rivativeOrderbook\x12\x45\n\x08\x62\x61lances\x18\x06 \x03(\x0b\x32#.injective.exchange.v1beta1.BalanceB\x04\xc8\xde\x1f\x00R\x08\x62\x61lances\x12R\n\tpositions\x18\x07 \x03(\x0b\x32..injective.exchange.v1beta1.DerivativePositionB\x04\xc8\xde\x1f\x00R\tpositions\x12i\n\x17subaccount_trade_nonces\x18\x08 \x03(\x0b\x32+.injective.exchange.v1beta1.SubaccountNonceB\x04\xc8\xde\x1f\x00R\x15subaccountTradeNonces\x12\x86\x01\n expiry_futures_market_info_state\x18\t \x03(\x0b\x32\x38.injective.exchange.v1beta1.ExpiryFuturesMarketInfoStateB\x04\xc8\xde\x1f\x00R\x1c\x65xpiryFuturesMarketInfoState\x12i\n\x15perpetual_market_info\x18\n \x03(\x0b\x32/.injective.exchange.v1beta1.PerpetualMarketInfoB\x04\xc8\xde\x1f\x00R\x13perpetualMarketInfo\x12\x82\x01\n\x1eperpetual_market_funding_state\x18\x0b \x03(\x0b\x32\x37.injective.exchange.v1beta1.PerpetualMarketFundingStateB\x04\xc8\xde\x1f\x00R\x1bperpetualMarketFundingState\x12\x95\x01\n&derivative_market_settlement_scheduled\x18\x0c \x03(\x0b\x32:.injective.exchange.v1beta1.DerivativeMarketSettlementInfoB\x04\xc8\xde\x1f\x00R#derivativeMarketSettlementScheduled\x12\x37\n\x18is_spot_exchange_enabled\x18\r \x01(\x08R\x15isSpotExchangeEnabled\x12\x45\n\x1fis_derivatives_exchange_enabled\x18\x0e \x01(\x08R\x1cisDerivativesExchangeEnabled\x12v\n\x1ctrading_reward_campaign_info\x18\x0f \x01(\x0b\x32\x35.injective.exchange.v1beta1.TradingRewardCampaignInfoR\x19tradingRewardCampaignInfo\x12\x80\x01\n%trading_reward_pool_campaign_schedule\x18\x10 \x03(\x0b\x32..injective.exchange.v1beta1.CampaignRewardPoolR!tradingRewardPoolCampaignSchedule\x12\x92\x01\n&trading_reward_campaign_account_points\x18\x11 \x03(\x0b\x32>.injective.exchange.v1beta1.TradingRewardCampaignAccountPointsR\"tradingRewardCampaignAccountPoints\x12\x63\n\x15\x66\x65\x65_discount_schedule\x18\x12 \x01(\x0b\x32/.injective.exchange.v1beta1.FeeDiscountScheduleR\x13\x66\x65\x65\x44iscountSchedule\x12w\n\x1d\x66\x65\x65_discount_account_tier_ttl\x18\x13 \x03(\x0b\x32\x35.injective.exchange.v1beta1.FeeDiscountAccountTierTTLR\x19\x66\x65\x65\x44iscountAccountTierTtl\x12\x89\x01\n#fee_discount_bucket_volume_accounts\x18\x14 \x03(\x0b\x32;.injective.exchange.v1beta1.FeeDiscountBucketVolumeAccountsR\x1f\x66\x65\x65\x44iscountBucketVolumeAccounts\x12<\n\x1bis_first_fee_cycle_finished\x18\x15 \x01(\x08R\x17isFirstFeeCycleFinished\x12\x8f\x01\n-pending_trading_reward_pool_campaign_schedule\x18\x16 \x03(\x0b\x32..injective.exchange.v1beta1.CampaignRewardPoolR(pendingTradingRewardPoolCampaignSchedule\x12\xa8\x01\n.pending_trading_reward_campaign_account_points\x18\x17 \x03(\x0b\x32\x45.injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPointsR)pendingTradingRewardCampaignAccountPoints\x12\x39\n\x19rewards_opt_out_addresses\x18\x18 \x03(\tR\x16rewardsOptOutAddresses\x12\x62\n\x18historical_trade_records\x18\x19 \x03(\x0b\x32(.injective.exchange.v1beta1.TradeRecordsR\x16historicalTradeRecords\x12\x65\n\x16\x62inary_options_markets\x18\x1a \x03(\x0b\x32/.injective.exchange.v1beta1.BinaryOptionsMarketR\x14\x62inaryOptionsMarkets\x12h\n2binary_options_market_ids_scheduled_for_settlement\x18\x1b \x03(\tR,binaryOptionsMarketIdsScheduledForSettlement\x12T\n(spot_market_ids_scheduled_to_force_close\x18\x1c \x03(\tR\"spotMarketIdsScheduledToForceClose\x12V\n\x0e\x64\x65nom_decimals\x18\x1d \x03(\x0b\x32).injective.exchange.v1beta1.DenomDecimalsB\x04\xc8\xde\x1f\x00R\rdenomDecimals\x12\x86\x01\n!conditional_derivative_orderbooks\x18\x1e \x03(\x0b\x32:.injective.exchange.v1beta1.ConditionalDerivativeOrderBookR\x1f\x63onditionalDerivativeOrderbooks\x12\x65\n\x16market_fee_multipliers\x18\x1f \x03(\x0b\x32/.injective.exchange.v1beta1.MarketFeeMultiplierR\x14marketFeeMultipliers\x12^\n\x13orderbook_sequences\x18 \x03(\x0b\x32-.injective.exchange.v1beta1.OrderbookSequenceR\x12orderbookSequences\x12j\n\x12subaccount_volumes\x18! \x03(\x0b\x32;.injective.exchange.v1beta1.AggregateSubaccountVolumeRecordR\x11subaccountVolumes\x12O\n\x0emarket_volumes\x18\" \x03(\x0b\x32(.injective.exchange.v1beta1.MarketVolumeR\rmarketVolumes\x12\x66\n\x14grant_authorizations\x18# \x03(\x0b\x32\x33.injective.exchange.v1beta1.FullGrantAuthorizationsR\x13grantAuthorizations\x12P\n\ractive_grants\x18$ \x03(\x0b\x32+.injective.exchange.v1beta1.FullActiveGrantR\x0c\x61\x63tiveGrants\"L\n\x11OrderbookSequence\x12\x1a\n\x08sequence\x18\x01 \x01(\x04R\x08sequence\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\"\x80\x01\n\x19\x46\x65\x65\x44iscountAccountTierTTL\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12I\n\x08tier_ttl\x18\x02 \x01(\x0b\x32..injective.exchange.v1beta1.FeeDiscountTierTTLR\x07tierTtl\"\xa9\x01\n\x1f\x46\x65\x65\x44iscountBucketVolumeAccounts\x12\x34\n\x16\x62ucket_start_timestamp\x18\x01 \x01(\x03R\x14\x62ucketStartTimestamp\x12P\n\x0e\x61\x63\x63ount_volume\x18\x02 \x03(\x0b\x32).injective.exchange.v1beta1.AccountVolumeR\raccountVolume\"f\n\rAccountVolume\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12;\n\x06volume\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06volume\"{\n\"TradingRewardCampaignAccountPoints\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12;\n\x06points\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06points\"\xd1\x01\n)TradingRewardCampaignAccountPendingPoints\x12=\n\x1breward_pool_start_timestamp\x18\x01 \x01(\x03R\x18rewardPoolStartTimestamp\x12\x65\n\x0e\x61\x63\x63ount_points\x18\x02 \x03(\x0b\x32>.injective.exchange.v1beta1.TradingRewardCampaignAccountPointsR\raccountPoints\"\x98\x01\n\rSpotOrderBook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x1c\n\tisBuySide\x18\x02 \x01(\x08R\tisBuySide\x12\x42\n\x06orders\x18\x03 \x03(\x0b\x32*.injective.exchange.v1beta1.SpotLimitOrderR\x06orders:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xa4\x01\n\x13\x44\x65rivativeOrderBook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x1c\n\tisBuySide\x18\x02 \x01(\x08R\tisBuySide\x12H\n\x06orders\x18\x03 \x03(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderR\x06orders:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xc1\x03\n\x1e\x43onditionalDerivativeOrderBook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12Z\n\x10limit_buy_orders\x18\x02 \x03(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderR\x0elimitBuyOrders\x12]\n\x11market_buy_orders\x18\x03 \x03(\x0b\x32\x31.injective.exchange.v1beta1.DerivativeMarketOrderR\x0fmarketBuyOrders\x12\\\n\x11limit_sell_orders\x18\x04 \x03(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderR\x0flimitSellOrders\x12_\n\x12market_sell_orders\x18\x05 \x03(\x0b\x32\x31.injective.exchange.v1beta1.DerivativeMarketOrderR\x10marketSellOrders:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\x8f\x01\n\x07\x42\x61lance\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12\x14\n\x05\x64\x65nom\x18\x02 \x01(\tR\x05\x64\x65nom\x12?\n\x08\x64\x65posits\x18\x03 \x01(\x0b\x32#.injective.exchange.v1beta1.DepositR\x08\x64\x65posits:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xa2\x01\n\x12\x44\x65rivativePosition\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\x12@\n\x08position\x18\x03 \x01(\x0b\x32$.injective.exchange.v1beta1.PositionR\x08position:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xae\x01\n\x0fSubaccountNonce\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12l\n\x16subaccount_trade_nonce\x18\x02 \x01(\x0b\x32\x30.injective.exchange.v1beta1.SubaccountTradeNonceB\x04\xc8\xde\x1f\x00R\x14subaccountTradeNonce:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\x91\x01\n\x1c\x45xpiryFuturesMarketInfoState\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12T\n\x0bmarket_info\x18\x02 \x01(\x0b\x32\x33.injective.exchange.v1beta1.ExpiryFuturesMarketInfoR\nmarketInfo\"\x88\x01\n\x1bPerpetualMarketFundingState\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12L\n\x07\x66unding\x18\x02 \x01(\x0b\x32\x32.injective.exchange.v1beta1.PerpetualMarketFundingR\x07\x66unding\"\x8b\x02\n\x17\x46ullGrantAuthorizations\x12\x18\n\x07granter\x18\x01 \x01(\tR\x07granter\x12K\n\x12total_grant_amount\x18\x02 \x01(\tB\x1d\xc8\xde\x1f\x00\xda\xde\x1f\x15\x63osmossdk.io/math.IntR\x10totalGrantAmount\x12\x41\n\x1dlast_delegations_checked_time\x18\x03 \x01(\x03R\x1alastDelegationsCheckedTime\x12\x46\n\x06grants\x18\x04 \x03(\x0b\x32..injective.exchange.v1beta1.GrantAuthorizationR\x06grants\"w\n\x0f\x46ullActiveGrant\x12\x18\n\x07grantee\x18\x01 \x01(\tR\x07grantee\x12J\n\x0c\x61\x63tive_grant\x18\x02 \x01(\x0b\x32\'.injective.exchange.v1beta1.ActiveGrantR\x0b\x61\x63tiveGrantB\x88\x02\n\x1e\x63om.injective.exchange.v1beta1B\x0cGenesisProtoP\x01ZNgithub.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types\xa2\x02\x03IEX\xaa\x02\x1aInjective.Exchange.V1beta1\xca\x02\x1aInjective\\Exchange\\V1beta1\xe2\x02&Injective\\Exchange\\V1beta1\\GPBMetadata\xea\x02\x1cInjective::Exchange::V1beta1b\x06proto3')
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(injective/exchange/v1beta1/genesis.proto\x12\x1ainjective.exchange.v1beta1\x1a)injective/exchange/v1beta1/exchange.proto\x1a#injective/exchange/v1beta1/tx.proto\x1a\x14gogoproto/gogo.proto\"\x89\x1e\n\x0cGenesisState\x12@\n\x06params\x18\x01 \x01(\x0b\x32\".injective.exchange.v1beta1.ParamsB\x04\xc8\xde\x1f\x00R\x06params\x12I\n\x0cspot_markets\x18\x02 \x03(\x0b\x32&.injective.exchange.v1beta1.SpotMarketR\x0bspotMarkets\x12[\n\x12\x64\x65rivative_markets\x18\x03 \x03(\x0b\x32,.injective.exchange.v1beta1.DerivativeMarketR\x11\x64\x65rivativeMarkets\x12V\n\x0espot_orderbook\x18\x04 \x03(\x0b\x32).injective.exchange.v1beta1.SpotOrderBookB\x04\xc8\xde\x1f\x00R\rspotOrderbook\x12h\n\x14\x64\x65rivative_orderbook\x18\x05 \x03(\x0b\x32/.injective.exchange.v1beta1.DerivativeOrderBookB\x04\xc8\xde\x1f\x00R\x13\x64\x65rivativeOrderbook\x12\x45\n\x08\x62\x61lances\x18\x06 \x03(\x0b\x32#.injective.exchange.v1beta1.BalanceB\x04\xc8\xde\x1f\x00R\x08\x62\x61lances\x12R\n\tpositions\x18\x07 \x03(\x0b\x32..injective.exchange.v1beta1.DerivativePositionB\x04\xc8\xde\x1f\x00R\tpositions\x12i\n\x17subaccount_trade_nonces\x18\x08 \x03(\x0b\x32+.injective.exchange.v1beta1.SubaccountNonceB\x04\xc8\xde\x1f\x00R\x15subaccountTradeNonces\x12\x86\x01\n expiry_futures_market_info_state\x18\t \x03(\x0b\x32\x38.injective.exchange.v1beta1.ExpiryFuturesMarketInfoStateB\x04\xc8\xde\x1f\x00R\x1c\x65xpiryFuturesMarketInfoState\x12i\n\x15perpetual_market_info\x18\n \x03(\x0b\x32/.injective.exchange.v1beta1.PerpetualMarketInfoB\x04\xc8\xde\x1f\x00R\x13perpetualMarketInfo\x12\x82\x01\n\x1eperpetual_market_funding_state\x18\x0b \x03(\x0b\x32\x37.injective.exchange.v1beta1.PerpetualMarketFundingStateB\x04\xc8\xde\x1f\x00R\x1bperpetualMarketFundingState\x12\x95\x01\n&derivative_market_settlement_scheduled\x18\x0c \x03(\x0b\x32:.injective.exchange.v1beta1.DerivativeMarketSettlementInfoB\x04\xc8\xde\x1f\x00R#derivativeMarketSettlementScheduled\x12\x37\n\x18is_spot_exchange_enabled\x18\r \x01(\x08R\x15isSpotExchangeEnabled\x12\x45\n\x1fis_derivatives_exchange_enabled\x18\x0e \x01(\x08R\x1cisDerivativesExchangeEnabled\x12v\n\x1ctrading_reward_campaign_info\x18\x0f \x01(\x0b\x32\x35.injective.exchange.v1beta1.TradingRewardCampaignInfoR\x19tradingRewardCampaignInfo\x12\x80\x01\n%trading_reward_pool_campaign_schedule\x18\x10 \x03(\x0b\x32..injective.exchange.v1beta1.CampaignRewardPoolR!tradingRewardPoolCampaignSchedule\x12\x92\x01\n&trading_reward_campaign_account_points\x18\x11 \x03(\x0b\x32>.injective.exchange.v1beta1.TradingRewardCampaignAccountPointsR\"tradingRewardCampaignAccountPoints\x12\x63\n\x15\x66\x65\x65_discount_schedule\x18\x12 \x01(\x0b\x32/.injective.exchange.v1beta1.FeeDiscountScheduleR\x13\x66\x65\x65\x44iscountSchedule\x12w\n\x1d\x66\x65\x65_discount_account_tier_ttl\x18\x13 \x03(\x0b\x32\x35.injective.exchange.v1beta1.FeeDiscountAccountTierTTLR\x19\x66\x65\x65\x44iscountAccountTierTtl\x12\x89\x01\n#fee_discount_bucket_volume_accounts\x18\x14 \x03(\x0b\x32;.injective.exchange.v1beta1.FeeDiscountBucketVolumeAccountsR\x1f\x66\x65\x65\x44iscountBucketVolumeAccounts\x12<\n\x1bis_first_fee_cycle_finished\x18\x15 \x01(\x08R\x17isFirstFeeCycleFinished\x12\x8f\x01\n-pending_trading_reward_pool_campaign_schedule\x18\x16 \x03(\x0b\x32..injective.exchange.v1beta1.CampaignRewardPoolR(pendingTradingRewardPoolCampaignSchedule\x12\xa8\x01\n.pending_trading_reward_campaign_account_points\x18\x17 \x03(\x0b\x32\x45.injective.exchange.v1beta1.TradingRewardCampaignAccountPendingPointsR)pendingTradingRewardCampaignAccountPoints\x12\x39\n\x19rewards_opt_out_addresses\x18\x18 \x03(\tR\x16rewardsOptOutAddresses\x12\x62\n\x18historical_trade_records\x18\x19 \x03(\x0b\x32(.injective.exchange.v1beta1.TradeRecordsR\x16historicalTradeRecords\x12\x65\n\x16\x62inary_options_markets\x18\x1a \x03(\x0b\x32/.injective.exchange.v1beta1.BinaryOptionsMarketR\x14\x62inaryOptionsMarkets\x12h\n2binary_options_market_ids_scheduled_for_settlement\x18\x1b \x03(\tR,binaryOptionsMarketIdsScheduledForSettlement\x12T\n(spot_market_ids_scheduled_to_force_close\x18\x1c \x03(\tR\"spotMarketIdsScheduledToForceClose\x12V\n\x0e\x64\x65nom_decimals\x18\x1d \x03(\x0b\x32).injective.exchange.v1beta1.DenomDecimalsB\x04\xc8\xde\x1f\x00R\rdenomDecimals\x12\x86\x01\n!conditional_derivative_orderbooks\x18\x1e \x03(\x0b\x32:.injective.exchange.v1beta1.ConditionalDerivativeOrderBookR\x1f\x63onditionalDerivativeOrderbooks\x12\x65\n\x16market_fee_multipliers\x18\x1f \x03(\x0b\x32/.injective.exchange.v1beta1.MarketFeeMultiplierR\x14marketFeeMultipliers\x12^\n\x13orderbook_sequences\x18 \x03(\x0b\x32-.injective.exchange.v1beta1.OrderbookSequenceR\x12orderbookSequences\x12j\n\x12subaccount_volumes\x18! \x03(\x0b\x32;.injective.exchange.v1beta1.AggregateSubaccountVolumeRecordR\x11subaccountVolumes\x12O\n\x0emarket_volumes\x18\" \x03(\x0b\x32(.injective.exchange.v1beta1.MarketVolumeR\rmarketVolumes\x12\x66\n\x14grant_authorizations\x18# \x03(\x0b\x32\x33.injective.exchange.v1beta1.FullGrantAuthorizationsR\x13grantAuthorizations\x12P\n\ractive_grants\x18$ \x03(\x0b\x32+.injective.exchange.v1beta1.FullActiveGrantR\x0c\x61\x63tiveGrants\x12\\\n\x13\x64\x65nom_min_notionals\x18% \x03(\x0b\x32,.injective.exchange.v1beta1.DenomMinNotionalR\x11\x64\x65nomMinNotionals\"L\n\x11OrderbookSequence\x12\x1a\n\x08sequence\x18\x01 \x01(\x04R\x08sequence\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\"\x80\x01\n\x19\x46\x65\x65\x44iscountAccountTierTTL\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12I\n\x08tier_ttl\x18\x02 \x01(\x0b\x32..injective.exchange.v1beta1.FeeDiscountTierTTLR\x07tierTtl\"\xa9\x01\n\x1f\x46\x65\x65\x44iscountBucketVolumeAccounts\x12\x34\n\x16\x62ucket_start_timestamp\x18\x01 \x01(\x03R\x14\x62ucketStartTimestamp\x12P\n\x0e\x61\x63\x63ount_volume\x18\x02 \x03(\x0b\x32).injective.exchange.v1beta1.AccountVolumeR\raccountVolume\"f\n\rAccountVolume\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12;\n\x06volume\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06volume\"{\n\"TradingRewardCampaignAccountPoints\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12;\n\x06points\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06points\"\xd1\x01\n)TradingRewardCampaignAccountPendingPoints\x12=\n\x1breward_pool_start_timestamp\x18\x01 \x01(\x03R\x18rewardPoolStartTimestamp\x12\x65\n\x0e\x61\x63\x63ount_points\x18\x02 \x03(\x0b\x32>.injective.exchange.v1beta1.TradingRewardCampaignAccountPointsR\raccountPoints\"\x98\x01\n\rSpotOrderBook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x1c\n\tisBuySide\x18\x02 \x01(\x08R\tisBuySide\x12\x42\n\x06orders\x18\x03 \x03(\x0b\x32*.injective.exchange.v1beta1.SpotLimitOrderR\x06orders:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xa4\x01\n\x13\x44\x65rivativeOrderBook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x1c\n\tisBuySide\x18\x02 \x01(\x08R\tisBuySide\x12H\n\x06orders\x18\x03 \x03(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderR\x06orders:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xc1\x03\n\x1e\x43onditionalDerivativeOrderBook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12Z\n\x10limit_buy_orders\x18\x02 \x03(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderR\x0elimitBuyOrders\x12]\n\x11market_buy_orders\x18\x03 \x03(\x0b\x32\x31.injective.exchange.v1beta1.DerivativeMarketOrderR\x0fmarketBuyOrders\x12\\\n\x11limit_sell_orders\x18\x04 \x03(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderR\x0flimitSellOrders\x12_\n\x12market_sell_orders\x18\x05 \x03(\x0b\x32\x31.injective.exchange.v1beta1.DerivativeMarketOrderR\x10marketSellOrders:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\x8f\x01\n\x07\x42\x61lance\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12\x14\n\x05\x64\x65nom\x18\x02 \x01(\tR\x05\x64\x65nom\x12?\n\x08\x64\x65posits\x18\x03 \x01(\x0b\x32#.injective.exchange.v1beta1.DepositR\x08\x64\x65posits:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xa2\x01\n\x12\x44\x65rivativePosition\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\x12@\n\x08position\x18\x03 \x01(\x0b\x32$.injective.exchange.v1beta1.PositionR\x08position:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\xae\x01\n\x0fSubaccountNonce\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12l\n\x16subaccount_trade_nonce\x18\x02 \x01(\x0b\x32\x30.injective.exchange.v1beta1.SubaccountTradeNonceB\x04\xc8\xde\x1f\x00R\x14subaccountTradeNonce:\x08\x88\xa0\x1f\x00\xe8\xa0\x1f\x00\"\x91\x01\n\x1c\x45xpiryFuturesMarketInfoState\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12T\n\x0bmarket_info\x18\x02 \x01(\x0b\x32\x33.injective.exchange.v1beta1.ExpiryFuturesMarketInfoR\nmarketInfo\"\x88\x01\n\x1bPerpetualMarketFundingState\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12L\n\x07\x66unding\x18\x02 \x01(\x0b\x32\x32.injective.exchange.v1beta1.PerpetualMarketFundingR\x07\x66unding\"\x8b\x02\n\x17\x46ullGrantAuthorizations\x12\x18\n\x07granter\x18\x01 \x01(\tR\x07granter\x12K\n\x12total_grant_amount\x18\x02 \x01(\tB\x1d\xc8\xde\x1f\x00\xda\xde\x1f\x15\x63osmossdk.io/math.IntR\x10totalGrantAmount\x12\x41\n\x1dlast_delegations_checked_time\x18\x03 \x01(\x03R\x1alastDelegationsCheckedTime\x12\x46\n\x06grants\x18\x04 \x03(\x0b\x32..injective.exchange.v1beta1.GrantAuthorizationR\x06grants\"w\n\x0f\x46ullActiveGrant\x12\x18\n\x07grantee\x18\x01 \x01(\tR\x07grantee\x12J\n\x0c\x61\x63tive_grant\x18\x02 \x01(\x0b\x32\'.injective.exchange.v1beta1.ActiveGrantR\x0b\x61\x63tiveGrantB\x88\x02\n\x1e\x63om.injective.exchange.v1beta1B\x0cGenesisProtoP\x01ZNgithub.com/InjectiveLabs/injective-core/injective-chain/modules/exchange/types\xa2\x02\x03IEX\xaa\x02\x1aInjective.Exchange.V1beta1\xca\x02\x1aInjective\\Exchange\\V1beta1\xe2\x02&Injective\\Exchange\\V1beta1\\GPBMetadata\xea\x02\x1cInjective::Exchange::V1beta1b\x06proto3')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

LGTM! The protobuf changes look good.

The removal of pending trading reward fields and the corresponding updates to serialized positions are correctly reflected in the generated code.

Let's verify that the removed fields are not being referenced anymore:

Also applies to: 71-103


🏁 Script executed:

#!/bin/bash
# Description: Search for any remaining references to removed fields
# Test: Look for references to removed fields. Expect: No references found.

rg -A 5 "pending_trading_reward_pool_campaign_schedule|pending_trading_reward_campaign_account_points"

Length of output: 59168


Attention: Update Test References to Removed Fields

The protobuf generation appears correct, and the serialized descriptors in pyinjective/proto/injective/exchange/v1beta1/genesis_pb2.py still include the pending trading reward fields (likely maintained for backward compatibility). However, our grep search shows that the test file still references these removed fields. Please update the following:

  • tests/client/chain/grpc/test_chain_grpc_exchange_api.py
    • Remove or update the references to:
      • pending_trading_reward_pool_campaign_schedule
      • pending_trading_reward_campaign_account_points
    • Ensure that the tests match the new API behavior and that no logic depends on these now-removed fields.

Comment on lines +7 to +24
async def main():
# Select network: choose between testnet, mainnet, or local
network = Network.testnet()

# Initialize AsyncClient
client = AsyncClient(network)

try:
# Fetch relayers
validators = await client.fetch_relayers()

# Print relayers
print("Relayers:")
print(validators)

except Exception as e:
print(f"Error: {e}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix variable name and enhance main function.

The variable name validators is inconsistent with the actual data being fetched (relayers). Also, add docstring and type hints.

-async def main():
+async def main() -> None:
+    """
+    Fetch and display relayers information from the selected network.
+    """
     # Select network: choose between testnet, mainnet, or local
     network = Network.testnet()

     # Initialize AsyncClient
     client = AsyncClient(network)

     try:
         # Fetch relayers
-        validators = await client.fetch_relayers()
+        relayers: dict = await client.fetch_relayers()

         # Print relayers
         print("Relayers:")
-        print(validators)
+        print(relayers)

     except Exception as e:
         print(f"Error: {e}")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async def main():
# Select network: choose between testnet, mainnet, or local
network = Network.testnet()
# Initialize AsyncClient
client = AsyncClient(network)
try:
# Fetch relayers
validators = await client.fetch_relayers()
# Print relayers
print("Relayers:")
print(validators)
except Exception as e:
print(f"Error: {e}")
async def main() -> None:
"""
Fetch and display relayers information from the selected network.
"""
# Select network: choose between testnet, mainnet, or local
network = Network.testnet()
# Initialize AsyncClient
client = AsyncClient(network)
try:
# Fetch relayers
relayers: dict = await client.fetch_relayers()
# Print relayers
print("Relayers:")
print(relayers)
except Exception as e:
print(f"Error: {e}")

Comment on lines +27 to +28
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update event loop usage to follow current best practices.

get_event_loop() is deprecated. Use asyncio.run() instead for a more modern approach.

-if __name__ == "__main__":
-    asyncio.get_event_loop().run_until_complete(main())
+if __name__ == "__main__":
+    asyncio.run(main())
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main())
if __name__ == "__main__":
asyncio.run(main())

Comment on lines +27 to +28
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update event loop usage to follow current best practices.

get_event_loop() is deprecated. Use asyncio.run() instead for a more modern approach.

-if __name__ == "__main__":
-    asyncio.get_event_loop().run_until_complete(main())
+if __name__ == "__main__":
+    asyncio.run(main())
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main())
if __name__ == "__main__":
asyncio.run(main())

Comment on lines +23 to +25
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update event loop usage to follow current best practices.

get_event_loop() is deprecated. Use asyncio.run() instead for a more modern approach.

 if __name__ == "__main__":
     logging.basicConfig(level=logging.INFO)
-    asyncio.get_event_loop().run_until_complete(main())
+    asyncio.run(main())
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
asyncio.run(main())

Comment on lines +28 to +30
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update event loop usage to follow current best practices.

get_event_loop() is deprecated. Use asyncio.run() instead for a more modern approach.

 if __name__ == "__main__":
     logging.basicConfig(level=logging.INFO)
-    asyncio.get_event_loop().run_until_complete(main())
+    asyncio.run(main())
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
asyncio.run(main())

Comment on lines +20 to +25
wasm_contracts = await client.fetch_wasm_contracts(
assets_only=True,
pagination=pagination,
)
print("Wasm contracts:")
print(wasm_contracts)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling and improve output formatting.

The API call should be wrapped in a try-except block, and the output should be formatted for better readability.

-    wasm_contracts = await client.fetch_wasm_contracts(
-        assets_only=True,
-        pagination=pagination,
-    )
-    print("Wasm contracts:")
-    print(wasm_contracts)
+    try:
+        wasm_contracts = await client.fetch_wasm_contracts(
+            assets_only=True,
+            pagination=pagination,
+        )
+        print("Wasm contracts:")
+        print(json.dumps(wasm_contracts, indent=2))
+    except ConnectionError as ex:
+        print(f"Connection error occurred: {ex}")
+    except TimeoutError as ex:
+        print(f"Timeout error occurred: {ex}")
+    except Exception as ex:
+        print(f"Unexpected error occurred: {ex}")

Don't forget to add the import at the top of the file:

+import json
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
wasm_contracts = await client.fetch_wasm_contracts(
assets_only=True,
pagination=pagination,
)
print("Wasm contracts:")
print(wasm_contracts)
import json
# ... other imports ...
# ... any preceding code ...
try:
wasm_contracts = await client.fetch_wasm_contracts(
assets_only=True,
pagination=pagination,
)
print("Wasm contracts:")
print(json.dumps(wasm_contracts, indent=2))
except ConnectionError as ex:
print(f"Connection error occurred: {ex}")
except TimeoutError as ex:
print(f"Timeout error occurred: {ex}")
except Exception as ex:
print(f"Unexpected error occurred: {ex}")
# ... any following code ...

Comment on lines +43 to +44
manager="inj1manageraddress",
roles=["admin", "user"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider making addresses configurable via environment variables.

The script contains hardcoded addresses for:

  • Role manager: "inj1manageraddress"
  • Policy manager: "inj1policymanageraddress"
  • Contract hook: "inj19ld6swyldyujcn72j7ugnu9twafhs9wxlyye5m"

These should be configurable to support different environments.

+    manager_address = os.getenv("ROLE_MANAGER_ADDRESS", "inj1manageraddress")
     role_manager = composer.permissions_role_manager(
-        manager="inj1manageraddress",
+        manager=manager_address,
         roles=["admin", "user"],
     )

+    policy_manager_address = os.getenv("POLICY_MANAGER_ADDRESS", "inj1policymanageraddress")
     policy_manager_capability = composer.permissions_policy_manager_capability(
-        manager="inj1policymanageraddress",
+        manager=policy_manager_address,
         action=composer.PERMISSIONS_ACTION["MODIFY_ROLE_PERMISSIONS"],

+    contract_hook_address = os.getenv("CONTRACT_HOOK_ADDRESS", "inj19ld6swyldyujcn72j7ugnu9twafhs9wxlyye5m")
-        contract_hook="inj19ld6swyldyujcn72j7ugnu9twafhs9wxlyye5m",
+        contract_hook=contract_hook_address,

Also applies to: 59-60, 68-68

Comment on lines +263 to +265
"""StreamPositions streams derivatives position updates. This is the legacy
version of the streamPositionsV2 endpoint. Use streamPositionsV2 instead.
"""
Copy link
Contributor

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 migration from StreamPositions to StreamPositionsV2.

The StreamPositions method is now marked as legacy. Ensure all clients are updated to use StreamPositionsV2 instead.

Run the following script to find any remaining usages of the legacy method:


🏁 Script executed:

#!/bin/bash
# Description: Find any remaining usages of the legacy StreamPositions method
# to ensure complete migration to StreamPositionsV2

# Search for StreamPositions usage in Python files
echo "Searching for StreamPositions usage in Python files..."
rg -t py "StreamPositions[^V2]" || echo "No legacy StreamPositions usage found"

# Search for specific client method calls
echo "Searching for specific client method calls..."
rg -t py "listen_derivative_positions_updates" || echo "No legacy client method calls found"

Length of output: 35244


Action Required: Replace legacy StreamPositions with StreamPositionsV2 in client calls

The search results confirm that while the autogenerated gRPC files still include the legacy StreamPositions definitions (which is expected), the client code and tests are still referencing the legacy method. In particular:

  • pyinjective/client/indexer/grpc_stream/indexer_grpc_derivative_stream.py

    • Legacy usage: constructing a StreamPositionsRequest and invoking _stub.StreamPositions instead of using the new V2 endpoint.
  • Tests and Async Client

    • Files such as tests/test_async_client_deprecation_warnings.py and pyinjective/async_client.py are still invoking the deprecated listen_derivative_positions_updates method.

Please update these client calls and test cases to ensure that all interactions use the new StreamPositionsV2 endpoint. This migration is necessary to fully deprecate the legacy functionality and ensure consistency across the codebase.


clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.13.4 --depth 1 --single-branch
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.14.1-RC.6 --depth 1 --single-branch
Copy link
Contributor

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:

What is the latest stable release version of injective-indexer?

💡 Result:

The latest stable release version of injective-indexer referenced in the provided sources is v1.11.54, as indicated by its npm package @injectivelabs/indexer-api last 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 like injective-core (e.g., v1.14.0)[1].

Citations:


Action Required: Reevaluate Usage of RC Version in Production

The Makefile currently clones injective-indexer using 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.

  • File: Makefile (Line 34)
  • Recommendation:
    • Assess if the RC version is necessary.
    • Consider using stable version v1.11.54 for production environments.
    • Document and test any known issues if continuing with the RC version.

@aarmoa aarmoa merged commit b09a7a0 into master Feb 13, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants