Conversation
…71. Includes support for the new Chainlink oracle messages.
…81. Includes support for the new Chainlink oracle messages.
…treams_oracle [C-655] add chainlink data streams oracle
[CHORE] Update licence year
Release/v1.13
…into release/v1_13_to_master
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. 💤 Files selected but had no reviewable changes (1)
⛔ Files ignored due to path filters (1)
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughBumps Injective proto/version pins to v1.18.x, adds Chainlink Data Streams oracle proto and RPCs, extends RFQ and IAM/routing proto stubs, updates EIP-712 order hashing, introduces wasm_hook/evm_hook in namespace messages, parameterizes oracle list APIs, and standardizes Decimal literals in examples. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AsyncClient
participant IndexerClient
participant IndexerGRPC
Client->>AsyncClient: fetch_oracle_list(symbol, oracle_type, per_page, token)
AsyncClient->>IndexerClient: fetch_oracle_list(symbol, oracle_type, per_page, token)
IndexerClient->>IndexerGRPC: OracleListRequest{symbol, oracle_type, per_page, token}
IndexerGRPC->>IndexerClient: OracleListResponse(oracles, next, token)
IndexerClient->>AsyncClient: parsed response dict
AsyncClient->>Client: return filtered oracle list
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Injective Python SDK to support Injective chain v1.18.0 and Indexer v1.18.3. The changes include protocol buffer regenerations, API signature updates for new features (particularly around permissions and oracle functionality), and various test/example updates to align with the new protocol versions.
Changes:
- Updated proto dependencies to Injective chain v1.18.0 and Indexer v1.18.3
- Renamed
contract_hooktowasm_hookand addedevm_hookparameter in permissions namespace operations - Added support for Chainlink Data Streams oracle and removed deprecated Band oracle methods
- Added new funding-related fields to derivative positions
- Enhanced oracle list API with filtering capabilities
Reviewed changes
Copilot reviewed 65 out of 81 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Version bump from 1.12.0 to 1.13.0 |
| buf.gen.yaml | Updated dependency tags for chain v1.18.0 |
| Makefile | Updated indexer version to v1.18.3 |
| CHANGELOG.md | Added v1.13.0 release notes |
| pyinjective/composer.py, composer_v2.py | Updated namespace methods with wasm_hook and evm_hook parameters |
| pyinjective/indexer_client.py, async_client.py | Added filtering parameters to fetch_oracle_list |
| pyinjective/client/indexer/grpc/indexer_grpc_oracle_api.py | Implemented oracle list filtering |
| pyinjective/orderhash.py | Updated EIP-712 implementation to use new library structure |
| tests/*.py | Updated tests for renamed parameters and new fields |
| examples/*.py | Updated examples for consistency with string Decimal literals |
| pyinjective/proto/**/*.py | Regenerated proto files for v1.18 compatibility |
| pyinjective/ofac.json | Added 3 new addresses to OFAC list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from pyinjective.proto.google.api import client_pb2 as google_dot_api_dot_client__pb2 | ||
| from pyinjective.proto.google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 | ||
| from pyinjective.proto.google.api import resource_pb2 as google_dot_api_dot_resource__pb2 | ||
| from google.iam.v1 import options_pb2 as google_dot_iam_dot_v1_dot_options__pb2 |
There was a problem hiding this comment.
Import of 'google_dot_iam_dot_v1_dot_options__pb2' is not used.
| from pyinjective.proto.google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 | ||
| from pyinjective.proto.google.api import resource_pb2 as google_dot_api_dot_resource__pb2 | ||
| from google.iam.v1 import options_pb2 as google_dot_iam_dot_v1_dot_options__pb2 | ||
| from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 |
There was a problem hiding this comment.
Import of 'google_dot_iam_dot_v1_dot_policy__pb2' is not used.
| from pyinjective.proto.google.api import resource_pb2 as google_dot_api_dot_resource__pb2 | ||
| from google.iam.v1 import options_pb2 as google_dot_iam_dot_v1_dot_options__pb2 | ||
| from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 | ||
| from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 |
There was a problem hiding this comment.
Import of 'google_dot_protobuf_dot_field__mask__pb2' is not used.
| @@ -0,0 +1,4 @@ | |||
| # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | |||
| """Client and server classes corresponding to protobuf-defined services.""" | |||
| import grpc | |||
There was a problem hiding this comment.
Import of 'grpc' is not used.
| _sym_db = _symbol_database.Default() | ||
|
|
||
|
|
||
| from google.type import expr_pb2 as google_dot_type_dot_expr__pb2 |
There was a problem hiding this comment.
Import of 'google_dot_type_dot_expr__pb2' is not used.
| @@ -0,0 +1,4 @@ | |||
| # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | |||
| """Client and server classes corresponding to protobuf-defined services.""" | |||
| import grpc | |||
There was a problem hiding this comment.
Import of 'grpc' is not used.
| _sym_db = _symbol_database.Default() | ||
|
|
||
|
|
||
| from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 |
There was a problem hiding this comment.
Import of 'google_dot_protobuf_dot_descriptor__pb2' is not used.
| @@ -0,0 +1,4 @@ | |||
| # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | |||
| """Client and server classes corresponding to protobuf-defined services.""" | |||
| import grpc | |||
There was a problem hiding this comment.
Import of 'grpc' is not used.
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@Makefile`:
- Line 29: The Makefile's gen target currently runs the failing git clone
command for InjectiveLabs/injective-indexer (the line with "git clone
https://github.com/InjectiveLabs/injective-indexer.git -b v1.18.3 --depth 1
--single-branch"), which breaks make gen and the subsequent copy-proto step;
update the gen flow so it no longer hard-fails on that clone by either replacing
the URL with an accessible mirror/tag, using a configurable
INJECTIVE_INDEXER_REPO variable, or adding a conditional check that skips
cloning and the copy-proto step if ./injective-indexer/api/gen/grpc/ is missing
(and document how to provide the protos from a local path or vendor archive);
ensure changes touch the gen target and any references to copy-proto so make gen
succeeds even when the original repository is inaccessible.
In `@pyinjective/orderhash.py`:
- Around line 4-8: Pin the eip712 dependency to version 0.3.0 or later in your
project manifest (change eip712 = "*" to eip712 >= 0.3.0) so imports like
EIP712Domain and EIP712Message are available; then change the OrderInfo model to
inherit from the library's EIP712Type (not pydantic.BaseModel) and update its
field/type declarations to match the eip712 struct pattern used by
EIP712Message/EIP712Domain (refer to the EIP712Type usage in the eip712 docs) so
the EIP-712 encoding with EIP712Message works correctly.
In `@pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py`:
- Around line 104-109: The generated servicer method AuctionAccountStatus has an
unused request parameter flagged by ARG002; to fix, either configure the linter
to ignore ARG002 for generated gRPC stubs (exclude files matching *_pb2_grpc.py)
or add a local suppression comment to the stub method (e.g., append a noqa for
ARG002 to the function signature or immediately inside the method) so the
generated file no longer triggers the lint error while leaving the generated
code otherwise unchanged.
In `@pyinjective/proto/exchange/injective_rfqrpc_pb2.py`:
- Around line 4-17: The generated protobuf header indicates "Protobuf Python
Version: 5.26.1" (see DESCRIPTOR / the module top comment), but Pipfile.lock is
pinned to protobuf 4.24.2; run pipenv lock to regenerate Pipfile.lock so it
honors the pyproject.toml constraint (^5.26.1) and update the lockfile in the
PR, ensuring the Pipfile.lock protobuf entry matches 5.26.1 (or a compatible
5.x) before merging.
🧹 Nitpick comments (3)
pyinjective/orderhash.py (1)
21-27: Consider extracting the shared EIP712Domain to reduce duplication.The
eip712_domaindefinition is identical betweenSpotOrderandDerivativeOrder. Extracting it to a module-level constant would improve maintainability and ensure consistency if domain parameters need to change.♻️ Suggested refactor to extract shared domain
+INJECTIVE_EIP712_DOMAIN = EIP712Domain( + name="Injective Protocol", + version="2.0.0", + chainId=888, + verifyingContract="0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", + salt=HexBytes("0x0000000000000000000000000000000000000000000000000000000000000000"), +) + + class SpotOrder(EIP712Message): - eip712_domain = EIP712Domain( - name="Injective Protocol", - version="2.0.0", - chainId=888, - verifyingContract="0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC", - salt=HexBytes("0x0000000000000000000000000000000000000000000000000000000000000000"), - ) + eip712_domain = INJECTIVE_EIP712_DOMAINApply the same change to
DerivativeOrder.pyinjective/proto/exchange/injective_rfqrpc_pb2_grpc.py (1)
70-143: Suppress Ruff ARG002 for generated servicer stubs.Static analysis flags unused
request/request_iteratorin generated servicer methods. To avoid CI noise without editing generated files, consider a per-file ignore or path exclusion for these gRPC stubs.Example Ruff config snippet:
[tool.ruff.per-file-ignores] "pyinjective/proto/**/injective_*_pb2_grpc.py" = ["ARG002"]pyinjective/composer.py (1)
1625-1650: Consider grouping related parameterswasm_hookandevm_hooktogether in the signature.The
wasm_hookparameter is at position 3 whileevm_hookis at position 9 (end of signature). These are logically related hook configurations and would be easier to use if adjacent. Also consider whether these should beOptional[str]if empty hooks are valid.Suggested parameter reordering
def msg_create_namespace( self, sender: str, denom: str, wasm_hook: str, + evm_hook: str, role_permissions: List[injective_permissions_pb.Role], actor_roles: List[injective_permissions_pb.ActorRoles], role_managers: List[injective_permissions_pb.RoleManager], policy_statuses: List[injective_permissions_pb.PolicyStatus], policy_manager_capabilities: List[injective_permissions_pb.PolicyManagerCapability], - evm_hook: str, ) -> injective_permissions_tx_pb.MsgCreateNamespace:
|
|
||
| clone-injective-indexer: | ||
| git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.17.16 --depth 1 --single-branch | ||
| git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.18.3 --depth 1 --single-branch |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
git ls-remote --tags https://github.com/InjectiveLabs/injective-indexer.git v1.18.3Repository: InjectiveLabs/sdk-python
Length of output: 185
🏁 Script executed:
#!/bin/bash
# Find and examine the Makefile
git ls-files | grep -i makefileRepository: InjectiveLabs/sdk-python
Length of output: 76
🏁 Script executed:
#!/bin/bash
# Check the Makefile around line 29 for context
if git ls-files | grep -q "Makefile"; then
wc -l Makefile
echo "---"
sed -n '25,35p' Makefile
fiRepository: InjectiveLabs/sdk-python
Length of output: 344
🏁 Script executed:
#!/bin/bash
# Search for injective references in the codebase
rg -i "injective" --max-count 20Repository: InjectiveLabs/sdk-python
Length of output: 50382
🏁 Script executed:
#!/bin/bash
# Find all targets in Makefile and their dependencies
cat -n Makefile | head -41Repository: InjectiveLabs/sdk-python
Length of output: 1525
🏁 Script executed:
#!/bin/bash
# Search for 'gen' target and clone dependencies
grep -n "gen\|clone" MakefileRepository: InjectiveLabs/sdk-python
Length of output: 550
🌐 Web query:
InjectiveLabs injective-indexer GitHub repository
💡 Result:
The GitHub repository InjectiveLabs/injective-indexer is referenced as the upstream repo for Injective’s published indexer client/proto packages on npm (e.g., @injectivelabs/indexer-api, @injectivelabs/indexer-proto-ts). [1][2]
However, the GitHub repo URL currently returns 404 (Not Found), which typically means it’s been deleted, made private, or renamed:
https://github.com/InjectiveLabs/injective-indexer
[3]
If your goal is to work with the indexer (without that repo), the official Injective docs still describe the Indexer API and how to run/query it. [4]
Sources: [1] [2] [3] [4]
Repository InjectiveLabs/injective-indexer is inaccessible and will block the make gen target.
The make gen command depends on cloning https://github.com/InjectiveLabs/injective-indexer.git at tag v1.18.3, but this repository returns 404 (deleted, made private, or renamed). The clone will fail immediately, causing copy-proto to fail since it expects ./injective-indexer/api/gen/grpc/ to exist. Either restore repository access, point to a different source, or update the build process to work without this dependency.
🤖 Prompt for AI Agents
In `@Makefile` at line 29, The Makefile's gen target currently runs the failing
git clone command for InjectiveLabs/injective-indexer (the line with "git clone
https://github.com/InjectiveLabs/injective-indexer.git -b v1.18.3 --depth 1
--single-branch"), which breaks make gen and the subsequent copy-proto step;
update the gen flow so it no longer hard-fails on that clone by either replacing
the URL with an accessible mirror/tag, using a configurable
INJECTIVE_INDEXER_REPO variable, or adding a conditional check that skips
cloning and the copy-proto step if ./injective-indexer/api/gen/grpc/ is missing
(and document how to provide the protos from a local path or vendor archive);
ensure changes touch the gen target and any references to copy-proto so make gen
succeeds even when the original repository is inaccessible.
| def AuctionAccountStatus(self, request, context): | ||
| """Get the allowlist status for a specific account in an auction round | ||
| """ | ||
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
| context.set_details('Method not implemented!') | ||
| raise NotImplementedError('Method not implemented!') |
There was a problem hiding this comment.
Suppress ARG002 for the generated servicer stub (unused request).
Ruff flags the unused request parameter in the new method. Consider excluding generated *_pb2_grpc.py from ARG002 or adding a local noqa to keep lint clean.
🧹 Minimal suppression (if linting generated files)
- def AuctionAccountStatus(self, request, context):
+ def AuctionAccountStatus(self, request, context): # noqa: ARG002🧰 Tools
🪛 Ruff (0.15.0)
[warning] 104-104: Unused method argument: request
(ARG002)
🤖 Prompt for AI Agents
In `@pyinjective/proto/exchange/injective_auction_rpc_pb2_grpc.py` around lines
104 - 109, The generated servicer method AuctionAccountStatus has an unused
request parameter flagged by ARG002; to fix, either configure the linter to
ignore ARG002 for generated gRPC stubs (exclude files matching *_pb2_grpc.py) or
add a local suppression comment to the stub method (e.g., append a noqa for
ARG002 to the function signature or immediately inside the method) so the
generated file no longer triggers the lint error while leaving the generated
code otherwise unchanged.
| # Protobuf Python Version: 5.26.1 | ||
| """Generated protocol buffer code.""" | ||
| from google.protobuf import descriptor as _descriptor | ||
| from google.protobuf import descriptor_pool as _descriptor_pool | ||
| from google.protobuf import symbol_database as _symbol_database | ||
| from google.protobuf.internal import builder as _builder | ||
| # @@protoc_insertion_point(imports) | ||
|
|
||
| _sym_db = _symbol_database.Default() | ||
|
|
||
|
|
||
|
|
||
|
|
||
| DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x65xchange/injective_rfqrpc.proto\x12\x10injective_rfqrpc\"L\n\x0eRequestRequest\x12:\n\x07request\x18\x01 \x01(\x0b\x32 .injective_rfqrpc.RFQRequestTypeR\x07request\"\x91\x03\n\x0eRFQRequestType\x12\x15\n\x06rfq_id\x18\x01 \x01(\x04R\x05rfqId\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\x12\x1c\n\tdirection\x18\x03 \x01(\tR\tdirection\x12\x16\n\x06margin\x18\x04 \x01(\tR\x06margin\x12\x1a\n\x08quantity\x18\x05 \x01(\tR\x08quantity\x12\x1f\n\x0bworst_price\x18\x06 \x01(\tR\nworstPrice\x12\'\n\x0frequest_address\x18\x07 \x01(\tR\x0erequestAddress\x12\x16\n\x06\x65xpiry\x18\x08 \x01(\x04R\x06\x65xpiry\x12\x16\n\x06status\x18\t \x01(\tR\x06status\x12\x1d\n\ncreated_at\x18\n \x01(\x12R\tcreatedAt\x12\x1d\n\nupdated_at\x18\x0b \x01(\x12R\tupdatedAt\x12)\n\x10transaction_time\x18\x0c \x01(\x04R\x0ftransactionTime\x12\x16\n\x06height\x18\r \x01(\x04R\x06height\")\n\x0fRequestResponse\x12\x16\n\x06status\x18\x01 \x01(\tR\x06status\"5\n\x14StreamRequestRequest\x12\x1d\n\nmarket_ids\x18\x01 \x03(\tR\tmarketIds\"~\n\x15StreamRequestResponse\x12:\n\x07request\x18\x01 \x01(\x0b\x32 .injective_rfqrpc.RFQRequestTypeR\x07request\x12)\n\x10stream_operation\x18\x02 \x01(\tR\x0fstreamOperation\"D\n\x0cQuoteRequest\x12\x34\n\x05quote\x18\x01 \x01(\x0b\x32\x1e.injective_rfqrpc.RFQQuoteTypeR\x05quote\"\x95\x04\n\x0cRFQQuoteType\x12\x19\n\x08\x63hain_id\x18\x01 \x01(\tR\x07\x63hainId\x12)\n\x10\x63ontract_address\x18\x02 \x01(\tR\x0f\x63ontractAddress\x12\x1b\n\tmarket_id\x18\x03 \x01(\tR\x08marketId\x12\x15\n\x06rfq_id\x18\x04 \x01(\x04R\x05rfqId\x12\'\n\x0ftaker_direction\x18\x05 \x01(\tR\x0etakerDirection\x12\x16\n\x06margin\x18\x06 \x01(\tR\x06margin\x12\x1a\n\x08quantity\x18\x07 \x01(\tR\x08quantity\x12\x14\n\x05price\x18\x08 \x01(\tR\x05price\x12\x16\n\x06\x65xpiry\x18\t \x01(\x04R\x06\x65xpiry\x12\x14\n\x05maker\x18\n \x01(\tR\x05maker\x12\x14\n\x05taker\x18\x0b \x01(\tR\x05taker\x12\x1c\n\tsignature\x18\x0c \x01(\tR\tsignature\x12\x16\n\x06status\x18\r \x01(\tR\x06status\x12\x1d\n\ncreated_at\x18\x0e \x01(\x12R\tcreatedAt\x12\x1d\n\nupdated_at\x18\x0f \x01(\x12R\tupdatedAt\x12\x16\n\x06height\x18\x10 \x01(\x04R\x06height\x12\x1d\n\nevent_time\x18\x11 \x01(\x04R\teventTime\x12)\n\x10transaction_time\x18\x12 \x01(\x04R\x0ftransactionTime\"\'\n\rQuoteResponse\x12\x16\n\x06status\x18\x01 \x01(\tR\x06status\"2\n\x12StreamQuoteRequest\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"v\n\x13StreamQuoteResponse\x12\x34\n\x05quote\x18\x01 \x01(\x0b\x32\x1e.injective_rfqrpc.RFQQuoteTypeR\x05quote\x12)\n\x10stream_operation\x18\x02 \x01(\tR\x0fstreamOperation\"\x18\n\x16GetOpenRequestsRequest\"W\n\x17GetOpenRequestsResponse\x12<\n\x08requests\x18\x01 \x03(\x0b\x32 .injective_rfqrpc.RFQRequestTypeR\x08requests\"\x19\n\x17GetPendingQuotesRequest\"R\n\x18GetPendingQuotesResponse\x12\x36\n\x06quotes\x18\x01 \x03(\x0b\x32\x1e.injective_rfqrpc.RFQQuoteTypeR\x06quotes\"_\n\x15ListSettlementRequest\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\x12\x12\n\x04skip\x18\x02 \x01(\x12R\x04skip\x12\x14\n\x05limit\x18\x03 \x01(\x12R\x05limit\"u\n\x16ListSettlementResponse\x12\x45\n\x0bsettlements\x18\x01 \x03(\x0b\x32#.injective_rfqrpc.RFQSettlementTypeR\x0bsettlements\x12\x14\n\x05total\x18\x02 \x01(\x12R\x05total\"\xa2\x04\n\x11RFQSettlementType\x12\x15\n\x06rfq_id\x18\x01 \x01(\x04R\x05rfqId\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\x12\x14\n\x05taker\x18\x03 \x01(\tR\x05taker\x12\x1c\n\tdirection\x18\x04 \x01(\tR\tdirection\x12\x16\n\x06margin\x18\x05 \x01(\tR\x06margin\x12\x1a\n\x08quantity\x18\x06 \x01(\tR\x08quantity\x12\x1f\n\x0bworst_price\x18\x07 \x01(\tR\nworstPrice\x12Z\n\x0funfilled_action\x18\x08 \x01(\x0b\x32\x31.injective_rfqrpc.RFQSettlementUnfilledActionTypeR\x0eunfilledAction\x12+\n\x11\x66\x61llback_quantity\x18\t \x01(\tR\x10\x66\x61llbackQuantity\x12\'\n\x0f\x66\x61llback_margin\x18\n \x01(\tR\x0e\x66\x61llbackMargin\x12)\n\x10transaction_time\x18\x0b \x01(\x04R\x0ftransactionTime\x12\x1d\n\ncreated_at\x18\x0c \x01(\x12R\tcreatedAt\x12\x1d\n\nupdated_at\x18\r \x01(\x12R\tupdatedAt\x12\x1d\n\nevent_time\x18\x0e \x01(\x04R\teventTime\x12\x16\n\x06height\x18\x0f \x01(\x04R\x06height\"\xb0\x01\n\x1fRFQSettlementUnfilledActionType\x12\x44\n\x05limit\x18\x01 \x01(\x0b\x32..injective_rfqrpc.RFQSettlementLimitActionTypeR\x05limit\x12G\n\x06market\x18\x02 \x01(\x0b\x32/.injective_rfqrpc.RFQSettlementMarketActionTypeR\x06market\"4\n\x1cRFQSettlementLimitActionType\x12\x14\n\x05price\x18\x01 \x01(\tR\x05price\"\x1f\n\x1dRFQSettlementMarketActionType\"7\n\x17StreamSettlementRequest\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"\x8a\x01\n\x18StreamSettlementResponse\x12\x43\n\nsettlement\x18\x01 \x01(\x0b\x32#.injective_rfqrpc.RFQSettlementTypeR\nsettlement\x12)\n\x10stream_operation\x18\x02 \x01(\tR\x0fstreamOperation\"\x82\x01\n\x1bTakerStreamStreamingRequest\x12!\n\x0cmessage_type\x18\x01 \x01(\tR\x0bmessageType\x12@\n\x07request\x18\x02 \x01(\x0b\x32&.injective_rfqrpc.CreateRFQRequestTypeR\x07request\"\xee\x02\n\x14\x43reateRFQRequestType\x12\x15\n\x06rfq_id\x18\x01 \x01(\x04R\x05rfqId\x12\x1b\n\tmarket_id\x18\x02 \x01(\tR\x08marketId\x12\x1c\n\tdirection\x18\x03 \x01(\tR\tdirection\x12\x16\n\x06margin\x18\x04 \x01(\tR\x06margin\x12\x1a\n\x08quantity\x18\x05 \x01(\tR\x08quantity\x12\x1f\n\x0bworst_price\x18\x06 \x01(\tR\nworstPrice\x12\x16\n\x06\x65xpiry\x18\x07 \x01(\x04R\x06\x65xpiry\x12\x16\n\x06status\x18\x08 \x01(\tR\x06status\x12\x1d\n\ncreated_at\x18\t \x01(\x12R\tcreatedAt\x12\x1d\n\nupdated_at\x18\n \x01(\x12R\tupdatedAt\x12)\n\x10transaction_time\x18\x0b \x01(\x04R\x0ftransactionTime\x12\x16\n\x06height\x18\x0c \x01(\x04R\x06height\"\xe1\x01\n\x13TakerStreamResponse\x12!\n\x0cmessage_type\x18\x01 \x01(\tR\x0bmessageType\x12\x34\n\x05quote\x18\x02 \x01(\x0b\x32\x1e.injective_rfqrpc.RFQQuoteTypeR\x05quote\x12<\n\x0brequest_ack\x18\x03 \x01(\x0b\x32\x1b.injective_rfqrpc.StreamAckR\nrequestAck\x12\x33\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x1d.injective_rfqrpc.StreamErrorR\x05\x65rror\":\n\tStreamAck\x12\x15\n\x06rfq_id\x18\x01 \x01(\x04R\x05rfqId\x12\x16\n\x06status\x18\x02 \x01(\tR\x06status\"<\n\x0bStreamError\x12\x12\n\x04\x63ode\x18\x01 \x01(\tR\x04\x63ode\x12\x19\n\x08message_\x18\x02 \x01(\tR\x07message\"v\n\x1bMakerStreamStreamingRequest\x12!\n\x0cmessage_type\x18\x01 \x01(\tR\x0bmessageType\x12\x34\n\x05quote\x18\x02 \x01(\x0b\x32\x1e.injective_rfqrpc.RFQQuoteTypeR\x05quote\"\xe3\x01\n\x13MakerStreamResponse\x12!\n\x0cmessage_type\x18\x01 \x01(\tR\x0bmessageType\x12:\n\x07request\x18\x02 \x01(\x0b\x32 .injective_rfqrpc.RFQRequestTypeR\x07request\x12\x38\n\tquote_ack\x18\x03 \x01(\x0b\x32\x1b.injective_rfqrpc.StreamAckR\x08quoteAck\x12\x33\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x1d.injective_rfqrpc.StreamErrorR\x05\x65rror2\xe4\x07\n\x0fInjectiveRFQRPC\x12N\n\x07Request\x12 .injective_rfqrpc.RequestRequest\x1a!.injective_rfqrpc.RequestResponse\x12\x62\n\rStreamRequest\x12&.injective_rfqrpc.StreamRequestRequest\x1a\'.injective_rfqrpc.StreamRequestResponse0\x01\x12H\n\x05Quote\x12\x1e.injective_rfqrpc.QuoteRequest\x1a\x1f.injective_rfqrpc.QuoteResponse\x12\\\n\x0bStreamQuote\x12$.injective_rfqrpc.StreamQuoteRequest\x1a%.injective_rfqrpc.StreamQuoteResponse0\x01\x12\x66\n\x0fGetOpenRequests\x12(.injective_rfqrpc.GetOpenRequestsRequest\x1a).injective_rfqrpc.GetOpenRequestsResponse\x12i\n\x10GetPendingQuotes\x12).injective_rfqrpc.GetPendingQuotesRequest\x1a*.injective_rfqrpc.GetPendingQuotesResponse\x12\x63\n\x0eListSettlement\x12\'.injective_rfqrpc.ListSettlementRequest\x1a(.injective_rfqrpc.ListSettlementResponse\x12k\n\x10StreamSettlement\x12).injective_rfqrpc.StreamSettlementRequest\x1a*.injective_rfqrpc.StreamSettlementResponse0\x01\x12g\n\x0bTakerStream\x12-.injective_rfqrpc.TakerStreamStreamingRequest\x1a%.injective_rfqrpc.TakerStreamResponse(\x01\x30\x01\x12g\n\x0bMakerStream\x12-.injective_rfqrpc.MakerStreamStreamingRequest\x1a%.injective_rfqrpc.MakerStreamResponse(\x01\x30\x01\x42\x9d\x01\n\x14\x63om.injective_rfqrpcB\x14InjectiveRfqrpcProtoP\x01Z\x13/injective_rfqrpcpb\xa2\x02\x03IXX\xaa\x02\x0fInjectiveRfqrpc\xca\x02\x0fInjectiveRfqrpc\xe2\x02\x1bInjectiveRfqrpc\\GPBMetadata\xea\x02\x0fInjectiveRfqrpcb\x06proto3') |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find and examine dependency files for protobuf version constraints
fd -e toml -e txt -e cfg -e py -e lock 2>/dev/null | grep -E '(pyproject|requirements|setup|Pipfile|poetry|poetry\.lock)' | head -20Repository: InjectiveLabs/sdk-python
Length of output: 119
🏁 Script executed:
#!/bin/bash
# Check protobuf version constraints in all dependency files
echo "=== pyproject.toml ==="
cat pyproject.toml | grep -A 5 -B 5 protobuf || echo "No protobuf found in pyproject.toml"
echo -e "\n=== poetry.lock (protobuf entries) ==="
grep -A 10 'name = "protobuf"' poetry.lock | head -30
echo -e "\n=== Pipfile.lock (protobuf entries) ==="
grep -A 10 '"protobuf"' Pipfile.lock | head -30Repository: InjectiveLabs/sdk-python
Length of output: 1900
🏁 Script executed:
#!/bin/bash
# Verify the exact protobuf version from Pipfile.lock
python3 << 'EOF'
import json
import re
# Try to parse Pipfile.lock to find protobuf version
try:
with open('Pipfile.lock', 'r') as f:
pipfile_lock = json.load(f)
if 'default' in pipfile_lock and 'protobuf' in pipfile_lock['default']:
protobuf_info = pipfile_lock['default']['protobuf']
print(f"Pipfile.lock protobuf version: {protobuf_info.get('version', 'N/A')}")
except Exception as e:
print(f"Could not parse Pipfile.lock: {e}")
# Also check if grpcio version constraints exist
print("\n=== grpcio constraints ===")
with open('pyproject.toml', 'r') as f:
for line in f:
if 'grpcio' in line:
print(line.strip())
EOFRepository: InjectiveLabs/sdk-python
Length of output: 167
🏁 Script executed:
#!/bin/bash
# Check for API differences between protobuf 4.24.2 and 5.26.1
# Specifically around _builder import
python3 << 'EOF'
# Protobuf 5.x introduced significant changes to descriptor APIs
# The _builder module exists in both, but let's verify compatibility
print("=== Protobuf Version Mismatch Analysis ===")
print("\nDependency Configuration:")
print("- pyproject.toml declares: protobuf = \"^5.26.1\"")
print("- poetry.lock locks to: protobuf 5.29.5 ✓ (satisfies constraint)")
print("- Pipfile.lock locks to: protobuf 4.24.2 ✗ (does NOT satisfy constraint)")
print("\nGenerated file declares: Protobuf Python Version: 5.26.1")
print("\nRisk Analysis:")
print("1. Pipenv users will get protobuf 4.24.2 (major version mismatch)")
print("2. Poetry users will get protobuf 5.29.5 (compatible)")
print("3. The generated code may fail with protobuf 4.24.2 due to API changes")
print("\nCritical Issue: Pipfile.lock and pyproject.toml are out of sync")
EOFRepository: InjectiveLabs/sdk-python
Length of output: 653
🏁 Script executed:
#!/bin/bash
# Check if there are other generated proto files for comparison
fd -name "*_pb2.py" | head -5Repository: InjectiveLabs/sdk-python
Length of output: 298
🏁 Script executed:
#!/bin/bash
# Check proto files and their protobuf version declarations
find . -name "*_pb2.py" -type f | head -10Repository: InjectiveLabs/sdk-python
Length of output: 589
🏁 Script executed:
#!/bin/bash
# Check version declarations in multiple proto files
echo "=== Protobuf version declarations in generated files ==="
grep -h "Protobuf Python Version" ./pyinjective/proto/amino/amino_pb2.py ./pyinjective/proto/exchange/injective_rfqrpc_pb2.py ./pyinjective/proto/capability/v1/capability_pb2.py 2>/dev/null | sort | uniq -cRepository: InjectiveLabs/sdk-python
Length of output: 166
🏁 Script executed:
#!/bin/bash
# Verify the impact by checking if both dependency managers are actively maintained
echo "=== Checking which dependency managers are in use ==="
echo "pyproject.toml exists: $([ -f pyproject.toml ] && echo 'YES' || echo 'NO')"
echo "Pipfile exists: $([ -f Pipfile ] && echo 'YES' || echo 'NO')"
echo "poetry.lock exists: $([ -f poetry.lock ] && echo 'YES' || echo 'NO')"
echo "Pipfile.lock exists: $([ -f Pipfile.lock ] && echo 'YES' || echo 'NO')"
echo -e "\n=== Checking for poetry configuration ==="
grep -E '\[tool\.poetry\]|build-backend' pyproject.toml | head -3Repository: InjectiveLabs/sdk-python
Length of output: 316
Update Pipfile.lock to match protobuf dependency constraint.
The generated module targets Protobuf Python 5.26.1, but Pipfile.lock is pinned to protobuf 4.24.2 while pyproject.toml requires ^5.26.1. Pipenv users will install an incompatible version. Update Pipfile.lock by running pipenv lock to align with the pyproject.toml constraint and resolve the version mismatch.
🤖 Prompt for AI Agents
In `@pyinjective/proto/exchange/injective_rfqrpc_pb2.py` around lines 4 - 17, The
generated protobuf header indicates "Protobuf Python Version: 5.26.1" (see
DESCRIPTOR / the module top comment), but Pipfile.lock is pinned to protobuf
4.24.2; run pipenv lock to regenerate Pipfile.lock so it honors the
pyproject.toml constraint (^5.26.1) and update the lockfile in the PR, ensuring
the Pipfile.lock protobuf entry matches 5.26.1 (or a compatible 5.x) before
merging.
…breaking changes in the future
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@pyinjective/orderhash.py`:
- Around line 4-6: pyinjective/orderhash.py imports eth_pydantic_types.abi but
that package is only a transitive dependency; add eth-pydantic-types as a direct
dependency by updating the [tool.poetry.dependencies] section in pyproject.toml
to include eth-pydantic-types = "^0.2.4" so imports like eth_pydantic_types
(used in pyinjective/orderhash.py) are guaranteed at runtime.
Summary by CodeRabbit
New Features
Updates
Chores