Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ dmypy.json
cython_debug/

.idea

.chain_cookie
.exchange_cookie

.flakeheaven_cache
.vscode/settings.json
.python-version
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [1.13.0] - 2026-02-13
### Changed
- Updated all compiled protos for compatibility with Injective core v1.18.0 and Indexer v1.18.3
- Includes new proto definitions for the Chainlink Data Streams oracle

## [1.12.0] - 2025-11-10
### Changed
- Updated all compiled protos for compatibility with Injective core v1.17.0 and Indexer v1.17.16
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ clean-all:
$(call clean_repos)

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
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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
git ls-remote --tags https://github.com/InjectiveLabs/injective-indexer.git v1.18.3

Repository: InjectiveLabs/sdk-python

Length of output: 185


🏁 Script executed:

#!/bin/bash
# Find and examine the Makefile
git ls-files | grep -i makefile

Repository: 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
fi

Repository: InjectiveLabs/sdk-python

Length of output: 344


🏁 Script executed:

#!/bin/bash
# Search for injective references in the codebase
rg -i "injective" --max-count 20

Repository: InjectiveLabs/sdk-python

Length of output: 50382


🏁 Script executed:

#!/bin/bash
# Find all targets in Makefile and their dependencies
cat -n Makefile | head -41

Repository: InjectiveLabs/sdk-python

Length of output: 1525


🏁 Script executed:

#!/bin/bash
# Search for 'gen' target and clone dependencies
grep -n "gen\|clone" Makefile

Repository: 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.


clone-all: clone-injective-indexer

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ___

## License

Copyright © 2021 - 2025 Injective Labs Inc. (https://injectivelabs.org/)
Copyright © 2021 - 2026 Injective Labs Inc. (https://injectivelabs.org/)

<a href="https://drive.google.com/uc?export=view&id=1-fPQRh_D_dnun2yTtSsPW5MypVBOVYJP"><img src="https://drive.google.com/uc?export=view&id=1-fPQRh_D_dnun2yTtSsPW5MypVBOVYJP" style="width: 300px; max-width: 100%; height: auto" />

Expand Down
12 changes: 6 additions & 6 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ inputs:
- git_repo: https://github.com/InjectiveLabs/wasmd
tag: v0.53.3-inj.2
- git_repo: https://github.com/InjectiveLabs/cometbft
tag: v1.0.1-inj.4
tag: v1.0.1-inj.6
- git_repo: https://github.com/InjectiveLabs/cosmos-sdk
tag: v0.50.14-inj
tag: v0.50.14-inj.4
# - git_repo: https://github.com/InjectiveLabs/wasmd
# branch: v0.51.x-inj
# subdir: proto
- git_repo: https://github.com/InjectiveLabs/hyperlane-cosmos
tag: v1.0.1-inj
subdir: proto
- git_repo: https://github.com/InjectiveLabs/injective-core
tag: v1.17.0
tag: v1.18.0
subdir: proto
# - git_repo: https://github.com/InjectiveLabs/injective-core
# branch: master
# subdir: proto
# - git_repo: https://github.com/InjectiveLabs/injective-core
# branch: c-655/add_chainlink_data_streams_oracle
# subdir: proto
- directory: proto
2 changes: 1 addition & 1 deletion examples/chain_client/10_SearchLiquidablePositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def main() -> None:
adjusted_unit_margin = (adj_margin / quantity) * (-1 if is_long else 1)
maintenance_margin_ratio = client_market.maintenance_margin_ratio * (-1 if is_long else 1)

liquidation_price = (entry_price + adjusted_unit_margin) / (Decimal(1) + maintenance_margin_ratio)
liquidation_price = (entry_price + adjusted_unit_margin) / (Decimal("1") + maintenance_margin_ratio)

should_be_liquidated = (is_long and market_mark_price <= liquidation_price) or (
not is_long and market_mark_price >= liquidation_price
Expand Down
32 changes: 12 additions & 20 deletions examples/chain_client/1_LocalOrderHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,19 @@ async def main() -> None:
market_id=deriv_market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(10500),
quantity=Decimal(0.01),
margin=composer.calculate_margin(
quantity=Decimal(0.01), price=Decimal(10500), leverage=Decimal(2), is_reduce_only=False
),
price=Decimal("10500"),
quantity=Decimal("0.01"),
margin=Decimal("52.5"),
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.derivative_order(
market_id=deriv_market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(65111),
quantity=Decimal(0.01),
margin=composer.calculate_margin(
quantity=Decimal(0.01), price=Decimal(65111), leverage=Decimal(2), is_reduce_only=False
),
price=Decimal("65111"),
quantity=Decimal("0.01"),
margin=Decimal("325.555"),
order_type="SELL",
cid=str(uuid.uuid4()),
),
Expand Down Expand Up @@ -204,23 +200,19 @@ async def main() -> None:
market_id=deriv_market_id,
subaccount_id=subaccount_id_2,
fee_recipient=fee_recipient,
price=Decimal(25111),
quantity=Decimal(0.01),
margin=composer.calculate_margin(
quantity=Decimal(0.01), price=Decimal(25111), leverage=Decimal("1.5"), is_reduce_only=False
),
price=Decimal("25111"),
quantity=Decimal("0.01"),
margin=Decimal("167.406666666666666667"),
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.derivative_order(
market_id=deriv_market_id,
subaccount_id=subaccount_id_2,
fee_recipient=fee_recipient,
price=Decimal(65111),
quantity=Decimal(0.01),
margin=composer.calculate_margin(
quantity=Decimal(0.01), price=Decimal(25111), leverage=Decimal(2), is_reduce_only=False
),
price=Decimal("65111"),
quantity=Decimal("0.01"),
margin=Decimal("125.555"),
order_type="SELL",
cid=str(uuid.uuid4()),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ async def main() -> None:
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(50000),
quantity=Decimal(0.1),
margin=composer.calculate_margin(
quantity=Decimal(0.1), price=Decimal(50000), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("50000"),
quantity=Decimal("0.1"),
margin=Decimal("5000"),
order_type="SELL",
cid=str(uuid.uuid4()),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ async def main() -> None:
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(50000),
quantity=Decimal(0.1),
margin=composer.calculate_margin(
quantity=Decimal(0.1), price=Decimal(50000), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("50000"),
quantity=Decimal("0.1"),
margin=Decimal("5000"),
order_type="BUY",
cid=str(uuid.uuid4()),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ async def main() -> None:
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal("0.5"),
quantity=Decimal(1),
margin=composer.calculate_margin(
quantity=Decimal(1), price=Decimal("0.5"), leverage=Decimal(1), is_reduce_only=False
),
quantity=Decimal("1"),
margin=Decimal("0.5"),
cid=str(uuid.uuid4()),
)

Expand Down
8 changes: 3 additions & 5 deletions examples/chain_client/exchange/19_MsgLiquidatePosition.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ async def main() -> None:
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(39.01), # This should be the liquidation price
quantity=Decimal(0.147),
margin=composer.calculate_margin(
quantity=Decimal(0.147), price=Decimal(39.01), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("39.01"), # This should be the liquidation price
quantity=Decimal("0.147"),
margin=Decimal("5.73447"),
order_type="SELL",
cid=cid,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def main() -> None:
market_id=market_id,
source_subaccount_id=subaccount_id,
destination_subaccount_id=subaccount_id,
amount=Decimal(2),
amount=Decimal("2"),
)

# broadcast the transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def main() -> None:
# prepare trade info
market_id = "0xfafec40a7b93331c1fc89c23f66d11fbb48f38dfdd78f7f4fc4031fad90f6896"
status = "Demolished"
settlement_price = Decimal(1)
settlement_price = Decimal("1")
expiration_timestamp = 1685460582
settlement_timestamp = 1690730982

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def main() -> None:
market_id=market_id,
source_subaccount_id=subaccount_id,
destination_subaccount_id=subaccount_id,
amount=Decimal(2),
amount=Decimal("2"),
)

# broadcast the transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ async def main() -> None:
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(50000),
quantity=Decimal(0.1),
margin=composer.calculate_margin(
quantity=Decimal(0.1), price=Decimal(50000), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("50000"),
quantity=Decimal("0.1"),
margin=Decimal("5000"),
order_type="SELL",
cid=str(uuid.uuid4()),
expiration_block=latest_height + 10,
Expand Down
24 changes: 9 additions & 15 deletions examples/chain_client/exchange/9_MsgBatchUpdateOrders.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,19 @@ async def main() -> None:
market_id=derivative_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(25000),
quantity=Decimal(0.1),
margin=composer.calculate_margin(
quantity=Decimal(0.1), price=Decimal(25000), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("25000"),
quantity=Decimal("0.1"),
margin=Decimal("2500"),
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.derivative_order(
market_id=derivative_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(50000),
quantity=Decimal(0.01),
margin=composer.calculate_margin(
quantity=Decimal(0.01), price=Decimal(50000), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("50000"),
quantity=Decimal("0.01"),
margin=Decimal("500"),
order_type="SELL",
cid=str(uuid.uuid4()),
),
Expand All @@ -109,11 +105,9 @@ async def main() -> None:
market_id=derivative_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
price=Decimal(25100),
quantity=Decimal(0.1),
margin=composer.calculate_margin(
quantity=Decimal(0.1), price=Decimal(25100), leverage=Decimal(1), is_reduce_only=False
),
price=Decimal("25100"),
quantity=Decimal("0.1"),
margin=Decimal("2510"),
order_type="BUY",
cid=str(uuid.uuid4()),
),
Expand Down
3 changes: 2 additions & 1 deletion examples/chain_client/permissions/1_MsgCreateNamespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ async def main() -> None:
message = composer.msg_create_namespace(
sender=address.to_acc_bech32(),
denom=denom,
contract_hook="",
wasm_hook="",
role_permissions=[role1, role2, role3],
actor_roles=[actor_role1, actor_role2],
role_managers=[role_manager],
policy_statuses=[policy_status1, policy_status2],
policy_manager_capabilities=[policy_manager_capability],
evm_hook="",
)

# broadcast the transaction
Expand Down
3 changes: 2 additions & 1 deletion examples/chain_client/permissions/2_MsgUpdateNamespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ async def main() -> None:
message = composer.msg_update_namespace(
sender=address.to_acc_bech32(),
denom=denom,
contract_hook="inj19ld6swyldyujcn72j7ugnu9twafhs9wxlyye5m",
wasm_hook="inj19ld6swyldyujcn72j7ugnu9twafhs9wxlyye5m",
role_permissions=[role1, role2],
role_managers=[role_manager],
policy_statuses=[policy_status1, policy_status2],
policy_manager_capabilities=[policy_manager_capability],
evm_hook="",
)

# broadcast the transaction
Expand Down
2 changes: 1 addition & 1 deletion examples/exchange_client/oracle_rpc/3_OracleList.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async def main() -> None:
# select network: local, testnet, mainnet
network = Network.testnet()
client = IndexerClient(network)
oracle_list = await client.fetch_oracle_list()
oracle_list = await client.fetch_oracle_list(symbol="TIA", oracle_type="provider")
print(json.dumps(oracle_list, indent=2))


Expand Down
Loading