Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.6.0 #337

Merged
merged 86 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
2016ad7
(feat) Added support for tendermint module queries
Mar 14, 2024
75a982e
(fix) Updated changelog and version number
Mar 14, 2024
136174c
(fix) Fixed typo
Mar 14, 2024
6b102f2
(fix) Fixed typo
Mar 14, 2024
211b888
(feat) Added support for tendermint module queries
Mar 14, 2024
60202fc
(fix) Updated changelog and version number
Mar 14, 2024
94726dd
(fix) Fixed typo
Mar 14, 2024
3f0254c
(fix) Fixed typo
Mar 14, 2024
cdd4bb9
Merge branch 'feat/tendermint_module_queries' of https://github.com/I…
Mar 14, 2024
8adf955
Merge pull request #313 from InjectiveLabs/feat/tendermint_module_que…
aarmoa Mar 14, 2024
5eb92af
(feat) Refactored cookies processing. Removed the Kubernetes cookies …
Mar 19, 2024
27acd84
(feat) Removed no longer necessary cookies methods in the AsyncClient
Mar 19, 2024
3bd98e5
(fix) Fix cookies admin test to use a ZoneInfo compatible with Window…
Mar 19, 2024
b65aeeb
(fix) Fix cookies admin test to use a ZoneInfo compatible with Window…
Mar 19, 2024
378e2ac
(fix) Fix cookies admin test to use a ZoneInfo compatible with Window…
Mar 19, 2024
1fae35f
Merge pull request #314 from InjectiveLabs/feat/reduce_calls_for_cookies
aarmoa Mar 26, 2024
40cff4b
(feat) Added support for IBC transfer module queries and the transfer…
Apr 10, 2024
3d9761d
(fix) Updated changelog
Apr 10, 2024
3165d58
Merge pull request #317 from InjectiveLabs/feat/add_ibc_transfer_support
aarmoa Apr 11, 2024
5207456
(feat) Added IBC Core Channel module queries, with unit tests and exa…
Apr 12, 2024
72407b4
Merge pull request #318 from InjectiveLabs/feat/ibc_core_channel_modu…
aarmoa Apr 15, 2024
5998b5e
(feat) Refactoring in Network class to support mixed secure and insec…
Apr 18, 2024
105723b
Merge branch 'feat/refactor_network_mixed_secure_insecure_channels' o…
Apr 18, 2024
79a4eb3
(fix) Fix issue when creating gRPC channels (we need to use grpc.aio …
Apr 19, 2024
d8192bb
Merge pull request #320 from InjectiveLabs/feat/network_refactoring_f…
aarmoa Apr 19, 2024
3f777fb
(feat) Added support for all IBC Core Client queries. Included exampl…
Apr 22, 2024
e074077
Update CHANGELOG.md
aarmoa Apr 22, 2024
71e7f0c
Merge pull request #321 from InjectiveLabs/feat/ibc_client_module_que…
aarmoa Apr 22, 2024
1c592e0
(feat) Added support for all queries in the IBC Core Connection modul…
Apr 25, 2024
e185d46
(fix) Updated dependencies
Apr 25, 2024
961884a
(fix) Update GitHub actions dependencies versions
Apr 25, 2024
58f62c2
(fix) Fix issue in GitHub workflow to run tests
Apr 25, 2024
0631678
(fix) Fix GitHub workflow configuration for tests run
Apr 25, 2024
0de78e7
Merge pull request #322 from InjectiveLabs/feat/ibc_connection_module…
aarmoa Apr 25, 2024
abdbede
(fix) Updated IBC Core Connection params request example script
Apr 25, 2024
37c5170
Merge pull request #323 from InjectiveLabs/fix/update_connection_para…
aarmoa Apr 25, 2024
d921dca
Merge branch 'master' of https://github.com/InjectiveLabs/sdk-python …
May 2, 2024
ad3f2f6
(fix) Fixed remaining usage of the deprecated parameter always_print_…
May 3, 2024
1d35d8d
Merge pull request #325 from InjectiveLabs/fix/sync_dev_with_v151
aarmoa May 3, 2024
4a423df
(feat) Added logic to load all tokens from the official tokens file i…
May 5, 2024
89b0f01
(fix) Updated changelog file
May 6, 2024
f59766b
(fix) Fixed failing unit tests
May 7, 2024
0d41383
(fix) Added exception handling to prevent connection issues from brak…
May 7, 2024
9e8fc8a
(fix) Updated dependencis in poetry lock file
May 7, 2024
355c3a9
(fix) Added unit test for AsyncClient tokens loading logic, to improv…
May 8, 2024
822bc90
Merge pull request #327 from InjectiveLabs/feat/load_official_tokens_…
aarmoa May 8, 2024
9d02df2
Merge branch 'master' of https://github.com/InjectiveLabs/sdk-python …
aarmoa Jun 6, 2024
4562e90
(fix) Updated poetry lock file
aarmoa Jun 6, 2024
df0a83c
Update CHANGELOG.md
aarmoa Jun 6, 2024
1b00ad8
Merge pull request #330 from InjectiveLabs/feat/sync_dev_with_master_…
aarmoa Jun 6, 2024
2c7bdaa
(feat) Updated proto definitions from injective-core with the candida…
aarmoa Jun 10, 2024
5ca69e4
(feat) Synchronized dev branch with master after releasing v1.5.4
aarmoa Jul 3, 2024
07d0427
(fix) Updated proto definitions
aarmoa Jul 3, 2024
c513f80
Merge pull request #335 from InjectiveLabs/feat/sync_dev_with_master_…
aarmoa Jul 3, 2024
987f25b
(feat) Refactored composer unit tests to always compare the construct…
aarmoa Jul 5, 2024
c8ac1b9
Merge pull request #336 from InjectiveLabs/fix/refactor_composer_unit…
aarmoa Jul 5, 2024
379ebf6
(fix) Solved issue when processing the PaginationOption next page key…
aarmoa Jun 11, 2024
4f3ebbe
(fix) Updated version number and CHANGELOG.md
aarmoa Jun 11, 2024
b786e42
(fix) Update poetry.lock file
aarmoa Jun 12, 2024
e3b4156
(fix) Updated Makefile gen-client script to make imports in proto mod…
aarmoa Jul 3, 2024
c11318d
(fix) Updated version number and CHANGELOG file
aarmoa Jul 3, 2024
c09c45b
(fix) Updated proto definitions
aarmoa Jul 3, 2024
42e2629
(feat) Refactored composer unit tests to always compare the construct…
aarmoa Jul 5, 2024
78c813d
(feat) Updated proto definitions from injective-core with the candida…
aarmoa Jun 10, 2024
37cdcce
(fix) Updated all proto definitions, including the new Indexer versio…
aarmoa Jul 4, 2024
ffaf19c
(feat) Updated proto definitions from injective-core with the candida…
aarmoa Jun 10, 2024
bb76bad
(fix) Fix failing tests in composer unit tests
aarmoa Jul 5, 2024
2a63051
(fix) Updated proto definitions
aarmoa Jul 8, 2024
5999886
(fix) Updated proto definitions from latest injective-core and inject…
aarmoa Jul 10, 2024
99545c4
(fix) Updated compiled protos with the latest changes from the inject…
aarmoa Jul 18, 2024
ddebcba
(fix) Update denoms INI files
aarmoa Jul 18, 2024
6317b0a
Merge branch 'dev' of https://github.com/InjectiveLabs/sdk-python int…
aarmoa Jul 18, 2024
2592c59
(fix) Updated compiled protos with the latest changes from the inject…
aarmoa Jul 18, 2024
6a6d293
(fix) Remove coins from denom INI files that have a name including no…
aarmoa Jul 18, 2024
83f8030
(fix) Remove coins from denom INI files that have a name including no…
aarmoa Jul 18, 2024
69e77b3
(fix) Changed version to RC1 in pyproject.toml
aarmoa Jul 18, 2024
856c464
(fix) Update dependencies in poetry.lock
aarmoa Jul 26, 2024
cb62eb9
(feat) Added support for permissions module's messages and queries
aarmoa Jul 29, 2024
25e9dbf
(fix) Regenerated all compiled protos. Updated CreateDenom message te…
aarmoa Jul 29, 2024
b2c569c
(fix) Updated pyproject version and CHANGELOG.md file
aarmoa Jul 29, 2024
572d3ad
Merge pull request #332 from InjectiveLabs/feat/update_dependencies_c…
aarmoa Jul 29, 2024
6bc6d27
(fix) Fixed an issue in the code that loads tokens from the official …
aarmoa Jul 30, 2024
716a628
Merge pull request #338 from InjectiveLabs/fix/solve_token_list_parsi…
aarmoa Jul 30, 2024
ab3371e
(feat) Added the method in Composer, to allow order cancellation jus…
aarmoa Jul 30, 2024
2ab34b3
Merge branch 'dev' into feat/add_order_data_creation_without_order_mask
aarmoa Jul 30, 2024
ea5c929
Merge pull request #339 from InjectiveLabs/feat/add_order_data_creati…
aarmoa Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5

- name: Install poetry
run: python -m pip install poetry
- name: Cache the virtualenv
id: cache-venv
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
- name: Install poetry
run: python -m pip install poetry
- name: Publish package
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,38 @@

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

## [1.6.0] - 2024-07-30
### Added
- Support for all queries in the chain "tendermint" module
- Support for all queries in the "IBC Transfer" module
- Support for all queries in the "IBC Channel" module
- Support for all queries in the "IBC Client" module
- Support for all queries in the "IBC Connection" module
- Support for all queries and messages in the chain "permissions" module
- Tokens initialization from the official tokens list in https://github.com/InjectiveLabs/injective-lists

### Changed
- Updated all proto definitions based on chain upgrade to v1.13
- Refactored cookies management logic to use all gRPC calls' responses to update the current cookies

## [1.5.4] - 2024-07-03
### Changed
- Fixed all import statements in pyinjective.proto modules to make them explicit

## [1.4.4] - 2024-07-03
### Changed
- Fixed all import statements in pyinjective.proto modules to make them explicit

## [1.5.3] - 2024-06-12
### Changed
- Changed parameter `key` from the PaginationOption class.
- Fixed an error when using the next page key in PaginationOption, causing incorrect pagination responses.

## [1.4.3] - 2024-06-06
### Changed
- Fixed `protobuf` dependency version to "<5" to for the v1.4 branch, because newer versions require a code refactoring (done in v1.5)
- Fixed `protobuf` dependency version to "<5" for the v1.4 branch because newer versions require a code refactoring (done in v1.5)

## [1.5.2] - 2024-05-10
### Changed
- Updated `protobuf` dependency version to ">=5.26.1"
Expand Down
44 changes: 7 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@ gen: gen-client

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

PROTO_MODULES := cosmwasm exchange gogoproto cosmos_proto cosmos testpb ibc amino tendermint injective
fix-proto-imports:

fix-generated-proto-imports:
@touch pyinjective/proto/__init__.py
@for module in $(PROTO_MODULES); do \
find ./pyinjective/proto -type f -name "*.py" -exec sed -i "" -e "s/from $${module}/from pyinjective.proto.$${module}/g" {} \; ; \
done
Expand All @@ -35,39 +30,14 @@ endef
clean-all:
$(call clean_repos)

clone-injective-core:
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.12.1 --depth 1 --single-branch

clone-injective-indexer:
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.12.79.1 --depth 1 --single-branch

clone-cometbft:
git clone https://github.com/InjectiveLabs/cometbft.git -b v0.37.2-inj --depth 1 --single-branch

clone-wasmd:
git clone https://github.com/InjectiveLabs/wasmd.git -b v0.45.0-inj --depth 1 --single-branch
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.13.4 --depth 1 --single-branch

clone-cosmos-sdk:
git clone https://github.com/InjectiveLabs/cosmos-sdk.git -b v0.47.3-inj-9 --depth 1 --single-branch

clone-ibc-go:
git clone https://github.com/InjectiveLabs/ibc-go.git -b v7.2.0-inj --depth 1 --single-branch

clone-all: clone-cosmos-sdk clone-cometbft clone-ibc-go clone-wasmd clone-injective-core clone-injective-indexer
clone-all: clone-injective-indexer

copy-proto:
rm -rf pyinjective/proto
mkdir -p proto/exchange
buf export ./cosmos-sdk --output=third_party
buf export ./ibc-go --exclude-imports --output=third_party
buf export ./cometbft --exclude-imports --output=third_party
buf export ./wasmd --exclude-imports --output=third_party
buf export https://github.com/cosmos/ics23.git --exclude-imports --output=third_party
cp -r injective-core/proto/injective proto/
cp -r third_party/* proto/

rm -rf ./third_party

find ./injective-indexer/api/gen/grpc -type f -name "*.proto" -exec cp {} ./proto/exchange/ \;

tests:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sudo dnf install python3-devel autoconf automake gcc gcc-c++ libffi-devel libtoo
**macOS**

```bash
brew install autoconf automake libtool
brew install autoconf automake libtool bufbuild/buf/buf
```

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

3. Fetch latest denom config
```
poetry run python pyinjective/fetch_metadata.py
poetry run python pyinjective/utils/fetch_metadata.py
```

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)
Expand Down
29 changes: 29 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: v2
managed:
enabled: true
plugins:
- remote: buf.build/protocolbuffers/python
out: ./pyinjective/proto/
- remote: buf.build/grpc/python
out: ./pyinjective/proto/
inputs:
- module: buf.build/cosmos/cosmos-proto
- module: buf.build/cosmos/gogo-proto
- module: buf.build/googleapis/googleapis
- module: buf.build/cosmos/ics23
- git_repo: https://github.com/InjectiveLabs/cosmos-sdk
tag: v0.50.8-inj-0
- git_repo: https://github.com/InjectiveLabs/ibc-go
tag: v8.3.2-inj-0
- git_repo: https://github.com/InjectiveLabs/wasmd
tag: v0.51.0-inj-0
# - git_repo: https://github.com/InjectiveLabs/wasmd
# branch: v0.51.x-inj
# subdir: proto
- git_repo: https://github.com/InjectiveLabs/injective-core
tag: v1.13.0
subdir: proto
# - git_repo: https://github.com/InjectiveLabs/injective-core
# branch: master
# subdir: proto
- directory: proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import os
from decimal import Decimal

import dotenv

Expand Down Expand Up @@ -40,14 +41,15 @@ async def main() -> None:
oracle_provider="UFC",
oracle_type="Provider",
oracle_scale_factor=6,
maker_fee_rate=0.0005, # 0.05%
taker_fee_rate=0.0010, # 0.10%
maker_fee_rate=Decimal("0.0005"), # 0.05%
taker_fee_rate=Decimal("0.0010"), # 0.10%
expiration_timestamp=1680730982,
settlement_timestamp=1690730982,
admin=address.to_acc_bech32(),
quote_denom="peggy0xdAC17F958D2ee523a2206206994597C13D831ec7",
min_price_tick_size=0.01,
min_quantity_tick_size=0.01,
min_price_tick_size=Decimal("0.01"),
min_quantity_tick_size=Decimal("0.01"),
min_notional=Decimal("1"),
)

# broadcast the transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async def main() -> None:
quote_denom="USDC",
min_price_tick_size=Decimal("0.001"),
min_quantity_tick_size=Decimal("0.01"),
min_notional=Decimal("1"),
)

# broadcast the transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def main() -> None:
maintenance_margin_ratio=Decimal("0.095"),
min_price_tick_size=Decimal("0.001"),
min_quantity_tick_size=Decimal("0.01"),
min_notional=Decimal("1"),
)

# broadcast the transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async def main() -> None:
maintenance_margin_ratio=Decimal("0.095"),
min_price_tick_size=Decimal("0.001"),
min_quantity_tick_size=Decimal("0.01"),
min_notional=Decimal("1"),
)

# broadcast the transaction
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequences = [1, 2]
pagination = PaginationOption(skip=2, limit=4)

acknowledgements = await client.fetch_ibc_packet_acknowledgements(
port_id=port_id,
channel_id=channel_id,
packet_commitment_sequences=sequences,
pagination=pagination,
)
print(acknowledgements)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/11_UnreceivedPackets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

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


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"
sequences = [1, 2]

packets = await client.fetch_ibc_unreceived_packets(
port_id=port_id, channel_id=channel_id, packet_commitment_sequences=sequences
)
print(packets)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/12_UnreceivedAcks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

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


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

acks = await client.fetch_ibc_unreceived_acks(
port_id=port_id,
channel_id=channel_id,
)
print(acks)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
25 changes: 25 additions & 0 deletions examples/chain_client/ibc/channel/query/13_NextSequenceReceive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import asyncio

from google.protobuf import symbol_database

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


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

sequence = await client.fetch_next_sequence_receive(
port_id=port_id,
channel_id=channel_id,
)
print(sequence)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
22 changes: 22 additions & 0 deletions examples/chain_client/ibc/channel/query/1_Channel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import asyncio

from google.protobuf import symbol_database

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


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

port_id = "transfer"
channel_id = "channel-126"

channel = await client.fetch_ibc_channel(port_id=port_id, channel_id=channel_id)
print(channel)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
22 changes: 22 additions & 0 deletions examples/chain_client/ibc/channel/query/2_Channels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import asyncio

from google.protobuf import symbol_database

from pyinjective.async_client import AsyncClient
from pyinjective.client.model.pagination import PaginationOption
from pyinjective.core.network import Network


async def main() -> None:
network = Network.testnet()
client = AsyncClient(network)

pagination = PaginationOption(skip=2, limit=4)

channels = await client.fetch_ibc_channels(pagination=pagination)
print(channels)


if __name__ == "__main__":
symbol_db = symbol_database.Default()
asyncio.get_event_loop().run_until_complete(main())
Loading
Loading