From 6fba3c4bd092c3ae3f94fc16baf86a2dd49dc54a Mon Sep 17 00:00:00 2001 From: abel Date: Mon, 8 Jan 2024 12:49:13 -0300 Subject: [PATCH 1/2] (feat) Migrated all proto definitions to injective-core and injective-indexer for the chain upgrade to v1.12 --- Makefile | 2 +- ...tadata.py => 68_DenomAuthorityMetadata.py} | 5 +- .../injective/insurance/v1beta1/events_pb2.py | 46 +++++++++++++++++++ .../insurance/v1beta1/events_pb2_grpc.py | 4 ++ .../insurance/v1beta1/insurance_pb2.py | 16 +------ 5 files changed, 56 insertions(+), 17 deletions(-) rename examples/chain_client/{68_AuthorityDenomMetadata.py => 68_DenomAuthorityMetadata.py} (66%) create mode 100644 pyinjective/proto/injective/insurance/v1beta1/events_pb2.py create mode 100644 pyinjective/proto/injective/insurance/v1beta1/events_pb2_grpc.py diff --git a/Makefile b/Makefile index df6ea1ea..c8c904d6 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ clean-all: $(call clean_repos) clone-injective-core: - git clone https://github.com/InjectiveLabs/injective-core.git -b v1.12.9-testnet --depth 1 --single-branch + git clone https://github.com/InjectiveLabs/injective-core.git -b v1.12.0 --depth 1 --single-branch clone-injective-indexer: git clone https://github.com/InjectiveLabs/injective-indexer.git -b v1.12.72 --depth 1 --single-branch diff --git a/examples/chain_client/68_AuthorityDenomMetadata.py b/examples/chain_client/68_DenomAuthorityMetadata.py similarity index 66% rename from examples/chain_client/68_AuthorityDenomMetadata.py rename to examples/chain_client/68_DenomAuthorityMetadata.py index f5ebaab5..0abd7801 100644 --- a/examples/chain_client/68_AuthorityDenomMetadata.py +++ b/examples/chain_client/68_DenomAuthorityMetadata.py @@ -7,7 +7,10 @@ async def main() -> None: network = Network.testnet() client = AsyncClient(network) - metadata = await client.fetch_denom_authority_metadata(creator="inj1zvy8xrlhe7ex9scer868clfstdv7j6vz790kwa") + metadata = await client.fetch_denom_authority_metadata( + creator="inj1uv6psuupldve0c9n3uezqlecadszqexv5vxx04", + sub_denom="position", + ) print(metadata) diff --git a/pyinjective/proto/injective/insurance/v1beta1/events_pb2.py b/pyinjective/proto/injective/insurance/v1beta1/events_pb2.py new file mode 100644 index 00000000..2ee48628 --- /dev/null +++ b/pyinjective/proto/injective/insurance/v1beta1/events_pb2.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: injective/insurance/v1beta1/events.proto +"""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() + + +from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 +from injective.insurance.v1beta1 import insurance_pb2 as injective_dot_insurance_dot_v1beta1_dot_insurance__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(injective/insurance/v1beta1/events.proto\x12\x1binjective.insurance.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a+injective/insurance/v1beta1/insurance.proto\"T\n\x18\x45ventInsuranceFundUpdate\x12\x38\n\x04\x66und\x18\x01 \x01(\x0b\x32*.injective.insurance.v1beta1.InsuranceFund\"[\n\x16\x45ventRequestRedemption\x12\x41\n\x08schedule\x18\x01 \x01(\x0b\x32/.injective.insurance.v1beta1.RedemptionSchedule\"\x92\x01\n\x17\x45ventWithdrawRedemption\x12\x41\n\x08schedule\x18\x01 \x01(\x0b\x32/.injective.insurance.v1beta1.RedemptionSchedule\x12\x34\n\x0bredeem_coin\x18\x02 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\x9b\x01\n\x0f\x45ventUnderwrite\x12\x13\n\x0bunderwriter\x18\x01 \x01(\t\x12\x10\n\x08marketId\x18\x02 \x01(\t\x12\x30\n\x07\x64\x65posit\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12/\n\x06shares\x18\x04 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"w\n\x16\x45ventInsuranceWithdraw\x12\x11\n\tmarket_id\x18\x01 \x01(\t\x12\x15\n\rmarket_ticker\x18\x02 \x01(\t\x12\x33\n\nwithdrawal\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x42QZOgithub.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/typesb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'injective.insurance.v1beta1.events_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZOgithub.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/types' + _EVENTWITHDRAWREDEMPTION.fields_by_name['redeem_coin']._options = None + _EVENTWITHDRAWREDEMPTION.fields_by_name['redeem_coin']._serialized_options = b'\310\336\037\000' + _EVENTUNDERWRITE.fields_by_name['deposit']._options = None + _EVENTUNDERWRITE.fields_by_name['deposit']._serialized_options = b'\310\336\037\000' + _EVENTUNDERWRITE.fields_by_name['shares']._options = None + _EVENTUNDERWRITE.fields_by_name['shares']._serialized_options = b'\310\336\037\000' + _EVENTINSURANCEWITHDRAW.fields_by_name['withdrawal']._options = None + _EVENTINSURANCEWITHDRAW.fields_by_name['withdrawal']._serialized_options = b'\310\336\037\000' + _globals['_EVENTINSURANCEFUNDUPDATE']._serialized_start=172 + _globals['_EVENTINSURANCEFUNDUPDATE']._serialized_end=256 + _globals['_EVENTREQUESTREDEMPTION']._serialized_start=258 + _globals['_EVENTREQUESTREDEMPTION']._serialized_end=349 + _globals['_EVENTWITHDRAWREDEMPTION']._serialized_start=352 + _globals['_EVENTWITHDRAWREDEMPTION']._serialized_end=498 + _globals['_EVENTUNDERWRITE']._serialized_start=501 + _globals['_EVENTUNDERWRITE']._serialized_end=656 + _globals['_EVENTINSURANCEWITHDRAW']._serialized_start=658 + _globals['_EVENTINSURANCEWITHDRAW']._serialized_end=777 +# @@protoc_insertion_point(module_scope) diff --git a/pyinjective/proto/injective/insurance/v1beta1/events_pb2_grpc.py b/pyinjective/proto/injective/insurance/v1beta1/events_pb2_grpc.py new file mode 100644 index 00000000..2daafffe --- /dev/null +++ b/pyinjective/proto/injective/insurance/v1beta1/events_pb2_grpc.py @@ -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 + diff --git a/pyinjective/proto/injective/insurance/v1beta1/insurance_pb2.py b/pyinjective/proto/injective/insurance/v1beta1/insurance_pb2.py index 4c10b109..a0f4c9ba 100644 --- a/pyinjective/proto/injective/insurance/v1beta1/insurance_pb2.py +++ b/pyinjective/proto/injective/insurance/v1beta1/insurance_pb2.py @@ -18,7 +18,7 @@ from injective.oracle.v1beta1 import oracle_pb2 as injective_dot_oracle_dot_v1beta1_dot_oracle__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+injective/insurance/v1beta1/insurance.proto\x12\x1binjective.insurance.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a%injective/oracle/v1beta1/oracle.proto\"\x9b\x01\n\x06Params\x12\x8a\x01\n)default_redemption_notice_period_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB<\xc8\xde\x1f\x00\xf2\xde\x1f\x30yaml:\"default_redemption_notice_period_duration\"\x98\xdf\x1f\x01:\x04\xe8\xa0\x1f\x01\"\xec\x03\n\rInsuranceFund\x12\x15\n\rdeposit_denom\x18\x01 \x01(\t\x12\"\n\x1ainsurance_pool_token_denom\x18\x02 \x01(\t\x12z\n!redemption_notice_period_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB4\xc8\xde\x1f\x00\xf2\xde\x1f(yaml:\"redemption_notice_period_duration\"\x98\xdf\x1f\x01\x12?\n\x07\x62\x61lance\x18\x04 \x01(\tB.\xc8\xde\x1f\x00\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\x12\x43\n\x0btotal_share\x18\x05 \x01(\tB.\xc8\xde\x1f\x00\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\x12\x11\n\tmarket_id\x18\x06 \x01(\t\x12\x15\n\rmarket_ticker\x18\x07 \x01(\t\x12\x13\n\x0boracle_base\x18\x08 \x01(\t\x12\x14\n\x0coracle_quote\x18\t \x01(\t\x12\x39\n\x0boracle_type\x18\n \x01(\x0e\x32$.injective.oracle.v1beta1.OracleType\x12\x0e\n\x06\x65xpiry\x18\x0b \x01(\x03\"\xed\x01\n\x12RedemptionSchedule\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x10\n\x08marketId\x18\x02 \x01(\t\x12\x10\n\x08redeemer\x18\x03 \x01(\t\x12k\n\x19\x63laimable_redemption_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB,\xc8\xde\x1f\x00\xf2\xde\x1f yaml:\"claimable_redemption_time\"\x90\xdf\x1f\x01\x12:\n\x11redemption_amount\x18\x05 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"T\n\x18\x45ventInsuranceFundUpdate\x12\x38\n\x04\x66und\x18\x01 \x01(\x0b\x32*.injective.insurance.v1beta1.InsuranceFund\"[\n\x16\x45ventRequestRedemption\x12\x41\n\x08schedule\x18\x01 \x01(\x0b\x32/.injective.insurance.v1beta1.RedemptionSchedule\"\x92\x01\n\x17\x45ventWithdrawRedemption\x12\x41\n\x08schedule\x18\x01 \x01(\x0b\x32/.injective.insurance.v1beta1.RedemptionSchedule\x12\x34\n\x0bredeem_coin\x18\x02 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\"\x9b\x01\n\x0f\x45ventUnderwrite\x12\x13\n\x0bunderwriter\x18\x01 \x01(\t\x12\x10\n\x08marketId\x18\x02 \x01(\t\x12\x30\n\x07\x64\x65posit\x18\x03 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x12/\n\x06shares\x18\x04 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x42QZOgithub.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/typesb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+injective/insurance/v1beta1/insurance.proto\x12\x1binjective.insurance.v1beta1\x1a\x14gogoproto/gogo.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a%injective/oracle/v1beta1/oracle.proto\"\x9b\x01\n\x06Params\x12\x8a\x01\n)default_redemption_notice_period_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB<\xc8\xde\x1f\x00\xf2\xde\x1f\x30yaml:\"default_redemption_notice_period_duration\"\x98\xdf\x1f\x01:\x04\xe8\xa0\x1f\x01\"\xec\x03\n\rInsuranceFund\x12\x15\n\rdeposit_denom\x18\x01 \x01(\t\x12\"\n\x1ainsurance_pool_token_denom\x18\x02 \x01(\t\x12z\n!redemption_notice_period_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB4\xc8\xde\x1f\x00\xf2\xde\x1f(yaml:\"redemption_notice_period_duration\"\x98\xdf\x1f\x01\x12?\n\x07\x62\x61lance\x18\x04 \x01(\tB.\xc8\xde\x1f\x00\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\x12\x43\n\x0btotal_share\x18\x05 \x01(\tB.\xc8\xde\x1f\x00\xda\xde\x1f&github.com/cosmos/cosmos-sdk/types.Int\x12\x11\n\tmarket_id\x18\x06 \x01(\t\x12\x15\n\rmarket_ticker\x18\x07 \x01(\t\x12\x13\n\x0boracle_base\x18\x08 \x01(\t\x12\x14\n\x0coracle_quote\x18\t \x01(\t\x12\x39\n\x0boracle_type\x18\n \x01(\x0e\x32$.injective.oracle.v1beta1.OracleType\x12\x0e\n\x06\x65xpiry\x18\x0b \x01(\x03\"\xed\x01\n\x12RedemptionSchedule\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x10\n\x08marketId\x18\x02 \x01(\t\x12\x10\n\x08redeemer\x18\x03 \x01(\t\x12k\n\x19\x63laimable_redemption_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB,\xc8\xde\x1f\x00\xf2\xde\x1f yaml:\"claimable_redemption_time\"\x90\xdf\x1f\x01\x12:\n\x11redemption_amount\x18\x05 \x01(\x0b\x32\x19.cosmos.base.v1beta1.CoinB\x04\xc8\xde\x1f\x00\x42QZOgithub.com/InjectiveLabs/injective-core/injective-chain/modules/insurance/typesb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -41,24 +41,10 @@ _REDEMPTIONSCHEDULE.fields_by_name['claimable_redemption_time']._serialized_options = b'\310\336\037\000\362\336\037 yaml:\"claimable_redemption_time\"\220\337\037\001' _REDEMPTIONSCHEDULE.fields_by_name['redemption_amount']._options = None _REDEMPTIONSCHEDULE.fields_by_name['redemption_amount']._serialized_options = b'\310\336\037\000' - _EVENTWITHDRAWREDEMPTION.fields_by_name['redeem_coin']._options = None - _EVENTWITHDRAWREDEMPTION.fields_by_name['redeem_coin']._serialized_options = b'\310\336\037\000' - _EVENTUNDERWRITE.fields_by_name['deposit']._options = None - _EVENTUNDERWRITE.fields_by_name['deposit']._serialized_options = b'\310\336\037\000' - _EVENTUNDERWRITE.fields_by_name['shares']._options = None - _EVENTUNDERWRITE.fields_by_name['shares']._serialized_options = b'\310\336\037\000' _globals['_PARAMS']._serialized_start=235 _globals['_PARAMS']._serialized_end=390 _globals['_INSURANCEFUND']._serialized_start=393 _globals['_INSURANCEFUND']._serialized_end=885 _globals['_REDEMPTIONSCHEDULE']._serialized_start=888 _globals['_REDEMPTIONSCHEDULE']._serialized_end=1125 - _globals['_EVENTINSURANCEFUNDUPDATE']._serialized_start=1127 - _globals['_EVENTINSURANCEFUNDUPDATE']._serialized_end=1211 - _globals['_EVENTREQUESTREDEMPTION']._serialized_start=1213 - _globals['_EVENTREQUESTREDEMPTION']._serialized_end=1304 - _globals['_EVENTWITHDRAWREDEMPTION']._serialized_start=1307 - _globals['_EVENTWITHDRAWREDEMPTION']._serialized_end=1453 - _globals['_EVENTUNDERWRITE']._serialized_start=1456 - _globals['_EVENTUNDERWRITE']._serialized_end=1611 # @@protoc_insertion_point(module_scope) From 29ca088995196c0f343e80661341050555e808f3 Mon Sep 17 00:00:00 2001 From: abel Date: Mon, 8 Jan 2024 12:52:28 -0300 Subject: [PATCH 2/2] (feat) Updated version number and changelog --- CHANGELOG.md | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d470639..8a521897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,14 @@ All notable changes to this project will be documented in this file. -## [1.0.1] - 2023-12-11 +## [1.0.1] - 2024-01-08 ### Added - Added low level API components for all modules (chain, exchain and explorer) to make the Python SDK compatible with the TypeScript SDK. +- Added support for all wasm module messages. +- Added support for all token factory module messages. ### Changed -- Updated proto definitions to injective-core v1.12.2-testnet and injective-indexer v1.12.45-rc3 +- Updated proto definitions to injective-core v1.12.0 and injective-indexer v1.12.72 - Added new functions in AsyncClient to interact with chain, exchange and explorer using the low level API components - Marked old function sin AsyncClient as deprecated (the functions will be removed in a future version) - Updated all API examples to use the new AsyncClient functions diff --git a/pyproject.toml b/pyproject.toml index 662df1da..ead03c5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "injective-py" -version = "1.0.1-rc5" +version = "1.0.1" description = "Injective Python SDK, with Exchange API Client" authors = ["Injective Labs "] license = "Apache-2.0"