Skip to content

Commit 2c7bdaa

Browse files
committed
(feat) Updated proto definitions from injective-core with the candidate version for v1.13 upgrade
1 parent 1b00ad8 commit 2c7bdaa

File tree

611 files changed

+27381
-11261
lines changed

Some content is hidden

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

611 files changed

+27381
-11261
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ clean-all:
2828
$(call clean_repos)
2929

3030
clone-injective-core:
31-
git clone https://github.com/InjectiveLabs/injective-core.git -b v1.12.1 --depth 1 --single-branch
31+
git clone https://github.com/InjectiveLabs/injective-core.git -b feat-sdk-v0.50-migration --depth 1 --single-branch
3232

3333
clone-injective-indexer:
34-
git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.12.79.1 --depth 1 --single-branch
34+
git clone https://github.com/InjectiveLabs/injective-indexer.git -b fix/makefile --depth 1 --single-branch
3535

3636
clone-cometbft:
37-
git clone https://github.com/InjectiveLabs/cometbft.git -b v0.37.2-inj --depth 1 --single-branch
37+
git clone https://github.com/InjectiveLabs/cometbft.git -b v0.38.6-inj-2 --depth 1 --single-branch
3838

3939
clone-wasmd:
40-
git clone https://github.com/InjectiveLabs/wasmd.git -b v0.45.0-inj --depth 1 --single-branch
40+
git clone https://github.com/InjectiveLabs/wasmd.git -b v0.50.x-inj --depth 1 --single-branch
4141

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

4545
clone-ibc-go:
46-
git clone https://github.com/InjectiveLabs/ibc-go.git -b v7.2.0-inj --depth 1 --single-branch
46+
git clone https://github.com/InjectiveLabs/ibc-go.git -b v8.3.x-inj --depth 1 --single-branch
4747

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

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

pyinjective/composer.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ def msg_instant_spot_market_launch(
540540
quote_denom: str,
541541
min_price_tick_size: Decimal,
542542
min_quantity_tick_size: Decimal,
543+
min_notional: Decimal,
543544
) -> injective_exchange_tx_pb.MsgInstantSpotMarketLaunch:
544545
base_token = self.tokens[base_denom]
545546
quote_token = self.tokens[quote_denom]
@@ -550,6 +551,9 @@ def msg_instant_spot_market_launch(
550551
chain_min_quantity_tick_size = min_quantity_tick_size * Decimal(
551552
f"1e{base_token.decimals + ADDITIONAL_CHAIN_FORMAT_DECIMALS}"
552553
)
554+
chain_min_notional = min_notional * Decimal(
555+
f"1e{quote_token.decimals - base_token.decimals + ADDITIONAL_CHAIN_FORMAT_DECIMALS}"
556+
)
553557

554558
return injective_exchange_tx_pb.MsgInstantSpotMarketLaunch(
555559
sender=sender,
@@ -558,6 +562,7 @@ def msg_instant_spot_market_launch(
558562
quote_denom=quote_token.denom,
559563
min_price_tick_size=f"{chain_min_price_tick_size.normalize():f}",
560564
min_quantity_tick_size=f"{chain_min_quantity_tick_size.normalize():f}",
565+
min_notional=f"{chain_min_notional.normalize():f}",
561566
)
562567

563568
def msg_instant_perpetual_market_launch(
@@ -575,6 +580,7 @@ def msg_instant_perpetual_market_launch(
575580
maintenance_margin_ratio: Decimal,
576581
min_price_tick_size: Decimal,
577582
min_quantity_tick_size: Decimal,
583+
min_notional: Decimal,
578584
) -> injective_exchange_tx_pb.MsgInstantPerpetualMarketLaunch:
579585
quote_token = self.tokens[quote_denom]
580586

@@ -586,6 +592,7 @@ def msg_instant_perpetual_market_launch(
586592
chain_taker_fee_rate = taker_fee_rate * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
587593
chain_initial_margin_ratio = initial_margin_ratio * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
588594
chain_maintenance_margin_ratio = maintenance_margin_ratio * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
595+
chain_min_notional = min_notional * Decimal(f"1e{quote_token.decimals + ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
589596

590597
return injective_exchange_tx_pb.MsgInstantPerpetualMarketLaunch(
591598
sender=sender,
@@ -601,6 +608,7 @@ def msg_instant_perpetual_market_launch(
601608
maintenance_margin_ratio=f"{chain_maintenance_margin_ratio.normalize():f}",
602609
min_price_tick_size=f"{chain_min_price_tick_size.normalize():f}",
603610
min_quantity_tick_size=f"{chain_min_quantity_tick_size.normalize():f}",
611+
min_notional=f"{chain_min_notional.normalize():f}",
604612
)
605613

606614
def msg_instant_expiry_futures_market_launch(
@@ -619,6 +627,7 @@ def msg_instant_expiry_futures_market_launch(
619627
maintenance_margin_ratio: Decimal,
620628
min_price_tick_size: Decimal,
621629
min_quantity_tick_size: Decimal,
630+
min_notional: Decimal,
622631
) -> injective_exchange_tx_pb.MsgInstantPerpetualMarketLaunch:
623632
quote_token = self.tokens[quote_denom]
624633

@@ -630,6 +639,7 @@ def msg_instant_expiry_futures_market_launch(
630639
chain_taker_fee_rate = taker_fee_rate * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
631640
chain_initial_margin_ratio = initial_margin_ratio * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
632641
chain_maintenance_margin_ratio = maintenance_margin_ratio * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
642+
chain_min_notional = min_notional * Decimal(f"1e{quote_token.decimals + ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
633643

634644
return injective_exchange_tx_pb.MsgInstantExpiryFuturesMarketLaunch(
635645
sender=sender,
@@ -646,6 +656,7 @@ def msg_instant_expiry_futures_market_launch(
646656
maintenance_margin_ratio=f"{chain_maintenance_margin_ratio.normalize():f}",
647657
min_price_tick_size=f"{chain_min_price_tick_size.normalize():f}",
648658
min_quantity_tick_size=f"{chain_min_quantity_tick_size.normalize():f}",
659+
min_notional=f"{chain_min_notional.normalize():f}",
649660
)
650661

651662
def MsgCreateSpotLimitOrder(
@@ -1260,6 +1271,7 @@ def msg_instant_binary_options_market_launch(
12601271
quote_denom: str,
12611272
min_price_tick_size: Decimal,
12621273
min_quantity_tick_size: Decimal,
1274+
min_notional: Decimal,
12631275
) -> injective_exchange_tx_pb.MsgInstantPerpetualMarketLaunch:
12641276
quote_token = self.tokens[quote_denom]
12651277

@@ -1269,6 +1281,7 @@ def msg_instant_binary_options_market_launch(
12691281
chain_min_quantity_tick_size = min_quantity_tick_size * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
12701282
chain_maker_fee_rate = maker_fee_rate * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
12711283
chain_taker_fee_rate = taker_fee_rate * Decimal(f"1e{ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
1284+
chain_min_notional = min_notional * Decimal(f"1e{quote_token.decimals + ADDITIONAL_CHAIN_FORMAT_DECIMALS}")
12721285

12731286
return injective_exchange_tx_pb.MsgInstantBinaryOptionsMarketLaunch(
12741287
sender=sender,
@@ -1285,6 +1298,7 @@ def msg_instant_binary_options_market_launch(
12851298
quote_denom=quote_token.denom,
12861299
min_price_tick_size=f"{chain_min_price_tick_size.normalize():f}",
12871300
min_quantity_tick_size=f"{chain_min_quantity_tick_size.normalize():f}",
1301+
min_notional=f"{chain_min_notional.normalize():f}",
12881302
)
12891303

12901304
def MsgCreateBinaryOptionsLimitOrder(

pyinjective/proto/amino/amino_pb2.py

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
"""Client and server classes corresponding to protobuf-defined services."""
33
import grpc
4+
import warnings
45

6+
7+
GRPC_GENERATED_VERSION = '1.64.1'
8+
GRPC_VERSION = grpc.__version__
9+
EXPECTED_ERROR_RELEASE = '1.65.0'
10+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
11+
_version_not_supported = False
12+
13+
try:
14+
from grpc._utilities import first_version_is_lower
15+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
16+
except ImportError:
17+
_version_not_supported = True
18+
19+
if _version_not_supported:
20+
warnings.warn(
21+
f'The grpc package installed is at version {GRPC_VERSION},'
22+
+ f' but the generated code in amino/amino_pb2_grpc.py depends on'
23+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
24+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
25+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
26+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
27+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
28+
RuntimeWarning
29+
)

pyinjective/proto/capability/v1/capability_pb2.py

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2+
"""Client and server classes corresponding to protobuf-defined services."""
3+
import grpc
4+
import warnings
5+
6+
7+
GRPC_GENERATED_VERSION = '1.64.1'
8+
GRPC_VERSION = grpc.__version__
9+
EXPECTED_ERROR_RELEASE = '1.65.0'
10+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
11+
_version_not_supported = False
12+
13+
try:
14+
from grpc._utilities import first_version_is_lower
15+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
16+
except ImportError:
17+
_version_not_supported = True
18+
19+
if _version_not_supported:
20+
warnings.warn(
21+
f'The grpc package installed is at version {GRPC_VERSION},'
22+
+ f' but the generated code in capability/v1/capability_pb2_grpc.py depends on'
23+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
24+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
25+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
26+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
27+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
28+
RuntimeWarning
29+
)

0 commit comments

Comments
 (0)