diff --git a/pyproject.toml b/pyproject.toml index 830393c..54b10f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ license = "MIT" packages = [{ include = "secret_sdk" }] readme = "README.md" repository = "https://github.com/stephanegg/secret-sdk-python" -version = "1.5.1" +version = "1.8.1" [tool.poetry.dependencies] aiohttp = "^3.7.3" diff --git a/scripts/generate_protobuf.sh b/scripts/generate_protobuf.sh old mode 100644 new mode 100755 index fe5a68a..b4c8608 --- a/scripts/generate_protobuf.sh +++ b/scripts/generate_protobuf.sh @@ -4,7 +4,7 @@ set -o errexit -o nounset -o pipefail SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" rm -rf "${SCRIPT_PATH}/SecretNetwork" -git clone --depth 1 --branch v1.5.0 https://github.com/scrtlabs/SecretNetwork "${SCRIPT_PATH}/SecretNetwork" +git clone --depth 1 --branch v1.15.0-beta.0 https://github.com/scrtlabs/SecretNetwork "${SCRIPT_PATH}/SecretNetwork" SECRET_DIR="${SCRIPT_PATH}/SecretNetwork/proto" SECRET_THIRD_PARTY_DIR="${SCRIPT_PATH}/SecretNetwork/third_party/proto" @@ -23,4 +23,4 @@ protoc \ --proto_path=${SECRET_DIR} \ --proto_path=${SECRET_THIRD_PARTY_DIR} \ --python_betterproto_out="${OUT_DIR}" \ - $(find ${SECRET_DIR} ${SECRET_THIRD_PARTY_DIR} -path -prune -o -name '*.proto' -print0 | xargs -0) \ No newline at end of file + $(find ${SECRET_DIR} ${SECRET_THIRD_PARTY_DIR} -path -prune -o -name '*.proto' -print0 | xargs -0) diff --git a/secret_sdk/client/lcd/api/registration.py b/secret_sdk/client/lcd/api/registration.py index af2b519..b1f58fd 100644 --- a/secret_sdk/client/lcd/api/registration.py +++ b/secret_sdk/client/lcd/api/registration.py @@ -24,7 +24,8 @@ async def encrypted_seed(self, pub_key: str): async def consensus_io_pub_key(self): """Returns the consensus_io_pub_key""" result = await self._c._get(f"/registration/v1beta1/tx-key") - return extract_consensus_io_pub_key(base64.b64decode(result['key'])) + # return extract_consensus_io_pub_key(base64.b64decode(result['key'])) + return base64.b64decode(result['key']) class RegistrationAPI(AsyncRegistrationAPI): diff --git a/secret_sdk/client/lcd/api/tx.py b/secret_sdk/client/lcd/api/tx.py index 10be3b9..9434301 100644 --- a/secret_sdk/client/lcd/api/tx.py +++ b/secret_sdk/client/lcd/api/tx.py @@ -222,19 +222,78 @@ def decrypt_txs_response(self, txs_response) -> TxInfo: txs_response = txs_response['tx_response'] raw_log = txs_response['raw_log'] - json_log = None - array_log = None + json_log = [] + array_log = [] + events = txs_response['events'] code = txs_response['code'] - if code == 0 and raw_log != '': - _json_log = json.loads(raw_log) - json_log = [] - for i, log in enumerate(_json_log): - if 'msg_index' not in log or not log['msg_index']: - # See https://github.com/cosmos/cosmos-sdk/pull/11147 - log['msg_index'] = i - json_log.append(TxLog(i, log.get('log'), log['events'])) - array_log = self.decrypt_logs(_json_log, nonces) + + if code == 0 and raw_log == "": + for event in events: + event_attributes = event.get('attributes', []) + msg_index_attr = next((attr for attr in event_attributes if attr.get('key') == 'msg_index'), None) + if not msg_index_attr: + continue + + msg_index = int(msg_index_attr.get('value')) + + for attr in event_attributes: + if attr.get('key') == 'msg_index': + continue + + # Try to decrypt if the event type is 'wasm' + if event.get('type') == 'wasm': + nonce = nonces[msg_index] + if nonce and len(nonce) == 32: + try: + decrypted_key = self.decrypt_data_field(base64.b64decode(attr['key']), nonce).decode('utf-8').strip() + attr['key'] = decrypted_key + except Exception: + pass + + try: + decrypted_value = self.decrypt_data_field(base64.b64decode(attr['value']), nonce).decode('utf-8').strip() + attr['value'] = decrypted_value + except Exception: + pass + + # Prepare entry for array_log + entry_to_push = { + 'msg': msg_index, + 'type': event['type'], + 'key': attr['key'], + 'value': attr['value'], + } + + # Append to array_log if entry_to_push is unique + if not any(entry == entry_to_push for entry in array_log): + array_log.append(entry_to_push) + + # Prepare entry for json_log + json_log_msg_index_entry = next((log for log in json_log if log['msg_index'] == msg_index), None) + if not json_log_msg_index_entry: + json_log.append({ + 'msg_index': msg_index, + 'events': [ + { + 'type': event['type'], + 'attributes': [{'key': attr['key'], 'value': attr['value']}] + } + ] + }) + else: + json_log_event_entry = next((log for log in json_log_msg_index_entry['events'] if log['type'] == event['type']), None) + if not json_log_event_entry: + json_log_msg_index_entry['events'].append({ + 'type': event['type'], + 'attributes': [{'key': attr['key'], 'value': attr['value']}] + }) + else: + attribute_to_push = {'key': attr['key'], 'value': attr['value']} + + # Add to attributes if not already present + if not any(attr == attribute_to_push for attr in json_log_event_entry['attributes']): + json_log_event_entry['attributes'].append(attribute_to_push) elif code != 0 and raw_log != '': try: error_message_rgx = re.compile( @@ -292,6 +351,7 @@ def decrypt_txs_response(self, txs_response) -> TxInfo: tx=decoded_tx, tx_bytes=txs_response['tx'].get('value') if txs_response['tx'] else None, rawlog=raw_log, + events=txs_response['events'], logs=array_log if array_log else json_log, data=data, gas_used=int(txs_response['gas_used']), @@ -387,12 +447,13 @@ async def broadcast_adapter(self, tx: Tx, mode: BroadcastMode, options: Broadcas broadcast_result = None tx_encoded = await super()._try_await(self.encode(tx)) if mode == BroadcastMode.BROADCAST_MODE_BLOCK: + raise Exception("BROADCAST_MODE_BLOCK is deprecated. Please use BROADCAST_MODE_SYNC instead") broadcast_result = await BaseAsyncAPI._try_await(self.broadcast(tx_encoded, options)) if mode == BroadcastMode.BROADCAST_MODE_ASYNC: broadcast_result = await BaseAsyncAPI._try_await(self.broadcast_async(tx_encoded, options)) if mode == BroadcastMode.BROADCAST_MODE_SYNC: broadcast_result = await BaseAsyncAPI._try_await(self.broadcast_sync(tx_encoded, options)) - if not broadcast_result.code != 0: + if broadcast_result.code != 0: raise Exception(f"Broadcasting transaction failed with code {broadcast_result.code} (codespace: ${broadcast_result.codespace}).Log: {broadcast_result.raw_log}") return broadcast_result diff --git a/secret_sdk/client/lcd/api/wasm.py b/secret_sdk/client/lcd/api/wasm.py index c707283..81f9826 100644 --- a/secret_sdk/client/lcd/api/wasm.py +++ b/secret_sdk/client/lcd/api/wasm.py @@ -1,6 +1,8 @@ import base64 import json +import re from typing import Any, Optional +from secret_sdk.exceptions import LCDResponseError from secret_sdk.client.lcd.api._base import BaseAsyncAPI, sync_bind from secret_sdk.core.coins import Coins @@ -62,7 +64,6 @@ async def code_hash_by_code_id(self, code_id: int) -> dict: res = await self._c._get(f"/compute/v1beta1/code_hash/by_code_id/{code_id}") return res - async def contract_hash(self, contract_address: str) -> str: """Fetches information about an instantiated contract. @@ -81,7 +82,7 @@ async def contract_hash(self, contract_address: str) -> str: return _contract_code_hash[contract_address] async def contract_query( - self, contract_address: str, query: dict, contract_code_hash: Optional[str] = None, + self, contract_address: str, query: dict, contract_code_hash: Optional[str] = None, height: Optional[int] = 0, timeout: Optional[int] = 15, retry_attempts: Optional[int] = 1 ) -> Any: """Runs a QueryMsg on a contract. @@ -114,21 +115,33 @@ async def contract_query( params['block_height'] = str(height) query_path = f"/compute/v1beta1/query/{contract_address}" - query_result = await BaseAsyncAPI._try_await( - self._c._get(query_path, params=params, timeout=timeout, retry_attempts=retry_attempts) - ) + try: + query_result = await BaseAsyncAPI._try_await( + self._c._get(query_path, params=params, timeout=timeout, retry_attempts=retry_attempts) + ) + except LCDResponseError as lcd_error: + # trying to decrypt error + error_json = json.loads(lcd_error.message.replace("'", '"')) + error_msg = error_json.get('message','') + encrypted_error = re.findall('encrypted: (.+?):', error_msg) + if encrypted_error: + decrypted_error = self._c.encrypt_utils.decrypt(base64.b64decode(bytes(encrypted_error[0], 'utf-8')), nonce) + lcd_error.message = decrypted_error.decode('utf-8') + raise lcd_error + except: + raise encoded_result = base64.b64decode(bytes(query_result["data"], "utf-8")) decrypted = self._c.encrypt_utils.decrypt(encoded_result, nonce) return json.loads(base64.b64decode(decrypted)) async def contract_execute_msg( - self, - sender_address: AccAddress, - contract_address: AccAddress, - handle_msg: dict, - transfer_amount: Optional[Coins] = None, - contract_code_hash: Optional[str] = None + self, + sender_address: AccAddress, + contract_address: AccAddress, + handle_msg: dict, + transfer_amount: Optional[Coins] = None, + contract_code_hash: Optional[str] = None ) -> MsgExecuteContract: if not contract_code_hash: if contract_address not in _contract_code_hash: @@ -183,7 +196,7 @@ def code_hash_by_code_id(self, code_info: int) -> dict: @sync_bind(AsyncWasmAPI.contract_query) def contract_query( - self, contract_address: str, query_msg: dict, contract_code_hash: Optional[str] = None, + self, contract_address: str, query_msg: dict, contract_code_hash: Optional[str] = None, height: Optional[int] = 0, timeout: Optional[int] = 15, retry_attempts: Optional[int] = 1 ) -> Any: pass @@ -192,12 +205,12 @@ def contract_query( @sync_bind(AsyncWasmAPI.contract_execute_msg) def contract_execute_msg( - self, - sender_address: AccAddress, - contract_address: AccAddress, - handle_msg: dict, - transfer_amount: Coins, - contract_code_hash: str + self, + sender_address: AccAddress, + contract_address: AccAddress, + handle_msg: dict, + transfer_amount: Coins, + contract_code_hash: str ) -> MsgExecuteContract: pass diff --git a/secret_sdk/client/lcd/lcdclient.py b/secret_sdk/client/lcd/lcdclient.py index 5277d37..d214b19 100644 --- a/secret_sdk/client/lcd/lcdclient.py +++ b/secret_sdk/client/lcd/lcdclient.py @@ -58,9 +58,12 @@ mainnet_chain_ids = {"secret-2", "secret-3", "secret-4"} +# mainnetConsensusIoPubKey = bytes.fromhex( +# "083b1a03661211d5a4cc8d39a77795795862f7730645573b2bcc2c1920c53c04" +# ) mainnetConsensusIoPubKey = bytes.fromhex( - "083b1a03661211d5a4cc8d39a77795795862f7730645573b2bcc2c1920c53c04" -) + "efdfbee583877e6d12c219695030a5bfb72e0a3abdc416655aa4a30c95a4446f" +) # == base64.b64decode("79++5YOHfm0SwhlpUDClv7cuCjq9xBZlWqSjDJWkRG8=") REQUEST_CONFIG = { "GET_TIMEOUT": 30, diff --git a/secret_sdk/client/lcd/wallet.py b/secret_sdk/client/lcd/wallet.py index fd73f58..7219bfb 100644 --- a/secret_sdk/client/lcd/wallet.py +++ b/secret_sdk/client/lcd/wallet.py @@ -177,7 +177,7 @@ async def create_and_broadcast_tx( create_tx_options.fee = fee signed_tx = await self.create_and_sign_tx(create_tx_options) - broadcast_mode = broadcast_mode if broadcast_mode else BroadcastMode.BROADCAST_MODE_BLOCK + broadcast_mode = broadcast_mode if broadcast_mode else BroadcastMode.BROADCAST_MODE_SYNC tx = await self.lcd.tx.broadcast_adapter(signed_tx, mode=broadcast_mode) return tx @@ -378,7 +378,7 @@ def create_and_broadcast_tx( create_tx_options.fee = fee signed_tx = self.create_and_sign_tx(create_tx_options) - broadcast_mode = broadcast_mode if broadcast_mode else BroadcastMode.BROADCAST_MODE_BLOCK + broadcast_mode = broadcast_mode if broadcast_mode else BroadcastMode.BROADCAST_MODE_SYNC tx = self.lcd.tx.broadcast_adapter(signed_tx, mode=broadcast_mode) return tx diff --git a/secret_sdk/core/tx.py b/secret_sdk/core/tx.py index f6b7c18..759610a 100755 --- a/secret_sdk/core/tx.py +++ b/secret_sdk/core/tx.py @@ -17,6 +17,7 @@ from secret_sdk.protobuf.cosmos.tx.v1beta1 import Tx as Tx_pb from secret_sdk.protobuf.cosmos.tx.v1beta1 import TxBody as TxBody_pb from secret_sdk.util.encrypt_utils import EncryptionUtils +from secret_sdk.protobuf.tendermint.abci import Event from secret_sdk.core.compact_bit_array import CompactBitArray from secret_sdk.core.fee import Fee @@ -592,6 +593,9 @@ class TxInfo(JSONSerializable): logs: Optional[List[TxLog]] = attr.ib() """Event log information.""" + events: Optional[List[Event]] = attr.ib() + """All events emitted during transaction processing (including ante handler events).""" + gas_wanted: int = attr.ib(converter=int) """Gas requested by transaction.""" @@ -620,6 +624,7 @@ def to_data(self) -> dict: "txhash": self.txhash, "rawlog": self.rawlog, "logs": [log.to_data() for log in self.logs] if self.logs else None, + "events" : self.events, "gas_wanted": str(self.gas_wanted), "gas_used": str(self.gas_used), "timestamp": self.timestamp, @@ -639,6 +644,7 @@ def from_data(cls, data: dict) -> TxInfo: data.get("txhash"), data.get("raw_log"), parse_tx_logs(data.get("logs")), + data.get("events"), data.get("gas_wanted"), data.get("gas_used"), Tx.from_data(data.get("tx")), @@ -655,6 +661,7 @@ def to_proto(self) -> TxResponse_pb: proto.txhash = self.txhash proto.raw_log = self.rawlog proto.logs = [log.to_proto() for log in self.logs] if self.logs else None + proto.events = self.events proto.gas_wanted = self.gas_wanted proto.gas_used = self.gas_used proto.timestamp = self.timestamp @@ -670,6 +677,7 @@ def from_proto(cls, proto: TxResponse_pb) -> TxInfo: txhash=proto.txhash, rawlog=proto.raw_log, logs=parse_tx_logs_proto(proto.logs), + events=proto.events, gas_wanted=proto.gas_wanted, gas_used=proto.gas_used, timestamp=proto.timestamp, diff --git a/secret_sdk/core/wasm/msgs.py b/secret_sdk/core/wasm/msgs.py index cb4cf7b..5f5beea 100755 --- a/secret_sdk/core/wasm/msgs.py +++ b/secret_sdk/core/wasm/msgs.py @@ -83,7 +83,7 @@ def to_amino(self) -> dict: def from_data(cls, data: dict) -> MsgStoreCode: return cls( sender=data["sender"], - wasm_byte_code=data["wasm_byte_code"], + wasm_byte_code=base64.b64decode(data["wasm_byte_code"]), source=data.get("source"), builder=data.get("builder") ) diff --git a/secret_sdk/protobuf/amino/__init__.py b/secret_sdk/protobuf/amino/__init__.py new file mode 100644 index 0000000..736a0e4 --- /dev/null +++ b/secret_sdk/protobuf/amino/__init__.py @@ -0,0 +1,6 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: amino/amino.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto diff --git a/secret_sdk/protobuf/cosmos/app/__init__.py b/secret_sdk/protobuf/cosmos/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/app/runtime/__init__.py b/secret_sdk/protobuf/cosmos/app/runtime/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/app/runtime/v1alpha1/__init__.py b/secret_sdk/protobuf/cosmos/app/runtime/v1alpha1/__init__.py new file mode 100644 index 0000000..1cdebb5 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/app/runtime/v1alpha1/__init__.py @@ -0,0 +1,85 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/app/runtime/v1alpha1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object for the runtime module.""" + + app_name: str = betterproto.string_field(1) + """app_name is the name of the app.""" + + begin_blockers: List[str] = betterproto.string_field(2) + """ + begin_blockers specifies the module names of begin blockers to call in the + order in which they should be called. If this is left empty no begin + blocker will be registered. + """ + + end_blockers: List[str] = betterproto.string_field(3) + """ + end_blockers specifies the module names of the end blockers to call in the + order in which they should be called. If this is left empty no end blocker + will be registered. + """ + + init_genesis: List[str] = betterproto.string_field(4) + """ + init_genesis specifies the module names of init genesis functions to call + in the order in which they should be called. If this is left empty no init + genesis function will be registered. + """ + + export_genesis: List[str] = betterproto.string_field(5) + """ + export_genesis specifies the order in which to export module genesis data. + If this is left empty, the init_genesis order will be used for export + genesis if it is specified. + """ + + override_store_keys: List["StoreKeyConfig"] = betterproto.message_field(6) + """ + override_store_keys is an optional list of overrides for the module store + keys to be used in keeper construction. + """ + + order_migrations: List[str] = betterproto.string_field(7) + """ + order_migrations defines the order in which module migrations are + performed. If this is left empty, it uses the default migration order. + https://pkg.go.dev/github.com/cosmos/cosmos- + sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder + """ + + precommiters: List[str] = betterproto.string_field(8) + """ + precommiters specifies the module names of the precommiters to call in the + order in which they should be called. If this is left empty no precommit + function will be registered. + """ + + prepare_check_staters: List[str] = betterproto.string_field(9) + """ + prepare_check_staters specifies the module names of the + prepare_check_staters to call in the order in which they should be called. + If this is left empty no preparecheckstate function will be registered. + """ + + +@dataclass(eq=False, repr=False) +class StoreKeyConfig(betterproto.Message): + """ + StoreKeyConfig may be supplied to override the default module store key, + which is the module name. + """ + + module_name: str = betterproto.string_field(1) + """name of the module to override the store key of""" + + kv_store_key: str = betterproto.string_field(2) + """the kv store key to use instead of the module name.""" diff --git a/secret_sdk/protobuf/cosmos/app/v1alpha1/__init__.py b/secret_sdk/protobuf/cosmos/app/v1alpha1/__init__.py new file mode 100644 index 0000000..ec09336 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/app/v1alpha1/__init__.py @@ -0,0 +1,241 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/app/v1alpha1/config.proto, cosmos/app/v1alpha1/module.proto, cosmos/app/v1alpha1/query.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class ModuleDescriptor(betterproto.Message): + """ModuleDescriptor describes an app module.""" + + go_import: str = betterproto.string_field(1) + """ + go_import names the package that should be imported by an app to load the + module in the runtime module registry. It is required to make debugging of + configuration errors easier for users. + """ + + use_package: List["PackageReference"] = betterproto.message_field(2) + """ + use_package refers to a protobuf package that this module uses and exposes + to the world. In an app, only one module should "use" or own a single + protobuf package. It is assumed that the module uses all of the .proto + files in a single package. + """ + + can_migrate_from: List["MigrateFromInfo"] = betterproto.message_field(3) + """ + can_migrate_from defines which module versions this module can migrate + state from. The framework will check that one module version is able to + migrate from a previous module version before attempting to update its + config. It is assumed that modules can transitively migrate from earlier + versions. For instance if v3 declares it can migrate from v2, and v2 + declares it can migrate from v1, the framework knows how to migrate from v1 + to v3, assuming all 3 module versions are registered at runtime. + """ + + +@dataclass(eq=False, repr=False) +class PackageReference(betterproto.Message): + """ + PackageReference is a reference to a protobuf package used by a module. + """ + + name: str = betterproto.string_field(1) + """name is the fully-qualified name of the package.""" + + revision: int = betterproto.uint32_field(2) + """ + revision is the optional revision of the package that is being used. + Protobuf packages used in Cosmos should generally have a major version as + the last part of the package name, ex. foo.bar.baz.v1. The revision of a + package can be thought of as the minor version of a package which has + additional backwards compatible definitions that weren't present in a + previous version. A package should indicate its revision with a source code + comment above the package declaration in one of its files containing the + text "Revision N" where N is an integer revision. All packages start at + revision 0 the first time they are released in a module. When a new version + of a module is released and items are added to existing .proto files, these + definitions should contain comments of the form "Since: Revision N" where N + is an integer revision. When the module runtime starts up, it will check + the pinned proto image and panic if there are runtime protobuf definitions + that are not in the pinned descriptor which do not have a "Since Revision + N" comment or have a "Since Revision N" comment where N is <= to the + revision specified here. This indicates that the protobuf files have been + updated, but the pinned file descriptor hasn't. If there are items in the + pinned file descriptor with a revision greater than the value indicated + here, this will also cause a panic as it may mean that the pinned + descriptor for a legacy module has been improperly updated or that there is + some other versioning discrepancy. Runtime protobuf definitions will also + be checked for compatibility with pinned file descriptors to make sure + there are no incompatible changes. This behavior ensures that: * pinned + proto images are up-to-date * protobuf files are carefully annotated with + revision comments which are important good client UX * protobuf files are + changed in backwards and forwards compatible ways + """ + + +@dataclass(eq=False, repr=False) +class MigrateFromInfo(betterproto.Message): + """ + MigrateFromInfo is information on a module version that a newer module can + migrate from. + """ + + module: str = betterproto.string_field(1) + """ + module is the fully-qualified protobuf name of the module config object for + the previous module version, ex: "cosmos.group.module.v1.Module". + """ + + +@dataclass(eq=False, repr=False) +class Config(betterproto.Message): + """ + Config represents the configuration for a Cosmos SDK ABCI app. It is + intended that all state machine logic including the version of baseapp and + tx handlers (and possibly even Tendermint) that an app needs can be + described in a config object. For compatibility, the framework should allow + a mixture of declarative and imperative app wiring, however, apps that + strive for the maximum ease of maintainability should be able to describe + their state machine with a config object alone. + """ + + modules: List["ModuleConfig"] = betterproto.message_field(1) + """modules are the module configurations for the app.""" + + golang_bindings: List["GolangBinding"] = betterproto.message_field(2) + """ + golang_bindings specifies explicit interface to implementation type + bindings which depinject uses to resolve interface inputs to provider + functions. The scope of this field's configuration is global (not module + specific). + """ + + +@dataclass(eq=False, repr=False) +class ModuleConfig(betterproto.Message): + """ModuleConfig is a module configuration for an app.""" + + name: str = betterproto.string_field(1) + """ + name is the unique name of the module within the app. It should be a name + that persists between different versions of a module so that modules can be + smoothly upgraded to new versions. For example, for the module + cosmos.bank.module.v1.Module, we may chose to simply name the module "bank" + in the app. When we upgrade to cosmos.bank.module.v2.Module, the app- + specific name "bank" stays the same and the framework knows that the v2 + module should receive all the same state that the v1 module had. Note: + modules should provide info on which versions they can migrate from in the + ModuleDescriptor.can_migration_from field. + """ + + config: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """ + config is the config object for the module. Module config messages should + define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module + extension. + """ + + golang_bindings: List["GolangBinding"] = betterproto.message_field(3) + """ + golang_bindings specifies explicit interface to implementation type + bindings which depinject uses to resolve interface inputs to provider + functions. The scope of this field's configuration is module specific. + """ + + +@dataclass(eq=False, repr=False) +class GolangBinding(betterproto.Message): + """ + GolangBinding is an explicit interface type to implementing type binding + for dependency injection. + """ + + interface_type: str = betterproto.string_field(1) + """ + interface_type is the interface type which will be bound to a specific + implementation type + """ + + implementation: str = betterproto.string_field(2) + """ + implementation is the implementing type which will be supplied when an + input of type interface is requested + """ + + +@dataclass(eq=False, repr=False) +class QueryConfigRequest(betterproto.Message): + """QueryConfigRequest is the Query/Config request type.""" + + pass + + +@dataclass(eq=False, repr=False) +class QueryConfigResponse(betterproto.Message): + """QueryConfigRequest is the Query/Config response type.""" + + config: "Config" = betterproto.message_field(1) + """config is the current app config.""" + + +class QueryStub(betterproto.ServiceStub): + async def config( + self, + query_config_request: "QueryConfigRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryConfigResponse": + return await self._unary_unary( + "/cosmos.app.v1alpha1.Query/Config", + query_config_request, + QueryConfigResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryBase(ServiceBase): + + async def config( + self, query_config_request: "QueryConfigRequest" + ) -> "QueryConfigResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_config( + self, stream: "grpclib.server.Stream[QueryConfigRequest, QueryConfigResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.config(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.app.v1alpha1.Query/Config": grpclib.const.Handler( + self.__rpc_config, + grpclib.const.Cardinality.UNARY_UNARY, + QueryConfigRequest, + QueryConfigResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/auth/module/__init__.py b/secret_sdk/protobuf/cosmos/auth/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/auth/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/auth/module/v1/__init__.py new file mode 100644 index 0000000..e499d55 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/auth/module/v1/__init__.py @@ -0,0 +1,40 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/auth/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object for the auth module.""" + + bech32_prefix: str = betterproto.string_field(1) + """bech32_prefix is the bech32 account prefix for the app.""" + + module_account_permissions: List["ModuleAccountPermission"] = ( + betterproto.message_field(2) + ) + """module_account_permissions are module account permissions.""" + + authority: str = betterproto.string_field(3) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ + + +@dataclass(eq=False, repr=False) +class ModuleAccountPermission(betterproto.Message): + """ModuleAccountPermission represents permissions for a module account.""" + + account: str = betterproto.string_field(1) + """account is the name of the module.""" + + permissions: List[str] = betterproto.string_field(2) + """ + permissions are the permissions this module has. Currently recognized + values are minter, burner and staking. + """ diff --git a/secret_sdk/protobuf/cosmos/auth/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/auth/v1beta1/__init__.py index ed4f554..a59670f 100644 --- a/secret_sdk/protobuf/cosmos/auth/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/auth/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/auth/v1beta1/auth.proto, cosmos/auth/v1beta1/genesis.proto, cosmos/auth/v1beta1/query.proto +# sources: cosmos/auth/v1beta1/auth.proto, cosmos/auth/v1beta1/genesis.proto, cosmos/auth/v1beta1/query.proto, cosmos/auth/v1beta1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -48,6 +49,27 @@ class ModuleAccount(betterproto.Message): permissions: List[str] = betterproto.string_field(3) +@dataclass(eq=False, repr=False) +class ModuleCredential(betterproto.Message): + """ + ModuleCredential represents a unclaimable pubkey for base accounts + controlled by modules. Since: cosmos-sdk 0.47 + """ + + module_name: str = betterproto.string_field(1) + """ + module_name is the name of the module used for address derivation (passed + into address.Module). + """ + + derivation_keys: List[bytes] = betterproto.bytes_field(2) + """ + derivation_keys is for deriving a module account address (passed into + address.Module) adding more keys creates sub-account addresses (passed into + address.Derive) + """ + + @dataclass(eq=False, repr=False) class Params(betterproto.Message): """Params defines the parameters for the auth module.""" @@ -59,6 +81,36 @@ class Params(betterproto.Message): sig_verify_cost_secp256_k1: int = betterproto.uint64_field(5) +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/auth parameters to update. NOTE: All parameters must + be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + @dataclass(eq=False, repr=False) class QueryAccountsRequest(betterproto.Message): """ @@ -123,6 +175,26 @@ class QueryParamsResponse(betterproto.Message): """params defines the parameters of the module.""" +@dataclass(eq=False, repr=False) +class QueryModuleAccountsRequest(betterproto.Message): + """ + QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts + RPC method. Since: cosmos-sdk 0.46 + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryModuleAccountsResponse(betterproto.Message): + """ + QueryModuleAccountsResponse is the response type for the + Query/ModuleAccounts RPC method. Since: cosmos-sdk 0.46 + """ + + accounts: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) + + @dataclass(eq=False, repr=False) class QueryModuleAccountByNameRequest(betterproto.Message): """ @@ -143,17 +215,157 @@ class QueryModuleAccountByNameResponse(betterproto.Message): account: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) +@dataclass(eq=False, repr=False) +class Bech32PrefixRequest(betterproto.Message): + """ + Bech32PrefixRequest is the request type for Bech32Prefix rpc method. Since: + cosmos-sdk 0.46 + """ + + pass + + +@dataclass(eq=False, repr=False) +class Bech32PrefixResponse(betterproto.Message): + """ + Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + Since: cosmos-sdk 0.46 + """ + + bech32_prefix: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class AddressBytesToStringRequest(betterproto.Message): + """ + AddressBytesToStringRequest is the request type for AddressString rpc + method. Since: cosmos-sdk 0.46 + """ + + address_bytes: bytes = betterproto.bytes_field(1) + + +@dataclass(eq=False, repr=False) +class AddressBytesToStringResponse(betterproto.Message): + """ + AddressBytesToStringResponse is the response type for AddressString rpc + method. Since: cosmos-sdk 0.46 + """ + + address_string: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class AddressStringToBytesRequest(betterproto.Message): + """ + AddressStringToBytesRequest is the request type for AccountBytes rpc + method. Since: cosmos-sdk 0.46 + """ + + address_string: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class AddressStringToBytesResponse(betterproto.Message): + """ + AddressStringToBytesResponse is the response type for AddressBytes rpc + method. Since: cosmos-sdk 0.46 + """ + + address_bytes: bytes = betterproto.bytes_field(1) + + +@dataclass(eq=False, repr=False) +class QueryAccountAddressByIdRequest(betterproto.Message): + """ + QueryAccountAddressByIDRequest is the request type for AccountAddressByID + rpc method Since: cosmos-sdk 0.46.2 + """ + + id: int = betterproto.int64_field(1) + """ + Deprecated, use account_id instead id is the account number of the address + to be queried. This field should have been an uint64 (like all account + numbers), and will be updated to uint64 in a future version of the auth + query. + """ + + account_id: int = betterproto.uint64_field(2) + """ + account_id is the account number of the address to be queried. Since: + cosmos-sdk 0.47 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("id"): + warnings.warn( + "QueryAccountAddressByIdRequest.id is deprecated", DeprecationWarning + ) + + +@dataclass(eq=False, repr=False) +class QueryAccountAddressByIdResponse(betterproto.Message): + """ + QueryAccountAddressByIDResponse is the response type for AccountAddressByID + rpc method Since: cosmos-sdk 0.46.2 + """ + + account_address: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class QueryAccountInfoRequest(betterproto.Message): + """ + QueryAccountInfoRequest is the Query/AccountInfo request type. Since: + cosmos-sdk 0.47 + """ + + address: str = betterproto.string_field(1) + """address is the account address string.""" + + +@dataclass(eq=False, repr=False) +class QueryAccountInfoResponse(betterproto.Message): + """ + QueryAccountInfoResponse is the Query/AccountInfo response type. Since: + cosmos-sdk 0.47 + """ + + info: "BaseAccount" = betterproto.message_field(1) + """info is the account info which is represented by BaseAccount.""" + + @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState defines the auth module's genesis state.""" params: "Params" = betterproto.message_field(1) - """params defines all the paramaters of the module.""" + """params defines all the parameters of the module.""" accounts: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(2) """accounts are the accounts present at genesis.""" +class MsgStub(betterproto.ServiceStub): + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + class QueryStub(betterproto.ServiceStub): async def accounts( self, @@ -189,6 +401,22 @@ async def account( metadata=metadata, ) + async def account_address_by_id( + self, + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryAccountAddressByIdResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/AccountAddressByID", + query_account_address_by_id_request, + QueryAccountAddressByIdResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def params( self, query_params_request: "QueryParamsRequest", @@ -206,6 +434,23 @@ async def params( metadata=metadata, ) + async def module_accounts( + self, + query_module_accounts_request: "QueryModuleAccountsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryModuleAccountsResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/ModuleAccounts", + query_module_accounts_request, + QueryModuleAccountsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def module_account_by_name( self, query_module_account_by_name_request: "QueryModuleAccountByNameRequest", @@ -223,8 +468,102 @@ async def module_account_by_name( metadata=metadata, ) + async def bech32_prefix( + self, + bech32_prefix_request: "Bech32PrefixRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "Bech32PrefixResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/Bech32Prefix", + bech32_prefix_request, + Bech32PrefixResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def address_bytes_to_string( + self, + address_bytes_to_string_request: "AddressBytesToStringRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "AddressBytesToStringResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/AddressBytesToString", + address_bytes_to_string_request, + AddressBytesToStringResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def address_string_to_bytes( + self, + address_string_to_bytes_request: "AddressStringToBytesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "AddressStringToBytesResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/AddressStringToBytes", + address_string_to_bytes_request, + AddressStringToBytesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def account_info( + self, + query_account_info_request: "QueryAccountInfoRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryAccountInfoResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/AccountInfo", + query_account_info_request, + QueryAccountInfoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.auth.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + class QueryBase(ServiceBase): + async def accounts( self, query_accounts_request: "QueryAccountsRequest" ) -> "QueryAccountsResponse": @@ -235,16 +574,44 @@ async def account( ) -> "QueryAccountResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def account_address_by_id(self) -> "QueryAccountAddressByIdResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def module_accounts( + self, query_module_accounts_request: "QueryModuleAccountsRequest" + ) -> "QueryModuleAccountsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def module_account_by_name( self, query_module_account_by_name_request: "QueryModuleAccountByNameRequest" ) -> "QueryModuleAccountByNameResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def bech32_prefix( + self, bech32_prefix_request: "Bech32PrefixRequest" + ) -> "Bech32PrefixResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def address_bytes_to_string( + self, address_bytes_to_string_request: "AddressBytesToStringRequest" + ) -> "AddressBytesToStringResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def address_string_to_bytes( + self, address_string_to_bytes_request: "AddressStringToBytesRequest" + ) -> "AddressStringToBytesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def account_info( + self, query_account_info_request: "QueryAccountInfoRequest" + ) -> "QueryAccountInfoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_accounts( self, stream: "grpclib.server.Stream[QueryAccountsRequest, QueryAccountsResponse]", @@ -260,6 +627,14 @@ async def __rpc_account( response = await self.account(request) await stream.send_message(response) + async def __rpc_account_address_by_id( + self, + stream: "grpclib.server.Stream[QueryAccountAddressByIdRequest, QueryAccountAddressByIdResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.account_address_by_id(request) + await stream.send_message(response) + async def __rpc_params( self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" ) -> None: @@ -267,6 +642,14 @@ async def __rpc_params( response = await self.params(request) await stream.send_message(response) + async def __rpc_module_accounts( + self, + stream: "grpclib.server.Stream[QueryModuleAccountsRequest, QueryModuleAccountsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.module_accounts(request) + await stream.send_message(response) + async def __rpc_module_account_by_name( self, stream: "grpclib.server.Stream[QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse]", @@ -275,6 +658,37 @@ async def __rpc_module_account_by_name( response = await self.module_account_by_name(request) await stream.send_message(response) + async def __rpc_bech32_prefix( + self, stream: "grpclib.server.Stream[Bech32PrefixRequest, Bech32PrefixResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.bech32_prefix(request) + await stream.send_message(response) + + async def __rpc_address_bytes_to_string( + self, + stream: "grpclib.server.Stream[AddressBytesToStringRequest, AddressBytesToStringResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.address_bytes_to_string(request) + await stream.send_message(response) + + async def __rpc_address_string_to_bytes( + self, + stream: "grpclib.server.Stream[AddressStringToBytesRequest, AddressStringToBytesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.address_string_to_bytes(request) + await stream.send_message(response) + + async def __rpc_account_info( + self, + stream: "grpclib.server.Stream[QueryAccountInfoRequest, QueryAccountInfoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.account_info(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.auth.v1beta1.Query/Accounts": grpclib.const.Handler( @@ -289,16 +703,52 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryAccountRequest, QueryAccountResponse, ), + "/cosmos.auth.v1beta1.Query/AccountAddressByID": grpclib.const.Handler( + self.__rpc_account_address_by_id, + grpclib.const.Cardinality.UNARY_UNARY, + QueryAccountAddressByIdRequest, + QueryAccountAddressByIdResponse, + ), "/cosmos.auth.v1beta1.Query/Params": grpclib.const.Handler( self.__rpc_params, grpclib.const.Cardinality.UNARY_UNARY, QueryParamsRequest, QueryParamsResponse, ), + "/cosmos.auth.v1beta1.Query/ModuleAccounts": grpclib.const.Handler( + self.__rpc_module_accounts, + grpclib.const.Cardinality.UNARY_UNARY, + QueryModuleAccountsRequest, + QueryModuleAccountsResponse, + ), "/cosmos.auth.v1beta1.Query/ModuleAccountByName": grpclib.const.Handler( self.__rpc_module_account_by_name, grpclib.const.Cardinality.UNARY_UNARY, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, ), + "/cosmos.auth.v1beta1.Query/Bech32Prefix": grpclib.const.Handler( + self.__rpc_bech32_prefix, + grpclib.const.Cardinality.UNARY_UNARY, + Bech32PrefixRequest, + Bech32PrefixResponse, + ), + "/cosmos.auth.v1beta1.Query/AddressBytesToString": grpclib.const.Handler( + self.__rpc_address_bytes_to_string, + grpclib.const.Cardinality.UNARY_UNARY, + AddressBytesToStringRequest, + AddressBytesToStringResponse, + ), + "/cosmos.auth.v1beta1.Query/AddressStringToBytes": grpclib.const.Handler( + self.__rpc_address_string_to_bytes, + grpclib.const.Cardinality.UNARY_UNARY, + AddressStringToBytesRequest, + AddressStringToBytesResponse, + ), + "/cosmos.auth.v1beta1.Query/AccountInfo": grpclib.const.Handler( + self.__rpc_account_info, + grpclib.const.Cardinality.UNARY_UNARY, + QueryAccountInfoRequest, + QueryAccountInfoResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/authz/module/__init__.py b/secret_sdk/protobuf/cosmos/authz/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/authz/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/authz/module/v1/__init__.py new file mode 100644 index 0000000..cc8723e --- /dev/null +++ b/secret_sdk/protobuf/cosmos/authz/module/v1/__init__.py @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/authz/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the authz module.""" + + pass diff --git a/secret_sdk/protobuf/cosmos/authz/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/authz/v1beta1/__init__.py index 8dc3fda..e2c3274 100644 --- a/secret_sdk/protobuf/cosmos/authz/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/authz/v1beta1/__init__.py @@ -46,14 +46,18 @@ class Grant(betterproto.Message): authorization: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) expiration: datetime = betterproto.message_field(2) + """ + time when the grant will expire and will be pruned. If null, then the grant + doesn't have a time expiration (other conditions in `authorization` may + apply to invalidate the grant) + """ @dataclass(eq=False, repr=False) class GrantAuthorization(betterproto.Message): """ GrantAuthorization extends a grant with both the addresses of the grantee - and granter. It is used in genesis.proto and query.proto Since: cosmos-sdk - 0.45.2 + and granter. It is used in genesis.proto and query.proto """ granter: str = betterproto.string_field(1) @@ -62,6 +66,42 @@ class GrantAuthorization(betterproto.Message): expiration: datetime = betterproto.message_field(4) +@dataclass(eq=False, repr=False) +class GrantQueueItem(betterproto.Message): + """GrantQueueItem contains the list of TypeURL of a sdk.Msg.""" + + msg_type_urls: List[str] = betterproto.string_field(1) + """msg_type_urls contains the list of TypeURL of a sdk.Msg.""" + + +@dataclass(eq=False, repr=False) +class EventGrant(betterproto.Message): + """EventGrant is emitted on Msg/Grant""" + + msg_type_url: str = betterproto.string_field(2) + """Msg type URL for which an autorization is granted""" + + granter: str = betterproto.string_field(3) + """Granter account address""" + + grantee: str = betterproto.string_field(4) + """Grantee account address""" + + +@dataclass(eq=False, repr=False) +class EventRevoke(betterproto.Message): + """EventRevoke is emitted on Msg/Revoke""" + + msg_type_url: str = betterproto.string_field(2) + """Msg type URL for which an autorization is revoked""" + + granter: str = betterproto.string_field(3) + """Granter account address""" + + grantee: str = betterproto.string_field(4) + """Grantee account address""" + + @dataclass(eq=False, repr=False) class MsgGrant(betterproto.Message): """ @@ -75,10 +115,10 @@ class MsgGrant(betterproto.Message): @dataclass(eq=False, repr=False) -class MsgExecResponse(betterproto.Message): - """MsgExecResponse defines the Msg/MsgExecResponse response type.""" +class MsgGrantResponse(betterproto.Message): + """MsgGrantResponse defines the Msg/MsgGrant response type.""" - results: List[bytes] = betterproto.bytes_field(1) + pass @dataclass(eq=False, repr=False) @@ -92,17 +132,16 @@ class MsgExec(betterproto.Message): grantee: str = betterproto.string_field(1) msgs: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(2) """ - Authorization Msg requests to execute. Each msg must implement - Authorization interface The x/authz will try to find a grant matching - (msg.signers[0], grantee, MsgTypeURL(msg)) triple and validate it. + Execute Msg. The x/authz will try to find a grant matching (msg.signers[0], + grantee, MsgTypeURL(msg)) triple and validate it. """ @dataclass(eq=False, repr=False) -class MsgGrantResponse(betterproto.Message): - """MsgGrantResponse defines the Msg/MsgGrant response type.""" +class MsgExecResponse(betterproto.Message): + """MsgExecResponse defines the Msg/MsgExecResponse response type.""" - pass + results: List[bytes] = betterproto.bytes_field(1) @dataclass(eq=False, repr=False) @@ -185,7 +224,7 @@ class QueryGranterGrantsResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryGranteeGrantsRequest(betterproto.Message): """ - QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants + QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. """ @@ -208,34 +247,6 @@ class QueryGranteeGrantsResponse(betterproto.Message): """pagination defines an pagination for the response.""" -@dataclass(eq=False, repr=False) -class EventGrant(betterproto.Message): - """EventGrant is emitted on Msg/Grant""" - - msg_type_url: str = betterproto.string_field(2) - """Msg type URL for which an autorization is granted""" - - granter: str = betterproto.string_field(3) - """Granter account address""" - - grantee: str = betterproto.string_field(4) - """Grantee account address""" - - -@dataclass(eq=False, repr=False) -class EventRevoke(betterproto.Message): - """EventRevoke is emitted on Msg/Revoke""" - - msg_type_url: str = betterproto.string_field(2) - """Msg type URL for which an autorization is revoked""" - - granter: str = betterproto.string_field(3) - """Granter account address""" - - grantee: str = betterproto.string_field(4) - """Grantee account address""" - - @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState defines the authz module's genesis state.""" @@ -350,6 +361,7 @@ async def grantee_grants( class MsgBase(ServiceBase): + async def grant(self, msg_grant: "MsgGrant") -> "MsgGrantResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -404,6 +416,7 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: class QueryBase(ServiceBase): + async def grants( self, query_grants_request: "QueryGrantsRequest" ) -> "QueryGrantsResponse": diff --git a/secret_sdk/protobuf/cosmos/autocli/__init__.py b/secret_sdk/protobuf/cosmos/autocli/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/autocli/v1/__init__.py b/secret_sdk/protobuf/cosmos/autocli/v1/__init__.py new file mode 100644 index 0000000..cebce71 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/autocli/v1/__init__.py @@ -0,0 +1,251 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/autocli/v1/options.proto, cosmos/autocli/v1/query.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class ModuleOptions(betterproto.Message): + """ModuleOptions describes the CLI options for a Cosmos SDK module.""" + + tx: "ServiceCommandDescriptor" = betterproto.message_field(1) + """tx describes the tx commands for the module.""" + + query: "ServiceCommandDescriptor" = betterproto.message_field(2) + """query describes the queries commands for the module.""" + + +@dataclass(eq=False, repr=False) +class ServiceCommandDescriptor(betterproto.Message): + """ + ServiceCommandDescriptor describes a CLI command based on a protobuf + service. + """ + + service: str = betterproto.string_field(1) + """ + service is the fully qualified name of the protobuf service to build the + command from. It can be left empty if sub_commands are used instead which + may be the case if a module provides multiple tx and/or query services. + """ + + rpc_command_options: List["RpcCommandOptions"] = betterproto.message_field(2) + """ + rpc_command_options are options for commands generated from rpc methods. If + no options are specified for a given rpc method on the service, a command + will be generated for that method with the default options. + """ + + sub_commands: Dict[str, "ServiceCommandDescriptor"] = betterproto.map_field( + 3, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE + ) + """ + sub_commands is a map of optional sub-commands for this command based on + different protobuf services. The map key is used as the name of the sub- + command. + """ + + +@dataclass(eq=False, repr=False) +class RpcCommandOptions(betterproto.Message): + """ + RpcCommandOptions specifies options for commands generated from protobuf + rpc methods. + """ + + rpc_method: str = betterproto.string_field(1) + """ + rpc_method is short name of the protobuf rpc method that this command is + generated from. + """ + + use: str = betterproto.string_field(2) + """ + use is the one-line usage method. It also allows specifying an alternate + name for the command as the first word of the usage text. By default the + name of an rpc command is the kebab-case short name of the rpc method. + """ + + long: str = betterproto.string_field(3) + """long is the long message shown in the 'help ' output.""" + + short: str = betterproto.string_field(4) + """short is the short description shown in the 'help' output.""" + + example: str = betterproto.string_field(5) + """example is examples of how to use the command.""" + + alias: List[str] = betterproto.string_field(6) + """ + alias is an array of aliases that can be used instead of the first word in + Use. + """ + + suggest_for: List[str] = betterproto.string_field(7) + """ + suggest_for is an array of command names for which this command will be + suggested - similar to aliases but only suggests. + """ + + deprecated: str = betterproto.string_field(8) + """ + deprecated defines, if this command is deprecated and should print this + string when used. + """ + + version: str = betterproto.string_field(9) + """ + version defines the version for this command. If this value is non-empty + and the command does not define a "version" flag, a "version" boolean flag + will be added to the command and, if specified, will print content of the + "Version" variable. A shorthand "v" flag will also be added if the command + does not define one. + """ + + flag_options: Dict[str, "FlagOptions"] = betterproto.map_field( + 10, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE + ) + """ + flag_options are options for flags generated from rpc request fields. By + default all request fields are configured as flags. They can also be + configured as positional args instead using positional_args. + """ + + positional_args: List["PositionalArgDescriptor"] = betterproto.message_field(11) + """positional_args specifies positional arguments for the command.""" + + skip: bool = betterproto.bool_field(12) + """ + skip specifies whether to skip this rpc method when generating commands. + """ + + +@dataclass(eq=False, repr=False) +class FlagOptions(betterproto.Message): + """ + FlagOptions are options for flags generated from rpc request fields. By + default, all request fields are configured as flags based on the kebab-case + name of the field. Fields can be turned into positional arguments instead + by using RpcCommandOptions.positional_args. + """ + + name: str = betterproto.string_field(1) + """name is an alternate name to use for the field flag.""" + + shorthand: str = betterproto.string_field(2) + """shorthand is a one-letter abbreviated flag.""" + + usage: str = betterproto.string_field(3) + """usage is the help message.""" + + default_value: str = betterproto.string_field(4) + """default_value is the default value as text.""" + + deprecated: str = betterproto.string_field(6) + """deprecated is the usage text to show if this flag is deprecated.""" + + shorthand_deprecated: str = betterproto.string_field(7) + """ + shorthand_deprecated is the usage text to show if the shorthand of this + flag is deprecated. + """ + + hidden: bool = betterproto.bool_field(8) + """hidden hides the flag from help/usage text""" + + +@dataclass(eq=False, repr=False) +class PositionalArgDescriptor(betterproto.Message): + """PositionalArgDescriptor describes a positional argument.""" + + proto_field: str = betterproto.string_field(1) + """ + proto_field specifies the proto field to use as the positional arg. Any + fields used as positional args will not have a flag generated. + """ + + varargs: bool = betterproto.bool_field(2) + """ + varargs makes a positional parameter a varargs parameter. This can only be + applied to last positional parameter and the proto_field must a repeated + field. + """ + + +@dataclass(eq=False, repr=False) +class AppOptionsRequest(betterproto.Message): + """AppOptionsRequest is the RemoteInfoService/AppOptions request type.""" + + pass + + +@dataclass(eq=False, repr=False) +class AppOptionsResponse(betterproto.Message): + """ + AppOptionsResponse is the RemoteInfoService/AppOptions response type. + """ + + module_options: Dict[str, "ModuleOptions"] = betterproto.map_field( + 1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE + ) + """module_options is a map of module name to autocli module options.""" + + +class QueryStub(betterproto.ServiceStub): + async def app_options( + self, + app_options_request: "AppOptionsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "AppOptionsResponse": + return await self._unary_unary( + "/cosmos.autocli.v1.Query/AppOptions", + app_options_request, + AppOptionsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryBase(ServiceBase): + + async def app_options( + self, app_options_request: "AppOptionsRequest" + ) -> "AppOptionsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_app_options( + self, stream: "grpclib.server.Stream[AppOptionsRequest, AppOptionsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.app_options(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.autocli.v1.Query/AppOptions": grpclib.const.Handler( + self.__rpc_app_options, + grpclib.const.Cardinality.UNARY_UNARY, + AppOptionsRequest, + AppOptionsResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/bank/module/__init__.py b/secret_sdk/protobuf/cosmos/bank/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/bank/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/bank/module/v1/__init__.py new file mode 100644 index 0000000..db4f676 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/bank/module/v1/__init__.py @@ -0,0 +1,26 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/bank/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the bank module.""" + + blocked_module_accounts_override: List[str] = betterproto.string_field(1) + """ + blocked_module_accounts_override configures exceptional module accounts + which should be blocked from receiving funds. If left empty it defaults to + the list of account names supplied in the auth module configuration as + module_account_permissions + """ + + authority: str = betterproto.string_field(2) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/bank/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/bank/v1beta1/__init__.py index eb3f382..0e6d2a1 100644 --- a/secret_sdk/protobuf/cosmos/bank/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/bank/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/bank/v1beta1/authz.proto, cosmos/bank/v1beta1/bank.proto, cosmos/bank/v1beta1/genesis.proto, cosmos/bank/v1beta1/query.proto, cosmos/bank/v1beta1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -23,13 +24,41 @@ from grpclib.metadata import Deadline +@dataclass(eq=False, repr=False) +class SendAuthorization(betterproto.Message): + """ + SendAuthorization allows the grantee to spend up to spend_limit coins from + the granter's account. Since: cosmos-sdk 0.43 + """ + + spend_limit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + allow_list: List[str] = betterproto.string_field(2) + """ + allow_list specifies an optional list of addresses to whom the grantee can + send tokens on behalf of the granter. If omitted, any recipient is allowed. + Since: cosmos-sdk 0.47 + """ + + @dataclass(eq=False, repr=False) class Params(betterproto.Message): """Params defines the parameters for the bank module.""" send_enabled: List["SendEnabled"] = betterproto.message_field(1) + """ + Deprecated: Use of SendEnabled in params is deprecated. For genesis, use + the newly added send_enabled field in the genesis object. Storage, lookup, + and manipulation of this information is now in the keeper. As of cosmos-sdk + 0.47, this only exists for backwards compatibility of genesis files. + """ + default_send_enabled: bool = betterproto.bool_field(2) + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("send_enabled"): + warnings.warn("Params.send_enabled is deprecated", DeprecationWarning) + @dataclass(eq=False, repr=False) class SendEnabled(betterproto.Message): @@ -88,7 +117,7 @@ class DenomUnit(betterproto.Message): exponent: int = betterproto.uint32_field(2) """ exponent represents power of 10 exponent that one must raise the base_denom - to in order to equal the given DenomUnit's denom 1 denom = 1^exponent + to in order to equal the given DenomUnit's denom 1 denom = 10^exponent base_denom (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with exponent = 6, thus: 1 atom = 10^6 uatom). """ @@ -126,6 +155,18 @@ class Metadata(betterproto.Message): be the same as the display. Since: cosmos-sdk 0.43 """ + uri: str = betterproto.string_field(7) + """ + URI to a document (on or off-chain) that contains additional information. + Optional. Since: cosmos-sdk 0.46 + """ + + uri_hash: str = betterproto.string_field(8) + """ + URIHash is a sha256 hash of a document pointed by URI. It's used to verify + that the document didn't change. Optional. Since: cosmos-sdk 0.46 + """ + @dataclass(eq=False, repr=False) class MsgSend(betterproto.Message): @@ -152,6 +193,11 @@ class MsgMultiSend(betterproto.Message): """ inputs: List["Input"] = betterproto.message_field(1) + """ + Inputs, despite being `repeated`, only allows one sender input. This is + checked in MsgMultiSend's ValidateBasic. + """ + outputs: List["Output"] = betterproto.message_field(2) @@ -162,6 +208,69 @@ class MsgMultiSendResponse(betterproto.Message): pass +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/bank parameters to update. NOTE: All parameters must + be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgSetSendEnabled(betterproto.Message): + """ + MsgSetSendEnabled is the Msg/SetSendEnabled request type. Only entries to + add/update/delete need to be included. Existing SendEnabled entries that + are not included in this message are left unchanged. Since: cosmos-sdk 0.47 + """ + + authority: str = betterproto.string_field(1) + """authority is the address that controls the module.""" + + send_enabled: List["SendEnabled"] = betterproto.message_field(2) + """send_enabled is the list of entries to add or update.""" + + use_default_for: List[str] = betterproto.string_field(3) + """ + use_default_for is a list of denoms that should use the + params.default_send_enabled value. Denoms listed here will have their + SendEnabled entries deleted. If a denom is included that doesn't have a + SendEnabled entry, it will be ignored. + """ + + +@dataclass(eq=False, repr=False) +class MsgSetSendEnabledResponse(betterproto.Message): + """ + MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + Since: cosmos-sdk 0.47 + """ + + pass + + @dataclass(eq=False, repr=False) class QueryBalanceRequest(betterproto.Message): """ @@ -198,6 +307,12 @@ class QueryAllBalancesRequest(betterproto.Message): pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) """pagination defines an optional pagination for the request.""" + resolve_denom: bool = betterproto.bool_field(3) + """ + resolve_denom is the flag to resolve the denom into a human-readable form + from the metadata. Since: cosmos-sdk 0.50 + """ + @dataclass(eq=False, repr=False) class QueryAllBalancesResponse(betterproto.Message): @@ -217,7 +332,7 @@ class QueryAllBalancesResponse(betterproto.Message): class QuerySpendableBalancesRequest(betterproto.Message): """ QuerySpendableBalancesRequest defines the gRPC request structure for - querying an account's spendable balances. + querying an account's spendable balances. Since: cosmos-sdk 0.46 """ address: str = betterproto.string_field(1) @@ -231,7 +346,7 @@ class QuerySpendableBalancesRequest(betterproto.Message): class QuerySpendableBalancesResponse(betterproto.Message): """ QuerySpendableBalancesResponse defines the gRPC response structure for - querying an account's spendable balances. + querying an account's spendable balances. Since: cosmos-sdk 0.46 """ balances: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) @@ -241,6 +356,33 @@ class QuerySpendableBalancesResponse(betterproto.Message): """pagination defines the pagination in the response.""" +@dataclass(eq=False, repr=False) +class QuerySpendableBalanceByDenomRequest(betterproto.Message): + """ + QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + querying an account's spendable balance for a specific denom. Since: + cosmos-sdk 0.47 + """ + + address: str = betterproto.string_field(1) + """address is the address to query balances for.""" + + denom: str = betterproto.string_field(2) + """denom is the coin denom to query balances for.""" + + +@dataclass(eq=False, repr=False) +class QuerySpendableBalanceByDenomResponse(betterproto.Message): + """ + QuerySpendableBalanceByDenomResponse defines the gRPC response structure + for querying an account's spendable balance for a specific denom. Since: + cosmos-sdk 0.47 + """ + + balance: "__base_v1_beta1__.Coin" = betterproto.message_field(1) + """balance is the balance of the coin.""" + + @dataclass(eq=False, repr=False) class QueryTotalSupplyRequest(betterproto.Message): """ @@ -309,6 +451,7 @@ class QueryParamsResponse(betterproto.Message): """ params: "Params" = betterproto.message_field(1) + """params provides the parameters of the bank module.""" @dataclass(eq=False, repr=False) @@ -364,13 +507,138 @@ class QueryDenomMetadataResponse(betterproto.Message): @dataclass(eq=False, repr=False) -class SendAuthorization(betterproto.Message): +class QueryDenomMetadataByQueryStringRequest(betterproto.Message): """ - SendAuthorization allows the grantee to spend up to spend_limit coins from - the granter's account. Since: cosmos-sdk 0.43 + QueryDenomMetadataByQueryStringRequest is the request type for the + Query/DenomMetadata RPC method. Identical with QueryDenomMetadataRequest + but receives denom as query string. """ - spend_limit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + denom: str = betterproto.string_field(1) + """denom is the coin denom to query the metadata for.""" + + +@dataclass(eq=False, repr=False) +class QueryDenomMetadataByQueryStringResponse(betterproto.Message): + """ + QueryDenomMetadataByQueryStringResponse is the response type for the + Query/DenomMetadata RPC method. Identical with QueryDenomMetadataResponse + but receives denom as query string in request. + """ + + metadata: "Metadata" = betterproto.message_field(1) + """ + metadata describes and provides all the client information for the + requested token. + """ + + +@dataclass(eq=False, repr=False) +class QueryDenomOwnersRequest(betterproto.Message): + """ + QueryDenomOwnersRequest defines the request type for the DenomOwners RPC + query, which queries for a paginated set of all account holders of a + particular denomination. + """ + + denom: str = betterproto.string_field(1) + """ + denom defines the coin denomination to query all account holders for. + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class DenomOwner(betterproto.Message): + """ + DenomOwner defines structure representing an account that owns or holds a + particular denominated token. It contains the account address and account + balance of the denominated token. Since: cosmos-sdk 0.46 + """ + + address: str = betterproto.string_field(1) + """address defines the address that owns a particular denomination.""" + + balance: "__base_v1_beta1__.Coin" = betterproto.message_field(2) + """balance is the balance of the denominated coin for an account.""" + + +@dataclass(eq=False, repr=False) +class QueryDenomOwnersResponse(betterproto.Message): + """ + QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC + query. Since: cosmos-sdk 0.46 + """ + + denom_owners: List["DenomOwner"] = betterproto.message_field(1) + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryDenomOwnersByQueryRequest(betterproto.Message): + """ + QueryDenomOwnersByQueryRequest defines the request type for the + DenomOwnersByQuery RPC query, which queries for a paginated set of all + account holders of a particular denomination. Since: cosmos-sdk 0.50.3 + """ + + denom: str = betterproto.string_field(1) + """ + denom defines the coin denomination to query all account holders for. + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryDenomOwnersByQueryResponse(betterproto.Message): + """ + QueryDenomOwnersByQueryResponse defines the RPC response of a + DenomOwnersByQuery RPC query. Since: cosmos-sdk 0.50.3 + """ + + denom_owners: List["DenomOwner"] = betterproto.message_field(1) + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QuerySendEnabledRequest(betterproto.Message): + """ + QuerySendEnabledRequest defines the RPC request for looking up SendEnabled + entries. Since: cosmos-sdk 0.47 + """ + + denoms: List[str] = betterproto.string_field(1) + """ + denoms is the specific denoms you want look up. Leave empty to get all + entries. + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(99) + """ + pagination defines an optional pagination for the request. This field is + only read if the denoms field is empty. + """ + + +@dataclass(eq=False, repr=False) +class QuerySendEnabledResponse(betterproto.Message): + """ + QuerySendEnabledResponse defines the RPC response of a SendEnable query. + Since: cosmos-sdk 0.47 + """ + + send_enabled: List["SendEnabled"] = betterproto.message_field(1) + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(99) + """ + pagination defines the pagination in the response. This field is only + populated if the denoms field in the request is empty. + """ @dataclass(eq=False, repr=False) @@ -378,7 +646,7 @@ class GenesisState(betterproto.Message): """GenesisState defines the bank module's genesis state.""" params: "Params" = betterproto.message_field(1) - """params defines all the paramaters of the module.""" + """params defines all the parameters of the module.""" balances: List["Balance"] = betterproto.message_field(2) """balances is an array containing the balances of all the accounts.""" @@ -391,7 +659,13 @@ class GenesisState(betterproto.Message): """ denom_metadata: List["Metadata"] = betterproto.message_field(4) - """denom_metadata defines the metadata of the differents coins.""" + """denom_metadata defines the metadata of the different coins.""" + + send_enabled: List["SendEnabled"] = betterproto.message_field(5) + """ + send_enabled defines the denoms where send is enabled or disabled. Since: + cosmos-sdk 0.47 + """ @dataclass(eq=False, repr=False) @@ -443,6 +717,40 @@ async def multi_send( metadata=metadata, ) + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def set_send_enabled( + self, + msg_set_send_enabled: "MsgSetSendEnabled", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSetSendEnabledResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Msg/SetSendEnabled", + msg_set_send_enabled, + MsgSetSendEnabledResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def balance( @@ -496,6 +804,23 @@ async def spendable_balances( metadata=metadata, ) + async def spendable_balance_by_denom( + self, + query_spendable_balance_by_denom_request: "QuerySpendableBalanceByDenomRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySpendableBalanceByDenomResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", + query_spendable_balance_by_denom_request, + QuerySpendableBalanceByDenomResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def total_supply( self, query_total_supply_request: "QueryTotalSupplyRequest", @@ -564,6 +889,23 @@ async def denom_metadata( metadata=metadata, ) + async def denom_metadata_by_query_string( + self, + query_denom_metadata_by_query_string_request: "QueryDenomMetadataByQueryStringRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDenomMetadataByQueryStringResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", + query_denom_metadata_by_query_string_request, + QueryDenomMetadataByQueryStringResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def denoms_metadata( self, query_denoms_metadata_request: "QueryDenomsMetadataRequest", @@ -581,8 +923,60 @@ async def denoms_metadata( metadata=metadata, ) + async def denom_owners( + self, + query_denom_owners_request: "QueryDenomOwnersRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDenomOwnersResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Query/DenomOwners", + query_denom_owners_request, + QueryDenomOwnersResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def denom_owners_by_query( + self, + query_denom_owners_by_query_request: "QueryDenomOwnersByQueryRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDenomOwnersByQueryResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", + query_denom_owners_by_query_request, + QueryDenomOwnersByQueryResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def send_enabled( + self, + query_send_enabled_request: "QuerySendEnabledRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySendEnabledResponse": + return await self._unary_unary( + "/cosmos.bank.v1beta1.Query/SendEnabled", + query_send_enabled_request, + QuerySendEnabledResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def send(self, msg_send: "MsgSend") -> "MsgSendResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -591,6 +985,16 @@ async def multi_send( ) -> "MsgMultiSendResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def set_send_enabled( + self, msg_set_send_enabled: "MsgSetSendEnabled" + ) -> "MsgSetSendEnabledResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_send( self, stream: "grpclib.server.Stream[MsgSend, MsgSendResponse]" ) -> None: @@ -605,6 +1009,21 @@ async def __rpc_multi_send( response = await self.multi_send(request) await stream.send_message(response) + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + async def __rpc_set_send_enabled( + self, + stream: "grpclib.server.Stream[MsgSetSendEnabled, MsgSetSendEnabledResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.set_send_enabled(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.bank.v1beta1.Msg/Send": grpclib.const.Handler( @@ -619,10 +1038,23 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgMultiSend, MsgMultiSendResponse, ), + "/cosmos.bank.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + "/cosmos.bank.v1beta1.Msg/SetSendEnabled": grpclib.const.Handler( + self.__rpc_set_send_enabled, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSetSendEnabled, + MsgSetSendEnabledResponse, + ), } class QueryBase(ServiceBase): + async def balance( self, query_balance_request: "QueryBalanceRequest" ) -> "QueryBalanceResponse": @@ -638,6 +1070,12 @@ async def spendable_balances( ) -> "QuerySpendableBalancesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def spendable_balance_by_denom( + self, + query_spendable_balance_by_denom_request: "QuerySpendableBalanceByDenomRequest", + ) -> "QuerySpendableBalanceByDenomResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def total_supply( self, query_total_supply_request: "QueryTotalSupplyRequest" ) -> "QueryTotalSupplyResponse": @@ -658,11 +1096,32 @@ async def denom_metadata( ) -> "QueryDenomMetadataResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def denom_metadata_by_query_string( + self, + query_denom_metadata_by_query_string_request: "QueryDenomMetadataByQueryStringRequest", + ) -> "QueryDenomMetadataByQueryStringResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def denoms_metadata( self, query_denoms_metadata_request: "QueryDenomsMetadataRequest" ) -> "QueryDenomsMetadataResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def denom_owners( + self, query_denom_owners_request: "QueryDenomOwnersRequest" + ) -> "QueryDenomOwnersResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def denom_owners_by_query( + self, query_denom_owners_by_query_request: "QueryDenomOwnersByQueryRequest" + ) -> "QueryDenomOwnersByQueryResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def send_enabled( + self, query_send_enabled_request: "QuerySendEnabledRequest" + ) -> "QuerySendEnabledResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_balance( self, stream: "grpclib.server.Stream[QueryBalanceRequest, QueryBalanceResponse]" ) -> None: @@ -686,6 +1145,14 @@ async def __rpc_spendable_balances( response = await self.spendable_balances(request) await stream.send_message(response) + async def __rpc_spendable_balance_by_denom( + self, + stream: "grpclib.server.Stream[QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.spendable_balance_by_denom(request) + await stream.send_message(response) + async def __rpc_total_supply( self, stream: "grpclib.server.Stream[QueryTotalSupplyRequest, QueryTotalSupplyResponse]", @@ -717,6 +1184,14 @@ async def __rpc_denom_metadata( response = await self.denom_metadata(request) await stream.send_message(response) + async def __rpc_denom_metadata_by_query_string( + self, + stream: "grpclib.server.Stream[QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.denom_metadata_by_query_string(request) + await stream.send_message(response) + async def __rpc_denoms_metadata( self, stream: "grpclib.server.Stream[QueryDenomsMetadataRequest, QueryDenomsMetadataResponse]", @@ -725,6 +1200,30 @@ async def __rpc_denoms_metadata( response = await self.denoms_metadata(request) await stream.send_message(response) + async def __rpc_denom_owners( + self, + stream: "grpclib.server.Stream[QueryDenomOwnersRequest, QueryDenomOwnersResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.denom_owners(request) + await stream.send_message(response) + + async def __rpc_denom_owners_by_query( + self, + stream: "grpclib.server.Stream[QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.denom_owners_by_query(request) + await stream.send_message(response) + + async def __rpc_send_enabled( + self, + stream: "grpclib.server.Stream[QuerySendEnabledRequest, QuerySendEnabledResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.send_enabled(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.bank.v1beta1.Query/Balance": grpclib.const.Handler( @@ -745,6 +1244,12 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, ), + "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom": grpclib.const.Handler( + self.__rpc_spendable_balance_by_denom, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySpendableBalanceByDenomRequest, + QuerySpendableBalanceByDenomResponse, + ), "/cosmos.bank.v1beta1.Query/TotalSupply": grpclib.const.Handler( self.__rpc_total_supply, grpclib.const.Cardinality.UNARY_UNARY, @@ -769,10 +1274,34 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryDenomMetadataRequest, QueryDenomMetadataResponse, ), + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString": grpclib.const.Handler( + self.__rpc_denom_metadata_by_query_string, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDenomMetadataByQueryStringRequest, + QueryDenomMetadataByQueryStringResponse, + ), "/cosmos.bank.v1beta1.Query/DenomsMetadata": grpclib.const.Handler( self.__rpc_denoms_metadata, grpclib.const.Cardinality.UNARY_UNARY, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, ), + "/cosmos.bank.v1beta1.Query/DenomOwners": grpclib.const.Handler( + self.__rpc_denom_owners, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDenomOwnersRequest, + QueryDenomOwnersResponse, + ), + "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery": grpclib.const.Handler( + self.__rpc_denom_owners_by_query, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDenomOwnersByQueryRequest, + QueryDenomOwnersByQueryResponse, + ), + "/cosmos.bank.v1beta1.Query/SendEnabled": grpclib.const.Handler( + self.__rpc_send_enabled, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySendEnabledRequest, + QuerySendEnabledResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/base/abci/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/base/abci/v1beta1/__init__.py index 075f6d4..5209731 100644 --- a/secret_sdk/protobuf/cosmos/base/abci/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/abci/v1beta1/__init__.py @@ -1,13 +1,17 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/base/abci/v1beta1/abci.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import List import betterproto import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf -from .....tendermint import abci as ____tendermint_abci__ +from .....tendermint import ( + abci as ____tendermint_abci__, + types as ____tendermint_types__, +) @dataclass(eq=False, repr=False) @@ -66,9 +70,9 @@ class TxResponse(betterproto.Message): """ Events defines all the events emitted by processing a transaction. Note, these events include those emitted by processing all the messages and those - emitted from the ante handler. Whereas Logs contains the events, with - additional metadata, emitted only by processing the messages. Since: - cosmos-sdk 0.42.11, 0.44.5, 0.45 + emitted from the ante. Whereas Logs contains the events, with additional + metadata, emitted only by processing the messages. Since: cosmos-sdk + 0.42.11, 0.44.5, 0.45 """ @@ -129,6 +133,8 @@ class Result(betterproto.Message): """ Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. + Deprecated. This field is still populated, but prefer msg_response instead + because it also contains the Msg response typeURL. """ log: str = betterproto.string_field(2) @@ -140,6 +146,19 @@ class Result(betterproto.Message): or handler execution. """ + msg_responses: List["betterproto_lib_google_protobuf.Any"] = ( + betterproto.message_field(4) + ) + """ + msg_responses contains the Msg handler responses type packed in Anys. + Since: cosmos-sdk 0.46 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("data"): + warnings.warn("Result.data is deprecated", DeprecationWarning) + @dataclass(eq=False, repr=False) class SimulationResponse(betterproto.Message): @@ -162,6 +181,10 @@ class MsgData(betterproto.Message): msg_type: str = betterproto.string_field(1) data: bytes = betterproto.bytes_field(2) + def __post_init__(self) -> None: + warnings.warn("MsgData is deprecated", DeprecationWarning) + super().__post_init__() + @dataclass(eq=False, repr=False) class TxMsgData(betterproto.Message): @@ -171,6 +194,20 @@ class TxMsgData(betterproto.Message): """ data: List["MsgData"] = betterproto.message_field(1) + """data field is deprecated and not populated.""" + + msg_responses: List["betterproto_lib_google_protobuf.Any"] = ( + betterproto.message_field(2) + ) + """ + msg_responses contains the Msg handler responses packed into Anys. Since: + cosmos-sdk 0.46 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("data"): + warnings.warn("TxMsgData.data is deprecated", DeprecationWarning) @dataclass(eq=False, repr=False) @@ -194,3 +231,26 @@ class SearchTxsResult(betterproto.Message): txs: List["TxResponse"] = betterproto.message_field(6) """List of txs in current page""" + + +@dataclass(eq=False, repr=False) +class SearchBlocksResult(betterproto.Message): + """SearchBlocksResult defines a structure for querying blocks pageable""" + + total_count: int = betterproto.int64_field(1) + """Count of all blocks""" + + count: int = betterproto.int64_field(2) + """Count of blocks in current page""" + + page_number: int = betterproto.int64_field(3) + """Index of current page, start from 1""" + + page_total: int = betterproto.int64_field(4) + """Count of total pages""" + + limit: int = betterproto.int64_field(5) + """Max count blocks per page""" + + blocks: List["____tendermint_types__.Block"] = betterproto.message_field(6) + """List of blocks in current page""" diff --git a/secret_sdk/protobuf/cosmos/base/node/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/base/node/v1beta1/__init__.py index 8d7568a..8c4325a 100644 --- a/secret_sdk/protobuf/cosmos/base/node/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/node/v1beta1/__init__.py @@ -2,6 +2,7 @@ # sources: cosmos/base/node/v1beta1/query.proto # plugin: python-betterproto from dataclasses import dataclass +from datetime import datetime from typing import ( TYPE_CHECKING, Dict, @@ -35,6 +36,29 @@ class ConfigResponse(betterproto.Message): """ minimum_gas_price: str = betterproto.string_field(1) + pruning_keep_recent: str = betterproto.string_field(2) + pruning_interval: str = betterproto.string_field(3) + halt_height: int = betterproto.uint64_field(4) + + +@dataclass(eq=False, repr=False) +class StatusRequest(betterproto.Message): + """StateRequest defines the request structure for the status of a node.""" + + pass + + +@dataclass(eq=False, repr=False) +class StatusResponse(betterproto.Message): + """ + StateResponse defines the response structure for the status of a node. + """ + + earliest_store_height: int = betterproto.uint64_field(1) + height: int = betterproto.uint64_field(2) + timestamp: datetime = betterproto.message_field(3) + app_hash: bytes = betterproto.bytes_field(4) + validator_hash: bytes = betterproto.bytes_field(5) class ServiceStub(betterproto.ServiceStub): @@ -55,11 +79,32 @@ async def config( metadata=metadata, ) + async def status( + self, + status_request: "StatusRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "StatusResponse": + return await self._unary_unary( + "/cosmos.base.node.v1beta1.Service/Status", + status_request, + StatusResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class ServiceBase(ServiceBase): + async def config(self, config_request: "ConfigRequest") -> "ConfigResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def status(self, status_request: "StatusRequest") -> "StatusResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_config( self, stream: "grpclib.server.Stream[ConfigRequest, ConfigResponse]" ) -> None: @@ -67,6 +112,13 @@ async def __rpc_config( response = await self.config(request) await stream.send_message(response) + async def __rpc_status( + self, stream: "grpclib.server.Stream[StatusRequest, StatusResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.status(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.base.node.v1beta1.Service/Config": grpclib.const.Handler( @@ -75,4 +127,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: ConfigRequest, ConfigResponse, ), + "/cosmos.base.node.v1beta1.Service/Status": grpclib.const.Handler( + self.__rpc_status, + grpclib.const.Cardinality.UNARY_UNARY, + StatusRequest, + StatusResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/base/query/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/base/query/v1beta1/__init__.py index a0e406d..6347fd1 100644 --- a/secret_sdk/protobuf/cosmos/base/query/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/query/v1beta1/__init__.py @@ -58,7 +58,7 @@ class PageResponse(betterproto.Message): next_key: bytes = betterproto.bytes_field(1) """ next_key is the key to be passed to PageRequest.key to query the next page - most efficiently + most efficiently. It will be empty if there are no more results. """ total: int = betterproto.uint64_field(2) diff --git a/secret_sdk/protobuf/cosmos/base/reflection/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/base/reflection/v1beta1/__init__.py index a038e99..acc754f 100644 --- a/secret_sdk/protobuf/cosmos/base/reflection/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/reflection/v1beta1/__init__.py @@ -100,6 +100,7 @@ async def list_implementations( class ReflectionServiceBase(ServiceBase): + async def list_all_interfaces( self, list_all_interfaces_request: "ListAllInterfacesRequest" ) -> "ListAllInterfacesResponse": diff --git a/secret_sdk/protobuf/cosmos/base/reflection/v2alpha1/__init__.py b/secret_sdk/protobuf/cosmos/base/reflection/v2alpha1/__init__.py index 5bd369c..6b5ecac 100644 --- a/secret_sdk/protobuf/cosmos/base/reflection/v2alpha1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/reflection/v2alpha1/__init__.py @@ -131,17 +131,17 @@ class InterfaceDescriptor(betterproto.Message): fullname: str = betterproto.string_field(1) """fullname is the name of the interface""" - interface_accepting_messages: List[ - "InterfaceAcceptingMessageDescriptor" - ] = betterproto.message_field(2) + interface_accepting_messages: List["InterfaceAcceptingMessageDescriptor"] = ( + betterproto.message_field(2) + ) """ interface_accepting_messages contains information regarding the proto messages which contain the interface as google.protobuf.Any field """ - interface_implementers: List[ - "InterfaceImplementerDescriptor" - ] = betterproto.message_field(3) + interface_implementers: List["InterfaceImplementerDescriptor"] = ( + betterproto.message_field(3) + ) """ interface_implementers is a list of the descriptors of the interface implementers @@ -488,6 +488,7 @@ async def get_tx_descriptor( class ReflectionServiceBase(ServiceBase): + async def get_authn_descriptor( self, get_authn_descriptor_request: "GetAuthnDescriptorRequest" ) -> "GetAuthnDescriptorResponse": diff --git a/secret_sdk/protobuf/cosmos/base/tendermint/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/base/tendermint/v1beta1/__init__.py index 9b48ebd..17327dd 100644 --- a/secret_sdk/protobuf/cosmos/base/tendermint/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/tendermint/v1beta1/__init__.py @@ -1,7 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/base/tendermint/v1beta1/query.proto +# sources: cosmos/base/tendermint/v1beta1/query.proto, cosmos/base/tendermint/v1beta1/types.proto # plugin: python-betterproto from dataclasses import dataclass +from datetime import datetime from typing import ( TYPE_CHECKING, Dict, @@ -17,6 +18,7 @@ from .....tendermint import ( p2p as ____tendermint_p2_p__, types as ____tendermint_types__, + version as ____tendermint_version__, ) from ...query import v1beta1 as __query_v1_beta1__ @@ -27,6 +29,54 @@ from grpclib.metadata import Deadline +@dataclass(eq=False, repr=False) +class Block(betterproto.Message): + """ + Block is tendermint type Block, with the Header proposer address field + converted to bech32 string. + """ + + header: "Header" = betterproto.message_field(1) + data: "____tendermint_types__.Data" = betterproto.message_field(2) + evidence: "____tendermint_types__.EvidenceList" = betterproto.message_field(3) + last_commit: "____tendermint_types__.Commit" = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class Header(betterproto.Message): + """Header defines the structure of a Tendermint block header.""" + + version: "____tendermint_version__.Consensus" = betterproto.message_field(1) + """basic block info""" + + chain_id: str = betterproto.string_field(2) + height: int = betterproto.int64_field(3) + time: datetime = betterproto.message_field(4) + last_block_id: "____tendermint_types__.BlockId" = betterproto.message_field(5) + """prev block info""" + + last_commit_hash: bytes = betterproto.bytes_field(6) + """hashes of block data""" + + data_hash: bytes = betterproto.bytes_field(7) + validators_hash: bytes = betterproto.bytes_field(8) + """hashes from the app output from the prev block""" + + next_validators_hash: bytes = betterproto.bytes_field(9) + consensus_hash: bytes = betterproto.bytes_field(10) + app_hash: bytes = betterproto.bytes_field(11) + last_results_hash: bytes = betterproto.bytes_field(12) + evidence_hash: bytes = betterproto.bytes_field(13) + """consensus info""" + + proposer_address: str = betterproto.string_field(14) + """ + proposer_address is the original block proposer address, formatted as a + Bech32 string. In Tendermint, this type is `bytes`, but in the SDK, we + convert it to a Bech32 string for better UX. + """ + + @dataclass(eq=False, repr=False) class GetValidatorSetByHeightRequest(betterproto.Message): """ @@ -105,6 +155,10 @@ class GetBlockByHeightResponse(betterproto.Message): block_id: "____tendermint_types__.BlockId" = betterproto.message_field(1) block: "____tendermint_types__.Block" = betterproto.message_field(2) + """Deprecated: please use `sdk_block` instead""" + + sdk_block: "Block" = betterproto.message_field(3) + """Since: cosmos-sdk 0.47""" @dataclass(eq=False, repr=False) @@ -126,6 +180,10 @@ class GetLatestBlockResponse(betterproto.Message): block_id: "____tendermint_types__.BlockId" = betterproto.message_field(1) block: "____tendermint_types__.Block" = betterproto.message_field(2) + """Deprecated: please use `sdk_block` instead""" + + sdk_block: "Block" = betterproto.message_field(3) + """Since: cosmos-sdk 0.47""" @dataclass(eq=False, repr=False) @@ -160,7 +218,7 @@ class GetNodeInfoRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetNodeInfoResponse(betterproto.Message): """ - GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC + GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. """ @@ -199,6 +257,62 @@ class Module(betterproto.Message): """checksum""" +@dataclass(eq=False, repr=False) +class AbciQueryRequest(betterproto.Message): + """ + ABCIQueryRequest defines the request structure for the ABCIQuery gRPC + query. + """ + + data: bytes = betterproto.bytes_field(1) + path: str = betterproto.string_field(2) + height: int = betterproto.int64_field(3) + prove: bool = betterproto.bool_field(4) + + +@dataclass(eq=False, repr=False) +class AbciQueryResponse(betterproto.Message): + """ + ABCIQueryResponse defines the response structure for the ABCIQuery gRPC + query. Note: This type is a duplicate of the ResponseQuery proto type + defined in Tendermint. + """ + + code: int = betterproto.uint32_field(1) + log: str = betterproto.string_field(3) + info: str = betterproto.string_field(4) + index: int = betterproto.int64_field(5) + key: bytes = betterproto.bytes_field(6) + value: bytes = betterproto.bytes_field(7) + proof_ops: "ProofOps" = betterproto.message_field(8) + height: int = betterproto.int64_field(9) + codespace: str = betterproto.string_field(10) + + +@dataclass(eq=False, repr=False) +class ProofOp(betterproto.Message): + """ + ProofOp defines an operation used for calculating Merkle root. The data + could be arbitrary format, providing necessary data for example + neighbouring node hash. Note: This type is a duplicate of the ProofOp proto + type defined in Tendermint. + """ + + type: str = betterproto.string_field(1) + key: bytes = betterproto.bytes_field(2) + data: bytes = betterproto.bytes_field(3) + + +@dataclass(eq=False, repr=False) +class ProofOps(betterproto.Message): + """ + ProofOps is Merkle proof defined by the list of ProofOps. Note: This type + is a duplicate of the ProofOps proto type defined in Tendermint. + """ + + ops: List["ProofOp"] = betterproto.message_field(1) + + class ServiceStub(betterproto.ServiceStub): async def get_node_info( self, @@ -302,8 +416,25 @@ async def get_validator_set_by_height( metadata=metadata, ) + async def abci_query( + self, + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "AbciQueryResponse": + return await self._unary_unary( + "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", + abci_query_request, + AbciQueryResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class ServiceBase(ServiceBase): + async def get_node_info( self, get_node_info_request: "GetNodeInfoRequest" ) -> "GetNodeInfoResponse": @@ -334,6 +465,9 @@ async def get_validator_set_by_height( ) -> "GetValidatorSetByHeightResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def abci_query(self) -> "AbciQueryResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_get_node_info( self, stream: "grpclib.server.Stream[GetNodeInfoRequest, GetNodeInfoResponse]" ) -> None: @@ -380,6 +514,13 @@ async def __rpc_get_validator_set_by_height( response = await self.get_validator_set_by_height(request) await stream.send_message(response) + async def __rpc_abci_query( + self, stream: "grpclib.server.Stream[AbciQueryRequest, AbciQueryResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.abci_query(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo": grpclib.const.Handler( @@ -418,4 +559,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ), + "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery": grpclib.const.Handler( + self.__rpc_abci_query, + grpclib.const.Cardinality.UNARY_UNARY, + AbciQueryRequest, + AbciQueryResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/base/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/base/v1beta1/__init__.py index a5bceee..452a521 100644 --- a/secret_sdk/protobuf/cosmos/base/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/base/v1beta1/__init__.py @@ -32,13 +32,19 @@ class DecCoin(betterproto.Message): @dataclass(eq=False, repr=False) class IntProto(betterproto.Message): - """IntProto defines a Protobuf wrapper around an Int object.""" + """ + IntProto defines a Protobuf wrapper around an Int object. Deprecated: + Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. + """ int: str = betterproto.string_field(1) @dataclass(eq=False, repr=False) class DecProto(betterproto.Message): - """DecProto defines a Protobuf wrapper around a Dec object.""" + """ + DecProto defines a Protobuf wrapper around a Dec object. Deprecated: Prefer + to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. + """ dec: str = betterproto.string_field(1) diff --git a/secret_sdk/protobuf/cosmos/consensus/__init__.py b/secret_sdk/protobuf/cosmos/consensus/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/consensus/module/__init__.py b/secret_sdk/protobuf/cosmos/consensus/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/consensus/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/consensus/module/v1/__init__.py new file mode 100644 index 0000000..67c2f02 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/consensus/module/v1/__init__.py @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/consensus/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the consensus module.""" + + authority: str = betterproto.string_field(1) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/consensus/v1/__init__.py b/secret_sdk/protobuf/cosmos/consensus/v1/__init__.py new file mode 100644 index 0000000..cf7b7ea --- /dev/null +++ b/secret_sdk/protobuf/cosmos/consensus/v1/__init__.py @@ -0,0 +1,167 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/consensus/v1/query.proto, cosmos/consensus/v1/tx.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from ....tendermint import types as ___tendermint_types__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the Msg/UpdateParams request type.""" + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + block: "___tendermint_types__.BlockParams" = betterproto.message_field(2) + """ + params defines the x/consensus parameters to update. VersionsParams is not + included in this Msg because it is tracked separarately in x/upgrade. NOTE: + All parameters must be supplied. + """ + + evidence: "___tendermint_types__.EvidenceParams" = betterproto.message_field(3) + validator: "___tendermint_types__.ValidatorParams" = betterproto.message_field(4) + abci: "___tendermint_types__.AbciParams" = betterproto.message_field(5) + """Since: cosmos-sdk 0.50""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryParamsRequest(betterproto.Message): + """ + QueryParamsRequest defines the request type for querying x/consensus + parameters. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryParamsResponse(betterproto.Message): + """ + QueryParamsResponse defines the response type for querying x/consensus + parameters. + """ + + params: "___tendermint_types__.ConsensusParams" = betterproto.message_field(1) + """ + params are the tendermint consensus params stored in the consensus module. + Please note that `params.version` is not populated in this response, it is + tracked separately in the x/upgrade module. + """ + + +class MsgStub(betterproto.ServiceStub): + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.consensus.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def params( + self, + query_params_request: "QueryParamsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryParamsResponse": + return await self._unary_unary( + "/cosmos.consensus.v1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.consensus.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def params( + self, query_params_request: "QueryParamsRequest" + ) -> "QueryParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_params( + self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.consensus.v1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/crisis/module/__init__.py b/secret_sdk/protobuf/cosmos/crisis/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/crisis/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/crisis/module/v1/__init__.py new file mode 100644 index 0000000..ee48179 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/crisis/module/v1/__init__.py @@ -0,0 +1,20 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/crisis/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the crisis module.""" + + fee_collector_name: str = betterproto.string_field(1) + """fee_collector_name is the name of the FeeCollector ModuleAccount.""" + + authority: str = betterproto.string_field(2) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/crisis/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/crisis/v1beta1/__init__.py index 2596612..f4688d7 100644 --- a/secret_sdk/protobuf/cosmos/crisis/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/crisis/v1beta1/__init__.py @@ -28,8 +28,16 @@ class MsgVerifyInvariant(betterproto.Message): """ sender: str = betterproto.string_field(1) + """ + sender is the account address of private key to send coins to fee collector + account. + """ + invariant_module_name: str = betterproto.string_field(2) + """name of the invariant module.""" + invariant_route: str = betterproto.string_field(3) + """invariant_route is the msg's invariant route.""" @dataclass(eq=False, repr=False) @@ -41,6 +49,33 @@ class MsgVerifyInvariantResponse(betterproto.Message): pass +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + constant_fee: "__base_v1_beta1__.Coin" = betterproto.message_field(2) + """constant_fee defines the x/crisis parameter.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState defines the crisis module's genesis state.""" @@ -69,13 +104,36 @@ async def verify_invariant( metadata=metadata, ) + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.crisis.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def verify_invariant( self, msg_verify_invariant: "MsgVerifyInvariant" ) -> "MsgVerifyInvariantResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_verify_invariant( self, stream: "grpclib.server.Stream[MsgVerifyInvariant, MsgVerifyInvariantResponse]", @@ -84,6 +142,13 @@ async def __rpc_verify_invariant( response = await self.verify_invariant(request) await stream.send_message(response) + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.crisis.v1beta1.Msg/VerifyInvariant": grpclib.const.Handler( @@ -92,4 +157,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgVerifyInvariant, MsgVerifyInvariantResponse, ), + "/cosmos.crisis.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/crypto/ed25519/__init__.py b/secret_sdk/protobuf/cosmos/crypto/ed25519/__init__.py index 5f00099..19ddd3b 100644 --- a/secret_sdk/protobuf/cosmos/crypto/ed25519/__init__.py +++ b/secret_sdk/protobuf/cosmos/crypto/ed25519/__init__.py @@ -22,8 +22,8 @@ class PubKey(betterproto.Message): @dataclass(eq=False, repr=False) class PrivKey(betterproto.Message): """ - Deprecated: PrivKey defines a ed25519 private key. NOTE: ed25519 keys must - not be used in SDK apps except in a tendermint validator context. + PrivKey defines a ed25519 private key. NOTE: ed25519 keys must not be used + in SDK apps except in a tendermint validator context. """ key: bytes = betterproto.bytes_field(1) diff --git a/secret_sdk/protobuf/cosmos/crypto/hd/__init__.py b/secret_sdk/protobuf/cosmos/crypto/hd/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/crypto/hd/v1/__init__.py b/secret_sdk/protobuf/cosmos/crypto/hd/v1/__init__.py new file mode 100644 index 0000000..100e3e4 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/crypto/hd/v1/__init__.py @@ -0,0 +1,32 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/crypto/hd/v1/hd.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Bip44Params(betterproto.Message): + """BIP44Params is used as path field in ledger item in Record.""" + + purpose: int = betterproto.uint32_field(1) + """ + purpose is a constant set to 44' (or 0x8000002C) following the BIP43 + recommendation + """ + + coin_type: int = betterproto.uint32_field(2) + """coin_type is a constant that improves privacy""" + + account: int = betterproto.uint32_field(3) + """account splits the key space into independent user identities""" + + change: bool = betterproto.bool_field(4) + """ + change is a constant used for public derivation. Constant 0 is used for + external chain and constant 1 for internal chain. + """ + + address_index: int = betterproto.uint32_field(5) + """address_index is used as child index in BIP32 derivation""" diff --git a/secret_sdk/protobuf/cosmos/crypto/keyring/__init__.py b/secret_sdk/protobuf/cosmos/crypto/keyring/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/crypto/keyring/v1/__init__.py b/secret_sdk/protobuf/cosmos/crypto/keyring/v1/__init__.py new file mode 100644 index 0000000..f444cb7 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/crypto/keyring/v1/__init__.py @@ -0,0 +1,60 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/crypto/keyring/v1/record.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto +import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf + +from ...hd import v1 as __hd_v1__ + + +@dataclass(eq=False, repr=False) +class Record(betterproto.Message): + """Record is used for representing a key in the keyring.""" + + name: str = betterproto.string_field(1) + """name represents a name of Record""" + + pub_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """pub_key represents a public key in any format""" + + local: "RecordLocal" = betterproto.message_field(3, group="item") + """local stores the private key locally.""" + + ledger: "RecordLedger" = betterproto.message_field(4, group="item") + """ledger stores the information about a Ledger key.""" + + multi: "RecordMulti" = betterproto.message_field(5, group="item") + """Multi does not store any other information.""" + + offline: "RecordOffline" = betterproto.message_field(6, group="item") + """Offline does not store any other information.""" + + +@dataclass(eq=False, repr=False) +class RecordLocal(betterproto.Message): + """Item is a keyring item stored in a keyring backend. Local item""" + + priv_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class RecordLedger(betterproto.Message): + """Ledger item""" + + path: "__hd_v1__.Bip44Params" = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class RecordMulti(betterproto.Message): + """Multi item""" + + pass + + +@dataclass(eq=False, repr=False) +class RecordOffline(betterproto.Message): + """Offline item""" + + pass diff --git a/secret_sdk/protobuf/cosmos/crypto/multisig/__init__.py b/secret_sdk/protobuf/cosmos/crypto/multisig/__init__.py index 0019eae..06ce89c 100644 --- a/secret_sdk/protobuf/cosmos/crypto/multisig/__init__.py +++ b/secret_sdk/protobuf/cosmos/crypto/multisig/__init__.py @@ -16,6 +16,6 @@ class LegacyAminoPubKey(betterproto.Message): """ threshold: int = betterproto.uint32_field(1) - public_keys: List[ - "betterproto_lib_google_protobuf.Any" - ] = betterproto.message_field(2) + public_keys: List["betterproto_lib_google_protobuf.Any"] = ( + betterproto.message_field(2) + ) diff --git a/secret_sdk/protobuf/cosmos/distribution/module/__init__.py b/secret_sdk/protobuf/cosmos/distribution/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/distribution/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/distribution/module/v1/__init__.py new file mode 100644 index 0000000..878d9bc --- /dev/null +++ b/secret_sdk/protobuf/cosmos/distribution/module/v1/__init__.py @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/distribution/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the distribution module.""" + + fee_collector_name: str = betterproto.string_field(1) + authority: str = betterproto.string_field(2) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/distribution/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/distribution/v1beta1/__init__.py index 107db0c..8417feb 100644 --- a/secret_sdk/protobuf/cosmos/distribution/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/distribution/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/distribution/v1beta1/distribution.proto, cosmos/distribution/v1beta1/genesis.proto, cosmos/distribution/v1beta1/query.proto, cosmos/distribution/v1beta1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -24,97 +25,38 @@ @dataclass(eq=False, repr=False) -class MsgSetWithdrawAddress(betterproto.Message): - """ - MsgSetWithdrawAddress sets the withdraw address for a delegator (or - validator self-delegation). - """ - - delegator_address: str = betterproto.string_field(1) - withdraw_address: str = betterproto.string_field(2) - - -@dataclass(eq=False, repr=False) -class MsgSetWithdrawAddressResponse(betterproto.Message): - """ - MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response - type. - """ - - pass - - -@dataclass(eq=False, repr=False) -class MsgWithdrawDelegatorReward(betterproto.Message): - """ - MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator - from a single validator. - """ - - delegator_address: str = betterproto.string_field(1) - validator_address: str = betterproto.string_field(2) - - -@dataclass(eq=False, repr=False) -class MsgWithdrawDelegatorRewardResponse(betterproto.Message): - """ - MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward - response type. - """ - - pass - - -@dataclass(eq=False, repr=False) -class MsgWithdrawValidatorCommission(betterproto.Message): - """ - MsgWithdrawValidatorCommission withdraws the full commission to the - validator address. - """ - - validator_address: str = betterproto.string_field(1) - - -@dataclass(eq=False, repr=False) -class MsgWithdrawValidatorCommissionResponse(betterproto.Message): - """ - MsgWithdrawValidatorCommissionResponse defines the - Msg/WithdrawValidatorCommission response type. - """ - - pass - +class Params(betterproto.Message): + """Params defines the set of params for the distribution module.""" -@dataclass(eq=False, repr=False) -class MsgFundCommunityPool(betterproto.Message): + community_tax: str = betterproto.string_field(1) + base_proposer_reward: str = betterproto.string_field(2) """ - MsgFundCommunityPool allows an account to directly fund the community pool. + Deprecated: The base_proposer_reward field is deprecated and is no longer + used in the x/distribution module's reward mechanism. """ - amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) - depositor: str = betterproto.string_field(2) - - -@dataclass(eq=False, repr=False) -class MsgFundCommunityPoolResponse(betterproto.Message): + bonus_proposer_reward: str = betterproto.string_field(3) """ - MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response - type. + Deprecated: The bonus_proposer_reward field is deprecated and is no longer + used in the x/distribution module's reward mechanism. """ - pass - - -@dataclass(eq=False, repr=False) -class Params(betterproto.Message): - """Params defines the set of params for the distribution module.""" - - community_tax: str = betterproto.string_field(1) - base_proposer_reward: str = betterproto.string_field(2) - bonus_proposer_reward: str = betterproto.string_field(3) withdraw_addr_enabled: bool = betterproto.bool_field(4) secret_foundation_tax: str = betterproto.string_field(5) secret_foundation_address: str = betterproto.string_field(6) + minimum_restake_threshold: str = betterproto.string_field(7) + restake_period: str = betterproto.string_field(8) + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("base_proposer_reward"): + warnings.warn( + "Params.base_proposer_reward is deprecated", DeprecationWarning + ) + if self.is_set("bonus_proposer_reward"): + warnings.warn( + "Params.bonus_proposer_reward is deprecated", DeprecationWarning + ) @dataclass(eq=False, repr=False) @@ -131,9 +73,9 @@ class ValidatorHistoricalRewards(betterproto.Message): zeroeth period, set on initialization """ - cumulative_reward_ratio: List[ - "__base_v1_beta1__.DecCoin" - ] = betterproto.message_field(1) + cumulative_reward_ratio: List["__base_v1_beta1__.DecCoin"] = ( + betterproto.message_field(1) + ) reference_count: int = betterproto.uint32_field(2) @@ -203,7 +145,11 @@ class CommunityPoolSpendProposal(betterproto.Message): """ CommunityPoolSpendProposal details a proposal for use of community funds, together with how many coins are proposed to be spent, and to which - recipient account. + recipient account. Deprecated: Do not use. As of the Cosmos SDK release + v0.47.x, there is no longer a need for an explicit + CommunityPoolSpendProposal. To spend community pool funds, a simple + MsgCommunityPoolSpend can be invoked from the x/gov module via a v1 + governance proposal. """ title: str = betterproto.string_field(1) @@ -211,6 +157,10 @@ class CommunityPoolSpendProposal(betterproto.Message): recipient: str = betterproto.string_field(3) amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(4) + def __post_init__(self) -> None: + warnings.warn("CommunityPoolSpendProposal is deprecated", DeprecationWarning) + super().__post_init__() + @dataclass(eq=False, repr=False) class DelegatorStartingInfo(betterproto.Message): @@ -253,6 +203,241 @@ class CommunityPoolSpendProposalWithDeposit(betterproto.Message): deposit: str = betterproto.string_field(5) +@dataclass(eq=False, repr=False) +class MsgSetWithdrawAddress(betterproto.Message): + """ + MsgSetWithdrawAddress sets the withdraw address for a delegator (or + validator self-delegation). + """ + + delegator_address: str = betterproto.string_field(1) + withdraw_address: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MsgSetAutoRestake(betterproto.Message): + """ + MsgEnableAutoRestake enables auto-restaking for a a delegator-validator + pair. + """ + + delegator_address: str = betterproto.string_field(1) + validator_address: str = betterproto.string_field(2) + enabled: bool = betterproto.bool_field(3) + + +@dataclass(eq=False, repr=False) +class MsgSetAutoRestakeResponse(betterproto.Message): + """ + MsgAutoRestakeResponse defines the Msg/AutoRestakeResponse response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgSetWithdrawAddressResponse(betterproto.Message): + """ + MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgWithdrawDelegatorReward(betterproto.Message): + """ + MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + from a single validator. + """ + + delegator_address: str = betterproto.string_field(1) + validator_address: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MsgWithdrawDelegatorRewardResponse(betterproto.Message): + """ + MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + response type. + """ + + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """Since: cosmos-sdk 0.46""" + + +@dataclass(eq=False, repr=False) +class MsgWithdrawValidatorCommission(betterproto.Message): + """ + MsgWithdrawValidatorCommission withdraws the full commission to the + validator address. + """ + + validator_address: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class MsgWithdrawValidatorCommissionResponse(betterproto.Message): + """ + MsgWithdrawValidatorCommissionResponse defines the + Msg/WithdrawValidatorCommission response type. + """ + + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """Since: cosmos-sdk 0.46""" + + +@dataclass(eq=False, repr=False) +class MsgFundCommunityPool(betterproto.Message): + """ + MsgFundCommunityPool allows an account to directly fund the community pool. + """ + + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + depositor: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MsgFundCommunityPoolResponse(betterproto.Message): + """ + MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response + type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/distribution parameters to update. NOTE: All + parameters must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCommunityPoolSpend(betterproto.Message): + """ + MsgCommunityPoolSpend defines a message for sending tokens from the + community pool to another account. This message is typically executed via a + governance proposal with the governance module being the executing + authority. Since: cosmos-sdk 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + recipient: str = betterproto.string_field(2) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class MsgCommunityPoolSpendResponse(betterproto.Message): + """ + MsgCommunityPoolSpendResponse defines the response to executing a + MsgCommunityPoolSpend message. Since: cosmos-sdk 0.47 + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgDepositValidatorRewardsPool(betterproto.Message): + """ + DepositValidatorRewardsPool defines the request structure to provide + additional rewards to delegators from a specific validator. Since: cosmos- + sdk 0.50 + """ + + depositor: str = betterproto.string_field(1) + validator_address: str = betterproto.string_field(2) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class MsgDepositValidatorRewardsPoolResponse(betterproto.Message): + """ + MsgDepositValidatorRewardsPoolResponse defines the response to executing a + MsgDepositValidatorRewardsPool message. Since: cosmos-sdk 0.50 + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryRestakeEntriesRequest(betterproto.Message): + """ + QueryRestakeThresholdRequest is the request type for the Query/Params RPC + method. + """ + + delegator: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class QueryRestakingEntriesResponse(betterproto.Message): + """ + QueryRestakeThresholdResponse is the request type for the Query/Params RPC + method. + """ + + validators: List[str] = betterproto.string_field(1) + """ + threshold = minimum amount in uscrt that you need to have delegated to + enable restaking + """ + + +@dataclass(eq=False, repr=False) +class QueryRestakeThresholdRequest(betterproto.Message): + """ + QueryRestakeThresholdRequest is the request type for the Query/Params RPC + method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryRestakeThresholdResponse(betterproto.Message): + """ + QueryRestakeThresholdResponse is the request type for the Query/Params RPC + method. + """ + + threshold: str = betterproto.string_field(1) + """ + threshold = minimum amount in uscrt that you need to have delegated to + enable restaking + """ + + @dataclass(eq=False, repr=False) class QueryParamsRequest(betterproto.Message): """ @@ -272,6 +457,34 @@ class QueryParamsResponse(betterproto.Message): """params defines the parameters of the module.""" +@dataclass(eq=False, repr=False) +class QueryValidatorDistributionInfoRequest(betterproto.Message): + """ + QueryValidatorDistributionInfoRequest is the request type for the + Query/ValidatorDistributionInfo RPC method. + """ + + validator_address: str = betterproto.string_field(1) + """validator_address defines the validator address to query for.""" + + +@dataclass(eq=False, repr=False) +class QueryValidatorDistributionInfoResponse(betterproto.Message): + """ + QueryValidatorDistributionInfoResponse is the response type for the + Query/ValidatorDistributionInfo RPC method. + """ + + operator_address: str = betterproto.string_field(1) + """operator_address defines the validator operator address.""" + + self_bond_rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(2) + """self_bond_rewards defines the self delegations rewards.""" + + commission: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(3) + """commission defines the commission the validator received.""" + + @dataclass(eq=False, repr=False) class QueryValidatorOutstandingRewardsRequest(betterproto.Message): """ @@ -312,7 +525,7 @@ class QueryValidatorCommissionResponse(betterproto.Message): """ commission: "ValidatorAccumulatedCommission" = betterproto.message_field(1) - """commission defines the commision the validator received.""" + """commission defines the commission the validator received.""" @dataclass(eq=False, repr=False) @@ -522,7 +735,7 @@ class ValidatorOutstandingRewardsRecord(betterproto.Message): 2 ) """ - outstanding_rewards represents the oustanding rewards of a validator. + outstanding_rewards represents the outstanding rewards of a validator. """ @@ -596,7 +809,7 @@ class ValidatorSlashEventRecord(betterproto.Message): """validator_address is the address of the validator.""" height: int = betterproto.uint64_field(2) - """height defines the block height at which the slash event occured.""" + """height defines the block height at which the slash event occurred.""" period: int = betterproto.uint64_field(3) """period is the period of the slash event.""" @@ -610,7 +823,7 @@ class GenesisState(betterproto.Message): """GenesisState defines the distribution module's genesis state.""" params: "Params" = betterproto.message_field(1) - """params defines all the paramaters of the module.""" + """params defines all the parameters of the module.""" fee_pool: "FeePool" = betterproto.message_field(2) """fee_pool defines the fee pool at genesis.""" @@ -623,40 +836,40 @@ class GenesisState(betterproto.Message): previous_proposer: str = betterproto.string_field(4) """fee_pool defines the previous proposer at genesis.""" - outstanding_rewards: List[ - "ValidatorOutstandingRewardsRecord" - ] = betterproto.message_field(5) + outstanding_rewards: List["ValidatorOutstandingRewardsRecord"] = ( + betterproto.message_field(5) + ) """ fee_pool defines the outstanding rewards of all validators at genesis. """ - validator_accumulated_commissions: List[ - "ValidatorAccumulatedCommissionRecord" - ] = betterproto.message_field(6) + validator_accumulated_commissions: List["ValidatorAccumulatedCommissionRecord"] = ( + betterproto.message_field(6) + ) """ - fee_pool defines the accumulated commisions of all validators at genesis. + fee_pool defines the accumulated commissions of all validators at genesis. """ - validator_historical_rewards: List[ - "ValidatorHistoricalRewardsRecord" - ] = betterproto.message_field(7) + validator_historical_rewards: List["ValidatorHistoricalRewardsRecord"] = ( + betterproto.message_field(7) + ) """ fee_pool defines the historical rewards of all validators at genesis. """ - validator_current_rewards: List[ - "ValidatorCurrentRewardsRecord" - ] = betterproto.message_field(8) + validator_current_rewards: List["ValidatorCurrentRewardsRecord"] = ( + betterproto.message_field(8) + ) """fee_pool defines the current rewards of all validators at genesis.""" - delegator_starting_infos: List[ - "DelegatorStartingInfoRecord" - ] = betterproto.message_field(9) + delegator_starting_infos: List["DelegatorStartingInfoRecord"] = ( + betterproto.message_field(9) + ) """fee_pool defines the delegator starting infos at genesis.""" - validator_slash_events: List[ - "ValidatorSlashEventRecord" - ] = betterproto.message_field(10) + validator_slash_events: List["ValidatorSlashEventRecord"] = ( + betterproto.message_field(10) + ) """fee_pool defines the validator slash events at genesis.""" @@ -729,6 +942,74 @@ async def fund_community_pool( metadata=metadata, ) + async def set_auto_restake( + self, + msg_set_auto_restake: "MsgSetAutoRestake", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSetAutoRestakeResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Msg/SetAutoRestake", + msg_set_auto_restake, + MsgSetAutoRestakeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def community_pool_spend( + self, + msg_community_pool_spend: "MsgCommunityPoolSpend", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCommunityPoolSpendResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend", + msg_community_pool_spend, + MsgCommunityPoolSpendResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def deposit_validator_rewards_pool( + self, + msg_deposit_validator_rewards_pool: "MsgDepositValidatorRewardsPool", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgDepositValidatorRewardsPoolResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool", + msg_deposit_validator_rewards_pool, + MsgDepositValidatorRewardsPoolResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def params( @@ -748,6 +1029,23 @@ async def params( metadata=metadata, ) + async def validator_distribution_info( + self, + query_validator_distribution_info_request: "QueryValidatorDistributionInfoRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryValidatorDistributionInfoResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", + query_validator_distribution_info_request, + QueryValidatorDistributionInfoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def validator_outstanding_rewards( self, query_validator_outstanding_rewards_request: "QueryValidatorOutstandingRewardsRequest", @@ -901,8 +1199,43 @@ async def foundation_tax( metadata=metadata, ) + async def restake_threshold( + self, + query_restake_threshold_request: "QueryRestakeThresholdRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryRestakeThresholdResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Query/RestakeThreshold", + query_restake_threshold_request, + QueryRestakeThresholdResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def restaking_entries( + self, + query_restake_entries_request: "QueryRestakeEntriesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryRestakingEntriesResponse": + return await self._unary_unary( + "/cosmos.distribution.v1beta1.Query/RestakingEntries", + query_restake_entries_request, + QueryRestakingEntriesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def set_withdraw_address( self, msg_set_withdraw_address: "MsgSetWithdrawAddress" ) -> "MsgSetWithdrawAddressResponse": @@ -923,6 +1256,26 @@ async def fund_community_pool( ) -> "MsgFundCommunityPoolResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def set_auto_restake( + self, msg_set_auto_restake: "MsgSetAutoRestake" + ) -> "MsgSetAutoRestakeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def community_pool_spend( + self, msg_community_pool_spend: "MsgCommunityPoolSpend" + ) -> "MsgCommunityPoolSpendResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def deposit_validator_rewards_pool( + self, msg_deposit_validator_rewards_pool: "MsgDepositValidatorRewardsPool" + ) -> "MsgDepositValidatorRewardsPoolResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_set_withdraw_address( self, stream: "grpclib.server.Stream[MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse]", @@ -955,6 +1308,37 @@ async def __rpc_fund_community_pool( response = await self.fund_community_pool(request) await stream.send_message(response) + async def __rpc_set_auto_restake( + self, + stream: "grpclib.server.Stream[MsgSetAutoRestake, MsgSetAutoRestakeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.set_auto_restake(request) + await stream.send_message(response) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + async def __rpc_community_pool_spend( + self, + stream: "grpclib.server.Stream[MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.community_pool_spend(request) + await stream.send_message(response) + + async def __rpc_deposit_validator_rewards_pool( + self, + stream: "grpclib.server.Stream[MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.deposit_validator_rewards_pool(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress": grpclib.const.Handler( @@ -981,15 +1365,46 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgFundCommunityPool, MsgFundCommunityPoolResponse, ), + "/cosmos.distribution.v1beta1.Msg/SetAutoRestake": grpclib.const.Handler( + self.__rpc_set_auto_restake, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSetAutoRestake, + MsgSetAutoRestakeResponse, + ), + "/cosmos.distribution.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend": grpclib.const.Handler( + self.__rpc_community_pool_spend, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCommunityPoolSpend, + MsgCommunityPoolSpendResponse, + ), + "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool": grpclib.const.Handler( + self.__rpc_deposit_validator_rewards_pool, + grpclib.const.Cardinality.UNARY_UNARY, + MsgDepositValidatorRewardsPool, + MsgDepositValidatorRewardsPoolResponse, + ), } class QueryBase(ServiceBase): + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def validator_distribution_info( + self, + query_validator_distribution_info_request: "QueryValidatorDistributionInfoRequest", + ) -> "QueryValidatorDistributionInfoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def validator_outstanding_rewards( self, query_validator_outstanding_rewards_request: "QueryValidatorOutstandingRewardsRequest", @@ -1038,6 +1453,16 @@ async def foundation_tax( ) -> "QueryFoundationTaxResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def restake_threshold( + self, query_restake_threshold_request: "QueryRestakeThresholdRequest" + ) -> "QueryRestakeThresholdResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def restaking_entries( + self, query_restake_entries_request: "QueryRestakeEntriesRequest" + ) -> "QueryRestakingEntriesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_params( self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" ) -> None: @@ -1045,6 +1470,14 @@ async def __rpc_params( response = await self.params(request) await stream.send_message(response) + async def __rpc_validator_distribution_info( + self, + stream: "grpclib.server.Stream[QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.validator_distribution_info(request) + await stream.send_message(response) + async def __rpc_validator_outstanding_rewards( self, stream: "grpclib.server.Stream[QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse]", @@ -1117,6 +1550,22 @@ async def __rpc_foundation_tax( response = await self.foundation_tax(request) await stream.send_message(response) + async def __rpc_restake_threshold( + self, + stream: "grpclib.server.Stream[QueryRestakeThresholdRequest, QueryRestakeThresholdResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.restake_threshold(request) + await stream.send_message(response) + + async def __rpc_restaking_entries( + self, + stream: "grpclib.server.Stream[QueryRestakeEntriesRequest, QueryRestakingEntriesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.restaking_entries(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.distribution.v1beta1.Query/Params": grpclib.const.Handler( @@ -1125,6 +1574,12 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryParamsRequest, QueryParamsResponse, ), + "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo": grpclib.const.Handler( + self.__rpc_validator_distribution_info, + grpclib.const.Cardinality.UNARY_UNARY, + QueryValidatorDistributionInfoRequest, + QueryValidatorDistributionInfoResponse, + ), "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards": grpclib.const.Handler( self.__rpc_validator_outstanding_rewards, grpclib.const.Cardinality.UNARY_UNARY, @@ -1179,4 +1634,16 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryFoundationTaxRequest, QueryFoundationTaxResponse, ), + "/cosmos.distribution.v1beta1.Query/RestakeThreshold": grpclib.const.Handler( + self.__rpc_restake_threshold, + grpclib.const.Cardinality.UNARY_UNARY, + QueryRestakeThresholdRequest, + QueryRestakeThresholdResponse, + ), + "/cosmos.distribution.v1beta1.Query/RestakingEntries": grpclib.const.Handler( + self.__rpc_restaking_entries, + grpclib.const.Cardinality.UNARY_UNARY, + QueryRestakeEntriesRequest, + QueryRestakingEntriesResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/evidence/module/__init__.py b/secret_sdk/protobuf/cosmos/evidence/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/evidence/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/evidence/module/v1/__init__.py new file mode 100644 index 0000000..4cdba1f --- /dev/null +++ b/secret_sdk/protobuf/cosmos/evidence/module/v1/__init__.py @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/evidence/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the evidence module.""" + + pass diff --git a/secret_sdk/protobuf/cosmos/evidence/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/evidence/v1beta1/__init__.py index 57fd211..7522515 100644 --- a/secret_sdk/protobuf/cosmos/evidence/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/evidence/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/evidence/v1beta1/evidence.proto, cosmos/evidence/v1beta1/genesis.proto, cosmos/evidence/v1beta1/query.proto, cosmos/evidence/v1beta1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from datetime import datetime from typing import ( @@ -32,7 +33,10 @@ class MsgSubmitEvidence(betterproto.Message): """ submitter: str = betterproto.string_field(1) + """submitter is the signer account address of evidence.""" + evidence: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """evidence defines the evidence of misbehavior.""" @dataclass(eq=False, repr=False) @@ -53,9 +57,16 @@ class Equivocation(betterproto.Message): """ height: int = betterproto.int64_field(1) + """height is the equivocation height.""" + time: datetime = betterproto.message_field(2) + """time is the equivocation time.""" + power: int = betterproto.int64_field(3) + """power is the equivocation validator power.""" + consensus_address: str = betterproto.string_field(4) + """consensus_address is the equivocation validator consensus address.""" @dataclass(eq=False, repr=False) @@ -65,7 +76,23 @@ class QueryEvidenceRequest(betterproto.Message): """ evidence_hash: bytes = betterproto.bytes_field(1) - """evidence_hash defines the hash of the requested evidence.""" + """ + evidence_hash defines the hash of the requested evidence. Deprecated: Use + hash, a HEX encoded string, instead. + """ + + hash: str = betterproto.string_field(2) + """ + hash defines the evidence hash of the requested evidence. Since: cosmos-sdk + 0.47 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("evidence_hash"): + warnings.warn( + "QueryEvidenceRequest.evidence_hash is deprecated", DeprecationWarning + ) @dataclass(eq=False, repr=False) @@ -168,6 +195,7 @@ async def all_evidence( class MsgBase(ServiceBase): + async def submit_evidence( self, msg_submit_evidence: "MsgSubmitEvidence" ) -> "MsgSubmitEvidenceResponse": @@ -193,6 +221,7 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: class QueryBase(ServiceBase): + async def evidence( self, query_evidence_request: "QueryEvidenceRequest" ) -> "QueryEvidenceResponse": diff --git a/secret_sdk/protobuf/cosmos/feegrant/module/__init__.py b/secret_sdk/protobuf/cosmos/feegrant/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/feegrant/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/feegrant/module/v1/__init__.py new file mode 100644 index 0000000..3af2f28 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/feegrant/module/v1/__init__.py @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/feegrant/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the feegrant module.""" + + pass diff --git a/secret_sdk/protobuf/cosmos/feegrant/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/feegrant/v1beta1/__init__.py index 5cd7948..3bb0687 100644 --- a/secret_sdk/protobuf/cosmos/feegrant/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/feegrant/v1beta1/__init__.py @@ -47,7 +47,7 @@ class MsgGrantAllowance(betterproto.Message): """ allowance: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(3) - """allowance can be any of basic and filtered fee allowance.""" + """allowance can be any of basic, periodic, allowed fee allowance.""" @dataclass(eq=False, repr=False) @@ -88,18 +88,38 @@ class MsgRevokeAllowanceResponse(betterproto.Message): pass +@dataclass(eq=False, repr=False) +class MsgPruneAllowances(betterproto.Message): + """ + MsgPruneAllowances prunes expired fee allowances. Since cosmos-sdk 0.50 + """ + + pruner: str = betterproto.string_field(1) + """pruner is the address of the user pruning expired allowances.""" + + +@dataclass(eq=False, repr=False) +class MsgPruneAllowancesResponse(betterproto.Message): + """ + MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response + type. Since cosmos-sdk 0.50 + """ + + pass + + @dataclass(eq=False, repr=False) class BasicAllowance(betterproto.Message): """ - BasicAllowance implements Allowance with a one-time grant of tokens that + BasicAllowance implements Allowance with a one-time grant of coins that optionally expires. The grantee can use up to SpendLimit to cover fees. """ spend_limit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) """ - spend_limit specifies the maximum amount of tokens that can be spent by - this allowance and will be updated as tokens are spent. If it is empty, - there is no spend limit and any amount of coins can be spent. + spend_limit specifies the maximum amount of coins that can be spent by this + allowance and will be updated as coins are spent. If it is empty, there is + no spend limit and any amount of coins can be spent. """ expiration: datetime = betterproto.message_field(2) @@ -149,7 +169,7 @@ class AllowedMsgAllowance(betterproto.Message): """ allowance: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) - """allowance can be any of basic and filtered fee allowance.""" + """allowance can be any of basic and periodic fee allowance.""" allowed_messages: List[str] = betterproto.string_field(2) """ @@ -173,7 +193,7 @@ class Grant(betterproto.Message): """ allowance: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(3) - """allowance can be any of basic and filtered fee allowance.""" + """allowance can be any of basic, periodic, allowed fee allowance.""" @dataclass(eq=False, repr=False) @@ -236,7 +256,7 @@ class QueryAllowancesResponse(betterproto.Message): class QueryAllowancesByGranterRequest(betterproto.Message): """ QueryAllowancesByGranterRequest is the request type for the - Query/AllowancesByGranter RPC method. + Query/AllowancesByGranter RPC method. Since: cosmos-sdk 0.46 """ granter: str = betterproto.string_field(1) @@ -248,7 +268,7 @@ class QueryAllowancesByGranterRequest(betterproto.Message): class QueryAllowancesByGranterResponse(betterproto.Message): """ QueryAllowancesByGranterResponse is the response type for the - Query/AllowancesByGranter RPC method. + Query/AllowancesByGranter RPC method. Since: cosmos-sdk 0.46 """ allowances: List["Grant"] = betterproto.message_field(1) @@ -302,6 +322,23 @@ async def revoke_allowance( metadata=metadata, ) + async def prune_allowances( + self, + msg_prune_allowances: "MsgPruneAllowances", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgPruneAllowancesResponse": + return await self._unary_unary( + "/cosmos.feegrant.v1beta1.Msg/PruneAllowances", + msg_prune_allowances, + MsgPruneAllowancesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def allowance( @@ -357,6 +394,7 @@ async def allowances_by_granter( class MsgBase(ServiceBase): + async def grant_allowance( self, msg_grant_allowance: "MsgGrantAllowance" ) -> "MsgGrantAllowanceResponse": @@ -367,6 +405,11 @@ async def revoke_allowance( ) -> "MsgRevokeAllowanceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def prune_allowances( + self, msg_prune_allowances: "MsgPruneAllowances" + ) -> "MsgPruneAllowancesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_grant_allowance( self, stream: "grpclib.server.Stream[MsgGrantAllowance, MsgGrantAllowanceResponse]", @@ -383,6 +426,14 @@ async def __rpc_revoke_allowance( response = await self.revoke_allowance(request) await stream.send_message(response) + async def __rpc_prune_allowances( + self, + stream: "grpclib.server.Stream[MsgPruneAllowances, MsgPruneAllowancesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.prune_allowances(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.feegrant.v1beta1.Msg/GrantAllowance": grpclib.const.Handler( @@ -397,10 +448,17 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgRevokeAllowance, MsgRevokeAllowanceResponse, ), + "/cosmos.feegrant.v1beta1.Msg/PruneAllowances": grpclib.const.Handler( + self.__rpc_prune_allowances, + grpclib.const.Cardinality.UNARY_UNARY, + MsgPruneAllowances, + MsgPruneAllowancesResponse, + ), } class QueryBase(ServiceBase): + async def allowance( self, query_allowance_request: "QueryAllowanceRequest" ) -> "QueryAllowanceResponse": diff --git a/secret_sdk/protobuf/cosmos/genutil/module/__init__.py b/secret_sdk/protobuf/cosmos/genutil/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/genutil/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/genutil/module/v1/__init__.py new file mode 100644 index 0000000..70e3a1b --- /dev/null +++ b/secret_sdk/protobuf/cosmos/genutil/module/v1/__init__.py @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/genutil/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object for the genutil module.""" + + pass diff --git a/secret_sdk/protobuf/cosmos/gov/module/__init__.py b/secret_sdk/protobuf/cosmos/gov/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/gov/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/gov/module/v1/__init__.py new file mode 100644 index 0000000..ad79ceb --- /dev/null +++ b/secret_sdk/protobuf/cosmos/gov/module/v1/__init__.py @@ -0,0 +1,23 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/gov/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the gov module.""" + + max_metadata_len: int = betterproto.uint64_field(1) + """ + max_metadata_len defines the maximum proposal metadata length. Defaults to + 255 if not explicitly set. + """ + + authority: str = betterproto.string_field(2) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/gov/v1/__init__.py b/secret_sdk/protobuf/cosmos/gov/v1/__init__.py new file mode 100644 index 0000000..64ed8e9 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/gov/v1/__init__.py @@ -0,0 +1,1477 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/gov/v1/genesis.proto, cosmos/gov/v1/gov.proto, cosmos/gov/v1/query.proto, cosmos/gov/v1/tx.proto +# plugin: python-betterproto +import warnings +from dataclasses import dataclass +from datetime import ( + datetime, + timedelta, +) +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from ...base import v1beta1 as __base_v1_beta1__ +from ...base.query import v1beta1 as __base_query_v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +class VoteOption(betterproto.Enum): + """ + VoteOption enumerates the valid vote options for a given governance + proposal. + """ + + VOTE_OPTION_UNSPECIFIED = 0 + """VOTE_OPTION_UNSPECIFIED defines a no-op vote option.""" + + VOTE_OPTION_YES = 1 + """VOTE_OPTION_YES defines a yes vote option.""" + + VOTE_OPTION_ABSTAIN = 2 + """VOTE_OPTION_ABSTAIN defines an abstain vote option.""" + + VOTE_OPTION_NO = 3 + """VOTE_OPTION_NO defines a no vote option.""" + + VOTE_OPTION_NO_WITH_VETO = 4 + """VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.""" + + +class ProposalStatus(betterproto.Enum): + """ProposalStatus enumerates the valid statuses of a proposal.""" + + PROPOSAL_STATUS_UNSPECIFIED = 0 + """PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.""" + + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 + """ + PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + """ + + PROPOSAL_STATUS_VOTING_PERIOD = 2 + """ + PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + """ + + PROPOSAL_STATUS_PASSED = 3 + """ + PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + """ + + PROPOSAL_STATUS_REJECTED = 4 + """ + PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + """ + + PROPOSAL_STATUS_FAILED = 5 + """ + PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + failed. + """ + + +@dataclass(eq=False, repr=False) +class WeightedVoteOption(betterproto.Message): + """WeightedVoteOption defines a unit of vote for vote split.""" + + option: "VoteOption" = betterproto.enum_field(1) + """ + option defines the valid vote options, it must not contain duplicate vote + options. + """ + + weight: str = betterproto.string_field(2) + """weight is the vote weight associated with the vote option.""" + + +@dataclass(eq=False, repr=False) +class Deposit(betterproto.Message): + """ + Deposit defines an amount deposited by an account address to an active + proposal. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + depositor: str = betterproto.string_field(2) + """depositor defines the deposit addresses from the proposals.""" + + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + """amount to be deposited by depositor.""" + + +@dataclass(eq=False, repr=False) +class Proposal(betterproto.Message): + """Proposal defines the core field members of a governance proposal.""" + + id: int = betterproto.uint64_field(1) + """id defines the unique id of the proposal.""" + + messages: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(2) + """ + messages are the arbitrary messages to be executed if the proposal passes. + """ + + status: "ProposalStatus" = betterproto.enum_field(3) + """status defines the proposal status.""" + + final_tally_result: "TallyResult" = betterproto.message_field(4) + """ + final_tally_result is the final tally result of the proposal. When querying + a proposal via gRPC, this field is not populated until the proposal's + voting period has ended. + """ + + submit_time: datetime = betterproto.message_field(5) + """submit_time is the time of proposal submission.""" + + deposit_end_time: datetime = betterproto.message_field(6) + """deposit_end_time is the end time for deposition.""" + + total_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(7) + """total_deposit is the total deposit on the proposal.""" + + voting_start_time: datetime = betterproto.message_field(8) + """voting_start_time is the starting time to vote on a proposal.""" + + voting_end_time: datetime = betterproto.message_field(9) + """voting_end_time is the end time of voting on a proposal.""" + + metadata: str = betterproto.string_field(10) + """ + metadata is any arbitrary metadata attached to the proposal. the + recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + """ + + title: str = betterproto.string_field(11) + """title is the title of the proposal Since: cosmos-sdk 0.47""" + + summary: str = betterproto.string_field(12) + """summary is a short summary of the proposal Since: cosmos-sdk 0.47""" + + proposer: str = betterproto.string_field(13) + """ + proposer is the address of the proposal sumbitter Since: cosmos-sdk 0.47 + """ + + expedited: bool = betterproto.bool_field(14) + """ + expedited defines if the proposal is expedited Since: cosmos-sdk 0.50 + """ + + failed_reason: str = betterproto.string_field(15) + """ + failed_reason defines the reason why the proposal failed Since: cosmos-sdk + 0.50 + """ + + +@dataclass(eq=False, repr=False) +class TallyResult(betterproto.Message): + """TallyResult defines a standard tally for a governance proposal.""" + + yes_count: str = betterproto.string_field(1) + """yes_count is the number of yes votes on a proposal.""" + + abstain_count: str = betterproto.string_field(2) + """abstain_count is the number of abstain votes on a proposal.""" + + no_count: str = betterproto.string_field(3) + """no_count is the number of no votes on a proposal.""" + + no_with_veto_count: str = betterproto.string_field(4) + """ + no_with_veto_count is the number of no with veto votes on a proposal. + """ + + +@dataclass(eq=False, repr=False) +class Vote(betterproto.Message): + """ + Vote defines a vote on a governance proposal. A Vote consists of a proposal + ID, the voter, and the vote option. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + voter: str = betterproto.string_field(2) + """voter is the voter address of the proposal.""" + + options: List["WeightedVoteOption"] = betterproto.message_field(4) + """options is the weighted vote options.""" + + metadata: str = betterproto.string_field(5) + """ + metadata is any arbitrary metadata attached to the vote. the recommended + format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/gov#vote-5 + """ + + +@dataclass(eq=False, repr=False) +class DepositParams(betterproto.Message): + """ + DepositParams defines the params for deposits on governance proposals. + """ + + min_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """Minimum deposit for a proposal to enter voting period.""" + + max_deposit_period: timedelta = betterproto.message_field(2) + """ + Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + months. + """ + + def __post_init__(self) -> None: + warnings.warn("DepositParams is deprecated", DeprecationWarning) + super().__post_init__() + + +@dataclass(eq=False, repr=False) +class VotingParams(betterproto.Message): + """VotingParams defines the params for voting on governance proposals.""" + + voting_period: timedelta = betterproto.message_field(1) + """Duration of the voting period.""" + + def __post_init__(self) -> None: + warnings.warn("VotingParams is deprecated", DeprecationWarning) + super().__post_init__() + + +@dataclass(eq=False, repr=False) +class TallyParams(betterproto.Message): + """ + TallyParams defines the params for tallying votes on governance proposals. + """ + + quorum: str = betterproto.string_field(1) + """ + Minimum percentage of total stake needed to vote for a result to be + considered valid. + """ + + threshold: str = betterproto.string_field(2) + """ + Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + """ + + veto_threshold: str = betterproto.string_field(3) + """ + Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. + Default value: 1/3. + """ + + def __post_init__(self) -> None: + warnings.warn("TallyParams is deprecated", DeprecationWarning) + super().__post_init__() + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """ + Params defines the parameters for the x/gov module. Since: cosmos-sdk 0.47 + """ + + min_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """Minimum deposit for a proposal to enter voting period.""" + + max_deposit_period: timedelta = betterproto.message_field(2) + """ + Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + months. + """ + + voting_period: timedelta = betterproto.message_field(3) + """Duration of the voting period.""" + + quorum: str = betterproto.string_field(4) + """ + Minimum percentage of total stake needed to vote for a result to be + considered valid. + """ + + threshold: str = betterproto.string_field(5) + """ + Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + """ + + veto_threshold: str = betterproto.string_field(6) + """ + Minimum value of Veto votes to Total votes ratio for proposal to be + vetoed. Default value: 1/3. + """ + + min_initial_deposit_ratio: str = betterproto.string_field(7) + """ + The ratio representing the proportion of the deposit value that must be + paid at proposal submission. + """ + + proposal_cancel_ratio: str = betterproto.string_field(8) + """ + The cancel ratio which will not be returned back to the depositors when a + proposal is cancelled. Since: cosmos-sdk 0.50 + """ + + proposal_cancel_dest: str = betterproto.string_field(9) + """ + The address which will receive (proposal_cancel_ratio * deposit) proposal + deposits. If empty, the (proposal_cancel_ratio * deposit) proposal deposits + will be burned. Since: cosmos-sdk 0.50 + """ + + expedited_voting_period: timedelta = betterproto.message_field(10) + """ + Duration of the voting period of an expedited proposal. Since: cosmos-sdk + 0.50 + """ + + expedited_threshold: str = betterproto.string_field(11) + """ + Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + Since: cosmos-sdk 0.50 + """ + + expedited_min_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field( + 12 + ) + """Minimum expedited deposit for a proposal to enter voting period.""" + + burn_vote_quorum: bool = betterproto.bool_field(13) + """burn deposits if a proposal does not meet quorum""" + + burn_proposal_deposit_prevote: bool = betterproto.bool_field(14) + """burn deposits if the proposal does not enter voting period""" + + burn_vote_veto: bool = betterproto.bool_field(15) + """burn deposits if quorum with vote type no_veto is met""" + + min_deposit_ratio: str = betterproto.string_field(16) + """ + The ratio representing the proportion of the deposit value minimum that + must be met when making a deposit. Default value: 0.01. Meaning that for a + chain with a min_deposit of 100stake, a deposit of 1stake would be + required. Since: cosmos-sdk 0.50 + """ + + +@dataclass(eq=False, repr=False) +class MsgSubmitProposal(betterproto.Message): + """ + MsgSubmitProposal defines an sdk.Msg type that supports submitting + arbitrary proposal Content. + """ + + messages: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) + """ + messages are the arbitrary messages to be executed if proposal passes. + """ + + initial_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(2) + """ + initial_deposit is the deposit value that must be paid at proposal + submission. + """ + + proposer: str = betterproto.string_field(3) + """proposer is the account address of the proposer.""" + + metadata: str = betterproto.string_field(4) + """metadata is any arbitrary metadata attached to the proposal.""" + + title: str = betterproto.string_field(5) + """title is the title of the proposal. Since: cosmos-sdk 0.47""" + + summary: str = betterproto.string_field(6) + """summary is the summary of the proposal Since: cosmos-sdk 0.47""" + + expedited: bool = betterproto.bool_field(7) + """ + expedited defines if the proposal is expedited or not Since: cosmos-sdk + 0.50 + """ + + +@dataclass(eq=False, repr=False) +class MsgSubmitProposalResponse(betterproto.Message): + """ + MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + +@dataclass(eq=False, repr=False) +class MsgExecLegacyContent(betterproto.Message): + """ + MsgExecLegacyContent is used to wrap the legacy content field into a + message. This ensures backwards compatibility with + v1beta1.MsgSubmitProposal. + """ + + content: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + """content is the proposal's content.""" + + authority: str = betterproto.string_field(2) + """authority must be the gov module address.""" + + +@dataclass(eq=False, repr=False) +class MsgExecLegacyContentResponse(betterproto.Message): + """ + MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response + type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgVote(betterproto.Message): + """MsgVote defines a message to cast a vote.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + voter: str = betterproto.string_field(2) + """voter is the voter address for the proposal.""" + + option: "VoteOption" = betterproto.enum_field(3) + """option defines the vote option.""" + + metadata: str = betterproto.string_field(4) + """metadata is any arbitrary metadata attached to the Vote.""" + + +@dataclass(eq=False, repr=False) +class MsgVoteResponse(betterproto.Message): + """MsgVoteResponse defines the Msg/Vote response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgVoteWeighted(betterproto.Message): + """MsgVoteWeighted defines a message to cast a vote.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + voter: str = betterproto.string_field(2) + """voter is the voter address for the proposal.""" + + options: List["WeightedVoteOption"] = betterproto.message_field(3) + """options defines the weighted vote options.""" + + metadata: str = betterproto.string_field(4) + """metadata is any arbitrary metadata attached to the VoteWeighted.""" + + +@dataclass(eq=False, repr=False) +class MsgVoteWeightedResponse(betterproto.Message): + """MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgDeposit(betterproto.Message): + """ + MsgDeposit defines a message to submit a deposit to an existing proposal. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + depositor: str = betterproto.string_field(2) + """depositor defines the deposit addresses from the proposals.""" + + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + """amount to be deposited by depositor.""" + + +@dataclass(eq=False, repr=False) +class MsgDepositResponse(betterproto.Message): + """MsgDepositResponse defines the Msg/Deposit response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/gov parameters to update. NOTE: All parameters must be + supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCancelProposal(betterproto.Message): + """ + MsgCancelProposal is the Msg/CancelProposal request type. Since: cosmos-sdk + 0.50 + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + proposer: str = betterproto.string_field(2) + """proposer is the account address of the proposer.""" + + +@dataclass(eq=False, repr=False) +class MsgCancelProposalResponse(betterproto.Message): + """ + MsgCancelProposalResponse defines the response structure for executing a + MsgCancelProposal message. Since: cosmos-sdk 0.50 + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + canceled_time: datetime = betterproto.message_field(2) + """canceled_time is the time when proposal is canceled.""" + + canceled_height: int = betterproto.uint64_field(3) + """ + canceled_height defines the block height at which the proposal is canceled. + """ + + +@dataclass(eq=False, repr=False) +class QueryConstitutionRequest(betterproto.Message): + """ + QueryConstitutionRequest is the request type for the Query/Constitution RPC + method + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryConstitutionResponse(betterproto.Message): + """ + QueryConstitutionResponse is the response type for the Query/Constitution + RPC method + """ + + constitution: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class QueryProposalRequest(betterproto.Message): + """ + QueryProposalRequest is the request type for the Query/Proposal RPC method. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalResponse(betterproto.Message): + """ + QueryProposalResponse is the response type for the Query/Proposal RPC + method. + """ + + proposal: "Proposal" = betterproto.message_field(1) + """proposal is the requested governance proposal.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalsRequest(betterproto.Message): + """ + QueryProposalsRequest is the request type for the Query/Proposals RPC + method. + """ + + proposal_status: "ProposalStatus" = betterproto.enum_field(1) + """proposal_status defines the status of the proposals.""" + + voter: str = betterproto.string_field(2) + """voter defines the voter address for the proposals.""" + + depositor: str = betterproto.string_field(3) + """depositor defines the deposit addresses from the proposals.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(4) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalsResponse(betterproto.Message): + """ + QueryProposalsResponse is the response type for the Query/Proposals RPC + method. + """ + + proposals: List["Proposal"] = betterproto.message_field(1) + """proposals defines all the requested governance proposals.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryVoteRequest(betterproto.Message): + """QueryVoteRequest is the request type for the Query/Vote RPC method.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + voter: str = betterproto.string_field(2) + """voter defines the voter address for the proposals.""" + + +@dataclass(eq=False, repr=False) +class QueryVoteResponse(betterproto.Message): + """ + QueryVoteResponse is the response type for the Query/Vote RPC method. + """ + + vote: "Vote" = betterproto.message_field(1) + """vote defines the queried vote.""" + + +@dataclass(eq=False, repr=False) +class QueryVotesRequest(betterproto.Message): + """ + QueryVotesRequest is the request type for the Query/Votes RPC method. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryVotesResponse(betterproto.Message): + """ + QueryVotesResponse is the response type for the Query/Votes RPC method. + """ + + votes: List["Vote"] = betterproto.message_field(1) + """votes defines the queried votes.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryParamsRequest(betterproto.Message): + """ + QueryParamsRequest is the request type for the Query/Params RPC method. + """ + + params_type: str = betterproto.string_field(1) + """ + params_type defines which parameters to query for, can be one of "voting", + "tallying" or "deposit". + """ + + +@dataclass(eq=False, repr=False) +class QueryParamsResponse(betterproto.Message): + """ + QueryParamsResponse is the response type for the Query/Params RPC method. + """ + + voting_params: "VotingParams" = betterproto.message_field(1) + """ + Deprecated: Prefer to use `params` instead. voting_params defines the + parameters related to voting. + """ + + deposit_params: "DepositParams" = betterproto.message_field(2) + """ + Deprecated: Prefer to use `params` instead. deposit_params defines the + parameters related to deposit. + """ + + tally_params: "TallyParams" = betterproto.message_field(3) + """ + Deprecated: Prefer to use `params` instead. tally_params defines the + parameters related to tally. + """ + + params: "Params" = betterproto.message_field(4) + """ + params defines all the paramaters of x/gov module. Since: cosmos-sdk 0.47 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("voting_params"): + warnings.warn( + "QueryParamsResponse.voting_params is deprecated", DeprecationWarning + ) + if self.is_set("deposit_params"): + warnings.warn( + "QueryParamsResponse.deposit_params is deprecated", DeprecationWarning + ) + if self.is_set("tally_params"): + warnings.warn( + "QueryParamsResponse.tally_params is deprecated", DeprecationWarning + ) + + +@dataclass(eq=False, repr=False) +class QueryDepositRequest(betterproto.Message): + """ + QueryDepositRequest is the request type for the Query/Deposit RPC method. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + depositor: str = betterproto.string_field(2) + """depositor defines the deposit addresses from the proposals.""" + + +@dataclass(eq=False, repr=False) +class QueryDepositResponse(betterproto.Message): + """ + QueryDepositResponse is the response type for the Query/Deposit RPC method. + """ + + deposit: "Deposit" = betterproto.message_field(1) + """deposit defines the requested deposit.""" + + +@dataclass(eq=False, repr=False) +class QueryDepositsRequest(betterproto.Message): + """ + QueryDepositsRequest is the request type for the Query/Deposits RPC method. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryDepositsResponse(betterproto.Message): + """ + QueryDepositsResponse is the response type for the Query/Deposits RPC + method. + """ + + deposits: List["Deposit"] = betterproto.message_field(1) + """deposits defines the requested deposits.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryTallyResultRequest(betterproto.Message): + """ + QueryTallyResultRequest is the request type for the Query/Tally RPC method. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + + +@dataclass(eq=False, repr=False) +class QueryTallyResultResponse(betterproto.Message): + """ + QueryTallyResultResponse is the response type for the Query/Tally RPC + method. + """ + + tally: "TallyResult" = betterproto.message_field(1) + """tally defines the requested tally.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the gov module's genesis state.""" + + starting_proposal_id: int = betterproto.uint64_field(1) + """starting_proposal_id is the ID of the starting proposal.""" + + deposits: List["Deposit"] = betterproto.message_field(2) + """deposits defines all the deposits present at genesis.""" + + votes: List["Vote"] = betterproto.message_field(3) + """votes defines all the votes present at genesis.""" + + proposals: List["Proposal"] = betterproto.message_field(4) + """proposals defines all the proposals present at genesis.""" + + deposit_params: "DepositParams" = betterproto.message_field(5) + """ + Deprecated: Prefer to use `params` instead. deposit_params defines all the + paramaters of related to deposit. + """ + + voting_params: "VotingParams" = betterproto.message_field(6) + """ + Deprecated: Prefer to use `params` instead. voting_params defines all the + paramaters of related to voting. + """ + + tally_params: "TallyParams" = betterproto.message_field(7) + """ + Deprecated: Prefer to use `params` instead. tally_params defines all the + paramaters of related to tally. + """ + + params: "Params" = betterproto.message_field(8) + """ + params defines all the paramaters of x/gov module. Since: cosmos-sdk 0.47 + """ + + constitution: str = betterproto.string_field(9) + """ + The constitution allows builders to lay a foundation and define purpose. + This is an immutable string set in genesis. There are no amendments, to go + outside of scope, just fork. constitution is an immutable string in genesis + for a chain builder to lay out their vision, ideas and ideals. Since: + cosmos-sdk 0.50 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("deposit_params"): + warnings.warn( + "GenesisState.deposit_params is deprecated", DeprecationWarning + ) + if self.is_set("voting_params"): + warnings.warn( + "GenesisState.voting_params is deprecated", DeprecationWarning + ) + if self.is_set("tally_params"): + warnings.warn("GenesisState.tally_params is deprecated", DeprecationWarning) + + +class MsgStub(betterproto.ServiceStub): + async def submit_proposal( + self, + msg_submit_proposal: "MsgSubmitProposal", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSubmitProposalResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/SubmitProposal", + msg_submit_proposal, + MsgSubmitProposalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def exec_legacy_content( + self, + msg_exec_legacy_content: "MsgExecLegacyContent", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgExecLegacyContentResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/ExecLegacyContent", + msg_exec_legacy_content, + MsgExecLegacyContentResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def vote( + self, + msg_vote: "MsgVote", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgVoteResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/Vote", + msg_vote, + MsgVoteResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def vote_weighted( + self, + msg_vote_weighted: "MsgVoteWeighted", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgVoteWeightedResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/VoteWeighted", + msg_vote_weighted, + MsgVoteWeightedResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def deposit( + self, + msg_deposit: "MsgDeposit", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgDepositResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/Deposit", + msg_deposit, + MsgDepositResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def cancel_proposal( + self, + msg_cancel_proposal: "MsgCancelProposal", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCancelProposalResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Msg/CancelProposal", + msg_cancel_proposal, + MsgCancelProposalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def constitution( + self, + query_constitution_request: "QueryConstitutionRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryConstitutionResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Constitution", + query_constitution_request, + QueryConstitutionResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def proposal( + self, + query_proposal_request: "QueryProposalRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryProposalResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Proposal", + query_proposal_request, + QueryProposalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def proposals( + self, + query_proposals_request: "QueryProposalsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryProposalsResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Proposals", + query_proposals_request, + QueryProposalsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def vote( + self, + query_vote_request: "QueryVoteRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVoteResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Vote", + query_vote_request, + QueryVoteResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def votes( + self, + query_votes_request: "QueryVotesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVotesResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Votes", + query_votes_request, + QueryVotesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def params( + self, + query_params_request: "QueryParamsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryParamsResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def deposit( + self, + query_deposit_request: "QueryDepositRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDepositResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Deposit", + query_deposit_request, + QueryDepositResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def deposits( + self, + query_deposits_request: "QueryDepositsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDepositsResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/Deposits", + query_deposits_request, + QueryDepositsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def tally_result( + self, + query_tally_result_request: "QueryTallyResultRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTallyResultResponse": + return await self._unary_unary( + "/cosmos.gov.v1.Query/TallyResult", + query_tally_result_request, + QueryTallyResultResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def submit_proposal( + self, msg_submit_proposal: "MsgSubmitProposal" + ) -> "MsgSubmitProposalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def exec_legacy_content( + self, msg_exec_legacy_content: "MsgExecLegacyContent" + ) -> "MsgExecLegacyContentResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def vote(self, msg_vote: "MsgVote") -> "MsgVoteResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def vote_weighted( + self, msg_vote_weighted: "MsgVoteWeighted" + ) -> "MsgVoteWeightedResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def deposit(self, msg_deposit: "MsgDeposit") -> "MsgDepositResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def cancel_proposal( + self, msg_cancel_proposal: "MsgCancelProposal" + ) -> "MsgCancelProposalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_submit_proposal( + self, + stream: "grpclib.server.Stream[MsgSubmitProposal, MsgSubmitProposalResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.submit_proposal(request) + await stream.send_message(response) + + async def __rpc_exec_legacy_content( + self, + stream: "grpclib.server.Stream[MsgExecLegacyContent, MsgExecLegacyContentResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.exec_legacy_content(request) + await stream.send_message(response) + + async def __rpc_vote( + self, stream: "grpclib.server.Stream[MsgVote, MsgVoteResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.vote(request) + await stream.send_message(response) + + async def __rpc_vote_weighted( + self, stream: "grpclib.server.Stream[MsgVoteWeighted, MsgVoteWeightedResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.vote_weighted(request) + await stream.send_message(response) + + async def __rpc_deposit( + self, stream: "grpclib.server.Stream[MsgDeposit, MsgDepositResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.deposit(request) + await stream.send_message(response) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + async def __rpc_cancel_proposal( + self, + stream: "grpclib.server.Stream[MsgCancelProposal, MsgCancelProposalResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.cancel_proposal(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.gov.v1.Msg/SubmitProposal": grpclib.const.Handler( + self.__rpc_submit_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitProposal, + MsgSubmitProposalResponse, + ), + "/cosmos.gov.v1.Msg/ExecLegacyContent": grpclib.const.Handler( + self.__rpc_exec_legacy_content, + grpclib.const.Cardinality.UNARY_UNARY, + MsgExecLegacyContent, + MsgExecLegacyContentResponse, + ), + "/cosmos.gov.v1.Msg/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + MsgVote, + MsgVoteResponse, + ), + "/cosmos.gov.v1.Msg/VoteWeighted": grpclib.const.Handler( + self.__rpc_vote_weighted, + grpclib.const.Cardinality.UNARY_UNARY, + MsgVoteWeighted, + MsgVoteWeightedResponse, + ), + "/cosmos.gov.v1.Msg/Deposit": grpclib.const.Handler( + self.__rpc_deposit, + grpclib.const.Cardinality.UNARY_UNARY, + MsgDeposit, + MsgDepositResponse, + ), + "/cosmos.gov.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + "/cosmos.gov.v1.Msg/CancelProposal": grpclib.const.Handler( + self.__rpc_cancel_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCancelProposal, + MsgCancelProposalResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def constitution( + self, query_constitution_request: "QueryConstitutionRequest" + ) -> "QueryConstitutionResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def proposal( + self, query_proposal_request: "QueryProposalRequest" + ) -> "QueryProposalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def proposals( + self, query_proposals_request: "QueryProposalsRequest" + ) -> "QueryProposalsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def vote(self, query_vote_request: "QueryVoteRequest") -> "QueryVoteResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def votes( + self, query_votes_request: "QueryVotesRequest" + ) -> "QueryVotesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def params( + self, query_params_request: "QueryParamsRequest" + ) -> "QueryParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def deposit( + self, query_deposit_request: "QueryDepositRequest" + ) -> "QueryDepositResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def deposits( + self, query_deposits_request: "QueryDepositsRequest" + ) -> "QueryDepositsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def tally_result( + self, query_tally_result_request: "QueryTallyResultRequest" + ) -> "QueryTallyResultResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_constitution( + self, + stream: "grpclib.server.Stream[QueryConstitutionRequest, QueryConstitutionResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.constitution(request) + await stream.send_message(response) + + async def __rpc_proposal( + self, + stream: "grpclib.server.Stream[QueryProposalRequest, QueryProposalResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.proposal(request) + await stream.send_message(response) + + async def __rpc_proposals( + self, + stream: "grpclib.server.Stream[QueryProposalsRequest, QueryProposalsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.proposals(request) + await stream.send_message(response) + + async def __rpc_vote( + self, stream: "grpclib.server.Stream[QueryVoteRequest, QueryVoteResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.vote(request) + await stream.send_message(response) + + async def __rpc_votes( + self, stream: "grpclib.server.Stream[QueryVotesRequest, QueryVotesResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.votes(request) + await stream.send_message(response) + + async def __rpc_params( + self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.params(request) + await stream.send_message(response) + + async def __rpc_deposit( + self, stream: "grpclib.server.Stream[QueryDepositRequest, QueryDepositResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.deposit(request) + await stream.send_message(response) + + async def __rpc_deposits( + self, + stream: "grpclib.server.Stream[QueryDepositsRequest, QueryDepositsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.deposits(request) + await stream.send_message(response) + + async def __rpc_tally_result( + self, + stream: "grpclib.server.Stream[QueryTallyResultRequest, QueryTallyResultResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.tally_result(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.gov.v1.Query/Constitution": grpclib.const.Handler( + self.__rpc_constitution, + grpclib.const.Cardinality.UNARY_UNARY, + QueryConstitutionRequest, + QueryConstitutionResponse, + ), + "/cosmos.gov.v1.Query/Proposal": grpclib.const.Handler( + self.__rpc_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + QueryProposalRequest, + QueryProposalResponse, + ), + "/cosmos.gov.v1.Query/Proposals": grpclib.const.Handler( + self.__rpc_proposals, + grpclib.const.Cardinality.UNARY_UNARY, + QueryProposalsRequest, + QueryProposalsResponse, + ), + "/cosmos.gov.v1.Query/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVoteRequest, + QueryVoteResponse, + ), + "/cosmos.gov.v1.Query/Votes": grpclib.const.Handler( + self.__rpc_votes, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVotesRequest, + QueryVotesResponse, + ), + "/cosmos.gov.v1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + "/cosmos.gov.v1.Query/Deposit": grpclib.const.Handler( + self.__rpc_deposit, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDepositRequest, + QueryDepositResponse, + ), + "/cosmos.gov.v1.Query/Deposits": grpclib.const.Handler( + self.__rpc_deposits, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDepositsRequest, + QueryDepositsResponse, + ), + "/cosmos.gov.v1.Query/TallyResult": grpclib.const.Handler( + self.__rpc_tally_result, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTallyResultRequest, + QueryTallyResultResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/gov/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/gov/v1beta1/__init__.py index f4b6acc..c95e148 100644 --- a/secret_sdk/protobuf/cosmos/gov/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/gov/v1beta1/__init__.py @@ -55,7 +55,7 @@ class ProposalStatus(betterproto.Enum): """ProposalStatus enumerates the valid statuses of a proposal.""" PROPOSAL_STATUS_UNSPECIFIED = 0 - """PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status.""" + """PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.""" PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 """ @@ -96,7 +96,13 @@ class WeightedVoteOption(betterproto.Message): """ option: "VoteOption" = betterproto.enum_field(1) + """ + option defines the valid vote options, it must not contain duplicate vote + options. + """ + weight: str = betterproto.string_field(2) + """weight is the vote weight associated with the vote option.""" @dataclass(eq=False, repr=False) @@ -107,7 +113,10 @@ class TextProposal(betterproto.Message): """ title: str = betterproto.string_field(1) + """title of the proposal.""" + description: str = betterproto.string_field(2) + """description associated with the proposal.""" @dataclass(eq=False, repr=False) @@ -118,8 +127,13 @@ class Deposit(betterproto.Message): """ proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + depositor: str = betterproto.string_field(2) + """depositor defines the deposit addresses from the proposals.""" + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + """amount to be deposited by depositor.""" @dataclass(eq=False, repr=False) @@ -127,14 +141,35 @@ class Proposal(betterproto.Message): """Proposal defines the core field members of a governance proposal.""" proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + content: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """content is the proposal's content.""" + status: "ProposalStatus" = betterproto.enum_field(3) + """status defines the proposal status.""" + final_tally_result: "TallyResult" = betterproto.message_field(4) + """ + final_tally_result is the final tally result of the proposal. When querying + a proposal via gRPC, this field is not populated until the proposal's + voting period has ended. + """ + submit_time: datetime = betterproto.message_field(5) + """submit_time is the time of proposal submission.""" + deposit_end_time: datetime = betterproto.message_field(6) + """deposit_end_time is the end time for deposition.""" + total_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(7) + """total_deposit is the total deposit on the proposal.""" + voting_start_time: datetime = betterproto.message_field(8) + """voting_start_time is the starting time to vote on a proposal.""" + voting_end_time: datetime = betterproto.message_field(9) + """voting_end_time is the end time of voting on a proposal.""" @dataclass(eq=False, repr=False) @@ -142,9 +177,16 @@ class TallyResult(betterproto.Message): """TallyResult defines a standard tally for a governance proposal.""" yes: str = betterproto.string_field(1) + """yes is the number of yes votes on a proposal.""" + abstain: str = betterproto.string_field(2) + """abstain is the number of abstain votes on a proposal.""" + no: str = betterproto.string_field(3) + """no is the number of no votes on a proposal.""" + no_with_veto: str = betterproto.string_field(4) + """no_with_veto is the number of no with veto votes on a proposal.""" @dataclass(eq=False, repr=False) @@ -155,7 +197,11 @@ class Vote(betterproto.Message): """ proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + voter: str = betterproto.string_field(2) + """voter is the voter address of the proposal.""" + option: "VoteOption" = betterproto.enum_field(3) """ Deprecated: Prefer to use `options` instead. This field is set in queries @@ -164,7 +210,7 @@ class Vote(betterproto.Message): """ options: List["WeightedVoteOption"] = betterproto.message_field(4) - """Since: cosmos-sdk 0.43""" + """options is the weighted vote options. Since: cosmos-sdk 0.43""" def __post_init__(self) -> None: super().__post_init__() @@ -193,7 +239,7 @@ class VotingParams(betterproto.Message): """VotingParams defines the params for voting on governance proposals.""" voting_period: timedelta = betterproto.message_field(1) - """Length of the voting period.""" + """Duration of the voting period.""" @dataclass(eq=False, repr=False) @@ -215,8 +261,8 @@ class TallyParams(betterproto.Message): veto_threshold: bytes = betterproto.bytes_field(3) """ - Minimum value of Veto votes to Total votes ratio for proposal to be - vetoed. Default value: 1/3. + Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. + Default value: 1/3. """ @@ -228,8 +274,16 @@ class MsgSubmitProposal(betterproto.Message): """ content: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + """content is the proposal's content.""" + initial_deposit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(2) + """ + initial_deposit is the deposit value that must be paid at proposal + submission. + """ + proposer: str = betterproto.string_field(3) + """proposer is the account address of the proposer.""" @dataclass(eq=False, repr=False) @@ -239,6 +293,7 @@ class MsgSubmitProposalResponse(betterproto.Message): """ proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" @dataclass(eq=False, repr=False) @@ -246,8 +301,13 @@ class MsgVote(betterproto.Message): """MsgVote defines a message to cast a vote.""" proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + voter: str = betterproto.string_field(2) + """voter is the voter address for the proposal.""" + option: "VoteOption" = betterproto.enum_field(3) + """option defines the vote option.""" @dataclass(eq=False, repr=False) @@ -264,8 +324,13 @@ class MsgVoteWeighted(betterproto.Message): """ proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + voter: str = betterproto.string_field(2) + """voter is the voter address for the proposal.""" + options: List["WeightedVoteOption"] = betterproto.message_field(3) + """options defines the weighted vote options.""" @dataclass(eq=False, repr=False) @@ -285,8 +350,13 @@ class MsgDeposit(betterproto.Message): """ proposal_id: int = betterproto.uint64_field(1) + """proposal_id defines the unique id of the proposal.""" + depositor: str = betterproto.string_field(2) + """depositor defines the deposit addresses from the proposals.""" + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + """amount to be deposited by depositor.""" @dataclass(eq=False, repr=False) @@ -344,6 +414,8 @@ class QueryProposalsResponse(betterproto.Message): """ proposals: List["Proposal"] = betterproto.message_field(1) + """proposals defines all the requested governance proposals.""" + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) """pagination defines the pagination in the response.""" @@ -356,7 +428,7 @@ class QueryVoteRequest(betterproto.Message): """proposal_id defines the unique id of the proposal.""" voter: str = betterproto.string_field(2) - """voter defines the oter address for the proposals.""" + """voter defines the voter address for the proposals.""" @dataclass(eq=False, repr=False) @@ -366,7 +438,7 @@ class QueryVoteResponse(betterproto.Message): """ vote: "Vote" = betterproto.message_field(1) - """vote defined the queried vote.""" + """vote defines the queried vote.""" @dataclass(eq=False, repr=False) @@ -389,7 +461,7 @@ class QueryVotesResponse(betterproto.Message): """ votes: List["Vote"] = betterproto.message_field(1) - """votes defined the queried votes.""" + """votes defines the queried votes.""" pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) """pagination defines the pagination in the response.""" @@ -468,6 +540,8 @@ class QueryDepositsResponse(betterproto.Message): """ deposits: List["Deposit"] = betterproto.message_field(1) + """deposits defines the requested deposits.""" + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) """pagination defines the pagination in the response.""" @@ -510,13 +584,13 @@ class GenesisState(betterproto.Message): """proposals defines all the proposals present at genesis.""" deposit_params: "DepositParams" = betterproto.message_field(5) - """params defines all the paramaters of related to deposit.""" + """deposit_params defines all the parameters related to deposit.""" voting_params: "VotingParams" = betterproto.message_field(6) - """params defines all the paramaters of related to voting.""" + """voting_params defines all the parameters related to voting.""" tally_params: "TallyParams" = betterproto.message_field(7) - """params defines all the paramaters of related to tally.""" + """tally_params defines all the parameters related to tally.""" class MsgStub(betterproto.ServiceStub): @@ -728,6 +802,7 @@ async def tally_result( class MsgBase(ServiceBase): + async def submit_proposal( self, msg_submit_proposal: "MsgSubmitProposal" ) -> "MsgSubmitProposalResponse": @@ -803,6 +878,7 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: class QueryBase(ServiceBase): + async def proposal( self, query_proposal_request: "QueryProposalRequest" ) -> "QueryProposalResponse": diff --git a/secret_sdk/protobuf/cosmos/ics23/__init__.py b/secret_sdk/protobuf/cosmos/ics23/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/ics23/v1/__init__.py b/secret_sdk/protobuf/cosmos/ics23/v1/__init__.py new file mode 100644 index 0000000..cd884f3 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/ics23/v1/__init__.py @@ -0,0 +1,278 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/ics23/v1/proofs.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +class HashOp(betterproto.Enum): + NO_HASH = 0 + """ + NO_HASH is the default if no data passed. Note this is an illegal argument + some places. + """ + + SHA256 = 1 + SHA512 = 2 + KECCAK = 3 + RIPEMD160 = 4 + BITCOIN = 5 + + +class LengthOp(betterproto.Enum): + """ + *LengthOp defines how to process the key and value of the LeafOpto include + length information. After encoding the length with the givenalgorithm, the + length will be prepended to the key and value bytes.(Each one with it's own + encoded length) + """ + + NO_PREFIX = 0 + """NO_PREFIX don't include any length info""" + + VAR_PROTO = 1 + """VAR_PROTO uses protobuf (and go-amino) varint encoding of the length""" + + VAR_RLP = 2 + """VAR_RLP uses rlp int encoding of the length""" + + FIXED32_BIG = 3 + """ + FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer + """ + + FIXED32_LITTLE = 4 + """ + FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit + integer + """ + + FIXED64_BIG = 5 + """ + FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer + """ + + FIXED64_LITTLE = 6 + """ + FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit + integer + """ + + REQUIRE_32_BYTES = 7 + """ + REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 + bytes (sha256 output) + """ + + REQUIRE_64_BYTES = 8 + """ + REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 + bytes (sha512 output) + """ + + +@dataclass(eq=False, repr=False) +class ExistenceProof(betterproto.Message): + """ + *ExistenceProof takes a key and a value and a set of steps to perform on + it.The result of peforming all these steps will provide a "root hash", + which canbe compared to the value in a header.Since it is computationally + infeasible to produce a hash collission for any of the usedcryptographic + hash functions, if someone can provide a series of operations to transforma + given key and value into a root hash that matches some trusted root, these + key and valuesmust be in the referenced merkle tree.The only possible issue + is maliablity in LeafOp, such as providing extra prefix data,which should + be controlled by a spec. Eg. with lengthOp as NONE,prefix = FOO, key = BAR, + value = CHOICEandprefix = F, key = OOBAR, value = CHOICEwould produce the + same value.With LengthOp this is tricker but not impossible. Which is why + the "leafPrefixEqual" fieldin the ProofSpec is valuable to prevent this + mutability. And why all trees shouldlength-prefix the data before hashing + it. + """ + + key: bytes = betterproto.bytes_field(1) + value: bytes = betterproto.bytes_field(2) + leaf: "LeafOp" = betterproto.message_field(3) + path: List["InnerOp"] = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class NonExistenceProof(betterproto.Message): + """ + NonExistenceProof takes a proof of two neighbors, one left of the desired + key,one right of the desired key. If both proofs are valid AND they are + neighbors,then there is no valid proof for the given key. + """ + + key: bytes = betterproto.bytes_field(1) + left: "ExistenceProof" = betterproto.message_field(2) + right: "ExistenceProof" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class CommitmentProof(betterproto.Message): + """ + CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a + Batch of such messages + """ + + exist: "ExistenceProof" = betterproto.message_field(1, group="proof") + nonexist: "NonExistenceProof" = betterproto.message_field(2, group="proof") + batch: "BatchProof" = betterproto.message_field(3, group="proof") + compressed: "CompressedBatchProof" = betterproto.message_field(4, group="proof") + + +@dataclass(eq=False, repr=False) +class LeafOp(betterproto.Message): + """ + *LeafOp represents the raw key-value data we wish to prove, andmust be + flexible to represent the internal transformation fromthe original key- + value pairs into the basis hash, for many existingmerkle trees.key and + value are passed in. So that the signature of this operation is:leafOp(key, + value) -> outputTo process this, first prehash the keys and values if + needed (ANY means no hash in this case):hkey = prehashKey(key)hvalue = + prehashValue(value)Then combine the bytes, and hash itoutput = hash(prefix + || length(hkey) || hkey || length(hvalue) || hvalue) + """ + + hash: "HashOp" = betterproto.enum_field(1) + prehash_key: "HashOp" = betterproto.enum_field(2) + prehash_value: "HashOp" = betterproto.enum_field(3) + length: "LengthOp" = betterproto.enum_field(4) + prefix: bytes = betterproto.bytes_field(5) + """ + prefix is a fixed bytes that may optionally be included at the beginning to + differentiate a leaf node from an inner node. + """ + + +@dataclass(eq=False, repr=False) +class InnerOp(betterproto.Message): + """ + *InnerOp represents a merkle-proof step that is not a leaf.It represents + concatenating two children and hashing them to provide the next result.The + result of the previous step is passed in, so the signature of this op + is:innerOp(child) -> outputThe result of applying InnerOp should be:output + = op.hash(op.prefix || child || op.suffix)where the || operator is + concatenation of binary data,and child is the result of hashing all the + tree below this step.Any special data, like prepending child with the + length, or prepending the entire operation withsome value to differentiate + from leaf nodes, should be included in prefix and suffix.If either of + prefix or suffix is empty, we just treat it as an empty string + """ + + hash: "HashOp" = betterproto.enum_field(1) + prefix: bytes = betterproto.bytes_field(2) + suffix: bytes = betterproto.bytes_field(3) + + +@dataclass(eq=False, repr=False) +class ProofSpec(betterproto.Message): + """ + *ProofSpec defines what the expected parameters are for a given proof + type.This can be stored in the client and used to validate any incoming + proofs.verify(ProofSpec, Proof) -> Proof | ErrorAs demonstrated in tests, + if we don't fix the algorithm used to calculate theLeafHash for a given + tree, there are many possible key-value pairs that cangenerate a given hash + (by interpretting the preimage differently).We need this for proper + security, requires client knows a priori whattree format server uses. But + not in code, rather a configuration object. + """ + + leaf_spec: "LeafOp" = betterproto.message_field(1) + """ + any field in the ExistenceProof must be the same as in this spec. except + Prefix, which is just the first bytes of prefix (spec can be longer) + """ + + inner_spec: "InnerSpec" = betterproto.message_field(2) + max_depth: int = betterproto.int32_field(3) + """ + max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for + fixed-depth tries) + """ + + min_depth: int = betterproto.int32_field(4) + """ + min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for + fixed-depth tries) + """ + + +@dataclass(eq=False, repr=False) +class InnerSpec(betterproto.Message): + """ + InnerSpec contains all store-specific structure info to determine if two + proofs from agiven store are neighbors.This enables:isLeftMost(spec: + InnerSpec, op: InnerOp)isRightMost(spec: InnerSpec, op: + InnerOp)isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + """ + + child_order: List[int] = betterproto.int32_field(1) + """ + Child order is the ordering of the children node, must count from 0 iavl + tree is [0, 1] (left then right) merk is [0, 2, 1] (left, right, here) + """ + + child_size: int = betterproto.int32_field(2) + min_prefix_length: int = betterproto.int32_field(3) + max_prefix_length: int = betterproto.int32_field(4) + empty_child: bytes = betterproto.bytes_field(5) + """ + empty child is the prehash image that is used when one child is nil (eg. 20 + bytes of 0) + """ + + hash: "HashOp" = betterproto.enum_field(6) + """hash is the algorithm that must be used for each InnerOp""" + + +@dataclass(eq=False, repr=False) +class BatchProof(betterproto.Message): + """BatchProof is a group of multiple proof types than can be compressed""" + + entries: List["BatchEntry"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class BatchEntry(betterproto.Message): + """Use BatchEntry not CommitmentProof, to avoid recursion""" + + exist: "ExistenceProof" = betterproto.message_field(1, group="proof") + nonexist: "NonExistenceProof" = betterproto.message_field(2, group="proof") + + +@dataclass(eq=False, repr=False) +class CompressedBatchProof(betterproto.Message): + entries: List["CompressedBatchEntry"] = betterproto.message_field(1) + lookup_inners: List["InnerOp"] = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class CompressedBatchEntry(betterproto.Message): + """Use BatchEntry not CommitmentProof, to avoid recursion""" + + exist: "CompressedExistenceProof" = betterproto.message_field(1, group="proof") + nonexist: "CompressedNonExistenceProof" = betterproto.message_field( + 2, group="proof" + ) + + +@dataclass(eq=False, repr=False) +class CompressedExistenceProof(betterproto.Message): + key: bytes = betterproto.bytes_field(1) + value: bytes = betterproto.bytes_field(2) + leaf: "LeafOp" = betterproto.message_field(3) + path: List[int] = betterproto.int32_field(4) + """ + these are indexes into the lookup_inners table in CompressedBatchProof + """ + + +@dataclass(eq=False, repr=False) +class CompressedNonExistenceProof(betterproto.Message): + key: bytes = betterproto.bytes_field(1) + left: "CompressedExistenceProof" = betterproto.message_field(2) + right: "CompressedExistenceProof" = betterproto.message_field(3) diff --git a/secret_sdk/protobuf/cosmos/mint/module/__init__.py b/secret_sdk/protobuf/cosmos/mint/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/mint/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/mint/module/v1/__init__.py new file mode 100644 index 0000000..f50a46f --- /dev/null +++ b/secret_sdk/protobuf/cosmos/mint/module/v1/__init__.py @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/mint/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the mint module.""" + + fee_collector_name: str = betterproto.string_field(1) + authority: str = betterproto.string_field(2) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/mint/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/mint/v1beta1/__init__.py index ab060ed..c05b8a8 100644 --- a/secret_sdk/protobuf/cosmos/mint/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/mint/v1beta1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/mint/v1beta1/genesis.proto, cosmos/mint/v1beta1/mint.proto, cosmos/mint/v1beta1/query.proto +# sources: cosmos/mint/v1beta1/genesis.proto, cosmos/mint/v1beta1/mint.proto, cosmos/mint/v1beta1/query.proto, cosmos/mint/v1beta1/tx.proto # plugin: python-betterproto from dataclasses import dataclass from typing import ( @@ -32,7 +32,7 @@ class Minter(betterproto.Message): @dataclass(eq=False, repr=False) class Params(betterproto.Message): - """Params holds parameters for the mint module.""" + """Params defines the parameters for the x/mint module.""" mint_denom: str = betterproto.string_field(1) """type of coin to mint""" @@ -53,6 +53,36 @@ class Params(betterproto.Message): """expected blocks per year""" +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/mint parameters to update. NOTE: All parameters must + be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + @dataclass(eq=False, repr=False) class QueryParamsRequest(betterproto.Message): """ @@ -122,7 +152,26 @@ class GenesisState(betterproto.Message): """minter is a space for holding current inflation information.""" params: "Params" = betterproto.message_field(2) - """params defines all the paramaters of the module.""" + """params defines all the parameters of the module.""" + + +class MsgStub(betterproto.ServiceStub): + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.mint.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) class QueryStub(betterproto.ServiceStub): @@ -178,7 +227,33 @@ async def annual_provisions( ) +class MsgBase(ServiceBase): + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.mint.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + class QueryBase(ServiceBase): + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": diff --git a/secret_sdk/protobuf/cosmos/msg/__init__.py b/secret_sdk/protobuf/cosmos/msg/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/msg/textual/__init__.py b/secret_sdk/protobuf/cosmos/msg/textual/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/msg/textual/v1/__init__.py b/secret_sdk/protobuf/cosmos/msg/textual/v1/__init__.py new file mode 100644 index 0000000..65a94d2 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/msg/textual/v1/__init__.py @@ -0,0 +1,6 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/msg/textual/v1/textual.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto diff --git a/secret_sdk/protobuf/cosmos/msg/v1/__init__.py b/secret_sdk/protobuf/cosmos/msg/v1/__init__.py new file mode 100644 index 0000000..5739c3e --- /dev/null +++ b/secret_sdk/protobuf/cosmos/msg/v1/__init__.py @@ -0,0 +1,6 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/msg/v1/msg.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto diff --git a/secret_sdk/protobuf/cosmos/orm/__init__.py b/secret_sdk/protobuf/cosmos/orm/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/orm/module/__init__.py b/secret_sdk/protobuf/cosmos/orm/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/orm/module/v1alpha1/__init__.py b/secret_sdk/protobuf/cosmos/orm/module/v1alpha1/__init__.py new file mode 100644 index 0000000..962097a --- /dev/null +++ b/secret_sdk/protobuf/cosmos/orm/module/v1alpha1/__init__.py @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/module/v1alpha1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """ + Module defines the ORM module which adds providers to the app container for + ORM ModuleDB's and in the future will automatically register query services + for modules that use the ORM. + """ + + pass diff --git a/secret_sdk/protobuf/cosmos/orm/query/__init__.py b/secret_sdk/protobuf/cosmos/orm/query/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/orm/query/v1alpha1/__init__.py b/secret_sdk/protobuf/cosmos/orm/query/v1alpha1/__init__.py new file mode 100644 index 0000000..0c2d051 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/orm/query/v1alpha1/__init__.py @@ -0,0 +1,242 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/query/v1alpha1/query.proto +# plugin: python-betterproto +import builtins +from dataclasses import dataclass +from datetime import ( + datetime, + timedelta, +) +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from ....base.query import v1beta1 as ___base_query_v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class GetRequest(betterproto.Message): + """GetRequest is the Query/Get request type.""" + + message_name: str = betterproto.string_field(1) + """ + message_name is the fully-qualified message name of the ORM table being + queried. + """ + + index: str = betterproto.string_field(2) + """ + index is the index fields expression used in orm definitions. If it is + empty, the table's primary key is assumed. If it is non-empty, it must + refer to an unique index. + """ + + values: List["IndexValue"] = betterproto.message_field(3) + """ + values are the values of the fields corresponding to the requested index. + There must be as many values provided as there are fields in the index and + these values must correspond to the index field types. + """ + + +@dataclass(eq=False, repr=False) +class GetResponse(betterproto.Message): + """GetResponse is the Query/Get response type.""" + + result: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + """ + result is the result of the get query. If no value is found, the gRPC + status code NOT_FOUND will be returned. + """ + + +@dataclass(eq=False, repr=False) +class ListRequest(betterproto.Message): + """ListRequest is the Query/List request type.""" + + message_name: str = betterproto.string_field(1) + """ + message_name is the fully-qualified message name of the ORM table being + queried. + """ + + index: str = betterproto.string_field(2) + """ + index is the index fields expression used in orm definitions. If it is + empty, the table's primary key is assumed. + """ + + prefix: "ListRequestPrefix" = betterproto.message_field(3, group="query") + """prefix defines a prefix query.""" + + range: "ListRequestRange" = betterproto.message_field(4, group="query") + """range defines a range query.""" + + pagination: "___base_query_v1_beta1__.PageRequest" = betterproto.message_field(5) + """pagination is the pagination request.""" + + +@dataclass(eq=False, repr=False) +class ListRequestPrefix(betterproto.Message): + """Prefix specifies the arguments to a prefix query.""" + + values: List["IndexValue"] = betterproto.message_field(1) + """ + values specifies the index values for the prefix query. It is valid to + special a partial prefix with fewer values than the number of fields in the + index. + """ + + +@dataclass(eq=False, repr=False) +class ListRequestRange(betterproto.Message): + """Range specifies the arguments to a range query.""" + + start: List["IndexValue"] = betterproto.message_field(1) + """ + start specifies the starting index values for the range query. It is valid + to provide fewer values than the number of fields in the index. + """ + + end: List["IndexValue"] = betterproto.message_field(2) + """ + end specifies the inclusive ending index values for the range query. It is + valid to provide fewer values than the number of fields in the index. + """ + + +@dataclass(eq=False, repr=False) +class ListResponse(betterproto.Message): + """ListResponse is the Query/List response type.""" + + results: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) + """results are the results of the query.""" + + pagination: "___base_query_v1_beta1__.PageResponse" = betterproto.message_field(5) + """pagination is the pagination response.""" + + +@dataclass(eq=False, repr=False) +class IndexValue(betterproto.Message): + """ + IndexValue represents the value of a field in an ORM index expression. + """ + + uint: int = betterproto.uint64_field(1, group="value") + """ + uint specifies a value for an uint32, fixed32, uint64, or fixed64 index + field. + """ + + int: builtins.int = betterproto.int64_field(2, group="value") + """ + int64 specifies a value for an int32, sfixed32, int64, or sfixed64 index + field. + """ + + str: builtins.str = betterproto.string_field(3, group="value") + """str specifies a value for a string index field.""" + + bytes: builtins.bytes = betterproto.bytes_field(4, group="value") + """bytes specifies a value for a bytes index field.""" + + enum: builtins.str = betterproto.string_field(5, group="value") + """enum specifies a value for an enum index field.""" + + bool: builtins.bool = betterproto.bool_field(6, group="value") + """bool specifies a value for a bool index field.""" + + timestamp: datetime = betterproto.message_field(7, group="value") + """timestamp specifies a value for a timestamp index field.""" + + duration: timedelta = betterproto.message_field(8, group="value") + """duration specifies a value for a duration index field.""" + + +class QueryStub(betterproto.ServiceStub): + async def get( + self, + get_request: "GetRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "GetResponse": + return await self._unary_unary( + "/cosmos.orm.query.v1alpha1.Query/Get", + get_request, + GetResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def list( + self, + list_request: "ListRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ListResponse": + return await self._unary_unary( + "/cosmos.orm.query.v1alpha1.Query/List", + list_request, + ListResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryBase(ServiceBase): + + async def get(self, get_request: "GetRequest") -> "GetResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def list(self, list_request: "ListRequest") -> "ListResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_get( + self, stream: "grpclib.server.Stream[GetRequest, GetResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.get(request) + await stream.send_message(response) + + async def __rpc_list( + self, stream: "grpclib.server.Stream[ListRequest, ListResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.list(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.orm.query.v1alpha1.Query/Get": grpclib.const.Handler( + self.__rpc_get, + grpclib.const.Cardinality.UNARY_UNARY, + GetRequest, + GetResponse, + ), + "/cosmos.orm.query.v1alpha1.Query/List": grpclib.const.Handler( + self.__rpc_list, + grpclib.const.Cardinality.UNARY_UNARY, + ListRequest, + ListResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/orm/v1/__init__.py b/secret_sdk/protobuf/cosmos/orm/v1/__init__.py new file mode 100644 index 0000000..9cf4870 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/orm/v1/__init__.py @@ -0,0 +1,112 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/v1/orm.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class TableDescriptor(betterproto.Message): + """TableDescriptor describes an ORM table.""" + + primary_key: "PrimaryKeyDescriptor" = betterproto.message_field(1) + """primary_key defines the primary key for the table.""" + + index: List["SecondaryIndexDescriptor"] = betterproto.message_field(2) + """index defines one or more secondary indexes.""" + + id: int = betterproto.uint32_field(3) + """ + id is a non-zero integer ID that must be unique within the tables and + singletons in this file. It may be deprecated in the future when this can + be auto-generated. + """ + + +@dataclass(eq=False, repr=False) +class PrimaryKeyDescriptor(betterproto.Message): + """PrimaryKeyDescriptor describes a table primary key.""" + + fields: str = betterproto.string_field(1) + """ + fields is a comma-separated list of fields in the primary key. Spaces are + not allowed. Supported field types, their encodings, and any applicable + constraints are described below. - uint32 are encoded as 2,3,4 or 5 bytes + using a compact encoding that is suitable for sorted iteration (not + varint encoding). This type is well-suited for small integers. - + uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that is + suitable for sorted iteration (not varint encoding). This type is well- + suited for small integers such as auto-incrementing sequences. - fixed32, + fixed64 are encoded as big-endian fixed width bytes and support sorted + iteration. These types are well-suited for encoding fixed with decimals + as integers. - string's are encoded as raw bytes in terminal key segments + and null-terminated in non-terminal segments. Null characters are thus + forbidden in strings. string fields support sorted iteration. - bytes + are encoded as raw bytes in terminal segments and length-prefixed with a + 32-bit unsigned varint in non-terminal segments. - int32, sint32, int64, + sint64, sfixed32, sfixed64 are encoded as fixed width bytes with an + encoding that enables sorted iteration. - google.protobuf.Timestamp is + encoded such that values with only seconds occupy 6 bytes, values + including nanos occupy 9 bytes, and nil values occupy 1 byte. When + iterating, nil values will always be ordered last. Seconds and nanos + values must conform to the officially specified ranges of + 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 + respectively. - google.protobuf.Duration is encoded as 12 bytes using an + encoding that enables sorted iteration. - enum fields are encoded using + varint encoding and do not support sorted iteration. - bool fields are + encoded as a single byte 0 or 1. All other fields types are unsupported in + keys including repeated and oneof fields. Primary keys are prefixed by the + varint encoded table id and the byte 0x0 plus any additional prefix + specified by the schema. + """ + + auto_increment: bool = betterproto.bool_field(2) + """ + auto_increment specifies that the primary key is generated by an auto- + incrementing integer. If this is set to true fields must only contain one + field of that is of type uint64. + """ + + +@dataclass(eq=False, repr=False) +class SecondaryIndexDescriptor(betterproto.Message): + """PrimaryKeyDescriptor describes a table secondary index.""" + + fields: str = betterproto.string_field(1) + """ + fields is a comma-separated list of fields in the index. The supported + field types are the same as those for PrimaryKeyDescriptor.fields. Index + keys are prefixed by the varint encoded table id and the varint encoded + index id plus any additional prefix specified by the schema. In addition + the field segments, non-unique index keys are suffixed with any additional + primary key fields not present in the index fields so that the primary key + can be reconstructed. Unique indexes instead of being suffixed store the + remaining primary key fields in the value.. + """ + + id: int = betterproto.uint32_field(2) + """ + id is a non-zero integer ID that must be unique within the indexes for this + table and less than 32768. It may be deprecated in the future when this can + be auto-generated. + """ + + unique: bool = betterproto.bool_field(3) + """unique specifies that this an unique index.""" + + +@dataclass(eq=False, repr=False) +class SingletonDescriptor(betterproto.Message): + """ + TableDescriptor describes an ORM singleton table which has at most one + instance. + """ + + id: int = betterproto.uint32_field(1) + """ + id is a non-zero integer ID that must be unique within the tables and + singletons in this file. It may be deprecated in the future when this can + be auto-generated. + """ diff --git a/secret_sdk/protobuf/cosmos/orm/v1alpha1/__init__.py b/secret_sdk/protobuf/cosmos/orm/v1alpha1/__init__.py new file mode 100644 index 0000000..87bf2f7 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/orm/v1alpha1/__init__.py @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/v1alpha1/schema.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +class StorageType(betterproto.Enum): + """StorageType""" + + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0 + """ + STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all + data is stored in the regular Merkle-tree backed KV-store. + """ + + STORAGE_TYPE_MEMORY = 1 + """ + STORAGE_TYPE_MEMORY indicates in-memory storage that will be reloaded every + time an app restarts. Tables with this type of storage will by default be + ignored when importing and exporting a module's state from JSON. + """ + + STORAGE_TYPE_TRANSIENT = 2 + """ + STORAGE_TYPE_TRANSIENT indicates transient storage that is reset at the end + of every block. Tables with this type of storage will by default be ignored + when importing and exporting a module's state from JSON. + """ + + +@dataclass(eq=False, repr=False) +class ModuleSchemaDescriptor(betterproto.Message): + """ModuleSchemaDescriptor describe's a module's ORM schema.""" + + schema_file: List["ModuleSchemaDescriptorFileEntry"] = betterproto.message_field(1) + prefix: bytes = betterproto.bytes_field(2) + """ + prefix is an optional prefix that precedes all keys in this module's store. + """ + + +@dataclass(eq=False, repr=False) +class ModuleSchemaDescriptorFileEntry(betterproto.Message): + """FileEntry describes an ORM file used in a module.""" + + id: int = betterproto.uint32_field(1) + """ + id is a prefix that will be varint encoded and prepended to all the table + keys specified in the file's tables. + """ + + proto_file_name: str = betterproto.string_field(2) + """ + proto_file_name is the name of a file .proto in that contains table + definitions. The .proto file must be in a package that the module has + referenced using cosmos.app.v1.ModuleDescriptor.use_package. + """ + + storage_type: "StorageType" = betterproto.enum_field(3) + """ + storage_type optionally indicates the type of storage this file's tables + should used. If it is left unspecified, the default KV-storage of the app + will be used. + """ diff --git a/secret_sdk/protobuf/cosmos/params/module/__init__.py b/secret_sdk/protobuf/cosmos/params/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/params/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/params/module/v1/__init__.py new file mode 100644 index 0000000..69ddd3d --- /dev/null +++ b/secret_sdk/protobuf/cosmos/params/module/v1/__init__.py @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/params/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the params module.""" + + pass diff --git a/secret_sdk/protobuf/cosmos/params/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/params/v1beta1/__init__.py index be11080..f897014 100644 --- a/secret_sdk/protobuf/cosmos/params/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/params/v1beta1/__init__.py @@ -65,6 +65,37 @@ class QueryParamsResponse(betterproto.Message): """param defines the queried parameter.""" +@dataclass(eq=False, repr=False) +class QuerySubspacesRequest(betterproto.Message): + """ + QuerySubspacesRequest defines a request type for querying for all + registered subspaces and all keys for a subspace. Since: cosmos-sdk 0.46 + """ + + pass + + +@dataclass(eq=False, repr=False) +class QuerySubspacesResponse(betterproto.Message): + """ + QuerySubspacesResponse defines the response types for querying for all + registered subspaces and all keys for a subspace. Since: cosmos-sdk 0.46 + """ + + subspaces: List["Subspace"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class Subspace(betterproto.Message): + """ + Subspace defines a parameter subspace name and all the keys that exist for + the subspace. Since: cosmos-sdk 0.46 + """ + + subspace: str = betterproto.string_field(1) + keys: List[str] = betterproto.string_field(2) + + class QueryStub(betterproto.ServiceStub): async def params( self, @@ -83,13 +114,36 @@ async def params( metadata=metadata, ) + async def subspaces( + self, + query_subspaces_request: "QuerySubspacesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySubspacesResponse": + return await self._unary_unary( + "/cosmos.params.v1beta1.Query/Subspaces", + query_subspaces_request, + QuerySubspacesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryBase(ServiceBase): + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def subspaces( + self, query_subspaces_request: "QuerySubspacesRequest" + ) -> "QuerySubspacesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_params( self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" ) -> None: @@ -97,6 +151,14 @@ async def __rpc_params( response = await self.params(request) await stream.send_message(response) + async def __rpc_subspaces( + self, + stream: "grpclib.server.Stream[QuerySubspacesRequest, QuerySubspacesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.subspaces(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.params.v1beta1.Query/Params": grpclib.const.Handler( @@ -105,4 +167,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryParamsRequest, QueryParamsResponse, ), + "/cosmos.params.v1beta1.Query/Subspaces": grpclib.const.Handler( + self.__rpc_subspaces, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySubspacesRequest, + QuerySubspacesResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/query/__init__.py b/secret_sdk/protobuf/cosmos/query/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/query/v1/__init__.py b/secret_sdk/protobuf/cosmos/query/v1/__init__.py new file mode 100644 index 0000000..3a2f39a --- /dev/null +++ b/secret_sdk/protobuf/cosmos/query/v1/__init__.py @@ -0,0 +1,6 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/query/v1/query.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto diff --git a/secret_sdk/protobuf/cosmos/reflection/__init__.py b/secret_sdk/protobuf/cosmos/reflection/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/reflection/v1/__init__.py b/secret_sdk/protobuf/cosmos/reflection/v1/__init__.py new file mode 100644 index 0000000..44f4ccd --- /dev/null +++ b/secret_sdk/protobuf/cosmos/reflection/v1/__init__.py @@ -0,0 +1,83 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/reflection/v1/reflection.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class FileDescriptorsRequest(betterproto.Message): + """FileDescriptorsRequest is the Query/FileDescriptors request type.""" + + pass + + +@dataclass(eq=False, repr=False) +class FileDescriptorsResponse(betterproto.Message): + """FileDescriptorsResponse is the Query/FileDescriptors response type.""" + + files: List["betterproto_lib_google_protobuf.FileDescriptorProto"] = ( + betterproto.message_field(1) + ) + """files is the file descriptors.""" + + +class ReflectionServiceStub(betterproto.ServiceStub): + async def file_descriptors( + self, + file_descriptors_request: "FileDescriptorsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "FileDescriptorsResponse": + return await self._unary_unary( + "/cosmos.reflection.v1.ReflectionService/FileDescriptors", + file_descriptors_request, + FileDescriptorsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class ReflectionServiceBase(ServiceBase): + + async def file_descriptors( + self, file_descriptors_request: "FileDescriptorsRequest" + ) -> "FileDescriptorsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_file_descriptors( + self, + stream: "grpclib.server.Stream[FileDescriptorsRequest, FileDescriptorsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.file_descriptors(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.reflection.v1.ReflectionService/FileDescriptors": grpclib.const.Handler( + self.__rpc_file_descriptors, + grpclib.const.Cardinality.UNARY_UNARY, + FileDescriptorsRequest, + FileDescriptorsResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/slashing/module/__init__.py b/secret_sdk/protobuf/cosmos/slashing/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/slashing/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/slashing/module/v1/__init__.py new file mode 100644 index 0000000..462aa58 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/slashing/module/v1/__init__.py @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/slashing/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the slashing module.""" + + authority: str = betterproto.string_field(1) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/slashing/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/slashing/v1beta1/__init__.py index d3e1f99..bd28f7b 100644 --- a/secret_sdk/protobuf/cosmos/slashing/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/slashing/v1beta1/__init__.py @@ -26,20 +26,6 @@ from grpclib.metadata import Deadline -@dataclass(eq=False, repr=False) -class MsgUnjail(betterproto.Message): - """MsgUnjail defines the Msg/Unjail request type""" - - validator_addr: str = betterproto.string_field(1) - - -@dataclass(eq=False, repr=False) -class MsgUnjailResponse(betterproto.Message): - """MsgUnjailResponse defines the Msg/Unjail response type""" - - pass - - @dataclass(eq=False, repr=False) class ValidatorSigningInfo(betterproto.Message): """ @@ -49,14 +35,13 @@ class ValidatorSigningInfo(betterproto.Message): address: str = betterproto.string_field(1) start_height: int = betterproto.int64_field(2) - """Height at which validator was first a candidate OR was unjailed""" + """Height at which validator was first a candidate OR was un-jailed""" index_offset: int = betterproto.int64_field(3) """ - Index which is incremented each time the validator was a bonded in a block - and may have signed a precommit or not. This in conjunction with the - `SignedBlocksWindow` param determines the index in the - `MissedBlocksBitArray`. + Index which is incremented every time a validator is bonded in a block and + _may_ have signed a pre-commit or not. This in conjunction with the + signed_blocks_window param determines the index in the missed block bitmap. """ jailed_until: datetime = betterproto.message_field(4) @@ -68,13 +53,13 @@ class ValidatorSigningInfo(betterproto.Message): """ Whether or not a validator has been tombstoned (killed out of validator set). It is set once the validator commits an equivocation or for any other - configured misbehiavor. + configured misbehavior. """ missed_blocks_counter: int = betterproto.int64_field(6) """ - A counter kept to avoid unnecessary array reads. Note that - `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + A counter of missed (unsigned) blocks. It is used to avoid unnecessary + reads in the missed block bitmap. """ @@ -89,6 +74,50 @@ class Params(betterproto.Message): slash_fraction_downtime: bytes = betterproto.bytes_field(5) +@dataclass(eq=False, repr=False) +class MsgUnjail(betterproto.Message): + """MsgUnjail defines the Msg/Unjail request type""" + + validator_addr: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class MsgUnjailResponse(betterproto.Message): + """MsgUnjailResponse defines the Msg/Unjail response type""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/slashing parameters to update. NOTE: All parameters + must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + @dataclass(eq=False, repr=False) class QueryParamsRequest(betterproto.Message): """ @@ -157,7 +186,7 @@ class GenesisState(betterproto.Message): """GenesisState defines the slashing module's genesis state.""" params: "Params" = betterproto.message_field(1) - """params defines all the paramaters of related to deposit.""" + """params defines all the parameters of the module.""" signing_infos: List["SigningInfo"] = betterproto.message_field(2) """ @@ -228,6 +257,23 @@ async def unjail( metadata=metadata, ) + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.slashing.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def params( @@ -283,9 +329,15 @@ async def signing_infos( class MsgBase(ServiceBase): + async def unjail(self, msg_unjail: "MsgUnjail") -> "MsgUnjailResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_unjail( self, stream: "grpclib.server.Stream[MsgUnjail, MsgUnjailResponse]" ) -> None: @@ -293,6 +345,13 @@ async def __rpc_unjail( response = await self.unjail(request) await stream.send_message(response) + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.slashing.v1beta1.Msg/Unjail": grpclib.const.Handler( @@ -301,10 +360,17 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgUnjail, MsgUnjailResponse, ), + "/cosmos.slashing.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } class QueryBase(ServiceBase): + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": diff --git a/secret_sdk/protobuf/cosmos/staking/module/__init__.py b/secret_sdk/protobuf/cosmos/staking/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/staking/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/staking/module/v1/__init__.py new file mode 100644 index 0000000..857d70d --- /dev/null +++ b/secret_sdk/protobuf/cosmos/staking/module/v1/__init__.py @@ -0,0 +1,33 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/staking/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the staking module.""" + + hooks_order: List[str] = betterproto.string_field(1) + """ + hooks_order specifies the order of staking hooks and should be a list of + module names which provide a staking hooks instance. If no order is + provided, then hooks will be applied in alphabetical order of module names. + """ + + authority: str = betterproto.string_field(2) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ + + bech32_prefix_validator: str = betterproto.string_field(3) + """bech32_prefix_validator is the bech32 validator prefix for the app.""" + + bech32_prefix_consensus: str = betterproto.string_field(4) + """ + bech32_prefix_consensus is the bech32 consensus node prefix for the app. + """ diff --git a/secret_sdk/protobuf/cosmos/staking/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/staking/v1beta1/__init__.py index c1b16f7..4102ce2 100644 --- a/secret_sdk/protobuf/cosmos/staking/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/staking/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/staking/v1beta1/authz.proto, cosmos/staking/v1beta1/genesis.proto, cosmos/staking/v1beta1/query.proto, cosmos/staking/v1beta1/staking.proto, cosmos/staking/v1beta1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from datetime import ( datetime, @@ -18,7 +19,10 @@ import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ....tendermint import types as ___tendermint_types__ +from ....tendermint import ( + abci as ___tendermint_abci__, + types as ___tendermint_types__, +) from ...base import v1beta1 as __base_v1_beta1__ from ...base.query import v1beta1 as __base_query_v1_beta1__ @@ -45,6 +49,19 @@ class BondStatus(betterproto.Enum): """BONDED defines a validator that is bonded.""" +class Infraction(betterproto.Enum): + """Infraction indicates the infraction a validator commited.""" + + INFRACTION_UNSPECIFIED = 0 + """UNSPECIFIED defines an empty infraction.""" + + INFRACTION_DOUBLE_SIGN = 1 + """DOUBLE_SIGN defines a validator that double-signs a block.""" + + INFRACTION_DOWNTIME = 2 + """DOWNTIME defines a validator that missed signing too many blocks.""" + + class AuthorizationType(betterproto.Enum): """ AuthorizationType defines the type of staking module authorization type @@ -73,6 +90,12 @@ class AuthorizationType(betterproto.Enum): Msg/BeginRedelegate """ + AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION = 4 + """ + AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization + type for Msg/MsgCancelUnbondingDelegation + """ + @dataclass(eq=False, repr=False) class HistoricalInfo(betterproto.Message): @@ -211,7 +234,19 @@ class Validator(betterproto.Message): min_self_delegation: str = betterproto.string_field(11) """ min_self_delegation is the validator's self declared minimum self - delegation. + delegation. Since: cosmos-sdk 0.46 + """ + + unbonding_on_hold_ref_count: int = betterproto.int64_field(12) + """ + strictly positive if this validator's unbonding has been stopped by + external modules + """ + + unbonding_ids: List[int] = betterproto.uint64_field(13) + """ + list of unbonding ids, each uniquely identifing an unbonding of this + validator """ @@ -271,10 +306,10 @@ class Delegation(betterproto.Message): """ delegator_address: str = betterproto.string_field(1) - """delegator_address is the bech32-encoded address of the delegator.""" + """delegator_address is the encoded address of the delegator.""" validator_address: str = betterproto.string_field(2) - """validator_address is the bech32-encoded address of the validator.""" + """validator_address is the encoded address of the validator.""" shares: str = betterproto.string_field(3) """shares define the delegation shares received.""" @@ -288,10 +323,10 @@ class UnbondingDelegation(betterproto.Message): """ delegator_address: str = betterproto.string_field(1) - """delegator_address is the bech32-encoded address of the delegator.""" + """delegator_address is the encoded address of the delegator.""" validator_address: str = betterproto.string_field(2) - """validator_address is the bech32-encoded address of the validator.""" + """validator_address is the encoded address of the validator.""" entries: List["UnbondingDelegationEntry"] = betterproto.message_field(3) """entries are the unbonding delegation entries.""" @@ -319,6 +354,15 @@ class UnbondingDelegationEntry(betterproto.Message): balance: str = betterproto.string_field(4) """balance defines the tokens to receive at completion.""" + unbonding_id: int = betterproto.uint64_field(5) + """Incrementing id that uniquely identifies this entry""" + + unbonding_on_hold_ref_count: int = betterproto.int64_field(6) + """ + Strictly positive if this entry's unbonding has been stopped by external + modules + """ + @dataclass(eq=False, repr=False) class RedelegationEntry(betterproto.Message): @@ -345,6 +389,15 @@ class RedelegationEntry(betterproto.Message): redelegation. """ + unbonding_id: int = betterproto.uint64_field(5) + """Incrementing id that uniquely identifies this entry""" + + unbonding_on_hold_ref_count: int = betterproto.int64_field(6) + """ + Strictly positive if this entry's unbonding has been stopped by external + modules + """ + @dataclass(eq=False, repr=False) class Redelegation(betterproto.Message): @@ -375,7 +428,7 @@ class Redelegation(betterproto.Message): @dataclass(eq=False, repr=False) class Params(betterproto.Message): - """Params defines the parameters for the staking module.""" + """Params defines the parameters for the x/staking module.""" unbonding_time: timedelta = betterproto.message_field(1) """unbonding_time is the time duration of unbonding.""" @@ -395,6 +448,12 @@ class Params(betterproto.Message): bond_denom: str = betterproto.string_field(5) """bond_denom defines the bondable coin denomination.""" + min_commission_rate: str = betterproto.string_field(6) + """ + min_commission_rate is the chain-wide minimum commission rate that a + validator can charge their delegators + """ + @dataclass(eq=False, repr=False) class DelegationResponse(betterproto.Message): @@ -442,6 +501,58 @@ class Pool(betterproto.Message): bonded_tokens: str = betterproto.string_field(2) +@dataclass(eq=False, repr=False) +class ValidatorUpdates(betterproto.Message): + """ + ValidatorUpdates defines an array of abci.ValidatorUpdate objects. TODO: + explore moving this to proto/cosmos/base to separate modules from + tendermint dependence + """ + + updates: List["___tendermint_abci__.ValidatorUpdate"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class StakeAuthorization(betterproto.Message): + """ + StakeAuthorization defines authorization for + delegate/undelegate/redelegate. Since: cosmos-sdk 0.43 + """ + + max_tokens: "__base_v1_beta1__.Coin" = betterproto.message_field(1) + """ + max_tokens specifies the maximum amount of tokens can be delegate to a + validator. If it is empty, there is no spend limit and any amount of coins + can be delegated. + """ + + allow_list: "StakeAuthorizationValidators" = betterproto.message_field( + 2, group="validators" + ) + """ + allow_list specifies list of validator addresses to whom grantee can + delegate tokens on behalf of granter's account. + """ + + deny_list: "StakeAuthorizationValidators" = betterproto.message_field( + 3, group="validators" + ) + """ + deny_list specifies list of validator addresses to whom grantee can not + delegate tokens. + """ + + authorization_type: "AuthorizationType" = betterproto.enum_field(4) + """authorization_type defines one of AuthorizationType.""" + + +@dataclass(eq=False, repr=False) +class StakeAuthorizationValidators(betterproto.Message): + """Validators defines list of validator addresses.""" + + address: List[str] = betterproto.string_field(1) + + @dataclass(eq=False, repr=False) class MsgCreateValidator(betterproto.Message): """ @@ -452,10 +563,23 @@ class MsgCreateValidator(betterproto.Message): commission: "CommissionRates" = betterproto.message_field(2) min_self_delegation: str = betterproto.string_field(3) delegator_address: str = betterproto.string_field(4) + """ + Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + The validator address bytes and delegator address bytes refer to the same + account while creating validator (defer only in bech32 notation). + """ + validator_address: str = betterproto.string_field(5) pubkey: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(6) value: "__base_v1_beta1__.Coin" = betterproto.message_field(7) + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("delegator_address"): + warnings.warn( + "MsgCreateValidator.delegator_address is deprecated", DeprecationWarning + ) + @dataclass(eq=False, repr=False) class MsgCreateValidatorResponse(betterproto.Message): @@ -551,6 +675,65 @@ class MsgUndelegateResponse(betterproto.Message): """MsgUndelegateResponse defines the Msg/Undelegate response type.""" completion_time: datetime = betterproto.message_field(1) + amount: "__base_v1_beta1__.Coin" = betterproto.message_field(2) + """ + amount returns the amount of undelegated coins Since: cosmos-sdk 0.50 + """ + + +@dataclass(eq=False, repr=False) +class MsgCancelUnbondingDelegation(betterproto.Message): + """ + MsgCancelUnbondingDelegation defines the SDK message for performing a + cancel unbonding delegation for delegator Since: cosmos-sdk 0.46 + """ + + delegator_address: str = betterproto.string_field(1) + validator_address: str = betterproto.string_field(2) + amount: "__base_v1_beta1__.Coin" = betterproto.message_field(3) + """ + amount is always less than or equal to unbonding delegation entry balance + """ + + creation_height: int = betterproto.int64_field(4) + """creation_height is the height which the unbonding took place.""" + + +@dataclass(eq=False, repr=False) +class MsgCancelUnbondingDelegationResponse(betterproto.Message): + """MsgCancelUnbondingDelegationResponse Since: cosmos-sdk 0.46""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/staking parameters to update. NOTE: All parameters + must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass @dataclass(eq=False, repr=False) @@ -597,7 +780,7 @@ class QueryValidatorResponse(betterproto.Message): """ validator: "Validator" = betterproto.message_field(1) - """validator defines the the validator info.""" + """validator defines the validator info.""" @dataclass(eq=False, repr=False) @@ -811,7 +994,7 @@ class QueryDelegatorValidatorsResponse(betterproto.Message): """ validators: List["Validator"] = betterproto.message_field(1) - """validators defines the the validators' info of a delegator.""" + """validators defines the validators' info of a delegator.""" pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) """pagination defines the pagination in the response.""" @@ -839,7 +1022,7 @@ class QueryDelegatorValidatorResponse(betterproto.Message): """ validator: "Validator" = betterproto.message_field(1) - """validator defines the the validator info.""" + """validator defines the validator info.""" @dataclass(eq=False, repr=False) @@ -896,53 +1079,12 @@ class QueryParamsResponse(betterproto.Message): """params holds all the parameters of this module.""" -@dataclass(eq=False, repr=False) -class StakeAuthorization(betterproto.Message): - """ - StakeAuthorization defines authorization for - delegate/undelegate/redelegate. Since: cosmos-sdk 0.43 - """ - - max_tokens: "__base_v1_beta1__.Coin" = betterproto.message_field(1) - """ - max_tokens specifies the maximum amount of tokens can be delegate to a - validator. If it is empty, there is no spend limit and any amount of coins - can be delegated. - """ - - allow_list: "StakeAuthorizationValidators" = betterproto.message_field( - 2, group="validators" - ) - """ - allow_list specifies list of validator addresses to whom grantee can - delegate tokens on behalf of granter's account. - """ - - deny_list: "StakeAuthorizationValidators" = betterproto.message_field( - 3, group="validators" - ) - """ - deny_list specifies list of validator addresses to whom grantee can not - delegate tokens. - """ - - authorization_type: "AuthorizationType" = betterproto.enum_field(4) - """authorization_type defines one of AuthorizationType.""" - - -@dataclass(eq=False, repr=False) -class StakeAuthorizationValidators(betterproto.Message): - """Validators defines list of validator addresses.""" - - address: List[str] = betterproto.string_field(1) - - @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState defines the staking module's genesis state.""" params: "Params" = betterproto.message_field(1) - """params defines all the paramaters of related to deposit.""" + """params defines all the parameters of related to deposit.""" last_total_power: bytes = betterproto.bytes_field(2) """ @@ -957,7 +1099,7 @@ class GenesisState(betterproto.Message): """ validators: List["Validator"] = betterproto.message_field(4) - """delegations defines the validator set at genesis.""" + """validators defines the validator set at genesis.""" delegations: List["Delegation"] = betterproto.message_field(5) """delegations defines the delegations active at genesis.""" @@ -971,6 +1113,10 @@ class GenesisState(betterproto.Message): """redelegations defines the redelegations active at genesis.""" exported: bool = betterproto.bool_field(8) + """ + exported defines a bool to identify whether the chain dealing with exported + or initialized genesis. + """ @dataclass(eq=False, repr=False) @@ -1070,6 +1216,40 @@ async def undelegate( metadata=metadata, ) + async def cancel_unbonding_delegation( + self, + msg_cancel_unbonding_delegation: "MsgCancelUnbondingDelegation", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCancelUnbondingDelegationResponse": + return await self._unary_unary( + "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", + msg_cancel_unbonding_delegation, + MsgCancelUnbondingDelegationResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/cosmos.staking.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def validators( @@ -1312,6 +1492,7 @@ async def params( class MsgBase(ServiceBase): + async def create_validator( self, msg_create_validator: "MsgCreateValidator" ) -> "MsgCreateValidatorResponse": @@ -1335,6 +1516,16 @@ async def undelegate( ) -> "MsgUndelegateResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def cancel_unbonding_delegation( + self, msg_cancel_unbonding_delegation: "MsgCancelUnbondingDelegation" + ) -> "MsgCancelUnbondingDelegationResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_create_validator( self, stream: "grpclib.server.Stream[MsgCreateValidator, MsgCreateValidatorResponse]", @@ -1373,6 +1564,21 @@ async def __rpc_undelegate( response = await self.undelegate(request) await stream.send_message(response) + async def __rpc_cancel_unbonding_delegation( + self, + stream: "grpclib.server.Stream[MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.cancel_unbonding_delegation(request) + await stream.send_message(response) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.staking.v1beta1.Msg/CreateValidator": grpclib.const.Handler( @@ -1405,10 +1611,23 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgUndelegate, MsgUndelegateResponse, ), + "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation": grpclib.const.Handler( + self.__rpc_cancel_unbonding_delegation, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCancelUnbondingDelegation, + MsgCancelUnbondingDelegationResponse, + ), + "/cosmos.staking.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } class QueryBase(ServiceBase): + async def validators( self, query_validators_request: "QueryValidatorsRequest" ) -> "QueryValidatorsResponse": diff --git a/secret_sdk/protobuf/cosmos/store/__init__.py b/secret_sdk/protobuf/cosmos/store/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/store/internal/__init__.py b/secret_sdk/protobuf/cosmos/store/internal/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/store/internal/kv/__init__.py b/secret_sdk/protobuf/cosmos/store/internal/kv/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/store/internal/kv/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/store/internal/kv/v1beta1/__init__.py new file mode 100644 index 0000000..2c1db87 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/store/internal/kv/v1beta1/__init__.py @@ -0,0 +1,22 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/store/internal/kv/v1beta1/kv.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class Pairs(betterproto.Message): + """Pairs defines a repeated slice of Pair objects.""" + + pairs: List["Pair"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class Pair(betterproto.Message): + """Pair defines a key/value bytes tuple.""" + + key: bytes = betterproto.bytes_field(1) + value: bytes = betterproto.bytes_field(2) diff --git a/secret_sdk/protobuf/cosmos/store/snapshots/__init__.py b/secret_sdk/protobuf/cosmos/store/snapshots/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/store/snapshots/v1/__init__.py b/secret_sdk/protobuf/cosmos/store/snapshots/v1/__init__.py new file mode 100644 index 0000000..a57b010 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/store/snapshots/v1/__init__.py @@ -0,0 +1,84 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/store/snapshots/v1/snapshot.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + + +@dataclass(eq=False, repr=False) +class Snapshot(betterproto.Message): + """Snapshot contains Tendermint state sync snapshot info.""" + + height: int = betterproto.uint64_field(1) + format: int = betterproto.uint32_field(2) + chunks: int = betterproto.uint32_field(3) + hash: bytes = betterproto.bytes_field(4) + metadata: "Metadata" = betterproto.message_field(5) + + +@dataclass(eq=False, repr=False) +class Metadata(betterproto.Message): + """Metadata contains SDK-specific snapshot metadata.""" + + chunk_hashes: List[bytes] = betterproto.bytes_field(1) + + +@dataclass(eq=False, repr=False) +class SnapshotItem(betterproto.Message): + """ + SnapshotItem is an item contained in a rootmulti.Store snapshot. Since: + cosmos-sdk 0.46 + """ + + store: "SnapshotStoreItem" = betterproto.message_field(1, group="item") + iavl: "SnapshotIavlItem" = betterproto.message_field(2, group="item") + extension: "SnapshotExtensionMeta" = betterproto.message_field(3, group="item") + extension_payload: "SnapshotExtensionPayload" = betterproto.message_field( + 4, group="item" + ) + + +@dataclass(eq=False, repr=False) +class SnapshotStoreItem(betterproto.Message): + """ + SnapshotStoreItem contains metadata about a snapshotted store. Since: + cosmos-sdk 0.46 + """ + + name: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class SnapshotIavlItem(betterproto.Message): + """SnapshotIAVLItem is an exported IAVL node. Since: cosmos-sdk 0.46""" + + key: bytes = betterproto.bytes_field(1) + value: bytes = betterproto.bytes_field(2) + version: int = betterproto.int64_field(3) + """version is block height""" + + height: int = betterproto.int32_field(4) + """height is depth of the tree.""" + + +@dataclass(eq=False, repr=False) +class SnapshotExtensionMeta(betterproto.Message): + """ + SnapshotExtensionMeta contains metadata about an external snapshotter. + Since: cosmos-sdk 0.46 + """ + + name: str = betterproto.string_field(1) + format: int = betterproto.uint32_field(2) + + +@dataclass(eq=False, repr=False) +class SnapshotExtensionPayload(betterproto.Message): + """ + SnapshotExtensionPayload contains payloads of an external snapshotter. + Since: cosmos-sdk 0.46 + """ + + payload: bytes = betterproto.bytes_field(1) diff --git a/secret_sdk/protobuf/cosmos/store/streaming/__init__.py b/secret_sdk/protobuf/cosmos/store/streaming/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/store/streaming/abci/__init__.py b/secret_sdk/protobuf/cosmos/store/streaming/abci/__init__.py new file mode 100644 index 0000000..36860dd --- /dev/null +++ b/secret_sdk/protobuf/cosmos/store/streaming/abci/__init__.py @@ -0,0 +1,148 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/store/streaming/abci/grpc.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from .....tendermint import abci as ____tendermint_abci__ +from ... import v1beta1 as __v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class ListenFinalizeBlockRequest(betterproto.Message): + """ + ListenEndBlockRequest is the request type for the ListenEndBlock RPC method + """ + + req: "____tendermint_abci__.RequestFinalizeBlock" = betterproto.message_field(1) + res: "____tendermint_abci__.ResponseFinalizeBlock" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class ListenFinalizeBlockResponse(betterproto.Message): + """ + ListenEndBlockResponse is the response type for the ListenEndBlock RPC + method + """ + + pass + + +@dataclass(eq=False, repr=False) +class ListenCommitRequest(betterproto.Message): + """ + ListenCommitRequest is the request type for the ListenCommit RPC method + """ + + block_height: int = betterproto.int64_field(1) + """ + explicitly pass in block height as ResponseCommit does not contain this + info + """ + + res: "____tendermint_abci__.ResponseCommit" = betterproto.message_field(2) + change_set: List["__v1_beta1__.StoreKvPair"] = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class ListenCommitResponse(betterproto.Message): + """ + ListenCommitResponse is the response type for the ListenCommit RPC method + """ + + pass + + +class AbciListenerServiceStub(betterproto.ServiceStub): + async def listen_finalize_block( + self, + listen_finalize_block_request: "ListenFinalizeBlockRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ListenFinalizeBlockResponse": + return await self._unary_unary( + "/cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock", + listen_finalize_block_request, + ListenFinalizeBlockResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def listen_commit( + self, + listen_commit_request: "ListenCommitRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ListenCommitResponse": + return await self._unary_unary( + "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit", + listen_commit_request, + ListenCommitResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class AbciListenerServiceBase(ServiceBase): + + async def listen_finalize_block( + self, listen_finalize_block_request: "ListenFinalizeBlockRequest" + ) -> "ListenFinalizeBlockResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def listen_commit( + self, listen_commit_request: "ListenCommitRequest" + ) -> "ListenCommitResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_listen_finalize_block( + self, + stream: "grpclib.server.Stream[ListenFinalizeBlockRequest, ListenFinalizeBlockResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.listen_finalize_block(request) + await stream.send_message(response) + + async def __rpc_listen_commit( + self, stream: "grpclib.server.Stream[ListenCommitRequest, ListenCommitResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.listen_commit(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock": grpclib.const.Handler( + self.__rpc_listen_finalize_block, + grpclib.const.Cardinality.UNARY_UNARY, + ListenFinalizeBlockRequest, + ListenFinalizeBlockResponse, + ), + "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit": grpclib.const.Handler( + self.__rpc_listen_commit, + grpclib.const.Cardinality.UNARY_UNARY, + ListenCommitRequest, + ListenCommitResponse, + ), + } diff --git a/secret_sdk/protobuf/cosmos/store/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/store/v1beta1/__init__.py new file mode 100644 index 0000000..dea9a2d --- /dev/null +++ b/secret_sdk/protobuf/cosmos/store/v1beta1/__init__.py @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/store/v1beta1/commit_info.proto, cosmos/store/v1beta1/listening.proto +# plugin: python-betterproto +from dataclasses import dataclass +from datetime import datetime +from typing import List + +import betterproto + +from ....tendermint import abci as ___tendermint_abci__ + + +@dataclass(eq=False, repr=False) +class StoreKvPair(betterproto.Message): + """ + StoreKVPair is a KVStore KVPair used for listening to state changes (Sets + and Deletes) It optionally includes the StoreKey for the originating + KVStore and a Boolean flag to distinguish between Sets and Deletes Since: + cosmos-sdk 0.43 + """ + + store_key: str = betterproto.string_field(1) + delete: bool = betterproto.bool_field(2) + key: bytes = betterproto.bytes_field(3) + value: bytes = betterproto.bytes_field(4) + + +@dataclass(eq=False, repr=False) +class BlockMetadata(betterproto.Message): + """ + BlockMetadata contains all the abci event data of a block the file streamer + dump them into files together with the state changes. + """ + + response_commit: "___tendermint_abci__.ResponseCommit" = betterproto.message_field( + 6 + ) + request_finalize_block: "___tendermint_abci__.RequestFinalizeBlock" = ( + betterproto.message_field(7) + ) + response_finalize_block: "___tendermint_abci__.ResponseFinalizeBlock" = ( + betterproto.message_field(8) + ) + + +@dataclass(eq=False, repr=False) +class CommitInfo(betterproto.Message): + """ + CommitInfo defines commit information used by the multi-store when + committing a version/height. + """ + + version: int = betterproto.int64_field(1) + store_infos: List["StoreInfo"] = betterproto.message_field(2) + timestamp: datetime = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class StoreInfo(betterproto.Message): + """ + StoreInfo defines store-specific commit information. It contains a + reference between a store name and the commit ID. + """ + + name: str = betterproto.string_field(1) + commit_id: "CommitId" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class CommitId(betterproto.Message): + """ + CommitID defines the commitment information when a specific store is + committed. + """ + + version: int = betterproto.int64_field(1) + hash: bytes = betterproto.bytes_field(2) diff --git a/secret_sdk/protobuf/cosmos/tx/config/__init__.py b/secret_sdk/protobuf/cosmos/tx/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/tx/config/v1/__init__.py b/secret_sdk/protobuf/cosmos/tx/config/v1/__init__.py new file mode 100644 index 0000000..53a7866 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/tx/config/v1/__init__.py @@ -0,0 +1,23 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/tx/config/v1/config.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Config(betterproto.Message): + """Config is the config object of the x/auth/tx package.""" + + skip_ante_handler: bool = betterproto.bool_field(1) + """ + skip_ante_handler defines whether the ante handler registration should be + skipped in case an app wants to override this functionality. + """ + + skip_post_handler: bool = betterproto.bool_field(2) + """ + skip_post_handler defines whether the post handler registration should be + skipped in case an app wants to override this functionality. + """ diff --git a/secret_sdk/protobuf/cosmos/tx/signing/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/tx/signing/v1beta1/__init__.py index 97dd925..09d9933 100644 --- a/secret_sdk/protobuf/cosmos/tx/signing/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/tx/signing/v1beta1/__init__.py @@ -11,31 +11,45 @@ class SignMode(betterproto.Enum): - """SignMode represents a signing mode with its own security guarantees.""" + """ + SignMode represents a signing mode with its own security guarantees. This + enum should be considered a registry of all known sign modes in the Cosmos + ecosystem. Apps are not expected to support all known sign modes. Apps that + would like to support custom sign modes are encouraged to open a small PR + against this file to add a new case to this SignMode enum describing their + sign mode so that different apps have a consistent version of this enum. + """ SIGN_MODE_UNSPECIFIED = 0 """ SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected + rejected. """ SIGN_MODE_DIRECT = 1 """ SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - verified with raw bytes from Tx + verified with raw bytes from Tx. """ SIGN_MODE_TEXTUAL = 2 """ SIGN_MODE_TEXTUAL is a future signing mode that will verify some human- readable textual representation on top of the binary representation from - SIGN_MODE_DIRECT + SIGN_MODE_DIRECT. Since: cosmos-sdk 0.50 + """ + + SIGN_MODE_DIRECT_AUX = 3 + """ + SIGN_MODE_DIRECT_AUX specifies a signing mode which uses SignDocDirectAux. + As opposed to SIGN_MODE_DIRECT, this sign mode does not require signers + signing over other signers' `signer_info`. Since: cosmos-sdk 0.46 """ SIGN_MODE_LEGACY_AMINO_JSON = 127 """ SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - Amino JSON and will be removed in the future + Amino JSON and will be removed in the future. """ SIGN_MODE_EIP_191 = 191 diff --git a/secret_sdk/protobuf/cosmos/tx/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/tx/v1beta1/__init__.py index ce5a07d..e6d6247 100644 --- a/secret_sdk/protobuf/cosmos/tx/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/tx/v1beta1/__init__.py @@ -56,8 +56,8 @@ class BroadcastMode(betterproto.Enum): BROADCAST_MODE_BLOCK = 1 """ - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits - for the tx to be committed in a block. + DEPRECATED: use BROADCAST_MODE_SYNC instead, BROADCAST_MODE_BLOCK is not + supported by the SDK from v0.47.x onwards. """ BROADCAST_MODE_SYNC = 2 @@ -153,6 +153,44 @@ class SignDoc(betterproto.Message): """account_number is the account number of the account in state""" +@dataclass(eq=False, repr=False) +class SignDocDirectAux(betterproto.Message): + """ + SignDocDirectAux is the type used for generating sign bytes for + SIGN_MODE_DIRECT_AUX. Since: cosmos-sdk 0.46 + """ + + body_bytes: bytes = betterproto.bytes_field(1) + """ + body_bytes is protobuf serialization of a TxBody that matches the + representation in TxRaw. + """ + + public_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """public_key is the public key of the signing account.""" + + chain_id: str = betterproto.string_field(3) + """ + chain_id is the identifier of the chain this transaction targets. It + prevents signed transactions from being used on another chain by an + attacker. + """ + + account_number: int = betterproto.uint64_field(4) + """account_number is the account number of the account in state.""" + + sequence: int = betterproto.uint64_field(5) + """sequence is the sequence number of the signing account.""" + + tip: "Tip" = betterproto.message_field(6) + """tips have been depreacted and should not be used""" + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("tip"): + warnings.warn("SignDocDirectAux.tip is deprecated", DeprecationWarning) + + @dataclass(eq=False, repr=False) class TxBody(betterproto.Message): """TxBody is the body of a transaction that all signers sign over.""" @@ -181,18 +219,18 @@ class TxBody(betterproto.Message): processed by the chain """ - extension_options: List[ - "betterproto_lib_google_protobuf.Any" - ] = betterproto.message_field(1023) + extension_options: List["betterproto_lib_google_protobuf.Any"] = ( + betterproto.message_field(1023) + ) """ extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, the transaction will be rejected """ - non_critical_extension_options: List[ - "betterproto_lib_google_protobuf.Any" - ] = betterproto.message_field(2047) + non_critical_extension_options: List["betterproto_lib_google_protobuf.Any"] = ( + betterproto.message_field(2047) + ) """ extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and @@ -223,6 +261,18 @@ class AuthInfo(betterproto.Message): of the signers. This can be estimated via simulation. """ + tip: "Tip" = betterproto.message_field(3) + """ + Tip is the optional tip used for transactions fees paid in another denom. + This field is ignored if the chain didn't enable tips, i.e. didn't add the + `TipDecorator` in its posthandler. Since: cosmos-sdk 0.46 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("tip"): + warnings.warn("AuthInfo.tip is deprecated", DeprecationWarning) + @dataclass(eq=False, repr=False) class SignerInfo(betterproto.Message): @@ -327,6 +377,51 @@ class Fee(betterproto.Message): """ +@dataclass(eq=False, repr=False) +class Tip(betterproto.Message): + """Tip is the tip used for meta-transactions. Since: cosmos-sdk 0.46""" + + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """amount is the amount of the tip""" + + tipper: str = betterproto.string_field(2) + """tipper is the address of the account paying for the tip""" + + def __post_init__(self) -> None: + warnings.warn("Tip is deprecated", DeprecationWarning) + super().__post_init__() + + +@dataclass(eq=False, repr=False) +class AuxSignerData(betterproto.Message): + """ + AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + tipper) builds and sends to the fee payer (who will build and broadcast the + actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + by the node if sent directly as-is. Since: cosmos-sdk 0.46 + """ + + address: str = betterproto.string_field(1) + """ + address is the bech32-encoded address of the auxiliary signer. If using + AuxSignerData across different chains, the bech32 prefix of the target + chain (where the final transaction is broadcasted) should be used. + """ + + sign_doc: "SignDocDirectAux" = betterproto.message_field(2) + """ + sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + signs. Note: we use the same sign doc even if we're signing with + LEGACY_AMINO_JSON. + """ + + mode: "_signing_v1_beta1__.SignMode" = betterproto.enum_field(3) + """mode is the signing mode of the single signer.""" + + sig: bytes = betterproto.bytes_field(4) + """sig is the signature of the sign doc.""" + + @dataclass(eq=False, repr=False) class GetTxsEventRequest(betterproto.Message): """ @@ -335,12 +430,44 @@ class GetTxsEventRequest(betterproto.Message): """ events: List[str] = betterproto.string_field(1) - """events is the list of transaction event type.""" + """ + events is the list of transaction event type. Deprecated post v0.47.x: use + query instead, which should contain a valid events query. + """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) - """pagination defines a pagination for the request.""" + """ + pagination defines a pagination for the request. Deprecated post v0.46.x: + use page and limit instead. + """ order_by: "OrderBy" = betterproto.enum_field(3) + page: int = betterproto.uint64_field(4) + """ + page is the page number to query, starts at 1. If not provided, will + default to first page. + """ + + limit: int = betterproto.uint64_field(5) + """ + limit is the total number of results to be returned in the result page. If + left empty it will default to a value to be set by each app. + """ + + query: str = betterproto.string_field(6) + """ + query defines the transaction event query that is proxied to Tendermint's + TxSearch RPC method. The query must be valid. Since cosmos-sdk 0.50 + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("events"): + warnings.warn("GetTxsEventRequest.events is deprecated", DeprecationWarning) + if self.is_set("pagination"): + warnings.warn( + "GetTxsEventRequest.pagination is deprecated", DeprecationWarning + ) @dataclass(eq=False, repr=False) @@ -359,7 +486,20 @@ class GetTxsEventResponse(betterproto.Message): """tx_responses is the list of queried TxResponses.""" pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(3) - """pagination defines a pagination for the response.""" + """ + pagination defines a pagination for the response. Deprecated post v0.46.x: + use total instead. + """ + + total: int = betterproto.uint64_field(4) + """total is total number of results available""" + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("pagination"): + warnings.warn( + "GetTxsEventResponse.pagination is deprecated", DeprecationWarning + ) @dataclass(eq=False, repr=False) @@ -468,6 +608,90 @@ class GetBlockWithTxsResponse(betterproto.Message): """pagination defines a pagination for the response.""" +@dataclass(eq=False, repr=False) +class TxDecodeRequest(betterproto.Message): + """ + TxDecodeRequest is the request type for the Service.TxDecode RPC method. + Since: cosmos-sdk 0.47 + """ + + tx_bytes: bytes = betterproto.bytes_field(1) + """tx_bytes is the raw transaction.""" + + +@dataclass(eq=False, repr=False) +class TxDecodeResponse(betterproto.Message): + """ + TxDecodeResponse is the response type for the Service.TxDecode method. + Since: cosmos-sdk 0.47 + """ + + tx: "Tx" = betterproto.message_field(1) + """tx is the decoded transaction.""" + + +@dataclass(eq=False, repr=False) +class TxEncodeRequest(betterproto.Message): + """ + TxEncodeRequest is the request type for the Service.TxEncode RPC method. + Since: cosmos-sdk 0.47 + """ + + tx: "Tx" = betterproto.message_field(1) + """tx is the transaction to encode.""" + + +@dataclass(eq=False, repr=False) +class TxEncodeResponse(betterproto.Message): + """ + TxEncodeResponse is the response type for the Service.TxEncode method. + Since: cosmos-sdk 0.47 + """ + + tx_bytes: bytes = betterproto.bytes_field(1) + """tx_bytes is the encoded transaction bytes.""" + + +@dataclass(eq=False, repr=False) +class TxEncodeAminoRequest(betterproto.Message): + """ + TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino RPC + method. Since: cosmos-sdk 0.47 + """ + + amino_json: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class TxEncodeAminoResponse(betterproto.Message): + """ + TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + RPC method. Since: cosmos-sdk 0.47 + """ + + amino_binary: bytes = betterproto.bytes_field(1) + + +@dataclass(eq=False, repr=False) +class TxDecodeAminoRequest(betterproto.Message): + """ + TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino RPC + method. Since: cosmos-sdk 0.47 + """ + + amino_binary: bytes = betterproto.bytes_field(1) + + +@dataclass(eq=False, repr=False) +class TxDecodeAminoResponse(betterproto.Message): + """ + TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + RPC method. Since: cosmos-sdk 0.47 + """ + + amino_json: str = betterproto.string_field(1) + + class ServiceStub(betterproto.ServiceStub): async def simulate( self, @@ -554,8 +778,77 @@ async def get_block_with_txs( metadata=metadata, ) + async def tx_decode( + self, + tx_decode_request: "TxDecodeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "TxDecodeResponse": + return await self._unary_unary( + "/cosmos.tx.v1beta1.Service/TxDecode", + tx_decode_request, + TxDecodeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def tx_encode( + self, + tx_encode_request: "TxEncodeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "TxEncodeResponse": + return await self._unary_unary( + "/cosmos.tx.v1beta1.Service/TxEncode", + tx_encode_request, + TxEncodeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def tx_encode_amino( + self, + tx_encode_amino_request: "TxEncodeAminoRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "TxEncodeAminoResponse": + return await self._unary_unary( + "/cosmos.tx.v1beta1.Service/TxEncodeAmino", + tx_encode_amino_request, + TxEncodeAminoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def tx_decode_amino( + self, + tx_decode_amino_request: "TxDecodeAminoRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "TxDecodeAminoResponse": + return await self._unary_unary( + "/cosmos.tx.v1beta1.Service/TxDecodeAmino", + tx_decode_amino_request, + TxDecodeAminoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class ServiceBase(ServiceBase): + async def simulate(self, simulate_request: "SimulateRequest") -> "SimulateResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -577,6 +870,26 @@ async def get_block_with_txs( ) -> "GetBlockWithTxsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def tx_decode( + self, tx_decode_request: "TxDecodeRequest" + ) -> "TxDecodeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def tx_encode( + self, tx_encode_request: "TxEncodeRequest" + ) -> "TxEncodeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def tx_encode_amino( + self, tx_encode_amino_request: "TxEncodeAminoRequest" + ) -> "TxEncodeAminoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def tx_decode_amino( + self, tx_decode_amino_request: "TxDecodeAminoRequest" + ) -> "TxDecodeAminoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_simulate( self, stream: "grpclib.server.Stream[SimulateRequest, SimulateResponse]" ) -> None: @@ -613,6 +926,36 @@ async def __rpc_get_block_with_txs( response = await self.get_block_with_txs(request) await stream.send_message(response) + async def __rpc_tx_decode( + self, stream: "grpclib.server.Stream[TxDecodeRequest, TxDecodeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.tx_decode(request) + await stream.send_message(response) + + async def __rpc_tx_encode( + self, stream: "grpclib.server.Stream[TxEncodeRequest, TxEncodeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.tx_encode(request) + await stream.send_message(response) + + async def __rpc_tx_encode_amino( + self, + stream: "grpclib.server.Stream[TxEncodeAminoRequest, TxEncodeAminoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.tx_encode_amino(request) + await stream.send_message(response) + + async def __rpc_tx_decode_amino( + self, + stream: "grpclib.server.Stream[TxDecodeAminoRequest, TxDecodeAminoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.tx_decode_amino(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.tx.v1beta1.Service/Simulate": grpclib.const.Handler( @@ -645,4 +988,28 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: GetBlockWithTxsRequest, GetBlockWithTxsResponse, ), + "/cosmos.tx.v1beta1.Service/TxDecode": grpclib.const.Handler( + self.__rpc_tx_decode, + grpclib.const.Cardinality.UNARY_UNARY, + TxDecodeRequest, + TxDecodeResponse, + ), + "/cosmos.tx.v1beta1.Service/TxEncode": grpclib.const.Handler( + self.__rpc_tx_encode, + grpclib.const.Cardinality.UNARY_UNARY, + TxEncodeRequest, + TxEncodeResponse, + ), + "/cosmos.tx.v1beta1.Service/TxEncodeAmino": grpclib.const.Handler( + self.__rpc_tx_encode_amino, + grpclib.const.Cardinality.UNARY_UNARY, + TxEncodeAminoRequest, + TxEncodeAminoResponse, + ), + "/cosmos.tx.v1beta1.Service/TxDecodeAmino": grpclib.const.Handler( + self.__rpc_tx_decode_amino, + grpclib.const.Cardinality.UNARY_UNARY, + TxDecodeAminoRequest, + TxDecodeAminoResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/upgrade/module/__init__.py b/secret_sdk/protobuf/cosmos/upgrade/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/upgrade/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/upgrade/module/v1/__init__.py new file mode 100644 index 0000000..d917419 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/upgrade/module/v1/__init__.py @@ -0,0 +1,17 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/upgrade/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the upgrade module.""" + + authority: str = betterproto.string_field(1) + """ + authority defines the custom module authority. If not set, defaults to the + governance module. + """ diff --git a/secret_sdk/protobuf/cosmos/upgrade/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/upgrade/v1beta1/__init__.py index b2eef62..be55393 100644 --- a/secret_sdk/protobuf/cosmos/upgrade/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/upgrade/v1beta1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/upgrade/v1beta1/query.proto, cosmos/upgrade/v1beta1/upgrade.proto +# sources: cosmos/upgrade/v1beta1/query.proto, cosmos/upgrade/v1beta1/tx.proto, cosmos/upgrade/v1beta1/upgrade.proto # plugin: python-betterproto import warnings from dataclasses import dataclass @@ -49,10 +49,7 @@ class Plan(betterproto.Message): """ height: int = betterproto.int64_field(3) - """ - The height at which the upgrade must be performed. Only used if Time is not - set. - """ + """The height at which the upgrade must be performed.""" info: str = betterproto.string_field(4) """ @@ -83,23 +80,41 @@ def __post_init__(self) -> None: class SoftwareUpgradeProposal(betterproto.Message): """ SoftwareUpgradeProposal is a gov Content type for initiating a software - upgrade. + upgrade. Deprecated: This legacy proposal is deprecated in favor of Msg- + based gov proposals, see MsgSoftwareUpgrade. """ title: str = betterproto.string_field(1) + """title of the proposal""" + description: str = betterproto.string_field(2) + """description of the proposal""" + plan: "Plan" = betterproto.message_field(3) + """plan of the proposal""" + + def __post_init__(self) -> None: + warnings.warn("SoftwareUpgradeProposal is deprecated", DeprecationWarning) + super().__post_init__() @dataclass(eq=False, repr=False) class CancelSoftwareUpgradeProposal(betterproto.Message): """ CancelSoftwareUpgradeProposal is a gov Content type for cancelling a - software upgrade. + software upgrade. Deprecated: This legacy proposal is deprecated in favor + of Msg-based gov proposals, see MsgCancelUpgrade. """ title: str = betterproto.string_field(1) + """title of the proposal""" + description: str = betterproto.string_field(2) + """description of the proposal""" + + def __post_init__(self) -> None: + warnings.warn("CancelSoftwareUpgradeProposal is deprecated", DeprecationWarning) + super().__post_init__() @dataclass(eq=False, repr=False) @@ -116,6 +131,57 @@ class ModuleVersion(betterproto.Message): """consensus version of the app module""" +@dataclass(eq=False, repr=False) +class MsgSoftwareUpgrade(betterproto.Message): + """ + MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. Since: cosmos- + sdk 0.46 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + plan: "Plan" = betterproto.message_field(2) + """plan is the upgrade plan.""" + + +@dataclass(eq=False, repr=False) +class MsgSoftwareUpgradeResponse(betterproto.Message): + """ + MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. Since: + cosmos-sdk 0.46 + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCancelUpgrade(betterproto.Message): + """ + MsgCancelUpgrade is the Msg/CancelUpgrade request type. Since: cosmos-sdk + 0.46 + """ + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + +@dataclass(eq=False, repr=False) +class MsgCancelUpgradeResponse(betterproto.Message): + """ + MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. Since: + cosmos-sdk 0.46 + """ + + pass + + @dataclass(eq=False, repr=False) class QueryCurrentPlanRequest(betterproto.Message): """ @@ -224,6 +290,62 @@ class QueryModuleVersionsResponse(betterproto.Message): """ +@dataclass(eq=False, repr=False) +class QueryAuthorityRequest(betterproto.Message): + """ + QueryAuthorityRequest is the request type for Query/Authority Since: + cosmos-sdk 0.46 + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryAuthorityResponse(betterproto.Message): + """ + QueryAuthorityResponse is the response type for Query/Authority Since: + cosmos-sdk 0.46 + """ + + address: str = betterproto.string_field(1) + + +class MsgStub(betterproto.ServiceStub): + async def software_upgrade( + self, + msg_software_upgrade: "MsgSoftwareUpgrade", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSoftwareUpgradeResponse": + return await self._unary_unary( + "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade", + msg_software_upgrade, + MsgSoftwareUpgradeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def cancel_upgrade( + self, + msg_cancel_upgrade: "MsgCancelUpgrade", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCancelUpgradeResponse": + return await self._unary_unary( + "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade", + msg_cancel_upgrade, + MsgCancelUpgradeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + class QueryStub(betterproto.ServiceStub): async def current_plan( self, @@ -293,8 +415,71 @@ async def module_versions( metadata=metadata, ) + async def authority( + self, + query_authority_request: "QueryAuthorityRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryAuthorityResponse": + return await self._unary_unary( + "/cosmos.upgrade.v1beta1.Query/Authority", + query_authority_request, + QueryAuthorityResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def software_upgrade( + self, msg_software_upgrade: "MsgSoftwareUpgrade" + ) -> "MsgSoftwareUpgradeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def cancel_upgrade( + self, msg_cancel_upgrade: "MsgCancelUpgrade" + ) -> "MsgCancelUpgradeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_software_upgrade( + self, + stream: "grpclib.server.Stream[MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.software_upgrade(request) + await stream.send_message(response) + + async def __rpc_cancel_upgrade( + self, + stream: "grpclib.server.Stream[MsgCancelUpgrade, MsgCancelUpgradeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.cancel_upgrade(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade": grpclib.const.Handler( + self.__rpc_software_upgrade, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSoftwareUpgrade, + MsgSoftwareUpgradeResponse, + ), + "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade": grpclib.const.Handler( + self.__rpc_cancel_upgrade, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCancelUpgrade, + MsgCancelUpgradeResponse, + ), + } + class QueryBase(ServiceBase): + async def current_plan( self, query_current_plan_request: "QueryCurrentPlanRequest" ) -> "QueryCurrentPlanResponse": @@ -316,6 +501,11 @@ async def module_versions( ) -> "QueryModuleVersionsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def authority( + self, query_authority_request: "QueryAuthorityRequest" + ) -> "QueryAuthorityResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_current_plan( self, stream: "grpclib.server.Stream[QueryCurrentPlanRequest, QueryCurrentPlanResponse]", @@ -348,6 +538,14 @@ async def __rpc_module_versions( response = await self.module_versions(request) await stream.send_message(response) + async def __rpc_authority( + self, + stream: "grpclib.server.Stream[QueryAuthorityRequest, QueryAuthorityResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.authority(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.upgrade.v1beta1.Query/CurrentPlan": grpclib.const.Handler( @@ -374,4 +572,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryModuleVersionsRequest, QueryModuleVersionsResponse, ), + "/cosmos.upgrade.v1beta1.Query/Authority": grpclib.const.Handler( + self.__rpc_authority, + grpclib.const.Cardinality.UNARY_UNARY, + QueryAuthorityRequest, + QueryAuthorityResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos/vesting/module/__init__.py b/secret_sdk/protobuf/cosmos/vesting/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/cosmos/vesting/module/v1/__init__.py b/secret_sdk/protobuf/cosmos/vesting/module/v1/__init__.py new file mode 100644 index 0000000..ac3c063 --- /dev/null +++ b/secret_sdk/protobuf/cosmos/vesting/module/v1/__init__.py @@ -0,0 +1,13 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/vesting/module/v1/module.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the vesting module.""" + + pass diff --git a/secret_sdk/protobuf/cosmos/vesting/v1beta1/__init__.py b/secret_sdk/protobuf/cosmos/vesting/v1beta1/__init__.py index 938141a..33b4e0a 100644 --- a/secret_sdk/protobuf/cosmos/vesting/v1beta1/__init__.py +++ b/secret_sdk/protobuf/cosmos/vesting/v1beta1/__init__.py @@ -23,30 +23,6 @@ from grpclib.metadata import Deadline -@dataclass(eq=False, repr=False) -class MsgCreateVestingAccount(betterproto.Message): - """ - MsgCreateVestingAccount defines a message that enables creating a vesting - account. - """ - - from_address: str = betterproto.string_field(1) - to_address: str = betterproto.string_field(2) - amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) - end_time: int = betterproto.int64_field(4) - delayed: bool = betterproto.bool_field(5) - - -@dataclass(eq=False, repr=False) -class MsgCreateVestingAccountResponse(betterproto.Message): - """ - MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount - response type. - """ - - pass - - @dataclass(eq=False, repr=False) class BaseVestingAccount(betterproto.Message): """ @@ -59,6 +35,7 @@ class BaseVestingAccount(betterproto.Message): delegated_free: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) delegated_vesting: List["__base_v1_beta1__.Coin"] = betterproto.message_field(4) end_time: int = betterproto.int64_field(5) + """Vesting end time, as unix timestamp (in seconds).""" @dataclass(eq=False, repr=False) @@ -70,6 +47,7 @@ class ContinuousVestingAccount(betterproto.Message): base_vesting_account: "BaseVestingAccount" = betterproto.message_field(1) start_time: int = betterproto.int64_field(2) + """Vesting start time, as unix timestamp (in seconds).""" @dataclass(eq=False, repr=False) @@ -88,6 +66,8 @@ class Period(betterproto.Message): """Period defines a length of time and amount of coins that will vest.""" length: int = betterproto.int64_field(1) + """Period duration in seconds.""" + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(2) @@ -115,6 +95,79 @@ class PermanentLockedAccount(betterproto.Message): base_vesting_account: "BaseVestingAccount" = betterproto.message_field(1) +@dataclass(eq=False, repr=False) +class MsgCreateVestingAccount(betterproto.Message): + """ + MsgCreateVestingAccount defines a message that enables creating a vesting + account. + """ + + from_address: str = betterproto.string_field(1) + to_address: str = betterproto.string_field(2) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + end_time: int = betterproto.int64_field(4) + """end of vesting as unix time (in seconds).""" + + delayed: bool = betterproto.bool_field(5) + + +@dataclass(eq=False, repr=False) +class MsgCreateVestingAccountResponse(betterproto.Message): + """ + MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount + response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCreatePermanentLockedAccount(betterproto.Message): + """ + MsgCreatePermanentLockedAccount defines a message that enables creating a + permanent locked account. Since: cosmos-sdk 0.46 + """ + + from_address: str = betterproto.string_field(1) + to_address: str = betterproto.string_field(2) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class MsgCreatePermanentLockedAccountResponse(betterproto.Message): + """ + MsgCreatePermanentLockedAccountResponse defines the + Msg/CreatePermanentLockedAccount response type. Since: cosmos-sdk 0.46 + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCreatePeriodicVestingAccount(betterproto.Message): + """ + MsgCreateVestingAccount defines a message that enables creating a vesting + account. Since: cosmos-sdk 0.46 + """ + + from_address: str = betterproto.string_field(1) + to_address: str = betterproto.string_field(2) + start_time: int = betterproto.int64_field(3) + """start of vesting as unix time (in seconds).""" + + vesting_periods: List["Period"] = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class MsgCreatePeriodicVestingAccountResponse(betterproto.Message): + """ + MsgCreateVestingAccountResponse defines the + Msg/CreatePeriodicVestingAccount response type. Since: cosmos-sdk 0.46 + """ + + pass + + class MsgStub(betterproto.ServiceStub): async def create_vesting_account( self, @@ -133,13 +186,58 @@ async def create_vesting_account( metadata=metadata, ) + async def create_permanent_locked_account( + self, + msg_create_permanent_locked_account: "MsgCreatePermanentLockedAccount", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCreatePermanentLockedAccountResponse": + return await self._unary_unary( + "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount", + msg_create_permanent_locked_account, + MsgCreatePermanentLockedAccountResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def create_periodic_vesting_account( + self, + msg_create_periodic_vesting_account: "MsgCreatePeriodicVestingAccount", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCreatePeriodicVestingAccountResponse": + return await self._unary_unary( + "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount", + msg_create_periodic_vesting_account, + MsgCreatePeriodicVestingAccountResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def create_vesting_account( self, msg_create_vesting_account: "MsgCreateVestingAccount" ) -> "MsgCreateVestingAccountResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def create_permanent_locked_account( + self, msg_create_permanent_locked_account: "MsgCreatePermanentLockedAccount" + ) -> "MsgCreatePermanentLockedAccountResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def create_periodic_vesting_account( + self, msg_create_periodic_vesting_account: "MsgCreatePeriodicVestingAccount" + ) -> "MsgCreatePeriodicVestingAccountResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_create_vesting_account( self, stream: "grpclib.server.Stream[MsgCreateVestingAccount, MsgCreateVestingAccountResponse]", @@ -148,6 +246,22 @@ async def __rpc_create_vesting_account( response = await self.create_vesting_account(request) await stream.send_message(response) + async def __rpc_create_permanent_locked_account( + self, + stream: "grpclib.server.Stream[MsgCreatePermanentLockedAccount, MsgCreatePermanentLockedAccountResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.create_permanent_locked_account(request) + await stream.send_message(response) + + async def __rpc_create_periodic_vesting_account( + self, + stream: "grpclib.server.Stream[MsgCreatePeriodicVestingAccount, MsgCreatePeriodicVestingAccountResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.create_periodic_vesting_account(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount": grpclib.const.Handler( @@ -156,4 +270,16 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgCreateVestingAccount, MsgCreateVestingAccountResponse, ), + "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount": grpclib.const.Handler( + self.__rpc_create_permanent_locked_account, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCreatePermanentLockedAccount, + MsgCreatePermanentLockedAccountResponse, + ), + "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount": grpclib.const.Handler( + self.__rpc_create_periodic_vesting_account, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCreatePeriodicVestingAccount, + MsgCreatePeriodicVestingAccountResponse, + ), } diff --git a/secret_sdk/protobuf/cosmos_proto/__init__.py b/secret_sdk/protobuf/cosmos_proto/__init__.py index bc87e08..bf63415 100644 --- a/secret_sdk/protobuf/cosmos_proto/__init__.py +++ b/secret_sdk/protobuf/cosmos_proto/__init__.py @@ -2,5 +2,70 @@ # sources: cosmos_proto/cosmos.proto # plugin: python-betterproto from dataclasses import dataclass +from typing import List import betterproto + + +class ScalarType(betterproto.Enum): + SCALAR_TYPE_UNSPECIFIED = 0 + SCALAR_TYPE_STRING = 1 + SCALAR_TYPE_BYTES = 2 + + +@dataclass(eq=False, repr=False) +class InterfaceDescriptor(betterproto.Message): + """ + InterfaceDescriptor describes an interface type to be used with + accepts_interface and implements_interface and declared by + declare_interface. + """ + + name: str = betterproto.string_field(1) + """ + name is the name of the interface. It should be a short-name (without a + period) such that the fully qualified name of the interface will be + package.name, ex. for the package a.b and interface named C, the fully- + qualified name will be a.b.C. + """ + + description: str = betterproto.string_field(2) + """ + description is a human-readable description of the interface and its + purpose. + """ + + +@dataclass(eq=False, repr=False) +class ScalarDescriptor(betterproto.Message): + """ + ScalarDescriptor describes an scalar type to be used with the scalar field + option and declared by declare_scalar. Scalars extend simple protobuf + built-in types with additional syntax and semantics, for instance to + represent big integers. Scalars should ideally define an encoding such that + there is only one valid syntactical representation for a given semantic + meaning, i.e. the encoding should be deterministic. + """ + + name: str = betterproto.string_field(1) + """ + name is the name of the scalar. It should be a short-name (without a + period) such that the fully qualified name of the scalar will be + package.name, ex. for the package a.b and scalar named C, the fully- + qualified name will be a.b.C. + """ + + description: str = betterproto.string_field(2) + """ + description is a human-readable description of the scalar and its encoding + format. For instance a big integer or decimal scalar should specify + precisely the expected encoding format. + """ + + field_type: List["ScalarType"] = betterproto.enum_field(3) + """ + field_type is the type of field with which this scalar can be used. Scalars + can be used with one and only one type of field so that encoding standards + and simple and clear. Currently only string and bytes fields are supported + for scalars. + """ diff --git a/secret_sdk/protobuf/ibc/applications/fee/__init__.py b/secret_sdk/protobuf/ibc/applications/fee/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/ibc/applications/fee/v1/__init__.py b/secret_sdk/protobuf/ibc/applications/fee/v1/__init__.py new file mode 100644 index 0000000..cdd6035 --- /dev/null +++ b/secret_sdk/protobuf/ibc/applications/fee/v1/__init__.py @@ -0,0 +1,1103 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: ibc/applications/fee/v1/ack.proto, ibc/applications/fee/v1/fee.proto, ibc/applications/fee/v1/genesis.proto, ibc/applications/fee/v1/metadata.proto, ibc/applications/fee/v1/query.proto, ibc/applications/fee/v1/tx.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from .....cosmos.base import v1beta1 as ____cosmos_base_v1_beta1__ +from .....cosmos.base.query import v1beta1 as ____cosmos_base_query_v1_beta1__ +from ....core.channel import v1 as ___core_channel_v1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class Fee(betterproto.Message): + """Fee defines the ICS29 receive, acknowledgement and timeout fees""" + + recv_fee: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """the packet receive fee""" + + ack_fee: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """the packet acknowledgement fee""" + + timeout_fee: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(3) + """the packet timeout fee""" + + +@dataclass(eq=False, repr=False) +class PacketFee(betterproto.Message): + """ + PacketFee contains ICS29 relayer fees, refund address and optional list of + permitted relayers + """ + + fee: "Fee" = betterproto.message_field(1) + """ + fee encapsulates the recv, ack and timeout fees associated with an IBC + packet + """ + + refund_address: str = betterproto.string_field(2) + """the refund address for unspent fees""" + + relayers: List[str] = betterproto.string_field(3) + """optional list of relayers permitted to receive fees""" + + +@dataclass(eq=False, repr=False) +class PacketFees(betterproto.Message): + """PacketFees contains a list of type PacketFee""" + + packet_fees: List["PacketFee"] = betterproto.message_field(1) + """list of packet fees""" + + +@dataclass(eq=False, repr=False) +class IdentifiedPacketFees(betterproto.Message): + """ + IdentifiedPacketFees contains a list of type PacketFee and associated + PacketId + """ + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(1) + """ + unique packet identifier comprised of the channel ID, port ID and sequence + """ + + packet_fees: List["PacketFee"] = betterproto.message_field(2) + """list of packet fees""" + + +@dataclass(eq=False, repr=False) +class MsgRegisterPayee(betterproto.Message): + """MsgRegisterPayee defines the request type for the RegisterPayee rpc""" + + port_id: str = betterproto.string_field(1) + """unique port identifier""" + + channel_id: str = betterproto.string_field(2) + """unique channel identifier""" + + relayer: str = betterproto.string_field(3) + """the relayer address""" + + payee: str = betterproto.string_field(4) + """the payee address""" + + +@dataclass(eq=False, repr=False) +class MsgRegisterPayeeResponse(betterproto.Message): + """ + MsgRegisterPayeeResponse defines the response type for the RegisterPayee + rpc + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgRegisterCounterpartyPayee(betterproto.Message): + """ + MsgRegisterCounterpartyPayee defines the request type for the + RegisterCounterpartyPayee rpc + """ + + port_id: str = betterproto.string_field(1) + """unique port identifier""" + + channel_id: str = betterproto.string_field(2) + """unique channel identifier""" + + relayer: str = betterproto.string_field(3) + """the relayer address""" + + counterparty_payee: str = betterproto.string_field(4) + """the counterparty payee address""" + + +@dataclass(eq=False, repr=False) +class MsgRegisterCounterpartyPayeeResponse(betterproto.Message): + """ + MsgRegisterCounterpartyPayeeResponse defines the response type for the + RegisterCounterpartyPayee rpc + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgPayPacketFee(betterproto.Message): + """ + MsgPayPacketFee defines the request type for the PayPacketFee rpc This Msg + can be used to pay for a packet at the next sequence send & should be + combined with the Msg that will be paid for + """ + + fee: "Fee" = betterproto.message_field(1) + """ + fee encapsulates the recv, ack and timeout fees associated with an IBC + packet + """ + + source_port_id: str = betterproto.string_field(2) + """the source port unique identifier""" + + source_channel_id: str = betterproto.string_field(3) + """the source channel unique identifer""" + + signer: str = betterproto.string_field(4) + """account address to refund fee if necessary""" + + relayers: List[str] = betterproto.string_field(5) + """optional list of relayers permitted to the receive packet fees""" + + +@dataclass(eq=False, repr=False) +class MsgPayPacketFeeResponse(betterproto.Message): + """ + MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgPayPacketFeeAsync(betterproto.Message): + """ + MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc + This Msg can be used to pay for a packet at a specified sequence (instead + of the next sequence send) + """ + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(1) + """ + unique packet identifier comprised of the channel ID, port ID and sequence + """ + + packet_fee: "PacketFee" = betterproto.message_field(2) + """the packet fee associated with a particular IBC packet""" + + +@dataclass(eq=False, repr=False) +class MsgPayPacketFeeAsyncResponse(betterproto.Message): + """ + MsgPayPacketFeeAsyncResponse defines the response type for the + PayPacketFeeAsync rpc + """ + + pass + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the ICS29 fee middleware genesis state""" + + identified_fees: List["IdentifiedPacketFees"] = betterproto.message_field(1) + """list of identified packet fees""" + + fee_enabled_channels: List["FeeEnabledChannel"] = betterproto.message_field(2) + """list of fee enabled channels""" + + registered_payees: List["RegisteredPayee"] = betterproto.message_field(3) + """list of registered payees""" + + registered_counterparty_payees: List["RegisteredCounterpartyPayee"] = ( + betterproto.message_field(4) + ) + """list of registered counterparty payees""" + + forward_relayers: List["ForwardRelayerAddress"] = betterproto.message_field(5) + """list of forward relayer addresses""" + + +@dataclass(eq=False, repr=False) +class FeeEnabledChannel(betterproto.Message): + """ + FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel + """ + + port_id: str = betterproto.string_field(1) + """unique port identifier""" + + channel_id: str = betterproto.string_field(2) + """unique channel identifier""" + + +@dataclass(eq=False, repr=False) +class RegisteredPayee(betterproto.Message): + """ + RegisteredPayee contains the relayer address and payee address for a + specific channel + """ + + channel_id: str = betterproto.string_field(1) + """unique channel identifier""" + + relayer: str = betterproto.string_field(2) + """the relayer address""" + + payee: str = betterproto.string_field(3) + """the payee address""" + + +@dataclass(eq=False, repr=False) +class RegisteredCounterpartyPayee(betterproto.Message): + """ + RegisteredCounterpartyPayee contains the relayer address and counterparty + payee address for a specific channel (used for recv fee distribution) + """ + + channel_id: str = betterproto.string_field(1) + """unique channel identifier""" + + relayer: str = betterproto.string_field(2) + """the relayer address""" + + counterparty_payee: str = betterproto.string_field(3) + """the counterparty payee address""" + + +@dataclass(eq=False, repr=False) +class ForwardRelayerAddress(betterproto.Message): + """ + ForwardRelayerAddress contains the forward relayer address and PacketId + used for async acknowledgements + """ + + address: str = betterproto.string_field(1) + """the forward relayer address""" + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(2) + """ + unique packet identifer comprised of the channel ID, port ID and sequence + """ + + +@dataclass(eq=False, repr=False) +class QueryIncentivizedPacketsRequest(betterproto.Message): + """ + QueryIncentivizedPacketsRequest defines the request type for the + IncentivizedPackets rpc + """ + + pagination: "____cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(1) + ) + """pagination defines an optional pagination for the request.""" + + query_height: int = betterproto.uint64_field(2) + """block height at which to query""" + + +@dataclass(eq=False, repr=False) +class QueryIncentivizedPacketsResponse(betterproto.Message): + """ + QueryIncentivizedPacketsResponse defines the response type for the + IncentivizedPackets rpc + """ + + incentivized_packets: List["IdentifiedPacketFees"] = betterproto.message_field(1) + """list of identified fees for incentivized packets""" + + pagination: "____cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryIncentivizedPacketRequest(betterproto.Message): + """ + QueryIncentivizedPacketRequest defines the request type for the + IncentivizedPacket rpc + """ + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(1) + """ + unique packet identifier comprised of channel ID, port ID and sequence + """ + + query_height: int = betterproto.uint64_field(2) + """block height at which to query""" + + +@dataclass(eq=False, repr=False) +class QueryIncentivizedPacketResponse(betterproto.Message): + """ + QueryIncentivizedPacketsResponse defines the response type for the + IncentivizedPacket rpc + """ + + incentivized_packet: "IdentifiedPacketFees" = betterproto.message_field(1) + """the identified fees for the incentivized packet""" + + +@dataclass(eq=False, repr=False) +class QueryIncentivizedPacketsForChannelRequest(betterproto.Message): + """ + QueryIncentivizedPacketsForChannelRequest defines the request type for + querying for all incentivized packets for a specific channel + """ + + pagination: "____cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(1) + ) + """pagination defines an optional pagination for the request.""" + + port_id: str = betterproto.string_field(2) + channel_id: str = betterproto.string_field(3) + query_height: int = betterproto.uint64_field(4) + """Height to query at""" + + +@dataclass(eq=False, repr=False) +class QueryIncentivizedPacketsForChannelResponse(betterproto.Message): + """ + QueryIncentivizedPacketsResponse defines the response type for the + incentivized packets RPC + """ + + incentivized_packets: List["IdentifiedPacketFees"] = betterproto.message_field(1) + """Map of all incentivized_packets""" + + pagination: "____cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryTotalRecvFeesRequest(betterproto.Message): + """ + QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees + rpc + """ + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(1) + """the packet identifier for the associated fees""" + + +@dataclass(eq=False, repr=False) +class QueryTotalRecvFeesResponse(betterproto.Message): + """ + QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees + rpc + """ + + recv_fees: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """the total packet receive fees""" + + +@dataclass(eq=False, repr=False) +class QueryTotalAckFeesRequest(betterproto.Message): + """ + QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc + """ + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(1) + """the packet identifier for the associated fees""" + + +@dataclass(eq=False, repr=False) +class QueryTotalAckFeesResponse(betterproto.Message): + """ + QueryTotalAckFeesResponse defines the response type for the TotalAckFees + rpc + """ + + ack_fees: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """the total packet acknowledgement fees""" + + +@dataclass(eq=False, repr=False) +class QueryTotalTimeoutFeesRequest(betterproto.Message): + """ + QueryTotalTimeoutFeesRequest defines the request type for the + TotalTimeoutFees rpc + """ + + packet_id: "___core_channel_v1__.PacketId" = betterproto.message_field(1) + """the packet identifier for the associated fees""" + + +@dataclass(eq=False, repr=False) +class QueryTotalTimeoutFeesResponse(betterproto.Message): + """ + QueryTotalTimeoutFeesResponse defines the response type for the + TotalTimeoutFees rpc + """ + + timeout_fees: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """the total packet timeout fees""" + + +@dataclass(eq=False, repr=False) +class QueryPayeeRequest(betterproto.Message): + """QueryPayeeRequest defines the request type for the Payee rpc""" + + channel_id: str = betterproto.string_field(1) + """unique channel identifier""" + + relayer: str = betterproto.string_field(2) + """the relayer address to which the distribution address is registered""" + + +@dataclass(eq=False, repr=False) +class QueryPayeeResponse(betterproto.Message): + """QueryPayeeResponse defines the response type for the Payee rpc""" + + payee_address: str = betterproto.string_field(1) + """the payee address to which packet fees are paid out""" + + +@dataclass(eq=False, repr=False) +class QueryCounterpartyPayeeRequest(betterproto.Message): + """ + QueryCounterpartyPayeeRequest defines the request type for the + CounterpartyPayee rpc + """ + + channel_id: str = betterproto.string_field(1) + """unique channel identifier""" + + relayer: str = betterproto.string_field(2) + """the relayer address to which the counterparty is registered""" + + +@dataclass(eq=False, repr=False) +class QueryCounterpartyPayeeResponse(betterproto.Message): + """ + QueryCounterpartyPayeeResponse defines the response type for the + CounterpartyPayee rpc + """ + + counterparty_payee: str = betterproto.string_field(1) + """the counterparty payee address used to compensate forward relaying""" + + +@dataclass(eq=False, repr=False) +class QueryFeeEnabledChannelsRequest(betterproto.Message): + """ + QueryFeeEnabledChannelsRequest defines the request type for the + FeeEnabledChannels rpc + """ + + pagination: "____cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(1) + ) + """pagination defines an optional pagination for the request.""" + + query_height: int = betterproto.uint64_field(2) + """block height at which to query""" + + +@dataclass(eq=False, repr=False) +class QueryFeeEnabledChannelsResponse(betterproto.Message): + """ + QueryFeeEnabledChannelsResponse defines the response type for the + FeeEnabledChannels rpc + """ + + fee_enabled_channels: List["FeeEnabledChannel"] = betterproto.message_field(1) + """list of fee enabled channels""" + + pagination: "____cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryFeeEnabledChannelRequest(betterproto.Message): + """ + QueryFeeEnabledChannelRequest defines the request type for the + FeeEnabledChannel rpc + """ + + port_id: str = betterproto.string_field(1) + """unique port identifier""" + + channel_id: str = betterproto.string_field(2) + """unique channel identifier""" + + +@dataclass(eq=False, repr=False) +class QueryFeeEnabledChannelResponse(betterproto.Message): + """ + QueryFeeEnabledChannelResponse defines the response type for the + FeeEnabledChannel rpc + """ + + fee_enabled: bool = betterproto.bool_field(1) + """boolean flag representing the fee enabled channel status""" + + +@dataclass(eq=False, repr=False) +class Metadata(betterproto.Message): + """ + Metadata defines the ICS29 channel specific metadata encoded into the + channel version bytestring See ICS004: + https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and- + packet-semantics#Versioning + """ + + fee_version: str = betterproto.string_field(1) + """fee_version defines the ICS29 fee version""" + + app_version: str = betterproto.string_field(2) + """ + app_version defines the underlying application version, which may or may + not be a JSON encoded bytestring + """ + + +@dataclass(eq=False, repr=False) +class IncentivizedAcknowledgement(betterproto.Message): + """ + IncentivizedAcknowledgement is the acknowledgement format to be used by + applications wrapped in the fee middleware + """ + + app_acknowledgement: bytes = betterproto.bytes_field(1) + """the underlying app acknowledgement bytes""" + + forward_relayer_address: str = betterproto.string_field(2) + """the relayer address which submits the recv packet message""" + + underlying_app_success: bool = betterproto.bool_field(3) + """success flag of the base application callback""" + + +class MsgStub(betterproto.ServiceStub): + async def register_payee( + self, + msg_register_payee: "MsgRegisterPayee", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgRegisterPayeeResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Msg/RegisterPayee", + msg_register_payee, + MsgRegisterPayeeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def register_counterparty_payee( + self, + msg_register_counterparty_payee: "MsgRegisterCounterpartyPayee", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgRegisterCounterpartyPayeeResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Msg/RegisterCounterpartyPayee", + msg_register_counterparty_payee, + MsgRegisterCounterpartyPayeeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def pay_packet_fee( + self, + msg_pay_packet_fee: "MsgPayPacketFee", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgPayPacketFeeResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Msg/PayPacketFee", + msg_pay_packet_fee, + MsgPayPacketFeeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def pay_packet_fee_async( + self, + msg_pay_packet_fee_async: "MsgPayPacketFeeAsync", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgPayPacketFeeAsyncResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Msg/PayPacketFeeAsync", + msg_pay_packet_fee_async, + MsgPayPacketFeeAsyncResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def incentivized_packets( + self, + query_incentivized_packets_request: "QueryIncentivizedPacketsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryIncentivizedPacketsResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/IncentivizedPackets", + query_incentivized_packets_request, + QueryIncentivizedPacketsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def incentivized_packet( + self, + query_incentivized_packet_request: "QueryIncentivizedPacketRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryIncentivizedPacketResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/IncentivizedPacket", + query_incentivized_packet_request, + QueryIncentivizedPacketResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def incentivized_packets_for_channel( + self, + query_incentivized_packets_for_channel_request: "QueryIncentivizedPacketsForChannelRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryIncentivizedPacketsForChannelResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/IncentivizedPacketsForChannel", + query_incentivized_packets_for_channel_request, + QueryIncentivizedPacketsForChannelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def total_recv_fees( + self, + query_total_recv_fees_request: "QueryTotalRecvFeesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTotalRecvFeesResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/TotalRecvFees", + query_total_recv_fees_request, + QueryTotalRecvFeesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def total_ack_fees( + self, + query_total_ack_fees_request: "QueryTotalAckFeesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTotalAckFeesResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/TotalAckFees", + query_total_ack_fees_request, + QueryTotalAckFeesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def total_timeout_fees( + self, + query_total_timeout_fees_request: "QueryTotalTimeoutFeesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTotalTimeoutFeesResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/TotalTimeoutFees", + query_total_timeout_fees_request, + QueryTotalTimeoutFeesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def payee( + self, + query_payee_request: "QueryPayeeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPayeeResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/Payee", + query_payee_request, + QueryPayeeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def counterparty_payee( + self, + query_counterparty_payee_request: "QueryCounterpartyPayeeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryCounterpartyPayeeResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/CounterpartyPayee", + query_counterparty_payee_request, + QueryCounterpartyPayeeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def fee_enabled_channels( + self, + query_fee_enabled_channels_request: "QueryFeeEnabledChannelsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryFeeEnabledChannelsResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/FeeEnabledChannels", + query_fee_enabled_channels_request, + QueryFeeEnabledChannelsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def fee_enabled_channel( + self, + query_fee_enabled_channel_request: "QueryFeeEnabledChannelRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryFeeEnabledChannelResponse": + return await self._unary_unary( + "/ibc.applications.fee.v1.Query/FeeEnabledChannel", + query_fee_enabled_channel_request, + QueryFeeEnabledChannelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def register_payee( + self, msg_register_payee: "MsgRegisterPayee" + ) -> "MsgRegisterPayeeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def register_counterparty_payee( + self, msg_register_counterparty_payee: "MsgRegisterCounterpartyPayee" + ) -> "MsgRegisterCounterpartyPayeeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def pay_packet_fee( + self, msg_pay_packet_fee: "MsgPayPacketFee" + ) -> "MsgPayPacketFeeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def pay_packet_fee_async( + self, msg_pay_packet_fee_async: "MsgPayPacketFeeAsync" + ) -> "MsgPayPacketFeeAsyncResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_register_payee( + self, + stream: "grpclib.server.Stream[MsgRegisterPayee, MsgRegisterPayeeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.register_payee(request) + await stream.send_message(response) + + async def __rpc_register_counterparty_payee( + self, + stream: "grpclib.server.Stream[MsgRegisterCounterpartyPayee, MsgRegisterCounterpartyPayeeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.register_counterparty_payee(request) + await stream.send_message(response) + + async def __rpc_pay_packet_fee( + self, stream: "grpclib.server.Stream[MsgPayPacketFee, MsgPayPacketFeeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.pay_packet_fee(request) + await stream.send_message(response) + + async def __rpc_pay_packet_fee_async( + self, + stream: "grpclib.server.Stream[MsgPayPacketFeeAsync, MsgPayPacketFeeAsyncResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.pay_packet_fee_async(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/ibc.applications.fee.v1.Msg/RegisterPayee": grpclib.const.Handler( + self.__rpc_register_payee, + grpclib.const.Cardinality.UNARY_UNARY, + MsgRegisterPayee, + MsgRegisterPayeeResponse, + ), + "/ibc.applications.fee.v1.Msg/RegisterCounterpartyPayee": grpclib.const.Handler( + self.__rpc_register_counterparty_payee, + grpclib.const.Cardinality.UNARY_UNARY, + MsgRegisterCounterpartyPayee, + MsgRegisterCounterpartyPayeeResponse, + ), + "/ibc.applications.fee.v1.Msg/PayPacketFee": grpclib.const.Handler( + self.__rpc_pay_packet_fee, + grpclib.const.Cardinality.UNARY_UNARY, + MsgPayPacketFee, + MsgPayPacketFeeResponse, + ), + "/ibc.applications.fee.v1.Msg/PayPacketFeeAsync": grpclib.const.Handler( + self.__rpc_pay_packet_fee_async, + grpclib.const.Cardinality.UNARY_UNARY, + MsgPayPacketFeeAsync, + MsgPayPacketFeeAsyncResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def incentivized_packets( + self, query_incentivized_packets_request: "QueryIncentivizedPacketsRequest" + ) -> "QueryIncentivizedPacketsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def incentivized_packet( + self, query_incentivized_packet_request: "QueryIncentivizedPacketRequest" + ) -> "QueryIncentivizedPacketResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def incentivized_packets_for_channel( + self, + query_incentivized_packets_for_channel_request: "QueryIncentivizedPacketsForChannelRequest", + ) -> "QueryIncentivizedPacketsForChannelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def total_recv_fees( + self, query_total_recv_fees_request: "QueryTotalRecvFeesRequest" + ) -> "QueryTotalRecvFeesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def total_ack_fees( + self, query_total_ack_fees_request: "QueryTotalAckFeesRequest" + ) -> "QueryTotalAckFeesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def total_timeout_fees( + self, query_total_timeout_fees_request: "QueryTotalTimeoutFeesRequest" + ) -> "QueryTotalTimeoutFeesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def payee( + self, query_payee_request: "QueryPayeeRequest" + ) -> "QueryPayeeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def counterparty_payee( + self, query_counterparty_payee_request: "QueryCounterpartyPayeeRequest" + ) -> "QueryCounterpartyPayeeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def fee_enabled_channels( + self, query_fee_enabled_channels_request: "QueryFeeEnabledChannelsRequest" + ) -> "QueryFeeEnabledChannelsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def fee_enabled_channel( + self, query_fee_enabled_channel_request: "QueryFeeEnabledChannelRequest" + ) -> "QueryFeeEnabledChannelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_incentivized_packets( + self, + stream: "grpclib.server.Stream[QueryIncentivizedPacketsRequest, QueryIncentivizedPacketsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.incentivized_packets(request) + await stream.send_message(response) + + async def __rpc_incentivized_packet( + self, + stream: "grpclib.server.Stream[QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.incentivized_packet(request) + await stream.send_message(response) + + async def __rpc_incentivized_packets_for_channel( + self, + stream: "grpclib.server.Stream[QueryIncentivizedPacketsForChannelRequest, QueryIncentivizedPacketsForChannelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.incentivized_packets_for_channel(request) + await stream.send_message(response) + + async def __rpc_total_recv_fees( + self, + stream: "grpclib.server.Stream[QueryTotalRecvFeesRequest, QueryTotalRecvFeesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.total_recv_fees(request) + await stream.send_message(response) + + async def __rpc_total_ack_fees( + self, + stream: "grpclib.server.Stream[QueryTotalAckFeesRequest, QueryTotalAckFeesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.total_ack_fees(request) + await stream.send_message(response) + + async def __rpc_total_timeout_fees( + self, + stream: "grpclib.server.Stream[QueryTotalTimeoutFeesRequest, QueryTotalTimeoutFeesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.total_timeout_fees(request) + await stream.send_message(response) + + async def __rpc_payee( + self, stream: "grpclib.server.Stream[QueryPayeeRequest, QueryPayeeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.payee(request) + await stream.send_message(response) + + async def __rpc_counterparty_payee( + self, + stream: "grpclib.server.Stream[QueryCounterpartyPayeeRequest, QueryCounterpartyPayeeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.counterparty_payee(request) + await stream.send_message(response) + + async def __rpc_fee_enabled_channels( + self, + stream: "grpclib.server.Stream[QueryFeeEnabledChannelsRequest, QueryFeeEnabledChannelsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.fee_enabled_channels(request) + await stream.send_message(response) + + async def __rpc_fee_enabled_channel( + self, + stream: "grpclib.server.Stream[QueryFeeEnabledChannelRequest, QueryFeeEnabledChannelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.fee_enabled_channel(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/ibc.applications.fee.v1.Query/IncentivizedPackets": grpclib.const.Handler( + self.__rpc_incentivized_packets, + grpclib.const.Cardinality.UNARY_UNARY, + QueryIncentivizedPacketsRequest, + QueryIncentivizedPacketsResponse, + ), + "/ibc.applications.fee.v1.Query/IncentivizedPacket": grpclib.const.Handler( + self.__rpc_incentivized_packet, + grpclib.const.Cardinality.UNARY_UNARY, + QueryIncentivizedPacketRequest, + QueryIncentivizedPacketResponse, + ), + "/ibc.applications.fee.v1.Query/IncentivizedPacketsForChannel": grpclib.const.Handler( + self.__rpc_incentivized_packets_for_channel, + grpclib.const.Cardinality.UNARY_UNARY, + QueryIncentivizedPacketsForChannelRequest, + QueryIncentivizedPacketsForChannelResponse, + ), + "/ibc.applications.fee.v1.Query/TotalRecvFees": grpclib.const.Handler( + self.__rpc_total_recv_fees, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTotalRecvFeesRequest, + QueryTotalRecvFeesResponse, + ), + "/ibc.applications.fee.v1.Query/TotalAckFees": grpclib.const.Handler( + self.__rpc_total_ack_fees, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTotalAckFeesRequest, + QueryTotalAckFeesResponse, + ), + "/ibc.applications.fee.v1.Query/TotalTimeoutFees": grpclib.const.Handler( + self.__rpc_total_timeout_fees, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTotalTimeoutFeesRequest, + QueryTotalTimeoutFeesResponse, + ), + "/ibc.applications.fee.v1.Query/Payee": grpclib.const.Handler( + self.__rpc_payee, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPayeeRequest, + QueryPayeeResponse, + ), + "/ibc.applications.fee.v1.Query/CounterpartyPayee": grpclib.const.Handler( + self.__rpc_counterparty_payee, + grpclib.const.Cardinality.UNARY_UNARY, + QueryCounterpartyPayeeRequest, + QueryCounterpartyPayeeResponse, + ), + "/ibc.applications.fee.v1.Query/FeeEnabledChannels": grpclib.const.Handler( + self.__rpc_fee_enabled_channels, + grpclib.const.Cardinality.UNARY_UNARY, + QueryFeeEnabledChannelsRequest, + QueryFeeEnabledChannelsResponse, + ), + "/ibc.applications.fee.v1.Query/FeeEnabledChannel": grpclib.const.Handler( + self.__rpc_fee_enabled_channel, + grpclib.const.Cardinality.UNARY_UNARY, + QueryFeeEnabledChannelRequest, + QueryFeeEnabledChannelResponse, + ), + } diff --git a/secret_sdk/protobuf/ibc/applications/interchain_accounts/controller/v1/__init__.py b/secret_sdk/protobuf/ibc/applications/interchain_accounts/controller/v1/__init__.py index 38429f8..7e425c2 100644 --- a/secret_sdk/protobuf/ibc/applications/interchain_accounts/controller/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/applications/interchain_accounts/controller/v1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: ibc/applications/interchain_accounts/controller/v1/controller.proto, ibc/applications/interchain_accounts/controller/v1/query.proto +# sources: ibc/applications/interchain_accounts/controller/v1/controller.proto, ibc/applications/interchain_accounts/controller/v1/query.proto, ibc/applications/interchain_accounts/controller/v1/tx.proto # plugin: python-betterproto from dataclasses import dataclass from typing import ( @@ -12,6 +12,9 @@ import grpclib from betterproto.grpc.grpclib_server import ServiceBase +from .....core.channel import v1 as ____core_channel_v1__ +from ... import v1 as __v1__ + if TYPE_CHECKING: import grpclib.server @@ -30,6 +33,92 @@ class Params(betterproto.Message): """controller_enabled enables or disables the controller submodule.""" +@dataclass(eq=False, repr=False) +class MsgRegisterInterchainAccount(betterproto.Message): + """ + MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount + """ + + owner: str = betterproto.string_field(1) + connection_id: str = betterproto.string_field(2) + version: str = betterproto.string_field(3) + ordering: "____core_channel_v1__.Order" = betterproto.enum_field(4) + + +@dataclass(eq=False, repr=False) +class MsgRegisterInterchainAccountResponse(betterproto.Message): + """ + MsgRegisterInterchainAccountResponse defines the response for + Msg/RegisterAccount + """ + + channel_id: str = betterproto.string_field(1) + port_id: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MsgSendTx(betterproto.Message): + """MsgSendTx defines the payload for Msg/SendTx""" + + owner: str = betterproto.string_field(1) + connection_id: str = betterproto.string_field(2) + packet_data: "__v1__.InterchainAccountPacketData" = betterproto.message_field(3) + relative_timeout: int = betterproto.uint64_field(4) + """ + Relative timeout timestamp provided will be added to the current block time + during transaction execution. The timeout timestamp must be non-zero. + """ + + +@dataclass(eq=False, repr=False) +class MsgSendTxResponse(betterproto.Message): + """MsgSendTxResponse defines the response for MsgSendTx""" + + sequence: int = betterproto.uint64_field(1) + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams defines the payload for Msg/UpdateParams""" + + signer: str = betterproto.string_field(1) + """signer address""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the 27-interchain-accounts/controller parameters to update. + NOTE: All parameters must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """MsgUpdateParamsResponse defines the response for Msg/UpdateParams""" + + pass + + +@dataclass(eq=False, repr=False) +class QueryInterchainAccountRequest(betterproto.Message): + """ + QueryInterchainAccountRequest is the request type for the + Query/InterchainAccount RPC method. + """ + + owner: str = betterproto.string_field(1) + connection_id: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class QueryInterchainAccountResponse(betterproto.Message): + """ + QueryInterchainAccountResponse the response type for the + Query/InterchainAccount RPC method. + """ + + address: str = betterproto.string_field(1) + + @dataclass(eq=False, repr=False) class QueryParamsRequest(betterproto.Message): """ @@ -49,7 +138,77 @@ class QueryParamsResponse(betterproto.Message): """params defines the parameters of the module.""" +class MsgStub(betterproto.ServiceStub): + async def register_interchain_account( + self, + msg_register_interchain_account: "MsgRegisterInterchainAccount", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgRegisterInterchainAccountResponse": + return await self._unary_unary( + "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterInterchainAccount", + msg_register_interchain_account, + MsgRegisterInterchainAccountResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def send_tx( + self, + msg_send_tx: "MsgSendTx", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSendTxResponse": + return await self._unary_unary( + "/ibc.applications.interchain_accounts.controller.v1.Msg/SendTx", + msg_send_tx, + MsgSendTxResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/ibc.applications.interchain_accounts.controller.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + class QueryStub(betterproto.ServiceStub): + async def interchain_account( + self, + query_interchain_account_request: "QueryInterchainAccountRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryInterchainAccountResponse": + return await self._unary_unary( + "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount", + query_interchain_account_request, + QueryInterchainAccountResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def params( self, query_params_request: "QueryParamsRequest", @@ -68,12 +227,86 @@ async def params( ) +class MsgBase(ServiceBase): + + async def register_interchain_account( + self, msg_register_interchain_account: "MsgRegisterInterchainAccount" + ) -> "MsgRegisterInterchainAccountResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def send_tx(self, msg_send_tx: "MsgSendTx") -> "MsgSendTxResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_register_interchain_account( + self, + stream: "grpclib.server.Stream[MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.register_interchain_account(request) + await stream.send_message(response) + + async def __rpc_send_tx( + self, stream: "grpclib.server.Stream[MsgSendTx, MsgSendTxResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.send_tx(request) + await stream.send_message(response) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterInterchainAccount": grpclib.const.Handler( + self.__rpc_register_interchain_account, + grpclib.const.Cardinality.UNARY_UNARY, + MsgRegisterInterchainAccount, + MsgRegisterInterchainAccountResponse, + ), + "/ibc.applications.interchain_accounts.controller.v1.Msg/SendTx": grpclib.const.Handler( + self.__rpc_send_tx, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSendTx, + MsgSendTxResponse, + ), + "/ibc.applications.interchain_accounts.controller.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + class QueryBase(ServiceBase): + + async def interchain_account( + self, query_interchain_account_request: "QueryInterchainAccountRequest" + ) -> "QueryInterchainAccountResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_interchain_account( + self, + stream: "grpclib.server.Stream[QueryInterchainAccountRequest, QueryInterchainAccountResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.interchain_account(request) + await stream.send_message(response) + async def __rpc_params( self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" ) -> None: @@ -83,6 +316,12 @@ async def __rpc_params( def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { + "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount": grpclib.const.Handler( + self.__rpc_interchain_account, + grpclib.const.Cardinality.UNARY_UNARY, + QueryInterchainAccountRequest, + QueryInterchainAccountResponse, + ), "/ibc.applications.interchain_accounts.controller.v1.Query/Params": grpclib.const.Handler( self.__rpc_params, grpclib.const.Cardinality.UNARY_UNARY, diff --git a/secret_sdk/protobuf/ibc/applications/interchain_accounts/genesis/__init__.py b/secret_sdk/protobuf/ibc/applications/interchain_accounts/genesis/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/ibc/applications/interchain_accounts/genesis/v1/__init__.py b/secret_sdk/protobuf/ibc/applications/interchain_accounts/genesis/v1/__init__.py new file mode 100644 index 0000000..ec53fe2 --- /dev/null +++ b/secret_sdk/protobuf/ibc/applications/interchain_accounts/genesis/v1/__init__.py @@ -0,0 +1,71 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: ibc/applications/interchain_accounts/genesis/v1/genesis.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import List + +import betterproto + +from ...controller import v1 as __controller_v1__ +from ...host import v1 as __host_v1__ + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the interchain accounts genesis state""" + + controller_genesis_state: "ControllerGenesisState" = betterproto.message_field(1) + host_genesis_state: "HostGenesisState" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class ControllerGenesisState(betterproto.Message): + """ + ControllerGenesisState defines the interchain accounts controller genesis + state + """ + + active_channels: List["ActiveChannel"] = betterproto.message_field(1) + interchain_accounts: List["RegisteredInterchainAccount"] = ( + betterproto.message_field(2) + ) + ports: List[str] = betterproto.string_field(3) + params: "__controller_v1__.Params" = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class HostGenesisState(betterproto.Message): + """HostGenesisState defines the interchain accounts host genesis state""" + + active_channels: List["ActiveChannel"] = betterproto.message_field(1) + interchain_accounts: List["RegisteredInterchainAccount"] = ( + betterproto.message_field(2) + ) + port: str = betterproto.string_field(3) + params: "__host_v1__.Params" = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class ActiveChannel(betterproto.Message): + """ + ActiveChannel contains a connection ID, port ID and associated active + channel ID, as well as a boolean flag to indicate if the channel is + middleware enabled + """ + + connection_id: str = betterproto.string_field(1) + port_id: str = betterproto.string_field(2) + channel_id: str = betterproto.string_field(3) + is_middleware_enabled: bool = betterproto.bool_field(4) + + +@dataclass(eq=False, repr=False) +class RegisteredInterchainAccount(betterproto.Message): + """ + RegisteredInterchainAccount contains a connection ID, port ID and + associated interchain account address + """ + + connection_id: str = betterproto.string_field(1) + port_id: str = betterproto.string_field(2) + account_address: str = betterproto.string_field(3) diff --git a/secret_sdk/protobuf/ibc/applications/interchain_accounts/host/v1/__init__.py b/secret_sdk/protobuf/ibc/applications/interchain_accounts/host/v1/__init__.py index 3e13d10..419158a 100644 --- a/secret_sdk/protobuf/ibc/applications/interchain_accounts/host/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/applications/interchain_accounts/host/v1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: ibc/applications/interchain_accounts/host/v1/host.proto, ibc/applications/interchain_accounts/host/v1/query.proto +# sources: ibc/applications/interchain_accounts/host/v1/host.proto, ibc/applications/interchain_accounts/host/v1/query.proto, ibc/applications/interchain_accounts/host/v1/tx.proto # plugin: python-betterproto from dataclasses import dataclass from typing import ( @@ -37,6 +37,27 @@ class Params(betterproto.Message): """ +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams defines the payload for Msg/UpdateParams""" + + signer: str = betterproto.string_field(1) + """signer address""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the 27-interchain-accounts/host parameters to update. NOTE: + All parameters must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """MsgUpdateParamsResponse defines the response for Msg/UpdateParams""" + + pass + + @dataclass(eq=False, repr=False) class QueryParamsRequest(betterproto.Message): """ @@ -56,6 +77,25 @@ class QueryParamsResponse(betterproto.Message): """params defines the parameters of the module.""" +class MsgStub(betterproto.ServiceStub): + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + class QueryStub(betterproto.ServiceStub): async def params( self, @@ -75,7 +115,33 @@ async def params( ) +class MsgBase(ServiceBase): + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + class QueryBase(ServiceBase): + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": diff --git a/secret_sdk/protobuf/ibc/applications/interchain_accounts/v1/__init__.py b/secret_sdk/protobuf/ibc/applications/interchain_accounts/v1/__init__.py index b5e9013..ab1579c 100644 --- a/secret_sdk/protobuf/ibc/applications/interchain_accounts/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/applications/interchain_accounts/v1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: ibc/applications/interchain_accounts/v1/account.proto, ibc/applications/interchain_accounts/v1/genesis.proto, ibc/applications/interchain_accounts/v1/metadata.proto, ibc/applications/interchain_accounts/v1/packet.proto +# sources: ibc/applications/interchain_accounts/v1/account.proto, ibc/applications/interchain_accounts/v1/metadata.proto, ibc/applications/interchain_accounts/v1/packet.proto # plugin: python-betterproto from dataclasses import dataclass from typing import List @@ -8,8 +8,6 @@ import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf from .....cosmos.auth import v1beta1 as ____cosmos_auth_v1_beta1__ -from ..controller import v1 as _controller_v1__ -from ..host import v1 as _host_v1__ class Type(betterproto.Enum): @@ -25,19 +23,6 @@ class Type(betterproto.Enum): """Execute a transaction on an interchain accounts host chain""" -@dataclass(eq=False, repr=False) -class InterchainAccount(betterproto.Message): - """ - An InterchainAccount is defined as a BaseAccount & the address of the - account owner on the controller chain - """ - - base_account: "____cosmos_auth_v1_beta1__.BaseAccount" = betterproto.message_field( - 1 - ) - account_owner: str = betterproto.string_field(2) - - @dataclass(eq=False, repr=False) class InterchainAccountPacketData(betterproto.Message): """ @@ -60,6 +45,19 @@ class CosmosTx(betterproto.Message): messages: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) +@dataclass(eq=False, repr=False) +class InterchainAccount(betterproto.Message): + """ + An InterchainAccount is defined as a BaseAccount & the address of the + account owner on the controller chain + """ + + base_account: "____cosmos_auth_v1_beta1__.BaseAccount" = betterproto.message_field( + 1 + ) + account_owner: str = betterproto.string_field(2) + + @dataclass(eq=False, repr=False) class Metadata(betterproto.Message): """ @@ -98,62 +96,3 @@ class Metadata(betterproto.Message): """ tx_type defines the type of transactions the interchain account can execute """ - - -@dataclass(eq=False, repr=False) -class GenesisState(betterproto.Message): - """GenesisState defines the interchain accounts genesis state""" - - controller_genesis_state: "ControllerGenesisState" = betterproto.message_field(1) - host_genesis_state: "HostGenesisState" = betterproto.message_field(2) - - -@dataclass(eq=False, repr=False) -class ControllerGenesisState(betterproto.Message): - """ - ControllerGenesisState defines the interchain accounts controller genesis - state - """ - - active_channels: List["ActiveChannel"] = betterproto.message_field(1) - interchain_accounts: List[ - "RegisteredInterchainAccount" - ] = betterproto.message_field(2) - ports: List[str] = betterproto.string_field(3) - params: "_controller_v1__.Params" = betterproto.message_field(4) - - -@dataclass(eq=False, repr=False) -class HostGenesisState(betterproto.Message): - """HostGenesisState defines the interchain accounts host genesis state""" - - active_channels: List["ActiveChannel"] = betterproto.message_field(1) - interchain_accounts: List[ - "RegisteredInterchainAccount" - ] = betterproto.message_field(2) - port: str = betterproto.string_field(3) - params: "_host_v1__.Params" = betterproto.message_field(4) - - -@dataclass(eq=False, repr=False) -class ActiveChannel(betterproto.Message): - """ - ActiveChannel contains a connection ID, port ID and associated active - channel ID - """ - - connection_id: str = betterproto.string_field(1) - port_id: str = betterproto.string_field(2) - channel_id: str = betterproto.string_field(3) - - -@dataclass(eq=False, repr=False) -class RegisteredInterchainAccount(betterproto.Message): - """ - RegisteredInterchainAccount contains a connection ID, port ID and - associated interchain account address - """ - - connection_id: str = betterproto.string_field(1) - port_id: str = betterproto.string_field(2) - account_address: str = betterproto.string_field(3) diff --git a/secret_sdk/protobuf/ibc/applications/transfer/v1/__init__.py b/secret_sdk/protobuf/ibc/applications/transfer/v1/__init__.py index b25b5cb..8f6c2c2 100644 --- a/secret_sdk/protobuf/ibc/applications/transfer/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/applications/transfer/v1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: ibc/applications/transfer/v1/genesis.proto, ibc/applications/transfer/v1/query.proto, ibc/applications/transfer/v1/transfer.proto, ibc/applications/transfer/v1/tx.proto +# sources: ibc/applications/transfer/v1/authz.proto, ibc/applications/transfer/v1/genesis.proto, ibc/applications/transfer/v1/query.proto, ibc/applications/transfer/v1/transfer.proto, ibc/applications/transfer/v1/tx.proto # plugin: python-betterproto from dataclasses import dataclass from typing import ( @@ -24,6 +24,81 @@ from grpclib.metadata import Deadline +@dataclass(eq=False, repr=False) +class DenomTrace(betterproto.Message): + """ + DenomTrace contains the base denomination for ICS20 fungible tokens and the + source tracing information path. + """ + + path: str = betterproto.string_field(1) + """ + path defines the chain of port/channel identifiers used for tracing the + source of the fungible token. + """ + + base_denom: str = betterproto.string_field(2) + """base denomination of the relayed fungible token.""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """ + Params defines the set of IBC transfer parameters. NOTE: To prevent a + single token from being transferred, set the TransfersEnabled parameter to + true and then set the bank module's SendEnabled parameter for the + denomination to false. + """ + + send_enabled: bool = betterproto.bool_field(1) + """ + send_enabled enables or disables all cross-chain token transfers from this + chain. + """ + + receive_enabled: bool = betterproto.bool_field(2) + """ + receive_enabled enables or disables all cross-chain token transfers to this + chain. + """ + + +@dataclass(eq=False, repr=False) +class Allocation(betterproto.Message): + """Allocation defines the spend limit for a particular port and channel""" + + source_port: str = betterproto.string_field(1) + """the port on which the packet will be sent""" + + source_channel: str = betterproto.string_field(2) + """the channel by which the packet will be sent""" + + spend_limit: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(3) + """spend limitation on the channel""" + + allow_list: List[str] = betterproto.string_field(4) + """ + allow list of receivers, an empty allow list permits any receiver address + """ + + allowed_packet_data: List[str] = betterproto.string_field(5) + """ + allow list of packet data keys, an empty list prohibits all packet data + keys; a list only with "*" permits any packet data key + """ + + +@dataclass(eq=False, repr=False) +class TransferAuthorization(betterproto.Message): + """ + TransferAuthorization allows the grantee to spend up to spend_limit coins + from the granter's account for ibc transfer on a specific channel + """ + + allocations: List["Allocation"] = betterproto.message_field(1) + """port and channel amounts""" + + @dataclass(eq=False, repr=False) class MsgTransfer(betterproto.Message): """ @@ -60,51 +135,40 @@ class MsgTransfer(betterproto.Message): disabled when set to 0. """ + memo: str = betterproto.string_field(8) + """optional memo""" + @dataclass(eq=False, repr=False) class MsgTransferResponse(betterproto.Message): """MsgTransferResponse defines the Msg/Transfer response type.""" - pass + sequence: int = betterproto.uint64_field(1) + """sequence number of the transfer packet sent""" @dataclass(eq=False, repr=False) -class DenomTrace(betterproto.Message): - """ - DenomTrace contains the base denomination for ICS20 fungible tokens and the - source tracing information path. - """ +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the Msg/UpdateParams request type.""" - path: str = betterproto.string_field(1) + signer: str = betterproto.string_field(1) + """signer address""" + + params: "Params" = betterproto.message_field(2) """ - path defines the chain of port/channel identifiers used for tracing the - source of the fungible token. + params defines the transfer parameters to update. NOTE: All parameters must + be supplied. """ - base_denom: str = betterproto.string_field(2) - """base denomination of the relayed fungible token.""" - @dataclass(eq=False, repr=False) -class Params(betterproto.Message): +class MsgUpdateParamsResponse(betterproto.Message): """ - Params defines the set of IBC transfer parameters. NOTE: To prevent a - single token from being transferred, set the TransfersEnabled parameter to - true and then set the bank module's SendEnabled parameter for the - denomination to false. + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. """ - send_enabled: bool = betterproto.bool_field(1) - """ - send_enabled enables or disables all cross-chain token transfers from this - chain. - """ - - receive_enabled: bool = betterproto.bool_field(2) - """ - receive_enabled enables or disables all cross-chain token transfers to this - chain. - """ + pass @dataclass(eq=False, repr=False) @@ -115,7 +179,10 @@ class QueryDenomTraceRequest(betterproto.Message): """ hash: str = betterproto.string_field(1) - """hash (in hex format) of the denomination trace information.""" + """ + hash (in hex format) or denom (full denom with ibc prefix) of the + denomination trace information. + """ @dataclass(eq=False, repr=False) @@ -199,6 +266,51 @@ class QueryDenomHashResponse(betterproto.Message): """hash (in hex format) of the denomination trace information.""" +@dataclass(eq=False, repr=False) +class QueryEscrowAddressRequest(betterproto.Message): + """ + QueryEscrowAddressRequest is the request type for the EscrowAddress RPC + method. + """ + + port_id: str = betterproto.string_field(1) + """unique port identifier""" + + channel_id: str = betterproto.string_field(2) + """unique channel identifier""" + + +@dataclass(eq=False, repr=False) +class QueryEscrowAddressResponse(betterproto.Message): + """ + QueryEscrowAddressResponse is the response type of the EscrowAddress RPC + method. + """ + + escrow_address: str = betterproto.string_field(1) + """the escrow account address""" + + +@dataclass(eq=False, repr=False) +class QueryTotalEscrowForDenomRequest(betterproto.Message): + """ + QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom + RPC method. + """ + + denom: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class QueryTotalEscrowForDenomResponse(betterproto.Message): + """ + QueryTotalEscrowForDenomResponse is the response type for + TotalEscrowForDenom RPC method. + """ + + amount: "____cosmos_base_v1_beta1__.Coin" = betterproto.message_field(1) + + @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState defines the ibc-transfer genesis state""" @@ -206,6 +318,13 @@ class GenesisState(betterproto.Message): port_id: str = betterproto.string_field(1) denom_traces: List["DenomTrace"] = betterproto.message_field(2) params: "Params" = betterproto.message_field(3) + total_escrowed: List["____cosmos_base_v1_beta1__.Coin"] = betterproto.message_field( + 4 + ) + """ + total_escrowed contains the total amount of tokens escrowed by the transfer + module + """ class MsgStub(betterproto.ServiceStub): @@ -226,25 +345,25 @@ async def transfer( metadata=metadata, ) - -class QueryStub(betterproto.ServiceStub): - async def denom_trace( + async def update_params( self, - query_denom_trace_request: "QueryDenomTraceRequest", + msg_update_params: "MsgUpdateParams", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "QueryDenomTraceResponse": + ) -> "MsgUpdateParamsResponse": return await self._unary_unary( - "/ibc.applications.transfer.v1.Query/DenomTrace", - query_denom_trace_request, - QueryDenomTraceResponse, + "/ibc.applications.transfer.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, timeout=timeout, deadline=deadline, metadata=metadata, ) + +class QueryStub(betterproto.ServiceStub): async def denom_traces( self, query_denom_traces_request: "QueryDenomTracesRequest", @@ -262,6 +381,23 @@ async def denom_traces( metadata=metadata, ) + async def denom_trace( + self, + query_denom_trace_request: "QueryDenomTraceRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDenomTraceResponse": + return await self._unary_unary( + "/ibc.applications.transfer.v1.Query/DenomTrace", + query_denom_trace_request, + QueryDenomTraceResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def params( self, query_params_request: "QueryParamsRequest", @@ -296,11 +432,51 @@ async def denom_hash( metadata=metadata, ) + async def escrow_address( + self, + query_escrow_address_request: "QueryEscrowAddressRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryEscrowAddressResponse": + return await self._unary_unary( + "/ibc.applications.transfer.v1.Query/EscrowAddress", + query_escrow_address_request, + QueryEscrowAddressResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def total_escrow_for_denom( + self, + query_total_escrow_for_denom_request: "QueryTotalEscrowForDenomRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTotalEscrowForDenomResponse": + return await self._unary_unary( + "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom", + query_total_escrow_for_denom_request, + QueryTotalEscrowForDenomResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def transfer(self, msg_transfer: "MsgTransfer") -> "MsgTransferResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_transfer( self, stream: "grpclib.server.Stream[MsgTransfer, MsgTransferResponse]" ) -> None: @@ -308,6 +484,13 @@ async def __rpc_transfer( response = await self.transfer(request) await stream.send_message(response) + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/ibc.applications.transfer.v1.Msg/Transfer": grpclib.const.Handler( @@ -316,20 +499,27 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgTransfer, MsgTransferResponse, ), + "/ibc.applications.transfer.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } class QueryBase(ServiceBase): - async def denom_trace( - self, query_denom_trace_request: "QueryDenomTraceRequest" - ) -> "QueryDenomTraceResponse": - raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def denom_traces( self, query_denom_traces_request: "QueryDenomTracesRequest" ) -> "QueryDenomTracesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def denom_trace( + self, query_denom_trace_request: "QueryDenomTraceRequest" + ) -> "QueryDenomTraceResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def params( self, query_params_request: "QueryParamsRequest" ) -> "QueryParamsResponse": @@ -340,20 +530,30 @@ async def denom_hash( ) -> "QueryDenomHashResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_denom_trace( + async def escrow_address( + self, query_escrow_address_request: "QueryEscrowAddressRequest" + ) -> "QueryEscrowAddressResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def total_escrow_for_denom( + self, query_total_escrow_for_denom_request: "QueryTotalEscrowForDenomRequest" + ) -> "QueryTotalEscrowForDenomResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_denom_traces( self, - stream: "grpclib.server.Stream[QueryDenomTraceRequest, QueryDenomTraceResponse]", + stream: "grpclib.server.Stream[QueryDenomTracesRequest, QueryDenomTracesResponse]", ) -> None: request = await stream.recv_message() - response = await self.denom_trace(request) + response = await self.denom_traces(request) await stream.send_message(response) - async def __rpc_denom_traces( + async def __rpc_denom_trace( self, - stream: "grpclib.server.Stream[QueryDenomTracesRequest, QueryDenomTracesResponse]", + stream: "grpclib.server.Stream[QueryDenomTraceRequest, QueryDenomTraceResponse]", ) -> None: request = await stream.recv_message() - response = await self.denom_traces(request) + response = await self.denom_trace(request) await stream.send_message(response) async def __rpc_params( @@ -371,20 +571,36 @@ async def __rpc_denom_hash( response = await self.denom_hash(request) await stream.send_message(response) + async def __rpc_escrow_address( + self, + stream: "grpclib.server.Stream[QueryEscrowAddressRequest, QueryEscrowAddressResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.escrow_address(request) + await stream.send_message(response) + + async def __rpc_total_escrow_for_denom( + self, + stream: "grpclib.server.Stream[QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.total_escrow_for_denom(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { - "/ibc.applications.transfer.v1.Query/DenomTrace": grpclib.const.Handler( - self.__rpc_denom_trace, - grpclib.const.Cardinality.UNARY_UNARY, - QueryDenomTraceRequest, - QueryDenomTraceResponse, - ), "/ibc.applications.transfer.v1.Query/DenomTraces": grpclib.const.Handler( self.__rpc_denom_traces, grpclib.const.Cardinality.UNARY_UNARY, QueryDenomTracesRequest, QueryDenomTracesResponse, ), + "/ibc.applications.transfer.v1.Query/DenomTrace": grpclib.const.Handler( + self.__rpc_denom_trace, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDenomTraceRequest, + QueryDenomTraceResponse, + ), "/ibc.applications.transfer.v1.Query/Params": grpclib.const.Handler( self.__rpc_params, grpclib.const.Cardinality.UNARY_UNARY, @@ -397,4 +613,16 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryDenomHashRequest, QueryDenomHashResponse, ), + "/ibc.applications.transfer.v1.Query/EscrowAddress": grpclib.const.Handler( + self.__rpc_escrow_address, + grpclib.const.Cardinality.UNARY_UNARY, + QueryEscrowAddressRequest, + QueryEscrowAddressResponse, + ), + "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom": grpclib.const.Handler( + self.__rpc_total_escrow_for_denom, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTotalEscrowForDenomRequest, + QueryTotalEscrowForDenomResponse, + ), } diff --git a/secret_sdk/protobuf/ibc/applications/transfer/v2/__init__.py b/secret_sdk/protobuf/ibc/applications/transfer/v2/__init__.py index dab0de2..9c6b04b 100644 --- a/secret_sdk/protobuf/ibc/applications/transfer/v2/__init__.py +++ b/secret_sdk/protobuf/ibc/applications/transfer/v2/__init__.py @@ -26,3 +26,6 @@ class FungibleTokenPacketData(betterproto.Message): receiver: str = betterproto.string_field(4) """the recipient address on the destination chain""" + + memo: str = betterproto.string_field(5) + """optional memo""" diff --git a/secret_sdk/protobuf/ibc/core/channel/v1/__init__.py b/secret_sdk/protobuf/ibc/core/channel/v1/__init__.py index ef8c367..f89cd19 100644 --- a/secret_sdk/protobuf/ibc/core/channel/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/core/channel/v1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: ibc/core/channel/v1/channel.proto, ibc/core/channel/v1/genesis.proto, ibc/core/channel/v1/query.proto, ibc/core/channel/v1/tx.proto +# sources: ibc/core/channel/v1/channel.proto, ibc/core/channel/v1/channel_upgrade.proto, ibc/core/channel/v1/genesis.proto, ibc/core/channel/v1/query.proto, ibc/core/channel/v1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -27,7 +28,7 @@ class State(betterproto.Enum): """ State defines if a channel is in one of the following states: CLOSED, INIT, - TRYOPEN, OPEN or UNINITIALIZED. + TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. """ STATE_UNINITIALIZED_UNSPECIFIED = 0 @@ -53,6 +54,15 @@ class State(betterproto.Enum): packets. """ + STATE_FLUSHING = 5 + """ + A channel has just accepted the upgrade handshake attempt and is flushing + in-flight packets. + """ + + STATE_FLUSHCOMPLETE = 6 + """A channel has just completed flushing any in-flight packets.""" + class Order(betterproto.Enum): """Order defines if a channel is ORDERED or UNORDERED""" @@ -76,18 +86,21 @@ class ResponseResultType(betterproto.Enum): message """ - RESPONSE_RESULT_UNSPECIFIED = 0 + RESPONSE_RESULT_TYPE_UNSPECIFIED = 0 """Default zero value enumeration""" - RESPONSE_RESULT_NOOP = 1 + RESPONSE_RESULT_TYPE_NOOP = 1 """ The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) """ - RESPONSE_RESULT_SUCCESS = 2 + RESPONSE_RESULT_TYPE_SUCCESS = 2 """The message was executed successfully""" + RESPONSE_RESULT_TYPE_FAILURE = 3 + """The message was executed unsuccessfully""" + @dataclass(eq=False, repr=False) class Channel(betterproto.Message): @@ -115,6 +128,12 @@ class Channel(betterproto.Message): version: str = betterproto.string_field(5) """opaque channel version, which is agreed upon during the handshake""" + upgrade_sequence: int = betterproto.uint64_field(6) + """ + upgrade sequence indicates the latest upgrade attempt performed by this + channel the value of 0 indicates the channel has never been upgraded + """ + @dataclass(eq=False, repr=False) class IdentifiedChannel(betterproto.Message): @@ -147,6 +166,12 @@ class IdentifiedChannel(betterproto.Message): channel_id: str = betterproto.string_field(7) """channel identifier""" + upgrade_sequence: int = betterproto.uint64_field(8) + """ + upgrade sequence indicates the latest upgrade attempt performed by this + channel the value of 0 indicates the channel has never been upgraded + """ + @dataclass(eq=False, repr=False) class Counterparty(betterproto.Message): @@ -218,6 +243,24 @@ class PacketState(betterproto.Message): """embedded data that represents packet state.""" +@dataclass(eq=False, repr=False) +class PacketId(betterproto.Message): + """ + PacketId is an identifer for a unique Packet Source chains refer to packets + by source port/channel Destination chains refer to packets by destination + port/channel + """ + + port_id: str = betterproto.string_field(1) + """channel port identifier""" + + channel_id: str = betterproto.string_field(2) + """channel unique identifier""" + + sequence: int = betterproto.uint64_field(3) + """packet sequence""" + + @dataclass(eq=False, repr=False) class Acknowledgement(betterproto.Message): """ @@ -235,6 +278,33 @@ class Acknowledgement(betterproto.Message): error: str = betterproto.string_field(22, group="response") +@dataclass(eq=False, repr=False) +class Timeout(betterproto.Message): + """ + Timeout defines an execution deadline structure for 04-channel handlers. + This includes packet lifecycle handlers as well as the upgrade handshake + handlers. A valid Timeout contains either one or both of a timestamp and + block height (sequence). + """ + + height: "__client_v1__.Height" = betterproto.message_field(1) + """block height after which the packet or upgrade times out""" + + timestamp: int = betterproto.uint64_field(2) + """ + block timestamp (in nanoseconds) after which the packet or upgrade times + out + """ + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the set of IBC channel parameters.""" + + upgrade_timeout: "Timeout" = betterproto.message_field(1) + """the relative timeout after which channel upgrades will time out.""" + + @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState defines the ibc channel submodule's genesis state.""" @@ -249,6 +319,8 @@ class GenesisState(betterproto.Message): next_channel_sequence: int = betterproto.uint64_field(8) """the sequence for the next generated channel identifier""" + params: "Params" = betterproto.message_field(9) + @dataclass(eq=False, repr=False) class PacketSequence(betterproto.Message): @@ -262,6 +334,50 @@ class PacketSequence(betterproto.Message): sequence: int = betterproto.uint64_field(3) +@dataclass(eq=False, repr=False) +class Upgrade(betterproto.Message): + """ + Upgrade is a verifiable type which contains the relevant information for an + attempted upgrade. It provides the proposed changes to the channel end, the + timeout for this upgrade attempt and the next packet sequence which allows + the counterparty to efficiently know the highest sequence it has received. + The next sequence send is used for pruning and upgrading from unordered to + ordered channels. + """ + + fields: "UpgradeFields" = betterproto.message_field(1) + timeout: "Timeout" = betterproto.message_field(2) + next_sequence_send: int = betterproto.uint64_field(3) + + +@dataclass(eq=False, repr=False) +class UpgradeFields(betterproto.Message): + """ + UpgradeFields are the fields in a channel end which may be changed during a + channel upgrade. + """ + + ordering: "Order" = betterproto.enum_field(1) + connection_hops: List[str] = betterproto.string_field(2) + version: str = betterproto.string_field(3) + + +@dataclass(eq=False, repr=False) +class ErrorReceipt(betterproto.Message): + """ + ErrorReceipt defines a type which encapsulates the upgrade sequence and + error associated with the upgrade handshake failure. When a channel upgrade + handshake is aborted both chains are expected to increment to the next + sequence. + """ + + sequence: int = betterproto.uint64_field(1) + """the channel upgrade sequence""" + + message: str = betterproto.string_field(2) + """the error message detailing the cause of failure""" + + @dataclass(eq=False, repr=False) class MsgChannelOpenInit(betterproto.Message): """ @@ -281,6 +397,7 @@ class MsgChannelOpenInitResponse(betterproto.Message): """ channel_id: str = betterproto.string_field(1) + version: str = betterproto.string_field(2) @dataclass(eq=False, repr=False) @@ -294,8 +411,8 @@ class MsgChannelOpenTry(betterproto.Message): port_id: str = betterproto.string_field(1) previous_channel_id: str = betterproto.string_field(2) """ - in the case of crossing hello's, when both chains call OpenInit, we need - the channel identifier of the previous channel in state INIT + Deprecated: this field is unused. Crossing hello's are no longer supported + in core IBC. """ channel: "Channel" = betterproto.message_field(3) @@ -309,6 +426,14 @@ class MsgChannelOpenTry(betterproto.Message): proof_height: "__client_v1__.Height" = betterproto.message_field(6) signer: str = betterproto.string_field(7) + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("previous_channel_id"): + warnings.warn( + "MsgChannelOpenTry.previous_channel_id is deprecated", + DeprecationWarning, + ) + @dataclass(eq=False, repr=False) class MsgChannelOpenTryResponse(betterproto.Message): @@ -316,14 +441,18 @@ class MsgChannelOpenTryResponse(betterproto.Message): MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. """ - pass + version: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) @dataclass(eq=False, repr=False) class MsgChannelOpenAck(betterproto.Message): """ MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge - the change of channel state to TRYOPEN on Chain B. + the change of channel state to TRYOPEN on Chain B. WARNING: a channel + upgrade MUST NOT initialize an upgrade for this channel in the same block + as executing this message otherwise the counterparty will be incapable of + opening. """ port_id: str = betterproto.string_field(1) @@ -401,6 +530,7 @@ class MsgChannelCloseConfirm(betterproto.Message): proof_init: bytes = betterproto.bytes_field(3) proof_height: "__client_v1__.Height" = betterproto.message_field(4) signer: str = betterproto.string_field(5) + counterparty_upgrade_sequence: int = betterproto.uint64_field(6) @dataclass(eq=False, repr=False) @@ -460,6 +590,7 @@ class MsgTimeoutOnClose(betterproto.Message): proof_height: "__client_v1__.Height" = betterproto.message_field(4) next_sequence_recv: int = betterproto.uint64_field(5) signer: str = betterproto.string_field(6) + counterparty_upgrade_sequence: int = betterproto.uint64_field(7) @dataclass(eq=False, repr=False) @@ -491,6 +622,240 @@ class MsgAcknowledgementResponse(betterproto.Message): result: "ResponseResultType" = betterproto.enum_field(1) +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeInit(betterproto.Message): + """ + MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit + rpc WARNING: Initializing a channel upgrade in the same block as opening + the channel may result in the counterparty being incapable of opening. + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + fields: "UpgradeFields" = betterproto.message_field(3) + signer: str = betterproto.string_field(4) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeInitResponse(betterproto.Message): + """ + MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response + type + """ + + upgrade: "Upgrade" = betterproto.message_field(1) + upgrade_sequence: int = betterproto.uint64_field(2) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeTry(betterproto.Message): + """ + MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + proposed_upgrade_connection_hops: List[str] = betterproto.string_field(3) + counterparty_upgrade_fields: "UpgradeFields" = betterproto.message_field(4) + counterparty_upgrade_sequence: int = betterproto.uint64_field(5) + proof_channel: bytes = betterproto.bytes_field(6) + proof_upgrade: bytes = betterproto.bytes_field(7) + proof_height: "__client_v1__.Height" = betterproto.message_field(8) + signer: str = betterproto.string_field(9) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeTryResponse(betterproto.Message): + """ + MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type + """ + + upgrade: "Upgrade" = betterproto.message_field(1) + upgrade_sequence: int = betterproto.uint64_field(2) + result: "ResponseResultType" = betterproto.enum_field(3) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeAck(betterproto.Message): + """ + MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + counterparty_upgrade: "Upgrade" = betterproto.message_field(3) + proof_channel: bytes = betterproto.bytes_field(4) + proof_upgrade: bytes = betterproto.bytes_field(5) + proof_height: "__client_v1__.Height" = betterproto.message_field(6) + signer: str = betterproto.string_field(7) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeAckResponse(betterproto.Message): + """ + MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type + """ + + result: "ResponseResultType" = betterproto.enum_field(1) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeConfirm(betterproto.Message): + """ + MsgChannelUpgradeConfirm defines the request type for the + ChannelUpgradeConfirm rpc + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + counterparty_channel_state: "State" = betterproto.enum_field(3) + counterparty_upgrade: "Upgrade" = betterproto.message_field(4) + proof_channel: bytes = betterproto.bytes_field(5) + proof_upgrade: bytes = betterproto.bytes_field(6) + proof_height: "__client_v1__.Height" = betterproto.message_field(7) + signer: str = betterproto.string_field(8) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeConfirmResponse(betterproto.Message): + """ + MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response + type + """ + + result: "ResponseResultType" = betterproto.enum_field(1) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeOpen(betterproto.Message): + """ + MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen + rpc + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + counterparty_channel_state: "State" = betterproto.enum_field(3) + counterparty_upgrade_sequence: int = betterproto.uint64_field(4) + proof_channel: bytes = betterproto.bytes_field(5) + proof_height: "__client_v1__.Height" = betterproto.message_field(6) + signer: str = betterproto.string_field(7) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeOpenResponse(betterproto.Message): + """ + MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response + type + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeTimeout(betterproto.Message): + """ + MsgChannelUpgradeTimeout defines the request type for the + ChannelUpgradeTimeout rpc + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + counterparty_channel: "Channel" = betterproto.message_field(3) + proof_channel: bytes = betterproto.bytes_field(4) + proof_height: "__client_v1__.Height" = betterproto.message_field(5) + signer: str = betterproto.string_field(6) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeTimeoutResponse(betterproto.Message): + """ + MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout + response type + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeCancel(betterproto.Message): + """ + MsgChannelUpgradeCancel defines the request type for the + ChannelUpgradeCancel rpc + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + error_receipt: "ErrorReceipt" = betterproto.message_field(3) + proof_error_receipt: bytes = betterproto.bytes_field(4) + proof_height: "__client_v1__.Height" = betterproto.message_field(5) + signer: str = betterproto.string_field(6) + + +@dataclass(eq=False, repr=False) +class MsgChannelUpgradeCancelResponse(betterproto.Message): + """ + MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel + response type + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the MsgUpdateParams request type.""" + + authority: str = betterproto.string_field(1) + """ + authority is the address that controls the module (defaults to x/gov unless + overwritten). + """ + + params: "Params" = betterproto.message_field(2) + """ + params defines the channel parameters to update. NOTE: All parameters must + be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """MsgUpdateParamsResponse defines the MsgUpdateParams response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgPruneAcknowledgements(betterproto.Message): + """ + MsgPruneAcknowledgements defines the request type for the + PruneAcknowledgements rpc. + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + limit: int = betterproto.uint64_field(3) + signer: str = betterproto.string_field(4) + + +@dataclass(eq=False, repr=False) +class MsgPruneAcknowledgementsResponse(betterproto.Message): + """ + MsgPruneAcknowledgementsResponse defines the response type for the + PruneAcknowledgements rpc. + """ + + total_pruned_sequences: int = betterproto.uint64_field(1) + """ + Number of sequences pruned (includes both packet acknowledgements and + packet receipts where appropriate). + """ + + total_remaining_sequences: int = betterproto.uint64_field(2) + """Number of sequences left after pruning.""" + + @dataclass(eq=False, repr=False) class QueryChannelRequest(betterproto.Message): """ @@ -922,7 +1287,7 @@ class QueryNextSequenceReceiveRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryNextSequenceReceiveResponse(betterproto.Message): """ - QuerySequenceResponse is the request type for the + QuerySequenceResponse is the response type for the Query/QueryNextSequenceReceiveResponse RPC method """ @@ -936,56 +1301,160 @@ class QueryNextSequenceReceiveResponse(betterproto.Message): """height at which the proof was retrieved""" -class MsgStub(betterproto.ServiceStub): - async def channel_open_init( - self, - msg_channel_open_init: "MsgChannelOpenInit", - *, - timeout: Optional[float] = None, - deadline: Optional["Deadline"] = None, - metadata: Optional["MetadataLike"] = None - ) -> "MsgChannelOpenInitResponse": - return await self._unary_unary( - "/ibc.core.channel.v1.Msg/ChannelOpenInit", - msg_channel_open_init, - MsgChannelOpenInitResponse, - timeout=timeout, - deadline=deadline, - metadata=metadata, - ) +@dataclass(eq=False, repr=False) +class QueryNextSequenceSendRequest(betterproto.Message): + """ + QueryNextSequenceSendRequest is the request type for the + Query/QueryNextSequenceSend RPC method + """ - async def channel_open_try( - self, - msg_channel_open_try: "MsgChannelOpenTry", - *, - timeout: Optional[float] = None, - deadline: Optional["Deadline"] = None, - metadata: Optional["MetadataLike"] = None - ) -> "MsgChannelOpenTryResponse": - return await self._unary_unary( - "/ibc.core.channel.v1.Msg/ChannelOpenTry", - msg_channel_open_try, - MsgChannelOpenTryResponse, - timeout=timeout, - deadline=deadline, - metadata=metadata, - ) + port_id: str = betterproto.string_field(1) + """port unique identifier""" - async def channel_open_ack( - self, - msg_channel_open_ack: "MsgChannelOpenAck", - *, - timeout: Optional[float] = None, - deadline: Optional["Deadline"] = None, - metadata: Optional["MetadataLike"] = None - ) -> "MsgChannelOpenAckResponse": - return await self._unary_unary( - "/ibc.core.channel.v1.Msg/ChannelOpenAck", - msg_channel_open_ack, - MsgChannelOpenAckResponse, - timeout=timeout, - deadline=deadline, - metadata=metadata, + channel_id: str = betterproto.string_field(2) + """channel unique identifier""" + + +@dataclass(eq=False, repr=False) +class QueryNextSequenceSendResponse(betterproto.Message): + """ + QueryNextSequenceSendResponse is the request type for the + Query/QueryNextSequenceSend RPC method + """ + + next_sequence_send: int = betterproto.uint64_field(1) + """next sequence send number""" + + proof: bytes = betterproto.bytes_field(2) + """merkle proof of existence""" + + proof_height: "__client_v1__.Height" = betterproto.message_field(3) + """height at which the proof was retrieved""" + + +@dataclass(eq=False, repr=False) +class QueryUpgradeErrorRequest(betterproto.Message): + """ + QueryUpgradeErrorRequest is the request type for the + Query/QueryUpgradeError RPC method + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class QueryUpgradeErrorResponse(betterproto.Message): + """ + QueryUpgradeErrorResponse is the response type for the + Query/QueryUpgradeError RPC method + """ + + error_receipt: "ErrorReceipt" = betterproto.message_field(1) + proof: bytes = betterproto.bytes_field(2) + """merkle proof of existence""" + + proof_height: "__client_v1__.Height" = betterproto.message_field(3) + """height at which the proof was retrieved""" + + +@dataclass(eq=False, repr=False) +class QueryUpgradeRequest(betterproto.Message): + """ + QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC + method + """ + + port_id: str = betterproto.string_field(1) + channel_id: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class QueryUpgradeResponse(betterproto.Message): + """ + QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC + method + """ + + upgrade: "Upgrade" = betterproto.message_field(1) + proof: bytes = betterproto.bytes_field(2) + """merkle proof of existence""" + + proof_height: "__client_v1__.Height" = betterproto.message_field(3) + """height at which the proof was retrieved""" + + +@dataclass(eq=False, repr=False) +class QueryChannelParamsRequest(betterproto.Message): + """ + QueryChannelParamsRequest is the request type for the Query/ChannelParams + RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryChannelParamsResponse(betterproto.Message): + """ + QueryChannelParamsResponse is the response type for the Query/ChannelParams + RPC method. + """ + + params: "Params" = betterproto.message_field(1) + """params defines the parameters of the module.""" + + +class MsgStub(betterproto.ServiceStub): + async def channel_open_init( + self, + msg_channel_open_init: "MsgChannelOpenInit", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelOpenInitResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelOpenInit", + msg_channel_open_init, + MsgChannelOpenInitResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_open_try( + self, + msg_channel_open_try: "MsgChannelOpenTry", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelOpenTryResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelOpenTry", + msg_channel_open_try, + MsgChannelOpenTryResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_open_ack( + self, + msg_channel_open_ack: "MsgChannelOpenAck", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelOpenAckResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelOpenAck", + msg_channel_open_ack, + MsgChannelOpenAckResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, ) async def channel_open_confirm( @@ -1107,6 +1576,159 @@ async def acknowledgement( metadata=metadata, ) + async def channel_upgrade_init( + self, + msg_channel_upgrade_init: "MsgChannelUpgradeInit", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeInitResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeInit", + msg_channel_upgrade_init, + MsgChannelUpgradeInitResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_upgrade_try( + self, + msg_channel_upgrade_try: "MsgChannelUpgradeTry", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeTryResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeTry", + msg_channel_upgrade_try, + MsgChannelUpgradeTryResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_upgrade_ack( + self, + msg_channel_upgrade_ack: "MsgChannelUpgradeAck", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeAckResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeAck", + msg_channel_upgrade_ack, + MsgChannelUpgradeAckResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_upgrade_confirm( + self, + msg_channel_upgrade_confirm: "MsgChannelUpgradeConfirm", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeConfirmResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm", + msg_channel_upgrade_confirm, + MsgChannelUpgradeConfirmResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_upgrade_open( + self, + msg_channel_upgrade_open: "MsgChannelUpgradeOpen", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeOpenResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeOpen", + msg_channel_upgrade_open, + MsgChannelUpgradeOpenResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_upgrade_timeout( + self, + msg_channel_upgrade_timeout: "MsgChannelUpgradeTimeout", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeTimeoutResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout", + msg_channel_upgrade_timeout, + MsgChannelUpgradeTimeoutResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_upgrade_cancel( + self, + msg_channel_upgrade_cancel: "MsgChannelUpgradeCancel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgChannelUpgradeCancelResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel", + msg_channel_upgrade_cancel, + MsgChannelUpgradeCancelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_channel_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/UpdateChannelParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def prune_acknowledgements( + self, + msg_prune_acknowledgements: "MsgPruneAcknowledgements", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgPruneAcknowledgementsResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Msg/PruneAcknowledgements", + msg_prune_acknowledgements, + MsgPruneAcknowledgementsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def channel( @@ -1330,8 +1952,77 @@ async def next_sequence_receive( metadata=metadata, ) + async def next_sequence_send( + self, + query_next_sequence_send_request: "QueryNextSequenceSendRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryNextSequenceSendResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Query/NextSequenceSend", + query_next_sequence_send_request, + QueryNextSequenceSendResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def upgrade_error( + self, + query_upgrade_error_request: "QueryUpgradeErrorRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryUpgradeErrorResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Query/UpgradeError", + query_upgrade_error_request, + QueryUpgradeErrorResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def upgrade( + self, + query_upgrade_request: "QueryUpgradeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryUpgradeResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Query/Upgrade", + query_upgrade_request, + QueryUpgradeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def channel_params( + self, + query_channel_params_request: "QueryChannelParamsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryChannelParamsResponse": + return await self._unary_unary( + "/ibc.core.channel.v1.Query/ChannelParams", + query_channel_params_request, + QueryChannelParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def channel_open_init( self, msg_channel_open_init: "MsgChannelOpenInit" ) -> "MsgChannelOpenInitResponse": @@ -1380,6 +2071,51 @@ async def acknowledgement( ) -> "MsgAcknowledgementResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def channel_upgrade_init( + self, msg_channel_upgrade_init: "MsgChannelUpgradeInit" + ) -> "MsgChannelUpgradeInitResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_upgrade_try( + self, msg_channel_upgrade_try: "MsgChannelUpgradeTry" + ) -> "MsgChannelUpgradeTryResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_upgrade_ack( + self, msg_channel_upgrade_ack: "MsgChannelUpgradeAck" + ) -> "MsgChannelUpgradeAckResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_upgrade_confirm( + self, msg_channel_upgrade_confirm: "MsgChannelUpgradeConfirm" + ) -> "MsgChannelUpgradeConfirmResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_upgrade_open( + self, msg_channel_upgrade_open: "MsgChannelUpgradeOpen" + ) -> "MsgChannelUpgradeOpenResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_upgrade_timeout( + self, msg_channel_upgrade_timeout: "MsgChannelUpgradeTimeout" + ) -> "MsgChannelUpgradeTimeoutResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_upgrade_cancel( + self, msg_channel_upgrade_cancel: "MsgChannelUpgradeCancel" + ) -> "MsgChannelUpgradeCancelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_channel_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def prune_acknowledgements( + self, msg_prune_acknowledgements: "MsgPruneAcknowledgements" + ) -> "MsgPruneAcknowledgementsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_channel_open_init( self, stream: "grpclib.server.Stream[MsgChannelOpenInit, MsgChannelOpenInitResponse]", @@ -1458,6 +2194,77 @@ async def __rpc_acknowledgement( response = await self.acknowledgement(request) await stream.send_message(response) + async def __rpc_channel_upgrade_init( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeInit, MsgChannelUpgradeInitResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_init(request) + await stream.send_message(response) + + async def __rpc_channel_upgrade_try( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeTry, MsgChannelUpgradeTryResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_try(request) + await stream.send_message(response) + + async def __rpc_channel_upgrade_ack( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeAck, MsgChannelUpgradeAckResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_ack(request) + await stream.send_message(response) + + async def __rpc_channel_upgrade_confirm( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeConfirm, MsgChannelUpgradeConfirmResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_confirm(request) + await stream.send_message(response) + + async def __rpc_channel_upgrade_open( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeOpen, MsgChannelUpgradeOpenResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_open(request) + await stream.send_message(response) + + async def __rpc_channel_upgrade_timeout( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeTimeout, MsgChannelUpgradeTimeoutResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_timeout(request) + await stream.send_message(response) + + async def __rpc_channel_upgrade_cancel( + self, + stream: "grpclib.server.Stream[MsgChannelUpgradeCancel, MsgChannelUpgradeCancelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_upgrade_cancel(request) + await stream.send_message(response) + + async def __rpc_update_channel_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_channel_params(request) + await stream.send_message(response) + + async def __rpc_prune_acknowledgements( + self, + stream: "grpclib.server.Stream[MsgPruneAcknowledgements, MsgPruneAcknowledgementsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.prune_acknowledgements(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/ibc.core.channel.v1.Msg/ChannelOpenInit": grpclib.const.Handler( @@ -1520,10 +2327,65 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgAcknowledgement, MsgAcknowledgementResponse, ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeInit": grpclib.const.Handler( + self.__rpc_channel_upgrade_init, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeInit, + MsgChannelUpgradeInitResponse, + ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeTry": grpclib.const.Handler( + self.__rpc_channel_upgrade_try, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeTry, + MsgChannelUpgradeTryResponse, + ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeAck": grpclib.const.Handler( + self.__rpc_channel_upgrade_ack, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeAck, + MsgChannelUpgradeAckResponse, + ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm": grpclib.const.Handler( + self.__rpc_channel_upgrade_confirm, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeConfirm, + MsgChannelUpgradeConfirmResponse, + ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeOpen": grpclib.const.Handler( + self.__rpc_channel_upgrade_open, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeOpen, + MsgChannelUpgradeOpenResponse, + ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout": grpclib.const.Handler( + self.__rpc_channel_upgrade_timeout, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeTimeout, + MsgChannelUpgradeTimeoutResponse, + ), + "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel": grpclib.const.Handler( + self.__rpc_channel_upgrade_cancel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgChannelUpgradeCancel, + MsgChannelUpgradeCancelResponse, + ), + "/ibc.core.channel.v1.Msg/UpdateChannelParams": grpclib.const.Handler( + self.__rpc_update_channel_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + "/ibc.core.channel.v1.Msg/PruneAcknowledgements": grpclib.const.Handler( + self.__rpc_prune_acknowledgements, + grpclib.const.Cardinality.UNARY_UNARY, + MsgPruneAcknowledgements, + MsgPruneAcknowledgementsResponse, + ), } class QueryBase(ServiceBase): + async def channel( self, query_channel_request: "QueryChannelRequest" ) -> "QueryChannelResponse": @@ -1590,6 +2452,26 @@ async def next_sequence_receive( ) -> "QueryNextSequenceReceiveResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def next_sequence_send( + self, query_next_sequence_send_request: "QueryNextSequenceSendRequest" + ) -> "QueryNextSequenceSendResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def upgrade_error( + self, query_upgrade_error_request: "QueryUpgradeErrorRequest" + ) -> "QueryUpgradeErrorResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def upgrade( + self, query_upgrade_request: "QueryUpgradeRequest" + ) -> "QueryUpgradeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def channel_params( + self, query_channel_params_request: "QueryChannelParamsRequest" + ) -> "QueryChannelParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_channel( self, stream: "grpclib.server.Stream[QueryChannelRequest, QueryChannelResponse]" ) -> None: @@ -1693,6 +2575,37 @@ async def __rpc_next_sequence_receive( response = await self.next_sequence_receive(request) await stream.send_message(response) + async def __rpc_next_sequence_send( + self, + stream: "grpclib.server.Stream[QueryNextSequenceSendRequest, QueryNextSequenceSendResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.next_sequence_send(request) + await stream.send_message(response) + + async def __rpc_upgrade_error( + self, + stream: "grpclib.server.Stream[QueryUpgradeErrorRequest, QueryUpgradeErrorResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.upgrade_error(request) + await stream.send_message(response) + + async def __rpc_upgrade( + self, stream: "grpclib.server.Stream[QueryUpgradeRequest, QueryUpgradeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.upgrade(request) + await stream.send_message(response) + + async def __rpc_channel_params( + self, + stream: "grpclib.server.Stream[QueryChannelParamsRequest, QueryChannelParamsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.channel_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/ibc.core.channel.v1.Query/Channel": grpclib.const.Handler( @@ -1773,4 +2686,28 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse, ), + "/ibc.core.channel.v1.Query/NextSequenceSend": grpclib.const.Handler( + self.__rpc_next_sequence_send, + grpclib.const.Cardinality.UNARY_UNARY, + QueryNextSequenceSendRequest, + QueryNextSequenceSendResponse, + ), + "/ibc.core.channel.v1.Query/UpgradeError": grpclib.const.Handler( + self.__rpc_upgrade_error, + grpclib.const.Cardinality.UNARY_UNARY, + QueryUpgradeErrorRequest, + QueryUpgradeErrorResponse, + ), + "/ibc.core.channel.v1.Query/Upgrade": grpclib.const.Handler( + self.__rpc_upgrade, + grpclib.const.Cardinality.UNARY_UNARY, + QueryUpgradeRequest, + QueryUpgradeResponse, + ), + "/ibc.core.channel.v1.Query/ChannelParams": grpclib.const.Handler( + self.__rpc_channel_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryChannelParamsRequest, + QueryChannelParamsResponse, + ), } diff --git a/secret_sdk/protobuf/ibc/core/client/v1/__init__.py b/secret_sdk/protobuf/ibc/core/client/v1/__init__.py index 585f13c..5113d84 100644 --- a/secret_sdk/protobuf/ibc/core/client/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/core/client/v1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: ibc/core/client/v1/client.proto, ibc/core/client/v1/genesis.proto, ibc/core/client/v1/query.proto, ibc/core/client/v1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -68,14 +69,48 @@ class ClientConsensusStates(betterproto.Message): """consensus states and their heights associated with the client""" +@dataclass(eq=False, repr=False) +class Height(betterproto.Message): + """ + Height is a monotonically increasing data type that can be compared against + another Height for the purposes of updating and freezing clients Normally + the RevisionHeight is incremented at each height while keeping + RevisionNumber the same. However some consensus algorithms may choose to + reset the height in certain conditions e.g. hard forks, state-machine + breaking changes In these cases, the RevisionNumber is incremented so that + height continues to be monitonically increasing even as the RevisionHeight + gets reset + """ + + revision_number: int = betterproto.uint64_field(1) + """the revision that the client is currently on""" + + revision_height: int = betterproto.uint64_field(2) + """the height within the given revision""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the set of IBC light client parameters.""" + + allowed_clients: List[str] = betterproto.string_field(1) + """ + allowed_clients defines the list of allowed client state types which can be + created and interacted with. If a client type is removed from the allowed + clients list, usage of this client will be disabled until it is added again + to the list. + """ + + @dataclass(eq=False, repr=False) class ClientUpdateProposal(betterproto.Message): """ - ClientUpdateProposal is a governance proposal. If it passes, the substitute - client's latest consensus state is copied over to the subject client. The - proposal handler may fail if the subject and the substitute do not match in - client and chain parameters (with exception to latest height, frozen - height, and chain-id). + ClientUpdateProposal is a legacy governance proposal. If it passes, the + substitute client's latest consensus state is copied over to the subject + client. The proposal handler may fail if the subject and the substitute do + not match in client and chain parameters (with exception to latest height, + frozen height, and chain-id). Deprecated: Please use MsgRecoverClient in + favour of this message type. """ title: str = betterproto.string_field(1) @@ -95,12 +130,17 @@ class ClientUpdateProposal(betterproto.Message): client """ + def __post_init__(self) -> None: + warnings.warn("ClientUpdateProposal is deprecated", DeprecationWarning) + super().__post_init__() + @dataclass(eq=False, repr=False) class UpgradeProposal(betterproto.Message): """ UpgradeProposal is a gov Content type for initiating an IBC breaking - upgrade. + upgrade. Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this + message type. """ title: str = betterproto.string_field(1) @@ -118,33 +158,9 @@ class UpgradeProposal(betterproto.Message): planned chain upgrades """ - -@dataclass(eq=False, repr=False) -class Height(betterproto.Message): - """ - Height is a monotonically increasing data type that can be compared against - another Height for the purposes of updating and freezing clients Normally - the RevisionHeight is incremented at each height while keeping - RevisionNumber the same. However some consensus algorithms may choose to - reset the height in certain conditions e.g. hard forks, state-machine - breaking changes In these cases, the RevisionNumber is incremented so that - height continues to be monitonically increasing even as the RevisionHeight - gets reset - """ - - revision_number: int = betterproto.uint64_field(1) - """the revision that the client is currently on""" - - revision_height: int = betterproto.uint64_field(2) - """the height within the given revision""" - - -@dataclass(eq=False, repr=False) -class Params(betterproto.Message): - """Params defines the set of IBC light client parameters.""" - - allowed_clients: List[str] = betterproto.string_field(1) - """allowed_clients defines the list of allowed client state types.""" + def __post_init__(self) -> None: + warnings.warn("UpgradeProposal is deprecated", DeprecationWarning) + super().__post_init__() @dataclass(eq=False, repr=False) @@ -162,11 +178,21 @@ class GenesisState(betterproto.Message): params: "Params" = betterproto.message_field(4) create_localhost: bool = betterproto.bool_field(5) - """create localhost on initialization""" + """ + Deprecated: create_localhost has been deprecated. The localhost client is + automatically created at genesis. + """ next_client_sequence: int = betterproto.uint64_field(6) """the sequence for the next generated client identifier""" + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("create_localhost"): + warnings.warn( + "GenesisState.create_localhost is deprecated", DeprecationWarning + ) + @dataclass(eq=False, repr=False) class GenesisMetadata(betterproto.Message): @@ -223,14 +249,14 @@ class MsgCreateClientResponse(betterproto.Message): class MsgUpdateClient(betterproto.Message): """ MsgUpdateClient defines an sdk.Msg to update a IBC client state using the - given header. + given client message. """ client_id: str = betterproto.string_field(1) """client unique identifier""" - header: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) - """header to update the light client""" + client_message: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """client message to update the light client""" signer: str = betterproto.string_field(3) """signer address""" @@ -287,7 +313,8 @@ class MsgUpgradeClientResponse(betterproto.Message): class MsgSubmitMisbehaviour(betterproto.Message): """ MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for - light client misbehaviour. + light client misbehaviour. This message has been deprecated. Use + MsgUpdateClient instead. """ client_id: str = betterproto.string_field(1) @@ -299,6 +326,10 @@ class MsgSubmitMisbehaviour(betterproto.Message): signer: str = betterproto.string_field(3) """signer address""" + def __post_init__(self) -> None: + warnings.warn("MsgSubmitMisbehaviour is deprecated", DeprecationWarning) + super().__post_init__() + @dataclass(eq=False, repr=False) class MsgSubmitMisbehaviourResponse(betterproto.Message): @@ -310,6 +341,96 @@ class MsgSubmitMisbehaviourResponse(betterproto.Message): pass +@dataclass(eq=False, repr=False) +class MsgRecoverClient(betterproto.Message): + """ + MsgRecoverClient defines the message used to recover a frozen or expired + client. + """ + + subject_client_id: str = betterproto.string_field(1) + """ + the client identifier for the client to be updated if the proposal passes + """ + + substitute_client_id: str = betterproto.string_field(2) + """ + the substitute client identifier for the client which will replace the + subject client + """ + + signer: str = betterproto.string_field(3) + """signer address""" + + +@dataclass(eq=False, repr=False) +class MsgRecoverClientResponse(betterproto.Message): + """ + MsgRecoverClientResponse defines the Msg/RecoverClient response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgIbcSoftwareUpgrade(betterproto.Message): + """ + MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an + IBC client using a v1 governance proposal + """ + + plan: "____cosmos_upgrade_v1_beta1__.Plan" = betterproto.message_field(1) + upgraded_client_state: "betterproto_lib_google_protobuf.Any" = ( + betterproto.message_field(2) + ) + """ + An UpgradedClientState must be provided to perform an IBC breaking upgrade. + This will make the chain commit to the correct upgraded (self) client state + before the upgrade occurs, so that connecting chains can verify that the + new upgraded client is valid by verifying a proof on the previous version + of the chain. This will allow IBC connections to persist smoothly across + planned chain upgrades. Correspondingly, the UpgradedClientState field has + been deprecated in the Cosmos SDK to allow for this logic to exist solely + in the 02-client module. + """ + + signer: str = betterproto.string_field(3) + """signer address""" + + +@dataclass(eq=False, repr=False) +class MsgIbcSoftwareUpgradeResponse(betterproto.Message): + """ + MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response + type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams defines the sdk.Msg type to update the client parameters. + """ + + signer: str = betterproto.string_field(1) + """signer address""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the client parameters to update. NOTE: All parameters must + be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """MsgUpdateParamsResponse defines the MsgUpdateParams response type.""" + + pass + + @dataclass(eq=False, repr=False) class QueryClientStateRequest(betterproto.Message): """ @@ -445,6 +566,38 @@ class QueryConsensusStatesResponse(betterproto.Message): """pagination response""" +@dataclass(eq=False, repr=False) +class QueryConsensusStateHeightsRequest(betterproto.Message): + """ + QueryConsensusStateHeightsRequest is the request type for + Query/ConsensusStateHeights RPC method. + """ + + client_id: str = betterproto.string_field(1) + """client identifier""" + + pagination: "____cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(2) + ) + """pagination request""" + + +@dataclass(eq=False, repr=False) +class QueryConsensusStateHeightsResponse(betterproto.Message): + """ + QueryConsensusStateHeightsResponse is the response type for the + Query/ConsensusStateHeights RPC method + """ + + consensus_state_heights: List["Height"] = betterproto.message_field(1) + """consensus state heights""" + + pagination: "____cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination response""" + + @dataclass(eq=False, repr=False) class QueryClientStatusRequest(betterproto.Message): """ @@ -602,6 +755,56 @@ async def submit_misbehaviour( metadata=metadata, ) + async def recover_client( + self, + msg_recover_client: "MsgRecoverClient", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgRecoverClientResponse": + return await self._unary_unary( + "/ibc.core.client.v1.Msg/RecoverClient", + msg_recover_client, + MsgRecoverClientResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def ibc_software_upgrade( + self, + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgIbcSoftwareUpgradeResponse": + return await self._unary_unary( + "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade", + msg_ibc_software_upgrade, + MsgIbcSoftwareUpgradeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_client_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/ibc.core.client.v1.Msg/UpdateClientParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def client_state( @@ -672,6 +875,23 @@ async def consensus_states( metadata=metadata, ) + async def consensus_state_heights( + self, + query_consensus_state_heights_request: "QueryConsensusStateHeightsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryConsensusStateHeightsResponse": + return await self._unary_unary( + "/ibc.core.client.v1.Query/ConsensusStateHeights", + query_consensus_state_heights_request, + QueryConsensusStateHeightsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + async def client_status( self, query_client_status_request: "QueryClientStatusRequest", @@ -742,6 +962,7 @@ async def upgraded_consensus_state( class MsgBase(ServiceBase): + async def create_client( self, msg_create_client: "MsgCreateClient" ) -> "MsgCreateClientResponse": @@ -762,6 +983,19 @@ async def submit_misbehaviour( ) -> "MsgSubmitMisbehaviourResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def recover_client( + self, msg_recover_client: "MsgRecoverClient" + ) -> "MsgRecoverClientResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def ibc_software_upgrade(self) -> "MsgIbcSoftwareUpgradeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_client_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_create_client( self, stream: "grpclib.server.Stream[MsgCreateClient, MsgCreateClientResponse]" ) -> None: @@ -792,6 +1026,29 @@ async def __rpc_submit_misbehaviour( response = await self.submit_misbehaviour(request) await stream.send_message(response) + async def __rpc_recover_client( + self, + stream: "grpclib.server.Stream[MsgRecoverClient, MsgRecoverClientResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.recover_client(request) + await stream.send_message(response) + + async def __rpc_ibc_software_upgrade( + self, + stream: "grpclib.server.Stream[MsgIbcSoftwareUpgrade, MsgIbcSoftwareUpgradeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.ibc_software_upgrade(request) + await stream.send_message(response) + + async def __rpc_update_client_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_client_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/ibc.core.client.v1.Msg/CreateClient": grpclib.const.Handler( @@ -818,10 +1075,29 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, ), + "/ibc.core.client.v1.Msg/RecoverClient": grpclib.const.Handler( + self.__rpc_recover_client, + grpclib.const.Cardinality.UNARY_UNARY, + MsgRecoverClient, + MsgRecoverClientResponse, + ), + "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade": grpclib.const.Handler( + self.__rpc_ibc_software_upgrade, + grpclib.const.Cardinality.UNARY_UNARY, + MsgIbcSoftwareUpgrade, + MsgIbcSoftwareUpgradeResponse, + ), + "/ibc.core.client.v1.Msg/UpdateClientParams": grpclib.const.Handler( + self.__rpc_update_client_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } class QueryBase(ServiceBase): + async def client_state( self, query_client_state_request: "QueryClientStateRequest" ) -> "QueryClientStateResponse": @@ -842,6 +1118,11 @@ async def consensus_states( ) -> "QueryConsensusStatesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def consensus_state_heights( + self, query_consensus_state_heights_request: "QueryConsensusStateHeightsRequest" + ) -> "QueryConsensusStateHeightsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def client_status( self, query_client_status_request: "QueryClientStatusRequest" ) -> "QueryClientStatusResponse": @@ -895,6 +1176,14 @@ async def __rpc_consensus_states( response = await self.consensus_states(request) await stream.send_message(response) + async def __rpc_consensus_state_heights( + self, + stream: "grpclib.server.Stream[QueryConsensusStateHeightsRequest, QueryConsensusStateHeightsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.consensus_state_heights(request) + await stream.send_message(response) + async def __rpc_client_status( self, stream: "grpclib.server.Stream[QueryClientStatusRequest, QueryClientStatusResponse]", @@ -953,6 +1242,12 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryConsensusStatesRequest, QueryConsensusStatesResponse, ), + "/ibc.core.client.v1.Query/ConsensusStateHeights": grpclib.const.Handler( + self.__rpc_consensus_state_heights, + grpclib.const.Cardinality.UNARY_UNARY, + QueryConsensusStateHeightsRequest, + QueryConsensusStateHeightsResponse, + ), "/ibc.core.client.v1.Query/ClientStatus": grpclib.const.Handler( self.__rpc_client_status, grpclib.const.Cardinality.UNARY_UNARY, diff --git a/secret_sdk/protobuf/ibc/core/commitment/v1/__init__.py b/secret_sdk/protobuf/ibc/core/commitment/v1/__init__.py index cb4c986..b707785 100644 --- a/secret_sdk/protobuf/ibc/core/commitment/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/core/commitment/v1/__init__.py @@ -6,7 +6,7 @@ import betterproto -from ..... import ics23 as ____ics23__ +from .....cosmos.ics23 import v1 as ____cosmos_ics23_v1__ @dataclass(eq=False, repr=False) @@ -50,4 +50,4 @@ class MerkleProof(betterproto.Message): should be succinct. MerkleProofs are ordered from leaf-to-root """ - proofs: List["____ics23__.CommitmentProof"] = betterproto.message_field(1) + proofs: List["____cosmos_ics23_v1__.CommitmentProof"] = betterproto.message_field(1) diff --git a/secret_sdk/protobuf/ibc/core/connection/v1/__init__.py b/secret_sdk/protobuf/ibc/core/connection/v1/__init__.py index 7845b19..548a110 100644 --- a/secret_sdk/protobuf/ibc/core/connection/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/core/connection/v1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: ibc/core/connection/v1/connection.proto, ibc/core/connection/v1/genesis.proto, ibc/core/connection/v1/query.proto, ibc/core/connection/v1/tx.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -224,8 +225,8 @@ class MsgConnectionOpenTry(betterproto.Message): client_id: str = betterproto.string_field(1) previous_connection_id: str = betterproto.string_field(2) """ - in the case of crossing hello's, when both chains call OpenInit, we need - the connection identifier of the previous connection in state INIT + Deprecated: this field is unused. Crossing hellos are no longer supported + in core IBC. """ client_state: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(3) @@ -247,6 +248,19 @@ class MsgConnectionOpenTry(betterproto.Message): consensus_height: "__client_v1__.Height" = betterproto.message_field(11) signer: str = betterproto.string_field(12) + host_consensus_state_proof: bytes = betterproto.bytes_field(13) + """ + optional proof data for host state machines that are unable to introspect + their own consensus state + """ + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("previous_connection_id"): + warnings.warn( + "MsgConnectionOpenTry.previous_connection_id is deprecated", + DeprecationWarning, + ) @dataclass(eq=False, repr=False) @@ -285,6 +299,11 @@ class MsgConnectionOpenAck(betterproto.Message): consensus_height: "__client_v1__.Height" = betterproto.message_field(9) signer: str = betterproto.string_field(10) + host_consensus_state_proof: bytes = betterproto.bytes_field(11) + """ + optional proof data for host state machines that are unable to introspect + their own consensus state + """ @dataclass(eq=False, repr=False) @@ -324,6 +343,30 @@ class MsgConnectionOpenConfirmResponse(betterproto.Message): pass +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams defines the sdk.Msg type to update the connection + parameters. + """ + + signer: str = betterproto.string_field(1) + """signer address""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the connection parameters to update. NOTE: All parameters + must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """MsgUpdateParamsResponse defines the MsgUpdateParams response type.""" + + pass + + @dataclass(eq=False, repr=False) class QueryConnectionRequest(betterproto.Message): """ @@ -478,6 +521,27 @@ class QueryConnectionConsensusStateResponse(betterproto.Message): """height at which the proof was retrieved""" +@dataclass(eq=False, repr=False) +class QueryConnectionParamsRequest(betterproto.Message): + """ + QueryConnectionParamsRequest is the request type for the + Query/ConnectionParams RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryConnectionParamsResponse(betterproto.Message): + """ + QueryConnectionParamsResponse is the response type for the + Query/ConnectionParams RPC method. + """ + + params: "Params" = betterproto.message_field(1) + """params defines the parameters of the module.""" + + class MsgStub(betterproto.ServiceStub): async def connection_open_init( self, @@ -547,6 +611,23 @@ async def connection_open_confirm( metadata=metadata, ) + async def update_connection_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/ibc.core.connection.v1.Msg/UpdateConnectionParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def connection( @@ -634,8 +715,26 @@ async def connection_consensus_state( metadata=metadata, ) + async def connection_params( + self, + query_connection_params_request: "QueryConnectionParamsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryConnectionParamsResponse": + return await self._unary_unary( + "/ibc.core.connection.v1.Query/ConnectionParams", + query_connection_params_request, + QueryConnectionParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgBase(ServiceBase): + async def connection_open_init( self, msg_connection_open_init: "MsgConnectionOpenInit" ) -> "MsgConnectionOpenInitResponse": @@ -656,6 +755,11 @@ async def connection_open_confirm( ) -> "MsgConnectionOpenConfirmResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def update_connection_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_connection_open_init( self, stream: "grpclib.server.Stream[MsgConnectionOpenInit, MsgConnectionOpenInitResponse]", @@ -688,6 +792,13 @@ async def __rpc_connection_open_confirm( response = await self.connection_open_confirm(request) await stream.send_message(response) + async def __rpc_update_connection_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_connection_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/ibc.core.connection.v1.Msg/ConnectionOpenInit": grpclib.const.Handler( @@ -714,10 +825,17 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, ), + "/ibc.core.connection.v1.Msg/UpdateConnectionParams": grpclib.const.Handler( + self.__rpc_update_connection_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } class QueryBase(ServiceBase): + async def connection( self, query_connection_request: "QueryConnectionRequest" ) -> "QueryConnectionResponse": @@ -744,6 +862,11 @@ async def connection_consensus_state( ) -> "QueryConnectionConsensusStateResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def connection_params( + self, query_connection_params_request: "QueryConnectionParamsRequest" + ) -> "QueryConnectionParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_connection( self, stream: "grpclib.server.Stream[QueryConnectionRequest, QueryConnectionResponse]", @@ -784,6 +907,14 @@ async def __rpc_connection_consensus_state( response = await self.connection_consensus_state(request) await stream.send_message(response) + async def __rpc_connection_params( + self, + stream: "grpclib.server.Stream[QueryConnectionParamsRequest, QueryConnectionParamsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.connection_params(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/ibc.core.connection.v1.Query/Connection": grpclib.const.Handler( @@ -816,4 +947,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponse, ), + "/ibc.core.connection.v1.Query/ConnectionParams": grpclib.const.Handler( + self.__rpc_connection_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryConnectionParamsRequest, + QueryConnectionParamsResponse, + ), } diff --git a/secret_sdk/protobuf/ibc/lightclients/localhost/v2/__init__.py b/secret_sdk/protobuf/ibc/lightclients/localhost/v2/__init__.py new file mode 100644 index 0000000..07953e6 --- /dev/null +++ b/secret_sdk/protobuf/ibc/lightclients/localhost/v2/__init__.py @@ -0,0 +1,16 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: ibc/lightclients/localhost/v2/localhost.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + +from ....core.client import v1 as ___core_client_v1__ + + +@dataclass(eq=False, repr=False) +class ClientState(betterproto.Message): + """ClientState defines the 09-localhost client state""" + + latest_height: "___core_client_v1__.Height" = betterproto.message_field(1) + """the latest block height""" diff --git a/secret_sdk/protobuf/ibc/lightclients/solomachine/v3/__init__.py b/secret_sdk/protobuf/ibc/lightclients/solomachine/v3/__init__.py new file mode 100644 index 0000000..da39fd0 --- /dev/null +++ b/secret_sdk/protobuf/ibc/lightclients/solomachine/v3/__init__.py @@ -0,0 +1,121 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: ibc/lightclients/solomachine/v3/solomachine.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto +import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf + + +@dataclass(eq=False, repr=False) +class ClientState(betterproto.Message): + """ + ClientState defines a solo machine client that tracks the current consensus + state and if the client is frozen. + """ + + sequence: int = betterproto.uint64_field(1) + """latest sequence of the client state""" + + is_frozen: bool = betterproto.bool_field(2) + """frozen sequence of the solo machine""" + + consensus_state: "ConsensusState" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class ConsensusState(betterproto.Message): + """ + ConsensusState defines a solo machine consensus state. The sequence of a + consensus state is contained in the "height" key used in storing the + consensus state. + """ + + public_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + """public key of the solo machine""" + + diversifier: str = betterproto.string_field(2) + """ + diversifier allows the same public key to be re-used across different solo + machine clients (potentially on different chains) without being considered + misbehaviour. + """ + + timestamp: int = betterproto.uint64_field(3) + + +@dataclass(eq=False, repr=False) +class Header(betterproto.Message): + """Header defines a solo machine consensus header""" + + timestamp: int = betterproto.uint64_field(1) + signature: bytes = betterproto.bytes_field(2) + new_public_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(3) + new_diversifier: str = betterproto.string_field(4) + + +@dataclass(eq=False, repr=False) +class Misbehaviour(betterproto.Message): + """ + Misbehaviour defines misbehaviour for a solo machine which consists of a + sequence and two signatures over different messages at that sequence. + """ + + sequence: int = betterproto.uint64_field(1) + signature_one: "SignatureAndData" = betterproto.message_field(2) + signature_two: "SignatureAndData" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class SignatureAndData(betterproto.Message): + """ + SignatureAndData contains a signature and the data signed over to create + that signature. + """ + + signature: bytes = betterproto.bytes_field(1) + path: bytes = betterproto.bytes_field(2) + data: bytes = betterproto.bytes_field(3) + timestamp: int = betterproto.uint64_field(4) + + +@dataclass(eq=False, repr=False) +class TimestampedSignatureData(betterproto.Message): + """ + TimestampedSignatureData contains the signature data and the timestamp of + the signature. + """ + + signature_data: bytes = betterproto.bytes_field(1) + timestamp: int = betterproto.uint64_field(2) + + +@dataclass(eq=False, repr=False) +class SignBytes(betterproto.Message): + """SignBytes defines the signed bytes used for signature verification.""" + + sequence: int = betterproto.uint64_field(1) + """the sequence number""" + + timestamp: int = betterproto.uint64_field(2) + """the proof timestamp""" + + diversifier: str = betterproto.string_field(3) + """the public key diversifier""" + + path: bytes = betterproto.bytes_field(4) + """the standardised path bytes""" + + data: bytes = betterproto.bytes_field(5) + """the marshaled data bytes""" + + +@dataclass(eq=False, repr=False) +class HeaderData(betterproto.Message): + """HeaderData returns the SignBytes data for update verification.""" + + new_pub_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + """header public key""" + + new_diversifier: str = betterproto.string_field(2) + """header diversifier""" diff --git a/secret_sdk/protobuf/ibc/lightclients/tendermint/v1/__init__.py b/secret_sdk/protobuf/ibc/lightclients/tendermint/v1/__init__.py index 1db9878..26c2107 100644 --- a/secret_sdk/protobuf/ibc/lightclients/tendermint/v1/__init__.py +++ b/secret_sdk/protobuf/ibc/lightclients/tendermint/v1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: ibc/lightclients/tendermint/v1/tendermint.proto # plugin: python-betterproto +import warnings from dataclasses import dataclass from datetime import ( datetime, @@ -10,7 +11,7 @@ import betterproto -from ..... import ics23 as ____ics23__ +from .....cosmos.ics23 import v1 as ____cosmos_ics23_v1__ from .....tendermint import types as ____tendermint_types__ from ....core.client import v1 as ___core_client_v1__ from ....core.commitment import v1 as ___core_commitment_v1__ @@ -45,7 +46,7 @@ class ClientState(betterproto.Message): latest_height: "___core_client_v1__.Height" = betterproto.message_field(7) """Latest height the client was updated to""" - proof_specs: List["____ics23__.ProofSpec"] = betterproto.message_field(8) + proof_specs: List["____cosmos_ics23_v1__.ProofSpec"] = betterproto.message_field(8) """Proof specifications used in verifying counterparty state""" upgrade_path: List[str] = betterproto.string_field(9) @@ -60,16 +61,23 @@ class ClientState(betterproto.Message): """ allow_update_after_expiry: bool = betterproto.bool_field(10) - """ - This flag, when set to true, will allow governance to recover a client - which has expired - """ + """allow_update_after_expiry is deprecated""" allow_update_after_misbehaviour: bool = betterproto.bool_field(11) - """ - This flag, when set to true, will allow governance to unfreeze a client - whose chain has experienced a misbehaviour event - """ + """allow_update_after_misbehaviour is deprecated""" + + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("allow_update_after_expiry"): + warnings.warn( + "ClientState.allow_update_after_expiry is deprecated", + DeprecationWarning, + ) + if self.is_set("allow_update_after_misbehaviour"): + warnings.warn( + "ClientState.allow_update_after_misbehaviour is deprecated", + DeprecationWarning, + ) @dataclass(eq=False, repr=False) @@ -96,9 +104,16 @@ class Misbehaviour(betterproto.Message): """ client_id: str = betterproto.string_field(1) + """ClientID is deprecated""" + header_1: "Header" = betterproto.message_field(2) header_2: "Header" = betterproto.message_field(3) + def __post_init__(self) -> None: + super().__post_init__() + if self.is_set("client_id"): + warnings.warn("Misbehaviour.client_id is deprecated", DeprecationWarning) + @dataclass(eq=False, repr=False) class Header(betterproto.Message): diff --git a/secret_sdk/protobuf/packetforward/__init__.py b/secret_sdk/protobuf/packetforward/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/packetforward/v1/__init__.py b/secret_sdk/protobuf/packetforward/v1/__init__.py new file mode 100644 index 0000000..711039a --- /dev/null +++ b/secret_sdk/protobuf/packetforward/v1/__init__.py @@ -0,0 +1,197 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: ibc-apps/packetforward/v1/genesis.proto, ibc-apps/packetforward/v1/query.proto, ibc-apps/packetforward/v1/tx.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the packetforward genesis state""" + + params: "Params" = betterproto.message_field(1) + in_flight_packets: Dict[str, "InFlightPacket"] = betterproto.map_field( + 2, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE + ) + """ + key - information about forwarded packet: src_channel + (parsedReceiver.Channel), src_port (parsedReceiver.Port), sequence value - + information about original packet for refunding if necessary: retries, + srcPacketSender, srcPacket.DestinationChannel, srcPacket.DestinationPort + """ + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the set of packetforward parameters.""" + + fee_percentage: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class InFlightPacket(betterproto.Message): + """ + InFlightPacket contains information about original packet for writing the + acknowledgement and refunding if necessary. + """ + + original_sender_address: str = betterproto.string_field(1) + refund_channel_id: str = betterproto.string_field(2) + refund_port_id: str = betterproto.string_field(3) + packet_src_channel_id: str = betterproto.string_field(4) + packet_src_port_id: str = betterproto.string_field(5) + packet_timeout_timestamp: int = betterproto.uint64_field(6) + packet_timeout_height: str = betterproto.string_field(7) + packet_data: bytes = betterproto.bytes_field(8) + refund_sequence: int = betterproto.uint64_field(9) + retries_remaining: int = betterproto.int32_field(10) + timeout: int = betterproto.uint64_field(11) + nonrefundable: bool = betterproto.bool_field(12) + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """ + MsgUpdateParams is the Msg/UpdateParams request type. Since: cosmos-sdk + 0.47 + """ + + authority: str = betterproto.string_field(1) + """authority is the address of the governance account.""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/packetforward parameters to update. NOTE: All + parameters must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. Since: cosmos-sdk 0.47 + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryParamsRequest(betterproto.Message): + """ + QueryParamsRequest is the request type for the Query/Params RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryParamsResponse(betterproto.Message): + """ + QueryParamsResponse is the response type for the Query/Params RPC method. + """ + + params: "Params" = betterproto.message_field(1) + """params defines the parameters of the module.""" + + +class MsgStub(betterproto.ServiceStub): + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/packetforward.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def params( + self, + query_params_request: "QueryParamsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryParamsResponse": + return await self._unary_unary( + "/packetforward.v1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/packetforward.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def params( + self, query_params_request: "QueryParamsRequest" + ) -> "QueryParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_params( + self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/packetforward.v1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/secret_sdk/protobuf/secret/compute/v1beta1/__init__.py b/secret_sdk/protobuf/secret/compute/v1beta1/__init__.py index a7a83eb..5503f16 100644 --- a/secret_sdk/protobuf/secret/compute/v1beta1/__init__.py +++ b/secret_sdk/protobuf/secret/compute/v1beta1/__init__.py @@ -30,6 +30,24 @@ class AccessType(betterproto.Enum): EVERYBODY = 3 +class ContractCodeHistoryOperationType(betterproto.Enum): + """ContractCodeHistoryOperationType actions that caused a code change""" + + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 + """ + ContractCodeHistoryOperationTypeUnspecified placeholder for empty value + """ + + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 + """ContractCodeHistoryOperationTypeInit on chain contract instantiation""" + + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 + """ContractCodeHistoryOperationTypeMigrate code migration""" + + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 + """ContractCodeHistoryOperationTypeGenesis based on genesis data""" + + @dataclass(eq=False, repr=False) class AccessTypeParam(betterproto.Message): value: "AccessType" = betterproto.enum_field(1) @@ -45,9 +63,16 @@ class CodeInfo(betterproto.Message): builder: str = betterproto.string_field(4) +@dataclass(eq=False, repr=False) +class ContractKey(betterproto.Message): + og_contract_key: bytes = betterproto.bytes_field(1) + current_contract_key: bytes = betterproto.bytes_field(2) + current_contract_key_proof: bytes = betterproto.bytes_field(3) + + @dataclass(eq=False, repr=False) class ContractCustomInfo(betterproto.Message): - enclave_key: bytes = betterproto.bytes_field(1) + enclave_key: "ContractKey" = betterproto.message_field(1) label: str = betterproto.string_field(2) @@ -56,15 +81,23 @@ class ContractInfo(betterproto.Message): """ContractInfo stores a WASM contract instance""" code_id: int = betterproto.uint64_field(1) + """CodeID is the reference to the stored Wasm code""" + creator: bytes = betterproto.bytes_field(2) + """Creator address who initially instantiated the contract""" + label: str = betterproto.string_field(4) + """Label is mandatory metadata to be stored with a contract instance.""" + created: "AbsoluteTxPosition" = betterproto.message_field(5) - """ - never show this in query results, just use for sorting (Note: when using - json tag "-" amino refused to serialize it...) - """ + """Created Tx position when the contract was instantiated.""" ibc_port_id: str = betterproto.string_field(6) + admin: str = betterproto.string_field(7) + """Admin is an optional address that can execute migrations""" + + admin_proof: bytes = betterproto.bytes_field(8) + """Proof that enclave executed the instantiate command""" @dataclass(eq=False, repr=False) @@ -92,6 +125,20 @@ class Model(betterproto.Message): """base64-encode raw value""" +@dataclass(eq=False, repr=False) +class ContractCodeHistoryEntry(betterproto.Message): + """ContractCodeHistoryEntry metadata to a contract.""" + + operation: "ContractCodeHistoryOperationType" = betterproto.enum_field(1) + code_id: int = betterproto.uint64_field(2) + """CodeID is the reference to the stored WASM code""" + + updated: "AbsoluteTxPosition" = betterproto.message_field(3) + """Updated Tx position when the operation was executed.""" + + msg: bytes = betterproto.bytes_field(4) + + @dataclass(eq=False, repr=False) class QuerySecretContractRequest(betterproto.Message): contract_address: str = betterproto.string_field(1) @@ -207,13 +254,34 @@ class DecryptedAnswer(betterproto.Message): @dataclass(eq=False, repr=False) class DecryptedAnswers(betterproto.Message): answers: List["DecryptedAnswer"] = betterproto.message_field(1) - output_logs: List[ - "___cosmos_base_abci_v1_beta1__.StringEvent" - ] = betterproto.message_field(2) + output_logs: List["___cosmos_base_abci_v1_beta1__.StringEvent"] = ( + betterproto.message_field(2) + ) output_error: str = betterproto.string_field(3) plaintext_error: str = betterproto.string_field(4) +@dataclass(eq=False, repr=False) +class QueryContractHistoryRequest(betterproto.Message): + """ + QueryContractHistoryRequest is the request type for the + Query/ContractHistory RPC method + """ + + contract_address: str = betterproto.string_field(1) + """address is the address of the contract to query""" + + +@dataclass(eq=False, repr=False) +class QueryContractHistoryResponse(betterproto.Message): + """ + QueryContractHistoryResponse is the response type for the + Query/ContractHistory RPC method + """ + + entries: List["ContractCodeHistoryEntry"] = betterproto.message_field(1) + + @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): """GenesisState - genesis state of x/wasm""" @@ -290,6 +358,8 @@ class MsgInstantiateContract(betterproto.Message): code_id: int = betterproto.uint64_field(3) label: str = betterproto.string_field(4) init_msg: bytes = betterproto.bytes_field(5) + """init_msg is an encrypted input to pass to the contract on init""" + init_funds: List["___cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(6) callback_sig: bytes = betterproto.bytes_field(7) """ @@ -297,6 +367,9 @@ class MsgInstantiateContract(betterproto.Message): transaction """ + admin: str = betterproto.string_field(8) + """Admin is an optional address that can execute migrations""" + @dataclass(eq=False, repr=False) class MsgInstantiateContractResponse(betterproto.Message): @@ -318,7 +391,14 @@ class MsgExecuteContract(betterproto.Message): """contract is the canonical address of the contract""" msg: bytes = betterproto.bytes_field(3) + """msg is an encrypted input to pass to the contract on execute""" + callback_code_hash: str = betterproto.string_field(4) + """ + used internally for encryption, should always be empty in a signed + transaction + """ + sent_funds: List["___cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(5) callback_sig: bytes = betterproto.bytes_field(6) """ @@ -335,6 +415,99 @@ class MsgExecuteContractResponse(betterproto.Message): """Data contains base64-encoded bytes to returned from the contract""" +@dataclass(eq=False, repr=False) +class MsgMigrateContract(betterproto.Message): + """ + MsgMigrateContract runs a code upgrade/ downgrade for a smart contract + """ + + sender: str = betterproto.string_field(1) + """Sender is the that actor that signed the messages""" + + contract: str = betterproto.string_field(2) + """Contract is the address of the smart contract""" + + code_id: int = betterproto.uint64_field(3) + """CodeID references the new WASM code""" + + msg: bytes = betterproto.bytes_field(4) + """msg is an encrypted input to pass to the contract on migration""" + + callback_sig: bytes = betterproto.bytes_field(7) + """ + used internally for encryption, should always be empty in a signed + transaction + """ + + callback_code_hash: str = betterproto.string_field(8) + """ + used internally for encryption, should always be empty in a signed + transaction + """ + + +@dataclass(eq=False, repr=False) +class MsgMigrateContractResponse(betterproto.Message): + """MsgMigrateContractResponse returns contract migration result data.""" + + data: bytes = betterproto.bytes_field(1) + """ + Data contains same raw bytes returned as data from the wasm contract. (May + be empty) + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateAdmin(betterproto.Message): + """MsgUpdateAdmin sets a new admin for a smart contract""" + + sender: str = betterproto.string_field(1) + """Sender is the that actor that signed the messages""" + + new_admin: str = betterproto.string_field(2) + """NewAdmin address to be set""" + + contract: str = betterproto.string_field(3) + """Contract is the address of the smart contract""" + + callback_sig: bytes = betterproto.bytes_field(7) + """ + used internally for encryption, should always be empty in a signed + transaction + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateAdminResponse(betterproto.Message): + """MsgUpdateAdminResponse returns empty data""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgClearAdmin(betterproto.Message): + """MsgClearAdmin removes any admin stored for a smart contract""" + + sender: str = betterproto.string_field(1) + """Sender is the that actor that signed the messages""" + + contract: str = betterproto.string_field(3) + """Contract is the address of the smart contract""" + + callback_sig: bytes = betterproto.bytes_field(7) + """ + used internally for encryption, should always be empty in a signed + transaction + """ + + +@dataclass(eq=False, repr=False) +class MsgClearAdminResponse(betterproto.Message): + """MsgClearAdminResponse returns empty data""" + + pass + + class QueryStub(betterproto.ServiceStub): async def contract_info( self, @@ -489,6 +662,23 @@ async def address_by_label( metadata=metadata, ) + async def contract_history( + self, + query_contract_history_request: "QueryContractHistoryRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryContractHistoryResponse": + return await self._unary_unary( + "/secret.compute.v1beta1.Query/ContractHistory", + query_contract_history_request, + QueryContractHistoryResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class MsgStub(betterproto.ServiceStub): async def store_code( @@ -542,8 +732,60 @@ async def execute_contract( metadata=metadata, ) + async def migrate_contract( + self, + msg_migrate_contract: "MsgMigrateContract", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgMigrateContractResponse": + return await self._unary_unary( + "/secret.compute.v1beta1.Msg/MigrateContract", + msg_migrate_contract, + MsgMigrateContractResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_admin( + self, + msg_update_admin: "MsgUpdateAdmin", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateAdminResponse": + return await self._unary_unary( + "/secret.compute.v1beta1.Msg/UpdateAdmin", + msg_update_admin, + MsgUpdateAdminResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def clear_admin( + self, + msg_clear_admin: "MsgClearAdmin", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgClearAdminResponse": + return await self._unary_unary( + "/secret.compute.v1beta1.Msg/ClearAdmin", + msg_clear_admin, + MsgClearAdminResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryBase(ServiceBase): + async def contract_info( self, query_by_contract_address_request: "QueryByContractAddressRequest" ) -> "QueryContractInfoResponse": @@ -590,6 +832,11 @@ async def address_by_label( ) -> "QueryContractAddressResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def contract_history( + self, query_contract_history_request: "QueryContractHistoryRequest" + ) -> "QueryContractHistoryResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_contract_info( self, stream: "grpclib.server.Stream[QueryByContractAddressRequest, QueryContractInfoResponse]", @@ -661,6 +908,14 @@ async def __rpc_address_by_label( response = await self.address_by_label(request) await stream.send_message(response) + async def __rpc_contract_history( + self, + stream: "grpclib.server.Stream[QueryContractHistoryRequest, QueryContractHistoryResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.contract_history(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/secret.compute.v1beta1.Query/ContractInfo": grpclib.const.Handler( @@ -717,10 +972,17 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: QueryByLabelRequest, QueryContractAddressResponse, ), + "/secret.compute.v1beta1.Query/ContractHistory": grpclib.const.Handler( + self.__rpc_contract_history, + grpclib.const.Cardinality.UNARY_UNARY, + QueryContractHistoryRequest, + QueryContractHistoryResponse, + ), } class MsgBase(ServiceBase): + async def store_code( self, msg_store_code: "MsgStoreCode" ) -> "MsgStoreCodeResponse": @@ -736,6 +998,21 @@ async def execute_contract( ) -> "MsgExecuteContractResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def migrate_contract( + self, msg_migrate_contract: "MsgMigrateContract" + ) -> "MsgMigrateContractResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_admin( + self, msg_update_admin: "MsgUpdateAdmin" + ) -> "MsgUpdateAdminResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def clear_admin( + self, msg_clear_admin: "MsgClearAdmin" + ) -> "MsgClearAdminResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_store_code( self, stream: "grpclib.server.Stream[MsgStoreCode, MsgStoreCodeResponse]" ) -> None: @@ -759,6 +1036,28 @@ async def __rpc_execute_contract( response = await self.execute_contract(request) await stream.send_message(response) + async def __rpc_migrate_contract( + self, + stream: "grpclib.server.Stream[MsgMigrateContract, MsgMigrateContractResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.migrate_contract(request) + await stream.send_message(response) + + async def __rpc_update_admin( + self, stream: "grpclib.server.Stream[MsgUpdateAdmin, MsgUpdateAdminResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_admin(request) + await stream.send_message(response) + + async def __rpc_clear_admin( + self, stream: "grpclib.server.Stream[MsgClearAdmin, MsgClearAdminResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.clear_admin(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { "/secret.compute.v1beta1.Msg/StoreCode": grpclib.const.Handler( @@ -779,4 +1078,22 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgExecuteContract, MsgExecuteContractResponse, ), + "/secret.compute.v1beta1.Msg/MigrateContract": grpclib.const.Handler( + self.__rpc_migrate_contract, + grpclib.const.Cardinality.UNARY_UNARY, + MsgMigrateContract, + MsgMigrateContractResponse, + ), + "/secret.compute.v1beta1.Msg/UpdateAdmin": grpclib.const.Handler( + self.__rpc_update_admin, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateAdmin, + MsgUpdateAdminResponse, + ), + "/secret.compute.v1beta1.Msg/ClearAdmin": grpclib.const.Handler( + self.__rpc_clear_admin, + grpclib.const.Cardinality.UNARY_UNARY, + MsgClearAdmin, + MsgClearAdminResponse, + ), } diff --git a/secret_sdk/protobuf/secret/emergencybutton/__init__.py b/secret_sdk/protobuf/secret/emergencybutton/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/secret_sdk/protobuf/secret/emergencybutton/v1beta1/__init__.py b/secret_sdk/protobuf/secret/emergencybutton/v1beta1/__init__.py new file mode 100644 index 0000000..c9adec5 --- /dev/null +++ b/secret_sdk/protobuf/secret/emergencybutton/v1beta1/__init__.py @@ -0,0 +1,205 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: secret/emergencybutton/v1beta1/genesis.proto, secret/emergencybutton/v1beta1/params.proto, secret/emergencybutton/v1beta1/query.proto, secret/emergencybutton/v1beta1/tx.proto +# plugin: python-betterproto +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the parameters for the ibc-rate-limit module.""" + + switch_status: str = betterproto.string_field(1) + pauser_address: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MsgToggleIbcSwitch(betterproto.Message): + """ + MsgToggleIbcSwitch represents a message to toggle the emergencybutton + status by the defined pauser. + """ + + sender: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class MsgToggleIbcSwitchResponse(betterproto.Message): + """MsgToggleIbcSwitchResponse defines the response type for the toggle.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + authority: str = betterproto.string_field(1) + """authority is the address of the governance account.""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/emergencybutton parameters to update. NOTE: All + parameters must be supplied. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + pass + + +@dataclass(eq=False, repr=False) +class ParamsRequest(betterproto.Message): + """ParamsRequest is the request type for the Query/Params RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class ParamsResponse(betterproto.Message): + """ParamsResponse is the response type for the Query/Params RPC method.""" + + params: "Params" = betterproto.message_field(1) + """params defines the parameters of the module.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState - genesis state of x/wasm""" + + params: "Params" = betterproto.message_field(1) + + +class MsgStub(betterproto.ServiceStub): + async def toggle_ibc_switch( + self, + msg_toggle_ibc_switch: "MsgToggleIbcSwitch", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgToggleIbcSwitchResponse": + return await self._unary_unary( + "/secret.emergencybutton.v1beta1.Msg/ToggleIbcSwitch", + msg_toggle_ibc_switch, + MsgToggleIbcSwitchResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_params( + self, + msg_update_params: "MsgUpdateParams", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateParamsResponse": + return await self._unary_unary( + "/secret.emergencybutton.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def params( + self, + params_request: "ParamsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ParamsResponse": + return await self._unary_unary( + "/secret.emergencybutton.v1beta1.Query/Params", + params_request, + ParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def toggle_ibc_switch( + self, msg_toggle_ibc_switch: "MsgToggleIbcSwitch" + ) -> "MsgToggleIbcSwitchResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_toggle_ibc_switch( + self, + stream: "grpclib.server.Stream[MsgToggleIbcSwitch, MsgToggleIbcSwitchResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.toggle_ibc_switch(request) + await stream.send_message(response) + + async def __rpc_update_params( + self, stream: "grpclib.server.Stream[MsgUpdateParams, MsgUpdateParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/secret.emergencybutton.v1beta1.Msg/ToggleIbcSwitch": grpclib.const.Handler( + self.__rpc_toggle_ibc_switch, + grpclib.const.Cardinality.UNARY_UNARY, + MsgToggleIbcSwitch, + MsgToggleIbcSwitchResponse, + ), + "/secret.emergencybutton.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def params(self, params_request: "ParamsRequest") -> "ParamsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_params( + self, stream: "grpclib.server.Stream[ParamsRequest, ParamsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.params(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/secret.emergencybutton.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + ParamsRequest, + ParamsResponse, + ), + } diff --git a/secret_sdk/protobuf/secret/registration/remote_attestation/v1beta1/__init__.py b/secret_sdk/protobuf/secret/registration/remote_attestation/v1beta1/__init__.py index b2d8c0f..7ba4e28 100644 --- a/secret_sdk/protobuf/secret/registration/remote_attestation/v1beta1/__init__.py +++ b/secret_sdk/protobuf/secret/registration/remote_attestation/v1beta1/__init__.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: secret/registration/v1beta1/remote_attestation/types.proto +# sources: secret/registration/remote_attestation/v1beta1/types.proto # plugin: python-betterproto from dataclasses import dataclass from typing import List diff --git a/secret_sdk/protobuf/secret/registration/v1beta1/__init__.py b/secret_sdk/protobuf/secret/registration/v1beta1/__init__.py index c3c6ddd..9d19731 100644 --- a/secret_sdk/protobuf/secret/registration/v1beta1/__init__.py +++ b/secret_sdk/protobuf/secret/registration/v1beta1/__init__.py @@ -23,6 +23,13 @@ @dataclass(eq=False, repr=False) class SeedConfig(betterproto.Message): + master_key: str = betterproto.string_field(1) + encrypted_key: str = betterproto.string_field(2) + version: int = betterproto.uint32_field(3) + + +@dataclass(eq=False, repr=False) +class LegacySeedConfig(betterproto.Message): master_cert: str = betterproto.string_field(1) encrypted_key: str = betterproto.string_field(2) @@ -40,7 +47,13 @@ class RaAuthenticate(betterproto.Message): @dataclass(eq=False, repr=False) -class MasterCertificate(betterproto.Message): +class RaAuthenticateResponse(betterproto.Message): + data: str = betterproto.string_field(1) + events: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MasterKey(betterproto.Message): bytes: builtins.bytes = betterproto.bytes_field(1) @@ -52,8 +65,8 @@ class Key(betterproto.Message): @dataclass(eq=False, repr=False) class GenesisState(betterproto.Message): registration: List["RegistrationNodeInfo"] = betterproto.message_field(1) - node_exch_master_certificate: "MasterCertificate" = betterproto.message_field(2) - io_master_certificate: "MasterCertificate" = betterproto.message_field(3) + node_exch_master_key: "MasterKey" = betterproto.message_field(2) + io_master_key: "MasterKey" = betterproto.message_field(3) @dataclass(eq=False, repr=False) @@ -66,6 +79,25 @@ class QueryEncryptedSeedResponse(betterproto.Message): encrypted_seed: bytes = betterproto.bytes_field(1) +class MsgStub(betterproto.ServiceStub): + async def register_auth( + self, + ra_authenticate: "RaAuthenticate", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "RaAuthenticateResponse": + return await self._unary_unary( + "/secret.registration.v1beta1.Msg/RegisterAuth", + ra_authenticate, + RaAuthenticateResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + class QueryStub(betterproto.ServiceStub): async def tx_key( self, @@ -119,7 +151,33 @@ async def encrypted_seed( ) +class MsgBase(ServiceBase): + + async def register_auth( + self, ra_authenticate: "RaAuthenticate" + ) -> "RaAuthenticateResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_register_auth( + self, stream: "grpclib.server.Stream[RaAuthenticate, RaAuthenticateResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.register_auth(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/secret.registration.v1beta1.Msg/RegisterAuth": grpclib.const.Handler( + self.__rpc_register_auth, + grpclib.const.Cardinality.UNARY_UNARY, + RaAuthenticate, + RaAuthenticateResponse, + ), + } + + class QueryBase(ServiceBase): + async def tx_key( self, betterproto_lib_google_protobuf_empty: "betterproto_lib_google_protobuf.Empty", diff --git a/secret_sdk/protobuf/tendermint/abci/__init__.py b/secret_sdk/protobuf/tendermint/abci/__init__.py index a38cdbc..0928e38 100644 --- a/secret_sdk/protobuf/tendermint/abci/__init__.py +++ b/secret_sdk/protobuf/tendermint/abci/__init__.py @@ -31,7 +31,7 @@ class CheckTxType(betterproto.Enum): RECHECK = 1 -class EvidenceType(betterproto.Enum): +class MisbehaviorType(betterproto.Enum): UNKNOWN = 0 DUPLICATE_VOTE = 1 LIGHT_CLIENT_ATTACK = 2 @@ -55,18 +55,32 @@ class ResponseApplySnapshotChunkResult(betterproto.Enum): REJECT_SNAPSHOT = 5 +class ResponseProcessProposalProposalStatus(betterproto.Enum): + UNKNOWN = 0 + ACCEPT = 1 + REJECT = 2 + + +class ResponseVerifyVoteExtensionVerifyStatus(betterproto.Enum): + UNKNOWN = 0 + ACCEPT = 1 + REJECT = 2 + """ + Rejecting the vote extension will reject the entire precommit by the + sender. Incorrectly implementing this thus has liveness implications as it + may affect CometBFT's ability to receive 2/3+ valid votes to finalize the + block. Honest nodes should never be rejected. + """ + + @dataclass(eq=False, repr=False) class Request(betterproto.Message): echo: "RequestEcho" = betterproto.message_field(1, group="value") flush: "RequestFlush" = betterproto.message_field(2, group="value") info: "RequestInfo" = betterproto.message_field(3, group="value") - set_option: "RequestSetOption" = betterproto.message_field(4, group="value") init_chain: "RequestInitChain" = betterproto.message_field(5, group="value") query: "RequestQuery" = betterproto.message_field(6, group="value") - begin_block: "RequestBeginBlock" = betterproto.message_field(7, group="value") check_tx: "RequestCheckTx" = betterproto.message_field(8, group="value") - deliver_tx: "RequestDeliverTx" = betterproto.message_field(9, group="value") - end_block: "RequestEndBlock" = betterproto.message_field(10, group="value") commit: "RequestCommit" = betterproto.message_field(11, group="value") list_snapshots: "RequestListSnapshots" = betterproto.message_field( 12, group="value" @@ -80,6 +94,19 @@ class Request(betterproto.Message): apply_snapshot_chunk: "RequestApplySnapshotChunk" = betterproto.message_field( 15, group="value" ) + prepare_proposal: "RequestPrepareProposal" = betterproto.message_field( + 16, group="value" + ) + process_proposal: "RequestProcessProposal" = betterproto.message_field( + 17, group="value" + ) + extend_vote: "RequestExtendVote" = betterproto.message_field(18, group="value") + verify_vote_extension: "RequestVerifyVoteExtension" = betterproto.message_field( + 19, group="value" + ) + finalize_block: "RequestFinalizeBlock" = betterproto.message_field( + 20, group="value" + ) @dataclass(eq=False, repr=False) @@ -97,21 +124,14 @@ class RequestInfo(betterproto.Message): version: str = betterproto.string_field(1) block_version: int = betterproto.uint64_field(2) p2_p_version: int = betterproto.uint64_field(3) - - -@dataclass(eq=False, repr=False) -class RequestSetOption(betterproto.Message): - """nondeterministic""" - - key: str = betterproto.string_field(1) - value: str = betterproto.string_field(2) + abci_version: str = betterproto.string_field(4) @dataclass(eq=False, repr=False) class RequestInitChain(betterproto.Message): time: datetime = betterproto.message_field(1) chain_id: str = betterproto.string_field(2) - consensus_params: "ConsensusParams" = betterproto.message_field(3) + consensus_params: "_types__.ConsensusParams" = betterproto.message_field(3) validators: List["ValidatorUpdate"] = betterproto.message_field(4) app_state_bytes: bytes = betterproto.bytes_field(5) initial_height: int = betterproto.int64_field(6) @@ -125,30 +145,12 @@ class RequestQuery(betterproto.Message): prove: bool = betterproto.bool_field(4) -@dataclass(eq=False, repr=False) -class RequestBeginBlock(betterproto.Message): - hash: bytes = betterproto.bytes_field(1) - header: "_types__.Header" = betterproto.message_field(2) - last_commit_info: "LastCommitInfo" = betterproto.message_field(3) - byzantine_validators: List["Evidence"] = betterproto.message_field(4) - - @dataclass(eq=False, repr=False) class RequestCheckTx(betterproto.Message): tx: bytes = betterproto.bytes_field(1) type: "CheckTxType" = betterproto.enum_field(2) -@dataclass(eq=False, repr=False) -class RequestDeliverTx(betterproto.Message): - tx: bytes = betterproto.bytes_field(1) - - -@dataclass(eq=False, repr=False) -class RequestEndBlock(betterproto.Message): - height: int = betterproto.int64_field(1) - - @dataclass(eq=False, repr=False) class RequestCommit(betterproto.Message): pass @@ -187,19 +189,106 @@ class RequestApplySnapshotChunk(betterproto.Message): sender: str = betterproto.string_field(3) +@dataclass(eq=False, repr=False) +class RequestPrepareProposal(betterproto.Message): + max_tx_bytes: int = betterproto.int64_field(1) + """the modified transactions cannot exceed this size.""" + + txs: List[bytes] = betterproto.bytes_field(2) + """ + txs is an array of transactions that will be included in a block, sent to + the app for possible modifications. + """ + + local_last_commit: "ExtendedCommitInfo" = betterproto.message_field(3) + misbehavior: List["Misbehavior"] = betterproto.message_field(4) + height: int = betterproto.int64_field(5) + time: datetime = betterproto.message_field(6) + next_validators_hash: bytes = betterproto.bytes_field(7) + proposer_address: bytes = betterproto.bytes_field(8) + """address of the public key of the validator proposing the block.""" + + +@dataclass(eq=False, repr=False) +class RequestProcessProposal(betterproto.Message): + txs: List[bytes] = betterproto.bytes_field(1) + proposed_last_commit: "CommitInfo" = betterproto.message_field(2) + misbehavior: List["Misbehavior"] = betterproto.message_field(3) + hash: bytes = betterproto.bytes_field(4) + """hash is the merkle root hash of the fields of the proposed block.""" + + height: int = betterproto.int64_field(5) + time: datetime = betterproto.message_field(6) + next_validators_hash: bytes = betterproto.bytes_field(7) + proposer_address: bytes = betterproto.bytes_field(8) + """address of the public key of the original proposer of the block.""" + + +@dataclass(eq=False, repr=False) +class RequestExtendVote(betterproto.Message): + """Extends a vote with application-injected data""" + + hash: bytes = betterproto.bytes_field(1) + """the hash of the block that this vote may be referring to""" + + height: int = betterproto.int64_field(2) + """the height of the extended vote""" + + time: datetime = betterproto.message_field(3) + """info of the block that this vote may be referring to""" + + txs: List[bytes] = betterproto.bytes_field(4) + proposed_last_commit: "CommitInfo" = betterproto.message_field(5) + misbehavior: List["Misbehavior"] = betterproto.message_field(6) + next_validators_hash: bytes = betterproto.bytes_field(7) + proposer_address: bytes = betterproto.bytes_field(8) + """address of the public key of the original proposer of the block.""" + + +@dataclass(eq=False, repr=False) +class RequestVerifyVoteExtension(betterproto.Message): + """Verify the vote extension""" + + hash: bytes = betterproto.bytes_field(1) + """the hash of the block that this received vote corresponds to""" + + validator_address: bytes = betterproto.bytes_field(2) + """the validator that signed the vote extension""" + + height: int = betterproto.int64_field(3) + vote_extension: bytes = betterproto.bytes_field(4) + + +@dataclass(eq=False, repr=False) +class RequestFinalizeBlock(betterproto.Message): + txs: List[bytes] = betterproto.bytes_field(1) + decided_last_commit: "CommitInfo" = betterproto.message_field(2) + misbehavior: List["Misbehavior"] = betterproto.message_field(3) + hash: bytes = betterproto.bytes_field(4) + """hash is the merkle root hash of the fields of the decided block.""" + + height: int = betterproto.int64_field(5) + time: datetime = betterproto.message_field(6) + next_validators_hash: bytes = betterproto.bytes_field(7) + proposer_address: bytes = betterproto.bytes_field(8) + """ + proposer_address is the address of the public key of the original proposer + of the block. + """ + + encrypted_random: "_types__.EncryptedRandom" = betterproto.message_field(9) + commit: "_types__.Commit" = betterproto.message_field(10) + + @dataclass(eq=False, repr=False) class Response(betterproto.Message): exception: "ResponseException" = betterproto.message_field(1, group="value") echo: "ResponseEcho" = betterproto.message_field(2, group="value") flush: "ResponseFlush" = betterproto.message_field(3, group="value") info: "ResponseInfo" = betterproto.message_field(4, group="value") - set_option: "ResponseSetOption" = betterproto.message_field(5, group="value") init_chain: "ResponseInitChain" = betterproto.message_field(6, group="value") query: "ResponseQuery" = betterproto.message_field(7, group="value") - begin_block: "ResponseBeginBlock" = betterproto.message_field(8, group="value") check_tx: "ResponseCheckTx" = betterproto.message_field(9, group="value") - deliver_tx: "ResponseDeliverTx" = betterproto.message_field(10, group="value") - end_block: "ResponseEndBlock" = betterproto.message_field(11, group="value") commit: "ResponseCommit" = betterproto.message_field(12, group="value") list_snapshots: "ResponseListSnapshots" = betterproto.message_field( 13, group="value" @@ -213,6 +302,19 @@ class Response(betterproto.Message): apply_snapshot_chunk: "ResponseApplySnapshotChunk" = betterproto.message_field( 16, group="value" ) + prepare_proposal: "ResponsePrepareProposal" = betterproto.message_field( + 17, group="value" + ) + process_proposal: "ResponseProcessProposal" = betterproto.message_field( + 18, group="value" + ) + extend_vote: "ResponseExtendVote" = betterproto.message_field(19, group="value") + verify_vote_extension: "ResponseVerifyVoteExtension" = betterproto.message_field( + 20, group="value" + ) + finalize_block: "ResponseFinalizeBlock" = betterproto.message_field( + 21, group="value" + ) @dataclass(eq=False, repr=False) @@ -241,20 +343,9 @@ class ResponseInfo(betterproto.Message): last_block_app_hash: bytes = betterproto.bytes_field(5) -@dataclass(eq=False, repr=False) -class ResponseSetOption(betterproto.Message): - """nondeterministic""" - - code: int = betterproto.uint32_field(1) - log: str = betterproto.string_field(3) - """bytes data = 2;""" - - info: str = betterproto.string_field(4) - - @dataclass(eq=False, repr=False) class ResponseInitChain(betterproto.Message): - consensus_params: "ConsensusParams" = betterproto.message_field(1) + consensus_params: "_types__.ConsensusParams" = betterproto.message_field(1) validators: List["ValidatorUpdate"] = betterproto.message_field(2) app_hash: bytes = betterproto.bytes_field(3) @@ -274,11 +365,6 @@ class ResponseQuery(betterproto.Message): codespace: str = betterproto.string_field(10) -@dataclass(eq=False, repr=False) -class ResponseBeginBlock(betterproto.Message): - events: List["Event"] = betterproto.message_field(1) - - @dataclass(eq=False, repr=False) class ResponseCheckTx(betterproto.Message): code: int = betterproto.uint32_field(1) @@ -291,30 +377,8 @@ class ResponseCheckTx(betterproto.Message): codespace: str = betterproto.string_field(8) -@dataclass(eq=False, repr=False) -class ResponseDeliverTx(betterproto.Message): - code: int = betterproto.uint32_field(1) - data: bytes = betterproto.bytes_field(2) - log: str = betterproto.string_field(3) - info: str = betterproto.string_field(4) - gas_wanted: int = betterproto.int64_field(5) - gas_used: int = betterproto.int64_field(6) - events: List["Event"] = betterproto.message_field(7) - codespace: str = betterproto.string_field(8) - - -@dataclass(eq=False, repr=False) -class ResponseEndBlock(betterproto.Message): - validator_updates: List["ValidatorUpdate"] = betterproto.message_field(1) - consensus_param_updates: "ConsensusParams" = betterproto.message_field(2) - events: List["Event"] = betterproto.message_field(3) - - @dataclass(eq=False, repr=False) class ResponseCommit(betterproto.Message): - data: bytes = betterproto.bytes_field(2) - """reserve 1""" - retain_height: int = betterproto.int64_field(3) @@ -341,41 +405,86 @@ class ResponseApplySnapshotChunk(betterproto.Message): @dataclass(eq=False, repr=False) -class ConsensusParams(betterproto.Message): - """ - ConsensusParams contains all consensus-relevant parameters that can be - adjusted by the abci app - """ +class ResponsePrepareProposal(betterproto.Message): + txs: List[bytes] = betterproto.bytes_field(1) + + +@dataclass(eq=False, repr=False) +class ResponseProcessProposal(betterproto.Message): + status: "ResponseProcessProposalProposalStatus" = betterproto.enum_field(1) + - block: "BlockParams" = betterproto.message_field(1) - evidence: "_types__.EvidenceParams" = betterproto.message_field(2) - validator: "_types__.ValidatorParams" = betterproto.message_field(3) - version: "_types__.VersionParams" = betterproto.message_field(4) +@dataclass(eq=False, repr=False) +class ResponseExtendVote(betterproto.Message): + vote_extension: bytes = betterproto.bytes_field(1) @dataclass(eq=False, repr=False) -class BlockParams(betterproto.Message): - """BlockParams contains limits on the block size.""" +class ResponseVerifyVoteExtension(betterproto.Message): + status: "ResponseVerifyVoteExtensionVerifyStatus" = betterproto.enum_field(1) + + +@dataclass(eq=False, repr=False) +class ResponseFinalizeBlock(betterproto.Message): + events: List["Event"] = betterproto.message_field(1) + """set of block events emmitted as part of executing the block""" - max_bytes: int = betterproto.int64_field(1) - """Note: must be greater than 0""" + tx_results: List["ExecTxResult"] = betterproto.message_field(2) + """ + the result of executing each transaction including the events the + particular transction emitted. This should match the order of the + transactions delivered in the block itself + """ + + validator_updates: List["ValidatorUpdate"] = betterproto.message_field(3) + """ + a list of updates to the validator set. These will reflect the validator + set at current height + 2. + """ - max_gas: int = betterproto.int64_field(2) - """Note: must be greater or equal to -1""" + consensus_param_updates: "_types__.ConsensusParams" = betterproto.message_field(4) + """updates to the consensus params, if any.""" + + app_hash: bytes = betterproto.bytes_field(5) + """ + app_hash is the hash of the applications' state which is used to confirm + that execution of the transactions was deterministic. It is up to the + application to decide which algorithm to use. + """ @dataclass(eq=False, repr=False) -class LastCommitInfo(betterproto.Message): +class CommitInfo(betterproto.Message): round: int = betterproto.int32_field(1) votes: List["VoteInfo"] = betterproto.message_field(2) +@dataclass(eq=False, repr=False) +class ExtendedCommitInfo(betterproto.Message): + """ + ExtendedCommitInfo is similar to CommitInfo except that it is only used in + the PrepareProposal request such that CometBFT can provide vote extensions + to the application. + """ + + round: int = betterproto.int32_field(1) + """ + The round at which the block proposer decided in the previous height. + """ + + votes: List["ExtendedVoteInfo"] = betterproto.message_field(2) + """ + List of validators' addresses in the last validator set with their voting + information, including vote extensions. + """ + + @dataclass(eq=False, repr=False) class Event(betterproto.Message): """ Event allows application developers to attach additional information to - ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and - ResponseDeliverTx. Later, transactions may be queried using these events. + ResponseFinalizeBlock and ResponseCheckTx. Later, transactions may be + queried using these events. """ type: str = betterproto.string_field(1) @@ -386,11 +495,29 @@ class Event(betterproto.Message): class EventAttribute(betterproto.Message): """EventAttribute is a single key-value pair, associated with an event.""" - key: bytes = betterproto.bytes_field(1) - value: bytes = betterproto.bytes_field(2) + key: str = betterproto.string_field(1) + value: str = betterproto.string_field(2) index: bool = betterproto.bool_field(3) +@dataclass(eq=False, repr=False) +class ExecTxResult(betterproto.Message): + """ + ExecTxResult contains results of executing one individual transaction. * + Its structure is equivalent to #ResponseDeliverTx which will be + deprecated/deleted + """ + + code: int = betterproto.uint32_field(1) + data: bytes = betterproto.bytes_field(2) + log: str = betterproto.string_field(3) + info: str = betterproto.string_field(4) + gas_wanted: int = betterproto.int64_field(5) + gas_used: int = betterproto.int64_field(6) + events: List["Event"] = betterproto.message_field(7) + codespace: str = betterproto.string_field(8) + + @dataclass(eq=False, repr=False) class TxResult(betterproto.Message): """ @@ -401,13 +528,11 @@ class TxResult(betterproto.Message): height: int = betterproto.int64_field(1) index: int = betterproto.uint32_field(2) tx: bytes = betterproto.bytes_field(3) - result: "ResponseDeliverTx" = betterproto.message_field(4) + result: "ExecTxResult" = betterproto.message_field(4) @dataclass(eq=False, repr=False) class Validator(betterproto.Message): - """Validator""" - address: bytes = betterproto.bytes_field(1) power: int = betterproto.int64_field(3) """PubKey pub_key = 2 [(gogoproto.nullable)=false];""" @@ -415,23 +540,40 @@ class Validator(betterproto.Message): @dataclass(eq=False, repr=False) class ValidatorUpdate(betterproto.Message): - """ValidatorUpdate""" - pub_key: "_crypto__.PublicKey" = betterproto.message_field(1) power: int = betterproto.int64_field(2) @dataclass(eq=False, repr=False) class VoteInfo(betterproto.Message): - """VoteInfo""" + validator: "Validator" = betterproto.message_field(1) + block_id_flag: "_types__.BlockIdFlag" = betterproto.enum_field(3) + +@dataclass(eq=False, repr=False) +class ExtendedVoteInfo(betterproto.Message): validator: "Validator" = betterproto.message_field(1) - signed_last_block: bool = betterproto.bool_field(2) + """The validator that sent the vote.""" + + vote_extension: bytes = betterproto.bytes_field(3) + """ + Non-deterministic extension provided by the sending validator's + application. + """ + + extension_signature: bytes = betterproto.bytes_field(4) + """Vote extension signature created by CometBFT""" + + block_id_flag: "_types__.BlockIdFlag" = betterproto.enum_field(5) + """ + block_id_flag indicates whether the validator voted for a block, nil, or + did not vote at all + """ @dataclass(eq=False, repr=False) -class Evidence(betterproto.Message): - type: "EvidenceType" = betterproto.enum_field(1) +class Misbehavior(betterproto.Message): + type: "MisbehaviorType" = betterproto.enum_field(1) validator: "Validator" = betterproto.message_field(2) """The offending validator""" @@ -458,7 +600,7 @@ class Snapshot(betterproto.Message): metadata: bytes = betterproto.bytes_field(5) -class AbciApplicationStub(betterproto.ServiceStub): +class AbciStub(betterproto.ServiceStub): async def echo( self, request_echo: "RequestEcho", @@ -468,7 +610,7 @@ async def echo( metadata: Optional["MetadataLike"] = None ) -> "ResponseEcho": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Echo", + "/tendermint.abci.ABCI/Echo", request_echo, ResponseEcho, timeout=timeout, @@ -485,7 +627,7 @@ async def flush( metadata: Optional["MetadataLike"] = None ) -> "ResponseFlush": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Flush", + "/tendermint.abci.ABCI/Flush", request_flush, ResponseFlush, timeout=timeout, @@ -502,7 +644,7 @@ async def info( metadata: Optional["MetadataLike"] = None ) -> "ResponseInfo": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Info", + "/tendermint.abci.ABCI/Info", request_info, ResponseInfo, timeout=timeout, @@ -510,212 +652,230 @@ async def info( metadata=metadata, ) - async def set_option( + async def check_tx( + self, + request_check_tx: "RequestCheckTx", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ResponseCheckTx": + return await self._unary_unary( + "/tendermint.abci.ABCI/CheckTx", + request_check_tx, + ResponseCheckTx, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def query( self, - request_set_option: "RequestSetOption", + request_query: "RequestQuery", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseSetOption": + ) -> "ResponseQuery": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/SetOption", - request_set_option, - ResponseSetOption, + "/tendermint.abci.ABCI/Query", + request_query, + ResponseQuery, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def deliver_tx( + async def commit( self, - request_deliver_tx: "RequestDeliverTx", + request_commit: "RequestCommit", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseDeliverTx": + ) -> "ResponseCommit": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/DeliverTx", - request_deliver_tx, - ResponseDeliverTx, + "/tendermint.abci.ABCI/Commit", + request_commit, + ResponseCommit, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def check_tx( + async def init_chain( self, - request_check_tx: "RequestCheckTx", + request_init_chain: "RequestInitChain", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseCheckTx": + ) -> "ResponseInitChain": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/CheckTx", - request_check_tx, - ResponseCheckTx, + "/tendermint.abci.ABCI/InitChain", + request_init_chain, + ResponseInitChain, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def query( + async def list_snapshots( self, - request_query: "RequestQuery", + request_list_snapshots: "RequestListSnapshots", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseQuery": + ) -> "ResponseListSnapshots": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Query", - request_query, - ResponseQuery, + "/tendermint.abci.ABCI/ListSnapshots", + request_list_snapshots, + ResponseListSnapshots, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def commit( + async def offer_snapshot( self, - request_commit: "RequestCommit", + request_offer_snapshot: "RequestOfferSnapshot", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseCommit": + ) -> "ResponseOfferSnapshot": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Commit", - request_commit, - ResponseCommit, + "/tendermint.abci.ABCI/OfferSnapshot", + request_offer_snapshot, + ResponseOfferSnapshot, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def init_chain( + async def load_snapshot_chunk( self, - request_init_chain: "RequestInitChain", + request_load_snapshot_chunk: "RequestLoadSnapshotChunk", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseInitChain": + ) -> "ResponseLoadSnapshotChunk": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/InitChain", - request_init_chain, - ResponseInitChain, + "/tendermint.abci.ABCI/LoadSnapshotChunk", + request_load_snapshot_chunk, + ResponseLoadSnapshotChunk, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def begin_block( + async def apply_snapshot_chunk( self, - request_begin_block: "RequestBeginBlock", + request_apply_snapshot_chunk: "RequestApplySnapshotChunk", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseBeginBlock": + ) -> "ResponseApplySnapshotChunk": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/BeginBlock", - request_begin_block, - ResponseBeginBlock, + "/tendermint.abci.ABCI/ApplySnapshotChunk", + request_apply_snapshot_chunk, + ResponseApplySnapshotChunk, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def end_block( + async def prepare_proposal( self, - request_end_block: "RequestEndBlock", + request_prepare_proposal: "RequestPrepareProposal", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseEndBlock": + ) -> "ResponsePrepareProposal": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/EndBlock", - request_end_block, - ResponseEndBlock, + "/tendermint.abci.ABCI/PrepareProposal", + request_prepare_proposal, + ResponsePrepareProposal, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def list_snapshots( + async def process_proposal( self, - request_list_snapshots: "RequestListSnapshots", + request_process_proposal: "RequestProcessProposal", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseListSnapshots": + ) -> "ResponseProcessProposal": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/ListSnapshots", - request_list_snapshots, - ResponseListSnapshots, + "/tendermint.abci.ABCI/ProcessProposal", + request_process_proposal, + ResponseProcessProposal, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def offer_snapshot( + async def extend_vote( self, - request_offer_snapshot: "RequestOfferSnapshot", + request_extend_vote: "RequestExtendVote", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseOfferSnapshot": + ) -> "ResponseExtendVote": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/OfferSnapshot", - request_offer_snapshot, - ResponseOfferSnapshot, + "/tendermint.abci.ABCI/ExtendVote", + request_extend_vote, + ResponseExtendVote, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def load_snapshot_chunk( + async def verify_vote_extension( self, - request_load_snapshot_chunk: "RequestLoadSnapshotChunk", + request_verify_vote_extension: "RequestVerifyVoteExtension", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseLoadSnapshotChunk": + ) -> "ResponseVerifyVoteExtension": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/LoadSnapshotChunk", - request_load_snapshot_chunk, - ResponseLoadSnapshotChunk, + "/tendermint.abci.ABCI/VerifyVoteExtension", + request_verify_vote_extension, + ResponseVerifyVoteExtension, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def apply_snapshot_chunk( + async def finalize_block( self, - request_apply_snapshot_chunk: "RequestApplySnapshotChunk", + request_finalize_block: "RequestFinalizeBlock", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseApplySnapshotChunk": + ) -> "ResponseFinalizeBlock": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/ApplySnapshotChunk", - request_apply_snapshot_chunk, - ResponseApplySnapshotChunk, + "/tendermint.abci.ABCI/FinalizeBlock", + request_finalize_block, + ResponseFinalizeBlock, timeout=timeout, deadline=deadline, metadata=metadata, ) -class AbciApplicationBase(ServiceBase): +class AbciBase(ServiceBase): + async def echo(self, request_echo: "RequestEcho") -> "ResponseEcho": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -725,16 +885,6 @@ async def flush(self, request_flush: "RequestFlush") -> "ResponseFlush": async def info(self, request_info: "RequestInfo") -> "ResponseInfo": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def set_option( - self, request_set_option: "RequestSetOption" - ) -> "ResponseSetOption": - raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - - async def deliver_tx( - self, request_deliver_tx: "RequestDeliverTx" - ) -> "ResponseDeliverTx": - raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def check_tx(self, request_check_tx: "RequestCheckTx") -> "ResponseCheckTx": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -749,16 +899,6 @@ async def init_chain( ) -> "ResponseInitChain": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def begin_block( - self, request_begin_block: "RequestBeginBlock" - ) -> "ResponseBeginBlock": - raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - - async def end_block( - self, request_end_block: "RequestEndBlock" - ) -> "ResponseEndBlock": - raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def list_snapshots( self, request_list_snapshots: "RequestListSnapshots" ) -> "ResponseListSnapshots": @@ -779,6 +919,31 @@ async def apply_snapshot_chunk( ) -> "ResponseApplySnapshotChunk": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def prepare_proposal( + self, request_prepare_proposal: "RequestPrepareProposal" + ) -> "ResponsePrepareProposal": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def process_proposal( + self, request_process_proposal: "RequestProcessProposal" + ) -> "ResponseProcessProposal": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def extend_vote( + self, request_extend_vote: "RequestExtendVote" + ) -> "ResponseExtendVote": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def verify_vote_extension( + self, request_verify_vote_extension: "RequestVerifyVoteExtension" + ) -> "ResponseVerifyVoteExtension": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def finalize_block( + self, request_finalize_block: "RequestFinalizeBlock" + ) -> "ResponseFinalizeBlock": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_echo( self, stream: "grpclib.server.Stream[RequestEcho, ResponseEcho]" ) -> None: @@ -800,20 +965,6 @@ async def __rpc_info( response = await self.info(request) await stream.send_message(response) - async def __rpc_set_option( - self, stream: "grpclib.server.Stream[RequestSetOption, ResponseSetOption]" - ) -> None: - request = await stream.recv_message() - response = await self.set_option(request) - await stream.send_message(response) - - async def __rpc_deliver_tx( - self, stream: "grpclib.server.Stream[RequestDeliverTx, ResponseDeliverTx]" - ) -> None: - request = await stream.recv_message() - response = await self.deliver_tx(request) - await stream.send_message(response) - async def __rpc_check_tx( self, stream: "grpclib.server.Stream[RequestCheckTx, ResponseCheckTx]" ) -> None: @@ -842,20 +993,6 @@ async def __rpc_init_chain( response = await self.init_chain(request) await stream.send_message(response) - async def __rpc_begin_block( - self, stream: "grpclib.server.Stream[RequestBeginBlock, ResponseBeginBlock]" - ) -> None: - request = await stream.recv_message() - response = await self.begin_block(request) - await stream.send_message(response) - - async def __rpc_end_block( - self, stream: "grpclib.server.Stream[RequestEndBlock, ResponseEndBlock]" - ) -> None: - request = await stream.recv_message() - response = await self.end_block(request) - await stream.send_message(response) - async def __rpc_list_snapshots( self, stream: "grpclib.server.Stream[RequestListSnapshots, ResponseListSnapshots]", @@ -888,96 +1025,141 @@ async def __rpc_apply_snapshot_chunk( response = await self.apply_snapshot_chunk(request) await stream.send_message(response) + async def __rpc_prepare_proposal( + self, + stream: "grpclib.server.Stream[RequestPrepareProposal, ResponsePrepareProposal]", + ) -> None: + request = await stream.recv_message() + response = await self.prepare_proposal(request) + await stream.send_message(response) + + async def __rpc_process_proposal( + self, + stream: "grpclib.server.Stream[RequestProcessProposal, ResponseProcessProposal]", + ) -> None: + request = await stream.recv_message() + response = await self.process_proposal(request) + await stream.send_message(response) + + async def __rpc_extend_vote( + self, stream: "grpclib.server.Stream[RequestExtendVote, ResponseExtendVote]" + ) -> None: + request = await stream.recv_message() + response = await self.extend_vote(request) + await stream.send_message(response) + + async def __rpc_verify_vote_extension( + self, + stream: "grpclib.server.Stream[RequestVerifyVoteExtension, ResponseVerifyVoteExtension]", + ) -> None: + request = await stream.recv_message() + response = await self.verify_vote_extension(request) + await stream.send_message(response) + + async def __rpc_finalize_block( + self, + stream: "grpclib.server.Stream[RequestFinalizeBlock, ResponseFinalizeBlock]", + ) -> None: + request = await stream.recv_message() + response = await self.finalize_block(request) + await stream.send_message(response) + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { - "/tendermint.abci.ABCIApplication/Echo": grpclib.const.Handler( + "/tendermint.abci.ABCI/Echo": grpclib.const.Handler( self.__rpc_echo, grpclib.const.Cardinality.UNARY_UNARY, RequestEcho, ResponseEcho, ), - "/tendermint.abci.ABCIApplication/Flush": grpclib.const.Handler( + "/tendermint.abci.ABCI/Flush": grpclib.const.Handler( self.__rpc_flush, grpclib.const.Cardinality.UNARY_UNARY, RequestFlush, ResponseFlush, ), - "/tendermint.abci.ABCIApplication/Info": grpclib.const.Handler( + "/tendermint.abci.ABCI/Info": grpclib.const.Handler( self.__rpc_info, grpclib.const.Cardinality.UNARY_UNARY, RequestInfo, ResponseInfo, ), - "/tendermint.abci.ABCIApplication/SetOption": grpclib.const.Handler( - self.__rpc_set_option, - grpclib.const.Cardinality.UNARY_UNARY, - RequestSetOption, - ResponseSetOption, - ), - "/tendermint.abci.ABCIApplication/DeliverTx": grpclib.const.Handler( - self.__rpc_deliver_tx, - grpclib.const.Cardinality.UNARY_UNARY, - RequestDeliverTx, - ResponseDeliverTx, - ), - "/tendermint.abci.ABCIApplication/CheckTx": grpclib.const.Handler( + "/tendermint.abci.ABCI/CheckTx": grpclib.const.Handler( self.__rpc_check_tx, grpclib.const.Cardinality.UNARY_UNARY, RequestCheckTx, ResponseCheckTx, ), - "/tendermint.abci.ABCIApplication/Query": grpclib.const.Handler( + "/tendermint.abci.ABCI/Query": grpclib.const.Handler( self.__rpc_query, grpclib.const.Cardinality.UNARY_UNARY, RequestQuery, ResponseQuery, ), - "/tendermint.abci.ABCIApplication/Commit": grpclib.const.Handler( + "/tendermint.abci.ABCI/Commit": grpclib.const.Handler( self.__rpc_commit, grpclib.const.Cardinality.UNARY_UNARY, RequestCommit, ResponseCommit, ), - "/tendermint.abci.ABCIApplication/InitChain": grpclib.const.Handler( + "/tendermint.abci.ABCI/InitChain": grpclib.const.Handler( self.__rpc_init_chain, grpclib.const.Cardinality.UNARY_UNARY, RequestInitChain, ResponseInitChain, ), - "/tendermint.abci.ABCIApplication/BeginBlock": grpclib.const.Handler( - self.__rpc_begin_block, - grpclib.const.Cardinality.UNARY_UNARY, - RequestBeginBlock, - ResponseBeginBlock, - ), - "/tendermint.abci.ABCIApplication/EndBlock": grpclib.const.Handler( - self.__rpc_end_block, - grpclib.const.Cardinality.UNARY_UNARY, - RequestEndBlock, - ResponseEndBlock, - ), - "/tendermint.abci.ABCIApplication/ListSnapshots": grpclib.const.Handler( + "/tendermint.abci.ABCI/ListSnapshots": grpclib.const.Handler( self.__rpc_list_snapshots, grpclib.const.Cardinality.UNARY_UNARY, RequestListSnapshots, ResponseListSnapshots, ), - "/tendermint.abci.ABCIApplication/OfferSnapshot": grpclib.const.Handler( + "/tendermint.abci.ABCI/OfferSnapshot": grpclib.const.Handler( self.__rpc_offer_snapshot, grpclib.const.Cardinality.UNARY_UNARY, RequestOfferSnapshot, ResponseOfferSnapshot, ), - "/tendermint.abci.ABCIApplication/LoadSnapshotChunk": grpclib.const.Handler( + "/tendermint.abci.ABCI/LoadSnapshotChunk": grpclib.const.Handler( self.__rpc_load_snapshot_chunk, grpclib.const.Cardinality.UNARY_UNARY, RequestLoadSnapshotChunk, ResponseLoadSnapshotChunk, ), - "/tendermint.abci.ABCIApplication/ApplySnapshotChunk": grpclib.const.Handler( + "/tendermint.abci.ABCI/ApplySnapshotChunk": grpclib.const.Handler( self.__rpc_apply_snapshot_chunk, grpclib.const.Cardinality.UNARY_UNARY, RequestApplySnapshotChunk, ResponseApplySnapshotChunk, ), + "/tendermint.abci.ABCI/PrepareProposal": grpclib.const.Handler( + self.__rpc_prepare_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + RequestPrepareProposal, + ResponsePrepareProposal, + ), + "/tendermint.abci.ABCI/ProcessProposal": grpclib.const.Handler( + self.__rpc_process_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + RequestProcessProposal, + ResponseProcessProposal, + ), + "/tendermint.abci.ABCI/ExtendVote": grpclib.const.Handler( + self.__rpc_extend_vote, + grpclib.const.Cardinality.UNARY_UNARY, + RequestExtendVote, + ResponseExtendVote, + ), + "/tendermint.abci.ABCI/VerifyVoteExtension": grpclib.const.Handler( + self.__rpc_verify_vote_extension, + grpclib.const.Cardinality.UNARY_UNARY, + RequestVerifyVoteExtension, + ResponseVerifyVoteExtension, + ), + "/tendermint.abci.ABCI/FinalizeBlock": grpclib.const.Handler( + self.__rpc_finalize_block, + grpclib.const.Cardinality.UNARY_UNARY, + RequestFinalizeBlock, + ResponseFinalizeBlock, + ), } diff --git a/secret_sdk/protobuf/tendermint/blocksync/__init__.py b/secret_sdk/protobuf/tendermint/blocksync/__init__.py new file mode 100644 index 0000000..7ea6fcb --- /dev/null +++ b/secret_sdk/protobuf/tendermint/blocksync/__init__.py @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: tendermint/blocksync/types.proto +# plugin: python-betterproto +from dataclasses import dataclass + +import betterproto + +from .. import types as _types__ + + +@dataclass(eq=False, repr=False) +class BlockRequest(betterproto.Message): + """BlockRequest requests a block for a specific height""" + + height: int = betterproto.int64_field(1) + + +@dataclass(eq=False, repr=False) +class NoBlockResponse(betterproto.Message): + """ + NoBlockResponse informs the node that the peer does not have block at the + requested height + """ + + height: int = betterproto.int64_field(1) + + +@dataclass(eq=False, repr=False) +class BlockResponse(betterproto.Message): + """BlockResponse returns block to the requested""" + + block: "_types__.Block" = betterproto.message_field(1) + ext_commit: "_types__.ExtendedCommit" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class StatusRequest(betterproto.Message): + """StatusRequest requests the status of a peer.""" + + pass + + +@dataclass(eq=False, repr=False) +class StatusResponse(betterproto.Message): + """StatusResponse is a peer response to inform their status.""" + + height: int = betterproto.int64_field(1) + base: int = betterproto.int64_field(2) + + +@dataclass(eq=False, repr=False) +class Message(betterproto.Message): + block_request: "BlockRequest" = betterproto.message_field(1, group="sum") + no_block_response: "NoBlockResponse" = betterproto.message_field(2, group="sum") + block_response: "BlockResponse" = betterproto.message_field(3, group="sum") + status_request: "StatusRequest" = betterproto.message_field(4, group="sum") + status_response: "StatusResponse" = betterproto.message_field(5, group="sum") diff --git a/secret_sdk/protobuf/tendermint/consensus/__init__.py b/secret_sdk/protobuf/tendermint/consensus/__init__.py index 73cb405..8ff1ceb 100644 --- a/secret_sdk/protobuf/tendermint/consensus/__init__.py +++ b/secret_sdk/protobuf/tendermint/consensus/__init__.py @@ -31,7 +31,7 @@ class NewRoundStep(betterproto.Message): class NewValidBlock(betterproto.Message): """ NewValidBlock is sent when a validator observes a valid block B in some - round r,i.e., there is a Proposal for block B and 2/3+ prevotes for the + round r, i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. In case the block is also committed, then IsCommit flag is set to true. """ diff --git a/secret_sdk/protobuf/tendermint/crypto/__init__.py b/secret_sdk/protobuf/tendermint/crypto/__init__.py index 8fe73bd..d22ab44 100644 --- a/secret_sdk/protobuf/tendermint/crypto/__init__.py +++ b/secret_sdk/protobuf/tendermint/crypto/__init__.py @@ -53,9 +53,7 @@ class ProofOps(betterproto.Message): @dataclass(eq=False, repr=False) class PublicKey(betterproto.Message): - """ - PublicKey defines the keys available for use with Tendermint Validators - """ + """PublicKey defines the keys available for use with Validators""" ed25519: bytes = betterproto.bytes_field(1, group="sum") secp256_k1: bytes = betterproto.bytes_field(2, group="sum") diff --git a/secret_sdk/protobuf/tendermint/rpc/grpc/__init__.py b/secret_sdk/protobuf/tendermint/rpc/grpc/__init__.py index 7940a39..f39cf9a 100644 --- a/secret_sdk/protobuf/tendermint/rpc/grpc/__init__.py +++ b/secret_sdk/protobuf/tendermint/rpc/grpc/__init__.py @@ -39,7 +39,7 @@ class ResponsePing(betterproto.Message): @dataclass(eq=False, repr=False) class ResponseBroadcastTx(betterproto.Message): check_tx: "__abci__.ResponseCheckTx" = betterproto.message_field(1) - deliver_tx: "__abci__.ResponseDeliverTx" = betterproto.message_field(2) + tx_result: "__abci__.ExecTxResult" = betterproto.message_field(2) class BroadcastApiStub(betterproto.ServiceStub): @@ -79,6 +79,7 @@ async def broadcast_tx( class BroadcastApiBase(ServiceBase): + async def ping(self, request_ping: "RequestPing") -> "ResponsePing": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) diff --git a/secret_sdk/protobuf/tendermint/state/__init__.py b/secret_sdk/protobuf/tendermint/state/__init__.py index d2d953d..0cc6f72 100644 --- a/secret_sdk/protobuf/tendermint/state/__init__.py +++ b/secret_sdk/protobuf/tendermint/state/__init__.py @@ -15,15 +15,39 @@ @dataclass(eq=False, repr=False) -class AbciResponses(betterproto.Message): +class LegacyAbciResponses(betterproto.Message): """ - ABCIResponses retains the responses of the various ABCI calls during block - processing. It is persisted to disk for each height before calling Commit. + LegacyABCIResponses retains the responses of the legacy ABCI calls during + block processing. Note ReponseDeliverTx is renamed to ExecTxResult but they + are semantically the same Kept for backwards compatibility for versions + prior to v0.38 """ - deliver_txs: List["_abci__.ResponseDeliverTx"] = betterproto.message_field(1) - end_block: "_abci__.ResponseEndBlock" = betterproto.message_field(2) - begin_block: "_abci__.ResponseBeginBlock" = betterproto.message_field(3) + deliver_txs: List["_abci__.ExecTxResult"] = betterproto.message_field(1) + end_block: "ResponseEndBlock" = betterproto.message_field(2) + begin_block: "ResponseBeginBlock" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class ResponseBeginBlock(betterproto.Message): + """ + ResponseBeginBlock is kept for backwards compatibility for versions prior + to v0.38 + """ + + events: List["_abci__.Event"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class ResponseEndBlock(betterproto.Message): + """ + ResponseEndBlock is kept for backwards compatibility for versions prior to + v0.38 + """ + + validator_updates: List["_abci__.ValidatorUpdate"] = betterproto.message_field(1) + consensus_param_updates: "_types__.ConsensusParams" = betterproto.message_field(2) + events: List["_abci__.Event"] = betterproto.message_field(3) @dataclass(eq=False, repr=False) @@ -48,6 +72,15 @@ class ConsensusParamsInfo(betterproto.Message): last_height_changed: int = betterproto.int64_field(2) +@dataclass(eq=False, repr=False) +class AbciResponsesInfo(betterproto.Message): + legacy_abci_responses: "LegacyAbciResponses" = betterproto.message_field(1) + height: int = betterproto.int64_field(2) + response_finalize_block: "_abci__.ResponseFinalizeBlock" = ( + betterproto.message_field(3) + ) + + @dataclass(eq=False, repr=False) class Version(betterproto.Message): consensus: "_version__.Consensus" = betterproto.message_field(1) diff --git a/secret_sdk/protobuf/tendermint/types/__init__.py b/secret_sdk/protobuf/tendermint/types/__init__.py index 0c614f3..bdc27db 100644 --- a/secret_sdk/protobuf/tendermint/types/__init__.py +++ b/secret_sdk/protobuf/tendermint/types/__init__.py @@ -18,7 +18,7 @@ class BlockIdFlag(betterproto.Enum): - """BlockIdFlag indicates which BlcokID the signature is for""" + """BlockIdFlag indicates which BlockID the signature is for""" BLOCK_ID_FLAG_UNKNOWN = 0 BLOCK_ID_FLAG_ABSENT = 1 @@ -38,6 +38,105 @@ class SignedMsgType(betterproto.Enum): """Proposals""" +@dataclass(eq=False, repr=False) +class ConsensusParams(betterproto.Message): + """ + ConsensusParams contains consensus critical parameters that determine the + validity of blocks. + """ + + block: "BlockParams" = betterproto.message_field(1) + evidence: "EvidenceParams" = betterproto.message_field(2) + validator: "ValidatorParams" = betterproto.message_field(3) + version: "VersionParams" = betterproto.message_field(4) + abci: "AbciParams" = betterproto.message_field(5) + + +@dataclass(eq=False, repr=False) +class BlockParams(betterproto.Message): + """BlockParams contains limits on the block size.""" + + max_bytes: int = betterproto.int64_field(1) + """Max block size, in bytes. Note: must be greater than 0""" + + max_gas: int = betterproto.int64_field(2) + """Max gas per block. Note: must be greater or equal to -1""" + + +@dataclass(eq=False, repr=False) +class EvidenceParams(betterproto.Message): + """EvidenceParams determine how we handle evidence of malfeasance.""" + + max_age_num_blocks: int = betterproto.int64_field(1) + """ + Max age of evidence, in blocks. The basic formula for calculating this is: + MaxAgeDuration / {average block time}. + """ + + max_age_duration: timedelta = betterproto.message_field(2) + """ + Max age of evidence, in time. It should correspond with an app's "unbonding + period" or other similar mechanism for handling [Nothing-At-Stake + attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is- + the-nothing-at-stake-problem-and-how-can-it-be-fixed). + """ + + max_bytes: int = betterproto.int64_field(3) + """ + This sets the maximum size of total evidence in bytes that can be committed + in a single block. and should fall comfortably under the max block bytes. + Default is 1048576 or 1MB + """ + + +@dataclass(eq=False, repr=False) +class ValidatorParams(betterproto.Message): + """ + ValidatorParams restrict the public key types validators can use. NOTE: + uses ABCI pubkey naming, not Amino names. + """ + + pub_key_types: List[str] = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class VersionParams(betterproto.Message): + """VersionParams contains the ABCI application version.""" + + app: int = betterproto.uint64_field(1) + + +@dataclass(eq=False, repr=False) +class HashedParams(betterproto.Message): + """ + HashedParams is a subset of ConsensusParams. It is hashed into the + Header.ConsensusHash. + """ + + block_max_bytes: int = betterproto.int64_field(1) + block_max_gas: int = betterproto.int64_field(2) + + +@dataclass(eq=False, repr=False) +class AbciParams(betterproto.Message): + """ + ABCIParams configure functionality specific to the Application Blockchain + Interface. + """ + + vote_extensions_enable_height: int = betterproto.int64_field(1) + """ + vote_extensions_enable_height configures the first height during which vote + extensions will be enabled. During this specified height, and for all + subsequent heights, precommit messages that do not contain valid extension + data will be considered invalid. Prior to this height, vote extensions will + not be used or accepted by validators on the network. Once enabled, vote + extensions will be created by the application in ExtendVote, passed to the + application for validation in VerifyVoteExtension and given to the + application to use when proposing a block during PrepareProposal. + """ + + @dataclass(eq=False, repr=False) class ValidatorSet(betterproto.Message): validators: List["Validator"] = betterproto.message_field(1) @@ -84,7 +183,7 @@ class BlockId(betterproto.Message): @dataclass(eq=False, repr=False) class Header(betterproto.Message): - """Header defines the structure of a Tendermint block header.""" + """Header defines the structure of a block header.""" version: "_version__.Consensus" = betterproto.message_field(1) """basic block info""" @@ -110,6 +209,16 @@ class Header(betterproto.Message): """consensus info""" proposer_address: bytes = betterproto.bytes_field(14) + encrypted_random: "EncryptedRandom" = betterproto.message_field(15) + """encrypted random""" + + +@dataclass(eq=False, repr=False) +class EncryptedRandom(betterproto.Message): + """Data contains the set of transactions included in the block""" + + random: bytes = betterproto.bytes_field(1) + proof: bytes = betterproto.bytes_field(2) @dataclass(eq=False, repr=False) @@ -127,8 +236,7 @@ class Data(betterproto.Message): @dataclass(eq=False, repr=False) class Vote(betterproto.Message): """ - Vote represents a prevote, precommit, or commit vote from validators for - consensus. + Vote represents a prevote or precommit vote from validators for consensus. """ type: "SignedMsgType" = betterproto.enum_field(1) @@ -139,6 +247,22 @@ class Vote(betterproto.Message): validator_address: bytes = betterproto.bytes_field(6) validator_index: int = betterproto.int32_field(7) signature: bytes = betterproto.bytes_field(8) + """ + Vote signature by the validator if they participated in consensus for the + associated block. + """ + + extension: bytes = betterproto.bytes_field(9) + """ + Vote extension provided by the application. Only valid for precommit + messages. + """ + + extension_signature: bytes = betterproto.bytes_field(10) + """ + Vote extension signature by the validator if they participated in consensus + for the associated block. Only valid for precommit messages. + """ @dataclass(eq=False, repr=False) @@ -164,6 +288,34 @@ class CommitSig(betterproto.Message): signature: bytes = betterproto.bytes_field(4) +@dataclass(eq=False, repr=False) +class ExtendedCommit(betterproto.Message): + height: int = betterproto.int64_field(1) + round: int = betterproto.int32_field(2) + block_id: "BlockId" = betterproto.message_field(3) + extended_signatures: List["ExtendedCommitSig"] = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class ExtendedCommitSig(betterproto.Message): + """ + ExtendedCommitSig retains all the same fields as CommitSig but adds vote + extension-related fields. We use two signatures to ensure backwards + compatibility. That is the digest of the original signature is still the + same in prior versions + """ + + block_id_flag: "BlockIdFlag" = betterproto.enum_field(1) + validator_address: bytes = betterproto.bytes_field(2) + timestamp: datetime = betterproto.message_field(3) + signature: bytes = betterproto.bytes_field(4) + extension: bytes = betterproto.bytes_field(5) + """Vote extension data""" + + extension_signature: bytes = betterproto.bytes_field(6) + """Vote extension signature""" + + @dataclass(eq=False, repr=False) class Proposal(betterproto.Message): type: "SignedMsgType" = betterproto.enum_field(1) @@ -207,91 +359,6 @@ class TxProof(betterproto.Message): proof: "_crypto__.Proof" = betterproto.message_field(3) -@dataclass(eq=False, repr=False) -class ConsensusParams(betterproto.Message): - """ - ConsensusParams contains consensus critical parameters that determine the - validity of blocks. - """ - - block: "BlockParams" = betterproto.message_field(1) - evidence: "EvidenceParams" = betterproto.message_field(2) - validator: "ValidatorParams" = betterproto.message_field(3) - version: "VersionParams" = betterproto.message_field(4) - - -@dataclass(eq=False, repr=False) -class BlockParams(betterproto.Message): - """BlockParams contains limits on the block size.""" - - max_bytes: int = betterproto.int64_field(1) - """Max block size, in bytes. Note: must be greater than 0""" - - max_gas: int = betterproto.int64_field(2) - """Max gas per block. Note: must be greater or equal to -1""" - - time_iota_ms: int = betterproto.int64_field(3) - """ - Minimum time increment between consecutive blocks (in milliseconds) If the - block header timestamp is ahead of the system clock, decrease this value. - Not exposed to the application. - """ - - -@dataclass(eq=False, repr=False) -class EvidenceParams(betterproto.Message): - """EvidenceParams determine how we handle evidence of malfeasance.""" - - max_age_num_blocks: int = betterproto.int64_field(1) - """ - Max age of evidence, in blocks. The basic formula for calculating this is: - MaxAgeDuration / {average block time}. - """ - - max_age_duration: timedelta = betterproto.message_field(2) - """ - Max age of evidence, in time. It should correspond with an app's "unbonding - period" or other similar mechanism for handling [Nothing-At-Stake - attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is- - the-nothing-at-stake-problem-and-how-can-it-be-fixed). - """ - - max_bytes: int = betterproto.int64_field(3) - """ - This sets the maximum size of total evidence in bytes that can be committed - in a single block. and should fall comfortably under the max block bytes. - Default is 1048576 or 1MB - """ - - -@dataclass(eq=False, repr=False) -class ValidatorParams(betterproto.Message): - """ - ValidatorParams restrict the public key types validators can use. NOTE: - uses ABCI pubkey naming, not Amino names. - """ - - pub_key_types: List[str] = betterproto.string_field(1) - - -@dataclass(eq=False, repr=False) -class VersionParams(betterproto.Message): - """VersionParams contains the ABCI application version.""" - - app_version: int = betterproto.uint64_field(1) - - -@dataclass(eq=False, repr=False) -class HashedParams(betterproto.Message): - """ - HashedParams is a subset of ConsensusParams. It is hashed into the - Header.ConsensusHash. - """ - - block_max_bytes: int = betterproto.int64_field(1) - block_max_gas: int = betterproto.int64_field(2) - - @dataclass(eq=False, repr=False) class Evidence(betterproto.Message): duplicate_vote_evidence: "DuplicateVoteEvidence" = betterproto.message_field( @@ -381,3 +448,16 @@ class CanonicalVote(betterproto.Message): block_id: "CanonicalBlockId" = betterproto.message_field(4) timestamp: datetime = betterproto.message_field(5) chain_id: str = betterproto.string_field(6) + + +@dataclass(eq=False, repr=False) +class CanonicalVoteExtension(betterproto.Message): + """ + CanonicalVoteExtension provides us a way to serialize a vote extension from + a particular validator such that we can sign over those serialized bytes. + """ + + extension: bytes = betterproto.bytes_field(1) + height: int = betterproto.sfixed64_field(2) + round: int = betterproto.sfixed64_field(3) + chain_id: str = betterproto.string_field(4) diff --git a/secret_sdk/util/tx.py b/secret_sdk/util/tx.py index 13a224c..9b3783f 100644 --- a/secret_sdk/util/tx.py +++ b/secret_sdk/util/tx.py @@ -14,4 +14,17 @@ def get_value_from_raw_log( for a in e['attributes']: if f'{e["type"]}.{a["key"]}' == key: return str(a['value']) - return '' \ No newline at end of file + return '' + +def get_value_from_events( + events: str, + key: str, +): + if not events: + return '' + + for e in events: + for a in e['attributes']: + if f'{e["type"]}.{a["key"]}' == key: + return str(a['value']) + return '' diff --git a/tests/setup_network.py b/tests/setup_network.py index 5d22daf..4605890 100644 --- a/tests/setup_network.py +++ b/tests/setup_network.py @@ -30,7 +30,7 @@ def setup_localsecret(): teardown_network() # 9091 grpc web, 1317 rest - run_command('docker run -it -d -p 9090:9090 -p 9091:9091 -p 1317:1317 --name localsecret ghcr.io/scrtlabs/localsecret:v1.5.0') + run_command('docker run -it -d -p 9090:9090 -p 9091:9091 -p 1317:1317 --name localsecret ghcr.io/scrtlabs/localsecret:v1.7.1') print("Waiting for the network to start...") await_blocks()