Skip to content

Commit 7f39b06

Browse files
authored
Merge pull request #337 from InjectiveLabs/dev
Release v1.6.0
2 parents 6a9c390 + ea5c929 commit 7f39b06

File tree

673 files changed

+61535
-16155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

673 files changed

+61535
-16155
lines changed

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Install Python
14-
uses: actions/setup-python@v4
14+
uses: actions/setup-python@v5
1515

1616
- name: Install poetry
1717
run: python -m pip install poetry
1818
- name: Cache the virtualenv
1919
id: cache-venv
20-
uses: actions/cache@v3
20+
uses: actions/cache@v4
2121
with:
2222
path: ./.venv
2323
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010

1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: Install Python
15-
uses: actions/setup-python@v3
15+
uses: actions/setup-python@v5
1616
- name: Install poetry
1717
run: python -m pip install poetry
1818
- name: Publish package

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,38 @@
22

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

5+
## [1.6.0] - 2024-07-30
6+
### Added
7+
- Support for all queries in the chain "tendermint" module
8+
- Support for all queries in the "IBC Transfer" module
9+
- Support for all queries in the "IBC Channel" module
10+
- Support for all queries in the "IBC Client" module
11+
- Support for all queries in the "IBC Connection" module
12+
- Support for all queries and messages in the chain "permissions" module
13+
- Tokens initialization from the official tokens list in https://github.com/InjectiveLabs/injective-lists
14+
15+
### Changed
16+
- Updated all proto definitions based on chain upgrade to v1.13
17+
- Refactored cookies management logic to use all gRPC calls' responses to update the current cookies
18+
519
## [1.5.4] - 2024-07-03
620
### Changed
721
- Fixed all import statements in pyinjective.proto modules to make them explicit
822

23+
## [1.4.4] - 2024-07-03
24+
### Changed
25+
- Fixed all import statements in pyinjective.proto modules to make them explicit
26+
927
## [1.5.3] - 2024-06-12
1028
### Changed
1129
- Changed parameter `key` from the PaginationOption class.
1230
- Fixed an error when using the next page key in PaginationOption, causing incorrect pagination responses.
1331

32+
## [1.4.3] - 2024-06-06
33+
### Changed
34+
- Fixed `protobuf` dependency version to "<5" to for the v1.4 branch, because newer versions require a code refactoring (done in v1.5)
35+
- Fixed `protobuf` dependency version to "<5" for the v1.4 branch because newer versions require a code refactoring (done in v1.5)
36+
1437
## [1.5.2] - 2024-05-10
1538
### Changed
1639
- Updated `protobuf` dependency version to ">=5.26.1"

Makefile

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@ gen: gen-client
44

55
gen-client: clone-all copy-proto
66
mkdir -p ./pyinjective/proto
7-
@for dir in $(shell find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq); do \
8-
python3 -m grpc_tools.protoc \
9-
--proto_path=./proto \
10-
--python_out=./pyinjective/proto \
11-
--grpc_python_out=./pyinjective/proto \
12-
$$(find ./$${dir} -type f -name '*.proto'); \
13-
done
7+
buf generate --template buf.gen.yaml
148
rm -rf proto
159
$(call clean_repos)
16-
touch pyinjective/proto/__init__.py
17-
$(MAKE) fix-proto-imports
10+
$(MAKE) fix-generated-proto-imports
1811

1912
PROTO_MODULES := cosmwasm exchange gogoproto cosmos_proto cosmos testpb ibc amino tendermint injective
20-
fix-proto-imports:
13+
14+
fix-generated-proto-imports:
15+
@touch pyinjective/proto/__init__.py
2116
@for module in $(PROTO_MODULES); do \
2217
find ./pyinjective/proto -type f -name "*.py" -exec sed -i "" -e "s/from $${module}/from pyinjective.proto.$${module}/g" {} \; ; \
2318
done
@@ -35,39 +30,14 @@ endef
3530
clean-all:
3631
$(call clean_repos)
3732

38-
clone-injective-core:
39-
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.12.1 --depth 1 --single-branch
40-
4133
clone-injective-indexer:
42-
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.12.79.1 --depth 1 --single-branch
43-
44-
clone-cometbft:
45-
git clone https://github.com/InjectiveLabs/cometbft.git -b v0.37.2-inj --depth 1 --single-branch
46-
47-
clone-wasmd:
48-
git clone https://github.com/InjectiveLabs/wasmd.git -b v0.45.0-inj --depth 1 --single-branch
34+
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.13.4 --depth 1 --single-branch
4935

50-
clone-cosmos-sdk:
51-
git clone https://github.com/InjectiveLabs/cosmos-sdk.git -b v0.47.3-inj-9 --depth 1 --single-branch
52-
53-
clone-ibc-go:
54-
git clone https://github.com/InjectiveLabs/ibc-go.git -b v7.2.0-inj --depth 1 --single-branch
55-
56-
clone-all: clone-cosmos-sdk clone-cometbft clone-ibc-go clone-wasmd clone-injective-core clone-injective-indexer
36+
clone-all: clone-injective-indexer
5737

5838
copy-proto:
5939
rm -rf pyinjective/proto
6040
mkdir -p proto/exchange
61-
buf export ./cosmos-sdk --output=third_party
62-
buf export ./ibc-go --exclude-imports --output=third_party
63-
buf export ./cometbft --exclude-imports --output=third_party
64-
buf export ./wasmd --exclude-imports --output=third_party
65-
buf export https://github.com/cosmos/ics23.git --exclude-imports --output=third_party
66-
cp -r injective-core/proto/injective proto/
67-
cp -r third_party/* proto/
68-
69-
rm -rf ./third_party
70-
7141
find ./injective-indexer/api/gen/grpc -type f -name "*.proto" -exec cp {} ./proto/exchange/ \;
7242

7343
tests:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sudo dnf install python3-devel autoconf automake gcc gcc-c++ libffi-devel libtoo
1616
**macOS**
1717

1818
```bash
19-
brew install autoconf automake libtool
19+
brew install autoconf automake libtool bufbuild/buf/buf
2020
```
2121

2222
### Quick Start
@@ -67,7 +67,7 @@ Upgrade `pip` to the latest version, if you see these warnings:
6767

6868
3. Fetch latest denom config
6969
```
70-
poetry run python pyinjective/fetch_metadata.py
70+
poetry run python pyinjective/utils/fetch_metadata.py
7171
```
7272

7373
Note that the [sync client](https://github.com/InjectiveLabs/sdk-python/blob/master/pyinjective/client.py) has been deprecated as of April 18, 2022. If you are using the sync client please make sure to transition to the [async client](https://github.com/InjectiveLabs/sdk-python/blob/master/pyinjective/async_client.py), for more information read [here](https://github.com/InjectiveLabs/sdk-python/issues/101)

buf.gen.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: v2
2+
managed:
3+
enabled: true
4+
plugins:
5+
- remote: buf.build/protocolbuffers/python
6+
out: ./pyinjective/proto/
7+
- remote: buf.build/grpc/python
8+
out: ./pyinjective/proto/
9+
inputs:
10+
- module: buf.build/cosmos/cosmos-proto
11+
- module: buf.build/cosmos/gogo-proto
12+
- module: buf.build/googleapis/googleapis
13+
- module: buf.build/cosmos/ics23
14+
- git_repo: https://github.com/InjectiveLabs/cosmos-sdk
15+
tag: v0.50.8-inj-0
16+
- git_repo: https://github.com/InjectiveLabs/ibc-go
17+
tag: v8.3.2-inj-0
18+
- git_repo: https://github.com/InjectiveLabs/wasmd
19+
tag: v0.51.0-inj-0
20+
# - git_repo: https://github.com/InjectiveLabs/wasmd
21+
# branch: v0.51.x-inj
22+
# subdir: proto
23+
- git_repo: https://github.com/InjectiveLabs/injective-core
24+
tag: v1.13.0
25+
subdir: proto
26+
# - git_repo: https://github.com/InjectiveLabs/injective-core
27+
# branch: master
28+
# subdir: proto
29+
- directory: proto

examples/chain_client/exchange/13_MsgInstantBinaryOptionsMarketLaunch.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import os
3+
from decimal import Decimal
34

45
import dotenv
56

@@ -40,14 +41,15 @@ async def main() -> None:
4041
oracle_provider="UFC",
4142
oracle_type="Provider",
4243
oracle_scale_factor=6,
43-
maker_fee_rate=0.0005, # 0.05%
44-
taker_fee_rate=0.0010, # 0.10%
44+
maker_fee_rate=Decimal("0.0005"), # 0.05%
45+
taker_fee_rate=Decimal("0.0010"), # 0.10%
4546
expiration_timestamp=1680730982,
4647
settlement_timestamp=1690730982,
4748
admin=address.to_acc_bech32(),
4849
quote_denom="peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
49-
min_price_tick_size=0.01,
50-
min_quantity_tick_size=0.01,
50+
min_price_tick_size=Decimal("0.01"),
51+
min_quantity_tick_size=Decimal("0.01"),
52+
min_notional=Decimal("1"),
5153
)
5254

5355
# broadcast the transaction

examples/chain_client/exchange/3_MsgInstantSpotMarketLaunch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ async def main() -> None:
4242
quote_denom="USDC",
4343
min_price_tick_size=Decimal("0.001"),
4444
min_quantity_tick_size=Decimal("0.01"),
45+
min_notional=Decimal("1"),
4546
)
4647

4748
# broadcast the transaction

examples/chain_client/exchange/4_MsgInstantPerpetualMarketLaunch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ async def main() -> None:
4949
maintenance_margin_ratio=Decimal("0.095"),
5050
min_price_tick_size=Decimal("0.001"),
5151
min_quantity_tick_size=Decimal("0.01"),
52+
min_notional=Decimal("1"),
5253
)
5354

5455
# broadcast the transaction

examples/chain_client/exchange/5_MsgInstantExpiryFuturesMarketLaunch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ async def main() -> None:
5050
maintenance_margin_ratio=Decimal("0.095"),
5151
min_price_tick_size=Decimal("0.001"),
5252
min_quantity_tick_size=Decimal("0.01"),
53+
min_notional=Decimal("1"),
5354
)
5455

5556
# broadcast the transaction

0 commit comments

Comments
 (0)